DVecDVecDivExpr.h
Go to the documentation of this file.
1 //=================================================================================================
33 //=================================================================================================
34 
35 #ifndef _BLAZE_MATH_EXPRESSIONS_DVECDVECDIVEXPR_H_
36 #define _BLAZE_MATH_EXPRESSIONS_DVECDVECDIVEXPR_H_
37 
38 
39 //*************************************************************************************************
40 // Includes
41 //*************************************************************************************************
42 
43 #include <iterator>
44 #include <blaze/math/Aliases.h>
48 #include <blaze/math/Exception.h>
54 #include <blaze/math/SIMD.h>
65 #include <blaze/system/Inline.h>
67 #include <blaze/util/Assert.h>
69 #include <blaze/util/EnableIf.h>
72 #include <blaze/util/mpl/And.h>
73 #include <blaze/util/mpl/If.h>
74 #include <blaze/util/mpl/Max.h>
75 #include <blaze/util/Types.h>
77 
78 
79 namespace blaze {
80 
81 //=================================================================================================
82 //
83 // CLASS DVECDVECDIVEXPR
84 //
85 //=================================================================================================
86 
87 //*************************************************************************************************
94 template< typename VT1 // Type of the left-hand side dense vector
95  , typename VT2 // Type of the right-hand side dense vector
96  , bool TF > // Transpose flag
97 class DVecDVecDivExpr : public DenseVector< DVecDVecDivExpr<VT1,VT2,TF>, TF >
98  , private VecVecDivExpr
99  , private Computation
100 {
101  private:
102  //**Type definitions****************************************************************************
111  //**********************************************************************************************
112 
113  //**Return type evaluation**********************************************************************
115 
120  enum : bool { returnExpr = !IsTemporary<RN1>::value && !IsTemporary<RN2>::value };
121 
124  //**********************************************************************************************
125 
126  //**Serial evaluation strategy******************************************************************
128 
134  enum : bool { useAssign = ( RequiresEvaluation<VT1>::value || RequiresEvaluation<VT2>::value || !returnExpr ) };
135 
137  template< typename VT >
139  struct UseAssign {
140  enum : bool { value = useAssign };
141  };
143  //**********************************************************************************************
144 
145  //**Parallel evaluation strategy****************************************************************
147 
153  template< typename VT >
154  struct UseSMPAssign {
155  enum : bool { value = ( !VT1::smpAssignable || !VT2::smpAssignable ) && useAssign };
156  };
158  //**********************************************************************************************
159 
160  public:
161  //**Type definitions****************************************************************************
166 
169 
172 
174  typedef If_< IsExpression<VT1>, const VT1, const VT1& > LeftOperand;
175 
177  typedef If_< IsExpression<VT2>, const VT2, const VT2& > RightOperand;
178  //**********************************************************************************************
179 
180  //**ConstIterator class definition**************************************************************
184  {
185  public:
186  //**Type definitions*************************************************************************
187  typedef std::random_access_iterator_tag IteratorCategory;
188  typedef ElementType ValueType;
189  typedef ElementType* PointerType;
190  typedef ElementType& ReferenceType;
192 
193  // STL iterator requirements
194  typedef IteratorCategory iterator_category;
195  typedef ValueType value_type;
196  typedef PointerType pointer;
197  typedef ReferenceType reference;
198  typedef DifferenceType difference_type;
199 
202 
205  //*******************************************************************************************
206 
207  //**Constructor******************************************************************************
213  explicit inline ConstIterator( LeftIteratorType left, RightIteratorType right )
214  : left_ ( left ) // Iterator to the current left-hand side element
215  , right_( right ) // Iterator to the current right-hand side element
216  {}
217  //*******************************************************************************************
218 
219  //**Addition assignment operator*************************************************************
225  inline ConstIterator& operator+=( size_t inc ) {
226  left_ += inc;
227  right_ += inc;
228  return *this;
229  }
230  //*******************************************************************************************
231 
232  //**Subtraction assignment operator**********************************************************
238  inline ConstIterator& operator-=( size_t dec ) {
239  left_ -= dec;
240  right_ -= dec;
241  return *this;
242  }
243  //*******************************************************************************************
244 
245  //**Prefix increment operator****************************************************************
251  ++left_;
252  ++right_;
253  return *this;
254  }
255  //*******************************************************************************************
256 
257  //**Postfix increment operator***************************************************************
262  inline const ConstIterator operator++( int ) {
263  return ConstIterator( left_++, right_++ );
264  }
265  //*******************************************************************************************
266 
267  //**Prefix decrement operator****************************************************************
273  --left_;
274  --right_;
275  return *this;
276  }
277  //*******************************************************************************************
278 
279  //**Postfix decrement operator***************************************************************
284  inline const ConstIterator operator--( int ) {
285  return ConstIterator( left_--, right_-- );
286  }
287  //*******************************************************************************************
288 
289  //**Element access operator******************************************************************
294  inline ReturnType operator*() const {
295  return (*left_) / (*right_);
296  }
297  //*******************************************************************************************
298 
299  //**Load function****************************************************************************
304  inline auto load() const noexcept {
305  return left_.load() / right_.load();
306  }
307  //*******************************************************************************************
308 
309  //**Equality operator************************************************************************
315  inline bool operator==( const ConstIterator& rhs ) const {
316  return left_ == rhs.left_;
317  }
318  //*******************************************************************************************
319 
320  //**Inequality operator**********************************************************************
326  inline bool operator!=( const ConstIterator& rhs ) const {
327  return left_ != rhs.left_;
328  }
329  //*******************************************************************************************
330 
331  //**Less-than operator***********************************************************************
337  inline bool operator<( const ConstIterator& rhs ) const {
338  return left_ < rhs.left_;
339  }
340  //*******************************************************************************************
341 
342  //**Greater-than operator********************************************************************
348  inline bool operator>( const ConstIterator& rhs ) const {
349  return left_ > rhs.left_;
350  }
351  //*******************************************************************************************
352 
353  //**Less-or-equal-than operator**************************************************************
359  inline bool operator<=( const ConstIterator& rhs ) const {
360  return left_ <= rhs.left_;
361  }
362  //*******************************************************************************************
363 
364  //**Greater-or-equal-than operator***********************************************************
370  inline bool operator>=( const ConstIterator& rhs ) const {
371  return left_ >= rhs.left_;
372  }
373  //*******************************************************************************************
374 
375  //**Subtraction operator*********************************************************************
381  inline DifferenceType operator-( const ConstIterator& rhs ) const {
382  return left_ - rhs.left_;
383  }
384  //*******************************************************************************************
385 
386  //**Addition operator************************************************************************
393  friend inline const ConstIterator operator+( const ConstIterator& it, size_t inc ) {
394  return ConstIterator( it.left_ + inc, it.right_ + inc );
395  }
396  //*******************************************************************************************
397 
398  //**Addition operator************************************************************************
405  friend inline const ConstIterator operator+( size_t inc, const ConstIterator& it ) {
406  return ConstIterator( it.left_ + inc, it.right_ + inc );
407  }
408  //*******************************************************************************************
409 
410  //**Subtraction operator*********************************************************************
417  friend inline const ConstIterator operator-( const ConstIterator& it, size_t dec ) {
418  return ConstIterator( it.left_ - dec, it.right_ - dec );
419  }
420  //*******************************************************************************************
421 
422  private:
423  //**Member variables*************************************************************************
424  LeftIteratorType left_;
425  RightIteratorType right_;
426  //*******************************************************************************************
427  };
428  //**********************************************************************************************
429 
430  //**Compilation flags***************************************************************************
432  enum : bool { simdEnabled = VT1::simdEnabled && VT2::simdEnabled &&
434 
436  enum : bool { smpAssignable = VT1::smpAssignable && VT2::smpAssignable };
437  //**********************************************************************************************
438 
439  //**SIMD properties*****************************************************************************
441  enum : size_t { SIMDSIZE = SIMDTrait<ElementType>::size };
442  //**********************************************************************************************
443 
444  //**Constructor*********************************************************************************
450  explicit inline DVecDVecDivExpr( const VT1& lhs, const VT2& rhs ) noexcept
451  : lhs_( lhs ) // Left-hand side dense vector of the division expression
452  , rhs_( rhs ) // Right-hand side dense vector of the division expression
453  {
454  BLAZE_INTERNAL_ASSERT( lhs.size() == rhs.size(), "Invalid vector sizes" );
455  }
456  //**********************************************************************************************
457 
458  //**Subscript operator**************************************************************************
464  inline ReturnType operator[]( size_t index ) const {
465  BLAZE_INTERNAL_ASSERT( index < lhs_.size(), "Invalid vector access index" );
466  return lhs_[index] / rhs_[index];
467  }
468  //**********************************************************************************************
469 
470  //**At function*********************************************************************************
477  inline ReturnType at( size_t index ) const {
478  if( index >= lhs_.size() ) {
479  BLAZE_THROW_OUT_OF_RANGE( "Invalid vector access index" );
480  }
481  return (*this)[index];
482  }
483  //**********************************************************************************************
484 
485  //**Load function*******************************************************************************
491  BLAZE_ALWAYS_INLINE auto load( size_t index ) const noexcept {
492  BLAZE_INTERNAL_ASSERT( index < lhs_.size() , "Invalid vector access index" );
493  BLAZE_INTERNAL_ASSERT( index % SIMDSIZE == 0UL, "Invalid vector access index" );
494  return lhs_.load( index ) / rhs_.load( index );
495  }
496  //**********************************************************************************************
497 
498  //**Begin function******************************************************************************
503  inline ConstIterator begin() const {
504  return ConstIterator( lhs_.begin(), rhs_.begin() );
505  }
506  //**********************************************************************************************
507 
508  //**End function********************************************************************************
513  inline ConstIterator end() const {
514  return ConstIterator( lhs_.end(), rhs_.end() );
515  }
516  //**********************************************************************************************
517 
518  //**Size function*******************************************************************************
523  inline size_t size() const noexcept {
524  return lhs_.size();
525  }
526  //**********************************************************************************************
527 
528  //**Left operand access*************************************************************************
533  inline LeftOperand leftOperand() const noexcept {
534  return lhs_;
535  }
536  //**********************************************************************************************
537 
538  //**Right operand access************************************************************************
543  inline RightOperand rightOperand() const noexcept {
544  return rhs_;
545  }
546  //**********************************************************************************************
547 
548  //**********************************************************************************************
554  template< typename T >
555  inline bool canAlias( const T* alias ) const noexcept {
556  return ( IsExpression<VT1>::value && ( RequiresEvaluation<VT1>::value ? lhs_.isAliased( alias ) : lhs_.canAlias( alias ) ) ) ||
557  ( IsExpression<VT2>::value && ( RequiresEvaluation<VT2>::value ? rhs_.isAliased( alias ) : rhs_.canAlias( alias ) ) );
558  }
559  //**********************************************************************************************
560 
561  //**********************************************************************************************
567  template< typename T >
568  inline bool isAliased( const T* alias ) const noexcept {
569  return ( lhs_.isAliased( alias ) || rhs_.isAliased( alias ) );
570  }
571  //**********************************************************************************************
572 
573  //**********************************************************************************************
578  inline bool isAligned() const noexcept {
579  return lhs_.isAligned() && rhs_.isAligned();
580  }
581  //**********************************************************************************************
582 
583  //**********************************************************************************************
588  inline bool canSMPAssign() const noexcept {
589  return lhs_.canSMPAssign() || rhs_.canSMPAssign() ||
590  ( size() > SMP_DVECDVECDIV_THRESHOLD );
591  }
592  //**********************************************************************************************
593 
594  private:
595  //**Member variables****************************************************************************
596  LeftOperand lhs_;
597  RightOperand rhs_;
598  //**********************************************************************************************
599 
600  //**Assignment to dense vectors*****************************************************************
614  template< typename VT > // Type of the target dense vector
615  friend inline EnableIf_< UseAssign<VT> >
616  assign( DenseVector<VT,TF>& lhs, const DVecDVecDivExpr& rhs )
617  {
619 
620  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
621 
622  if( !IsComputation<VT1>::value && isSame( ~lhs, rhs.lhs_ ) ) {
623  divAssign( ~lhs, rhs.rhs_ );
624  }
625  else if( IsSame<VT,ResultType>::value ||
627  assign ( ~lhs, rhs.lhs_ );
628  divAssign( ~lhs, rhs.rhs_ );
629  }
630  else {
631  const ResultType tmp( serial( rhs ) );
632  assign( ~lhs, tmp );
633  }
634  }
636  //**********************************************************************************************
637 
638  //**Assignment to sparse vectors****************************************************************
652  template< typename VT > // Type of the target sparse vector
653  friend inline EnableIf_< UseAssign<VT> >
654  assign( SparseVector<VT,TF>& lhs, const DVecDVecDivExpr& rhs )
655  {
657 
661 
662  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
663 
664  const ResultType tmp( serial( rhs ) );
665  assign( ~lhs, tmp );
666  }
668  //**********************************************************************************************
669 
670  //**Addition assignment to dense vectors********************************************************
684  template< typename VT > // Type of the target dense vector
685  friend inline EnableIf_< UseAssign<VT> >
686  addAssign( DenseVector<VT,TF>& lhs, const DVecDVecDivExpr& rhs )
687  {
689 
692  BLAZE_CONSTRAINT_MUST_BE_REFERENCE_TYPE( CompositeType_<ResultType> );
693 
694  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
695 
696  const ResultType tmp( serial( rhs ) );
697  addAssign( ~lhs, tmp );
698  }
700  //**********************************************************************************************
701 
702  //**Addition assignment to sparse vectors*******************************************************
703  // No special implementation for the addition assignment to sparse vectors.
704  //**********************************************************************************************
705 
706  //**Subtraction assignment to dense vectors*****************************************************
720  template< typename VT > // Type of the target dense vector
721  friend inline EnableIf_< UseAssign<VT> >
722  subAssign( DenseVector<VT,TF>& lhs, const DVecDVecDivExpr& rhs )
723  {
725 
728  BLAZE_CONSTRAINT_MUST_BE_REFERENCE_TYPE( CompositeType_<ResultType> );
729 
730  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
731 
732  const ResultType tmp( serial( rhs ) );
733  subAssign( ~lhs, tmp );
734  }
736  //**********************************************************************************************
737 
738  //**Subtraction assignment to sparse vectors****************************************************
739  // No special implementation for the subtraction assignment to sparse vectors.
740  //**********************************************************************************************
741 
742  //**Multiplication assignment to dense vectors**************************************************
756  template< typename VT > // Type of the target dense vector
757  friend inline EnableIf_< UseAssign<VT> >
758  multAssign( DenseVector<VT,TF>& lhs, const DVecDVecDivExpr& rhs )
759  {
761 
764  BLAZE_CONSTRAINT_MUST_BE_REFERENCE_TYPE( CompositeType_<ResultType> );
765 
766  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
767 
768  const ResultType tmp( serial( rhs ) );
769  multAssign( ~lhs, tmp );
770  }
772  //**********************************************************************************************
773 
774  //**Multiplication assignment to sparse vectors*************************************************
775  // No special implementation for the multiplication assignment to sparse vectors.
776  //**********************************************************************************************
777 
778  //**Division assignment to dense vectors********************************************************
792  template< typename VT > // Type of the target dense vector
793  friend inline EnableIf_< UseAssign<VT> >
794  divAssign( DenseVector<VT,TF>& lhs, const DVecDVecDivExpr& rhs )
795  {
797 
800  BLAZE_CONSTRAINT_MUST_BE_REFERENCE_TYPE( CompositeType_<ResultType> );
801 
802  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
803 
804  const ResultType tmp( serial( rhs ) );
805  divAssign( ~lhs, tmp );
806  }
808  //**********************************************************************************************
809 
810  //**Division assignment to sparse vectors*******************************************************
811  // No special implementation for the division assignment to sparse vectors.
812  //**********************************************************************************************
813 
814  //**SMP assignment to dense vectors*************************************************************
828  template< typename VT > // Type of the target dense vector
829  friend inline EnableIf_< UseSMPAssign<VT> >
830  smpAssign( DenseVector<VT,TF>& lhs, const DVecDVecDivExpr& rhs )
831  {
833 
834  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
835 
836  if( !IsComputation<VT1>::value && isSame( ~lhs, rhs.lhs_ ) ) {
837  smpDivAssign( ~lhs, rhs.rhs_ );
838  }
839  else if( IsSame<VT,ResultType>::value ||
840  IsSame< ElementType_<VT>, ElementType_<VT1> >::value ) {
841  smpAssign ( ~lhs, rhs.lhs_ );
842  smpDivAssign( ~lhs, rhs.rhs_ );
843  }
844  else {
845  const ResultType tmp( rhs );
846  smpAssign( ~lhs, tmp );
847  }
848  }
850  //**********************************************************************************************
851 
852  //**SMP assignment to sparse vectors************************************************************
866  template< typename VT > // Type of the target sparse vector
867  friend inline EnableIf_< UseSMPAssign<VT> >
868  smpAssign( SparseVector<VT,TF>& lhs, const DVecDVecDivExpr& rhs )
869  {
871 
874  BLAZE_CONSTRAINT_MUST_BE_REFERENCE_TYPE( CompositeType_<ResultType> );
875 
876  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
877 
878  const ResultType tmp( rhs );
879  smpAssign( ~lhs, tmp );
880  }
882  //**********************************************************************************************
883 
884  //**SMP addition assignment to dense vectors****************************************************
898  template< typename VT > // Type of the target dense vector
899  friend inline EnableIf_< UseSMPAssign<VT> >
900  smpAddAssign( DenseVector<VT,TF>& lhs, const DVecDVecDivExpr& rhs )
901  {
903 
906  BLAZE_CONSTRAINT_MUST_BE_REFERENCE_TYPE( CompositeType_<ResultType> );
907 
908  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
909 
910  const ResultType tmp( rhs );
911  smpAddAssign( ~lhs, tmp );
912  }
914  //**********************************************************************************************
915 
916  //**SMP addition assignment to sparse vectors***************************************************
917  // No special implementation for the SMP addition assignment to sparse vectors.
918  //**********************************************************************************************
919 
920  //**SMP subtraction assignment to dense vectors*************************************************
934  template< typename VT > // Type of the target dense vector
935  friend inline EnableIf_< UseSMPAssign<VT> >
936  smpSubAssign( DenseVector<VT,TF>& lhs, const DVecDVecDivExpr& rhs )
937  {
939 
942  BLAZE_CONSTRAINT_MUST_BE_REFERENCE_TYPE( CompositeType_<ResultType> );
943 
944  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
945 
946  const ResultType tmp( rhs );
947  smpSubAssign( ~lhs, tmp );
948  }
950  //**********************************************************************************************
951 
952  //**SMP subtraction assignment to sparse vectors************************************************
953  // No special implementation for the SMP subtraction assignment to sparse vectors.
954  //**********************************************************************************************
955 
956  //**SMP multiplication assignment to dense vectors**********************************************
970  template< typename VT > // Type of the target dense vector
971  friend inline EnableIf_< UseSMPAssign<VT> >
972  smpMultAssign( DenseVector<VT,TF>& lhs, const DVecDVecDivExpr& rhs )
973  {
975 
978  BLAZE_CONSTRAINT_MUST_BE_REFERENCE_TYPE( CompositeType_<ResultType> );
979 
980  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
981 
982  const ResultType tmp( rhs );
983  smpMultAssign( ~lhs, tmp );
984  }
986  //**********************************************************************************************
987 
988  //**SMP multiplication assignment to sparse vectors*********************************************
989  // No special implementation for the SMP multiplication assignment to sparse vectors.
990  //**********************************************************************************************
991 
992  //**SMP division assignment to dense vectors****************************************************
1006  template< typename VT > // Type of the target dense vector
1007  friend inline EnableIf_< UseSMPAssign<VT> >
1008  smpDivAssign( DenseVector<VT,TF>& lhs, const DVecDVecDivExpr& rhs )
1009  {
1011 
1014  BLAZE_CONSTRAINT_MUST_BE_REFERENCE_TYPE( CompositeType_<ResultType> );
1015 
1016  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
1017 
1018  const ResultType tmp( rhs );
1019  smpDivAssign( ~lhs, tmp );
1020  }
1022  //**********************************************************************************************
1023 
1024  //**SMP division assignment to sparse vectors***************************************************
1025  // No special implementation for the SMP division assignment to sparse vectors.
1026  //**********************************************************************************************
1027 
1028  //**Compile time checks*************************************************************************
1036  //**********************************************************************************************
1037 };
1038 //*************************************************************************************************
1039 
1040 
1041 
1042 
1043 //=================================================================================================
1044 //
1045 // GLOBAL BINARY ARITHMETIC OPERATORS
1046 //
1047 //=================================================================================================
1048 
1049 //*************************************************************************************************
1074 template< typename T1 // Type of the left-hand side dense vector
1075  , typename T2 // Type of the right-hand side dense vector
1076  , bool TF > // Transpose flag
1077 inline const DVecDVecDivExpr<T1,T2,TF>
1079 {
1081 
1082  if( (~lhs).size() != (~rhs).size() ) {
1083  BLAZE_THROW_INVALID_ARGUMENT( "Vector sizes do not match" );
1084  }
1085 
1086  return DVecDVecDivExpr<T1,T2,TF>( ~lhs, ~rhs );
1087 }
1088 //*************************************************************************************************
1089 
1090 
1091 
1092 
1093 //=================================================================================================
1094 //
1095 // SIZE SPECIALIZATIONS
1096 //
1097 //=================================================================================================
1098 
1099 //*************************************************************************************************
1101 template< typename VT1, typename VT2, bool TF >
1102 struct Size< DVecDVecDivExpr<VT1,VT2,TF> >
1103  : public Max< Size<VT1>, Size<VT2> >
1104 {};
1106 //*************************************************************************************************
1107 
1108 
1109 
1110 
1111 //=================================================================================================
1112 //
1113 // ISALIGNED SPECIALIZATIONS
1114 //
1115 //=================================================================================================
1116 
1117 //*************************************************************************************************
1119 template< typename VT1, typename VT2, bool TF >
1120 struct IsAligned< DVecDVecDivExpr<VT1,VT2,TF> >
1121  : public BoolConstant< And< IsAligned<VT1>, IsAligned<VT2> >::value >
1122 {};
1124 //*************************************************************************************************
1125 
1126 
1127 
1128 
1129 //=================================================================================================
1130 //
1131 // EXPRESSION TRAIT SPECIALIZATIONS
1132 //
1133 //=================================================================================================
1134 
1135 //*************************************************************************************************
1137 template< typename VT1, typename VT2, bool TF, bool AF >
1138 struct SubvectorExprTrait< DVecDVecDivExpr<VT1,VT2,TF>, AF >
1139 {
1140  public:
1141  //**********************************************************************************************
1142  using Type = DivExprTrait_< SubvectorExprTrait_<const VT1,AF>
1143  , SubvectorExprTrait_<const VT2,AF> >;
1144  //**********************************************************************************************
1145 };
1147 //*************************************************************************************************
1148 
1149 } // namespace blaze
1150 
1151 #endif
#define BLAZE_THROW_INVALID_ARGUMENT(MESSAGE)
Macro for the emission of a std::invalid_argument exception.This macro encapsulates the default way o...
Definition: Exception.h:235
Pointer difference type of the Blaze library.
Header file for auxiliary alias declarations.
Header file for the Max class template.
Compile time check whether the given type is a computational expression template.This type trait clas...
Definition: IsComputation.h:72
DVecDVecDivExpr< VT1, VT2, TF > This
Type of this DVecDVecDivExpr instance.
Definition: DVecDVecDivExpr.h:162
Compile time check whether the given type is a temporary vector or matrix type.This type trait class ...
Definition: IsTemporary.h:70
Header file for the VecVecDivExpr base class.
ConstIterator end() const
Returns an iterator just past the last non-zero element of the dense vector.
Definition: DVecDVecDivExpr.h:513
BLAZE_ALWAYS_INLINE bool isSame(const Matrix< MT1, SO1 > &a, const Matrix< MT2, SO2 > &b) noexcept
Returns whether the two given matrices represent the same observable state.
Definition: Matrix.h:653
Header file for basic type definitions.
EnableIf_< IsDenseMatrix< MT1 > > smpSubAssign(Matrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs)
Default implementation of the SMP subtraction assignment of a matrix to dense matrix.
Definition: DenseMatrix.h:160
Header file for the serial shim.
BLAZE_ALWAYS_INLINE size_t size(const Vector< VT, TF > &vector) noexcept
Returns the current size/dimension of the vector.
Definition: Vector.h:258
Header file for the IsSame and IsStrictlySame type traits.
EnableIf_< IsDenseVector< VT1 > > smpMultAssign(Vector< VT1, TF1 > &lhs, const Vector< VT2, TF2 > &rhs)
Default implementation of the SMP multiplication assignment of a vector to a dense vector...
Definition: DenseVector.h:193
Iterator over the elements of the dense vector.
Definition: DVecDVecDivExpr.h:183
If_< IsExpression< VT2 >, const VT2, const VT2 & > RightOperand
Composite type of the right-hand side dense vector expression.
Definition: DVecDVecDivExpr.h:177
Header file for the And class template.
Header file for the DenseVector base class.
LeftOperand leftOperand() const noexcept
Returns the left-hand side dense vector operand.
Definition: DVecDVecDivExpr.h:533
const DMatSerialExpr< MT, SO > serial(const DenseMatrix< MT, SO > &dm)
Forces the serial evaluation of the given dense matrix expression dm.
Definition: DMatSerialExpr.h:723
Header file for the Computation base class.
Type relationship analysis.This class tests if the two data types A and B are equal. For this type comparison, the cv-qualifiers of both data types are ignored. If A and B are the same data type (ignoring the cv-qualifiers), then the value member constant is set to true, the nested type definition Type is TrueType, and the class derives from TrueType. Otherwise value is set to false, Type is FalseType, and the class derives from FalseType.
Definition: IsSame.h:138
RightOperand rhs_
Right-hand side dense vector of the division expression.
Definition: DVecDVecDivExpr.h:597
RightIteratorType right_
Iterator to the current right-hand side element.
Definition: DVecDVecDivExpr.h:425
Constraint on the data type.
Header file for the RequiresEvaluation type trait.
bool isAligned() const noexcept
Returns whether the operands of the expression are properly aligned in memory.
Definition: DVecDVecDivExpr.h:578
ptrdiff_t DifferenceType
Difference between two iterators.
Definition: DVecDVecDivExpr.h:191
typename T::ResultType ResultType_
Alias declaration for nested ResultType type definitions.The ResultType_ alias declaration provides a...
Definition: Aliases.h:323
EnableIf_< IsDenseMatrix< MT1 > > smpAddAssign(Matrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs)
Default implementation of the SMP addition assignment of a matrix to a dense matrix.
Definition: DenseMatrix.h:129
bool isAliased(const T *alias) const noexcept
Returns whether the expression is aliased with the given address alias.
Definition: DVecDVecDivExpr.h:568
CompositeType_< VT2 > CT2
Composite type of the right-hand side dense vector expression.
Definition: DVecDVecDivExpr.h:108
IteratorCategory iterator_category
The iterator category.
Definition: DVecDVecDivExpr.h:194
Constraint on the data type.
typename IfTrue< Condition, T1, T2 >::Type IfTrue_
Auxiliary alias declaration for the IfTrue class template.The IfTrue_ alias declaration provides a co...
Definition: If.h:109
typename T::ReturnType ReturnType_
Alias declaration for nested ReturnType type definitions.The ReturnType_ alias declaration provides a...
Definition: Aliases.h:343
Header file for the DivExprTrait class template.
Expression object for dense vector-dense vector divisions.The DVecDVecDivExpr class represents the co...
Definition: DVecDVecDivExpr.h:97
ResultType_< VT2 > RT2
Result type of the right-hand side dense vector expression.
Definition: DVecDVecDivExpr.h:104
bool operator<(const ConstIterator &rhs) const
Less-than comparison between two ConstIterator objects.
Definition: DVecDVecDivExpr.h:337
IfTrue_< useAssign, const ResultType, const DVecDVecDivExpr & > CompositeType
Data type for composite expression templates.
Definition: DVecDVecDivExpr.h:171
Compile time check to query the requirement to evaluate an expression.Via this type trait it is possi...
Definition: RequiresEvaluation.h:72
typename T::CompositeType CompositeType_
Alias declaration for nested CompositeType type definitions.The CompositeType_ alias declaration prov...
Definition: Aliases.h:83
ConstIterator_< VT1 > LeftIteratorType
ConstIterator type of the left-hand side dense vector expression.
Definition: DVecDVecDivExpr.h:201
bool canAlias(const T *alias) const noexcept
Returns whether the expression can alias with the given address alias.
Definition: DVecDVecDivExpr.h:555
const EnableIf_< IsNumeric< T2 >, DivExprTrait_< T1, T2 > > operator/(const DenseMatrix< T1, SO > &mat, T2 scalar)
Division operator for the division of a dense matrix by a scalar value ( ).
Definition: DMatScalarDivExpr.h:966
ConstIterator & operator--()
Pre-decrement operator.
Definition: DVecDVecDivExpr.h:272
const ConstIterator operator++(int)
Post-increment operator.
Definition: DVecDVecDivExpr.h:262
Header file for the IsTemporary type trait class.
const ConstIterator operator--(int)
Post-decrement operator.
Definition: DVecDVecDivExpr.h:284
ElementType_< VT2 > ET2
Element type of the right-hand side dense vector expression.
Definition: DVecDVecDivExpr.h:110
Namespace of the Blaze C++ math library.
Definition: Blaze.h:57
#define BLAZE_ALWAYS_INLINE
Platform dependent setup of an enforced inline keyword.
Definition: Inline.h:85
Header file for the If class template.
bool operator>(const ConstIterator &rhs) const
Greater-than comparison between two ConstIterator objects.
Definition: DVecDVecDivExpr.h:348
LeftIteratorType left_
Iterator to the current left-hand side element.
Definition: DVecDVecDivExpr.h:424
bool canSMPAssign() const noexcept
Returns whether the expression can be used in SMP assignments.
Definition: DVecDVecDivExpr.h:588
const Element * ConstIterator
Iterator over constant elements.
Definition: CompressedMatrix.h:2647
DivTrait_< RT1, RT2 > ResultType
Result type for expression template evaluations.
Definition: DVecDVecDivExpr.h:163
EnableIf_< IsDenseMatrix< MT1 > > smpAssign(Matrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs)
Default implementation of the SMP assignment of a matrix to a dense matrix.
Definition: DenseMatrix.h:98
bool operator>=(const ConstIterator &rhs) const
Greater-than comparison between two ConstIterator objects.
Definition: DVecDVecDivExpr.h:370
ReturnType operator*() const
Direct access to the element at the current iterator position.
Definition: DVecDVecDivExpr.h:294
ValueType value_type
Type of the underlying elements.
Definition: DVecDVecDivExpr.h:195
#define BLAZE_THROW_OUT_OF_RANGE(MESSAGE)
Macro for the emission of a std::out_of_range exception.This macro encapsulates the default way of Bl...
Definition: Exception.h:331
Base class for all vector/vector division expression templates.The VecVecDivExpr class serves as a ta...
Definition: VecVecDivExpr.h:65
friend const ConstIterator operator+(const ConstIterator &it, size_t inc)
Addition between a ConstIterator and an integral value.
Definition: DVecDVecDivExpr.h:393
typename T::ElementType ElementType_
Alias declaration for nested ElementType type definitions.The ElementType_ alias declaration provides...
Definition: Aliases.h:163
Header file for all SIMD functionality.
ReturnType operator[](size_t index) const
Subscript operator for the direct access to the vector elements.
Definition: DVecDVecDivExpr.h:464
bool operator!=(const ConstIterator &rhs) const
Inequality comparison between two ConstIterator objects.
Definition: DVecDVecDivExpr.h:326
Availability of a SIMD division for the given data types.Depending on the available instruction set (...
Definition: HasSIMDDiv.h:144
Base class for N-dimensional dense vectors.The DenseVector class is a base class for all arbitrarily ...
Definition: DenseVector.h:70
Header file for the IsAligned type trait.
ConstIterator & operator-=(size_t dec)
Subtraction assignment operator.
Definition: DVecDVecDivExpr.h:238
Constraint on the data type.
#define BLAZE_CONSTRAINT_MUST_BE_REFERENCE_TYPE(T)
Constraint on the data type.In case the given data type T is not a reference type, a compilation error is created.
Definition: Reference.h:60
bool operator<=(const ConstIterator &rhs) const
Less-than comparison between two ConstIterator objects.
Definition: DVecDVecDivExpr.h:359
DivExprTrait_< RN1, RN2 > ExprReturnType
Expression return type for the subscript operator.
Definition: DVecDVecDivExpr.h:123
ElementType * PointerType
Pointer return type.
Definition: DVecDVecDivExpr.h:189
BLAZE_ALWAYS_INLINE auto load(size_t index) const noexcept
Access to the SIMD elements of the vector.
Definition: DVecDVecDivExpr.h:491
Constraint on the data type.
ConstIterator_< VT2 > RightIteratorType
ConstIterator type of the right-hand side dense vector expression.
Definition: DVecDVecDivExpr.h:204
Header file for the exception macros of the math module.
ElementType ValueType
Type of the underlying elements.
Definition: DVecDVecDivExpr.h:188
Header file for all forward declarations for expression class templates.
Header file for the EnableIf class template.
If_< IsExpression< VT1 >, const VT1, const VT1 & > LeftOperand
Composite type of the left-hand side dense vector expression.
Definition: DVecDVecDivExpr.h:174
DifferenceType difference_type
Difference between two iterators.
Definition: DVecDVecDivExpr.h:198
typename DivTrait< T1, T2 >::Type DivTrait_
Auxiliary alias declaration for the DivTrait class template.The DivTrait_ alias declaration provides ...
Definition: DivTrait.h:245
ConstIterator begin() const
Returns an iterator to the first non-zero element of the dense vector.
Definition: DVecDVecDivExpr.h:503
ReturnType at(size_t index) const
Checked access to the vector elements.
Definition: DVecDVecDivExpr.h:477
friend const ConstIterator operator-(const ConstIterator &it, size_t dec)
Subtraction between a ConstIterator and an integral value.
Definition: DVecDVecDivExpr.h:417
Header file for run time assertion macros.
DifferenceType operator-(const ConstIterator &rhs) const
Calculating the number of elements between two iterators.
Definition: DVecDVecDivExpr.h:381
Header file for the division trait.
friend const ConstIterator operator+(size_t inc, const ConstIterator &it)
Addition between an integral value and a ConstIterator.
Definition: DVecDVecDivExpr.h:405
typename If< T1, T2, T3 >::Type If_
Auxiliary alias declaration for the If class template.The If_ alias declaration provides a convenient...
Definition: If.h:160
auto load() const noexcept
Access to the SIMD elements of the vector.
Definition: DVecDVecDivExpr.h:304
EnableIf_< IsDenseVector< VT1 > > smpDivAssign(Vector< VT1, TF1 > &lhs, const Vector< VT2, TF2 > &rhs)
Default implementation of the SMP division assignment of a vector to a dense vector.
Definition: DenseVector.h:222
ConstIterator & operator+=(size_t inc)
Addition assignment operator.
Definition: DVecDVecDivExpr.h:225
ReferenceType reference
Reference return type.
Definition: DVecDVecDivExpr.h:197
ResultType_< VT1 > RT1
Result type of the left-hand side dense vector expression.
Definition: DVecDVecDivExpr.h:103
ConstIterator & operator++()
Pre-increment operator.
Definition: DVecDVecDivExpr.h:250
IntegralConstant< bool, B > BoolConstant
Generic wrapper for a compile time constant boolean value.The BoolConstant class template represents ...
Definition: IntegralConstant.h:100
typename EnableIf< Condition, T >::Type EnableIf_
Auxiliary alias declaration for the EnableIf class template.The EnableIf_ alias declaration provides ...
Definition: EnableIf.h:223
std::random_access_iterator_tag IteratorCategory
The iterator category.
Definition: DVecDVecDivExpr.h:187
CompositeType_< VT1 > CT1
Composite type of the left-hand side dense vector expression.
Definition: DVecDVecDivExpr.h:107
ElementType_< VT1 > ET1
Element type of the left-hand side dense vector expression.
Definition: DVecDVecDivExpr.h:109
TransposeType_< ResultType > TransposeType
Transpose type for expression template evaluations.
Definition: DVecDVecDivExpr.h:164
typename T::ConstIterator ConstIterator_
Alias declaration for nested ConstIterator type definitions.The ConstIterator_ alias declaration prov...
Definition: Aliases.h:103
#define BLAZE_CONSTRAINT_MUST_BE_DENSE_VECTOR_TYPE(T)
Constraint on the data type.In case the given data type T is not a dense, N-dimensional vector type...
Definition: DenseVector.h:61
bool operator==(const ConstIterator &rhs) const
Equality comparison between two ConstIterator objects.
Definition: DVecDVecDivExpr.h:315
LeftOperand lhs_
Left-hand side dense vector of the division expression.
Definition: DVecDVecDivExpr.h:596
ReturnType_< VT2 > RN2
Return type of the right-hand side dense vector expression.
Definition: DVecDVecDivExpr.h:106
Header file for the HasSIMDDiv type trait.
#define BLAZE_CONSTRAINT_MUST_FORM_VALID_VECVECDIVEXPR(T1, T2)
Constraint on the data type.In case the given data types T1 and T2 do not form a valid vector/vector ...
Definition: VecVecDivExpr.h:109
RightOperand rightOperand() const noexcept
Returns the right-hand side dense vector operand.
Definition: DVecDVecDivExpr.h:543
Header file for the IsComputation type trait class.
size_t size() const noexcept
Returns the current size/dimension of the vector.
Definition: DVecDVecDivExpr.h:523
typename DivExprTrait< T1, T2 >::Type DivExprTrait_
Auxiliary alias declaration for the DivExprTrait class template.The DivExprTrait_ alias declaration p...
Definition: DivExprTrait.h:196
Base class for all compute expression templates.The Computation class serves as a tag for all computa...
Definition: Computation.h:59
ElementType & ReferenceType
Reference return type.
Definition: DVecDVecDivExpr.h:190
PointerType pointer
Pointer return type.
Definition: DVecDVecDivExpr.h:196
Base class for sparse vectors.The SparseVector class is a base class for all arbitrarily sized (N-dim...
Definition: Forward.h:110
#define BLAZE_FUNCTION_TRACE
Function trace macro.This macro can be used to reliably trace function calls. In case function tracin...
Definition: FunctionTrace.h:157
Header file for the IntegralConstant class template.
ConstIterator(LeftIteratorType left, RightIteratorType right)
Constructor for the ConstIterator class.
Definition: DVecDVecDivExpr.h:213
Header file for the SubvectorExprTrait class template.
typename T::TransposeType TransposeType_
Alias declaration for nested TransposeType type definitions.The TransposeType_ alias declaration prov...
Definition: Aliases.h:403
DVecDVecDivExpr(const VT1 &lhs, const VT2 &rhs) noexcept
Constructor for the DVecDVecDivExpr class.
Definition: DVecDVecDivExpr.h:450
const IfTrue_< returnExpr, ExprReturnType, ElementType > ReturnType
Return type for expression template evaluations.
Definition: DVecDVecDivExpr.h:168
System settings for the inline keywords.
Header file for the Size type trait.
#define BLAZE_CONSTRAINT_MUST_BE_VECTOR_WITH_TRANSPOSE_FLAG(T, TF)
Constraint on the data type.In case the given data type T is not a dense or sparse vector type and in...
Definition: TransposeFlag.h:63
Header file for the thresholds for matrix/vector and matrix/matrix multiplications.
#define BLAZE_INTERNAL_ASSERT(expr, msg)
Run time assertion macro for internal checks.In case of an invalid run time expression, the program execution is terminated. The BLAZE_INTERNAL_ASSERT macro can be disabled by setting the BLAZE_USER_ASSERTION flag to zero or by defining NDEBUG during the compilation.
Definition: Assert.h:101
Compile time check whether the given type is an expression template.This type trait class tests wheth...
Definition: IsExpression.h:71
Header file for the IsExpression type trait class.
ReturnType_< VT1 > RN1
Return type of the left-hand side dense vector expression.
Definition: DVecDVecDivExpr.h:105
ElementType_< ResultType > ElementType
Resulting element type.
Definition: DVecDVecDivExpr.h:165
Header file for the FunctionTrace class.