DVecDVecMultExpr.h
Go to the documentation of this file.
1 //=================================================================================================
33 //=================================================================================================
34 
35 #ifndef _BLAZE_MATH_EXPRESSIONS_DVECDVECMULTEXPR_H_
36 #define _BLAZE_MATH_EXPRESSIONS_DVECDVECMULTEXPR_H_
37 
38 
39 //*************************************************************************************************
40 // Includes
41 //*************************************************************************************************
42 
43 #include <iterator>
44 #include <blaze/math/Aliases.h>
49 #include <blaze/math/Exception.h>
55 #include <blaze/math/SIMD.h>
66 #include <blaze/system/Inline.h>
68 #include <blaze/util/Assert.h>
69 #include <blaze/util/EnableIf.h>
71 #include <blaze/util/mpl/And.h>
72 #include <blaze/util/mpl/If.h>
73 #include <blaze/util/mpl/Maximum.h>
74 #include <blaze/util/Types.h>
75 
76 
77 namespace blaze {
78 
79 //=================================================================================================
80 //
81 // CLASS DVECDVECMULTEXPR
82 //
83 //=================================================================================================
84 
85 //*************************************************************************************************
92 template< typename VT1 // Type of the left-hand side dense vector
93  , typename VT2 // Type of the right-hand side dense vector
94  , bool TF > // Transpose flag
96  : public VecVecMultExpr< DenseVector< DVecDVecMultExpr<VT1,VT2,TF>, TF > >
97  , private Computation
98 {
99  private:
100  //**Type definitions****************************************************************************
109  //**********************************************************************************************
110 
111  //**Return type evaluation**********************************************************************
113 
118  enum : bool { returnExpr = !IsTemporary<RN1>::value && !IsTemporary<RN2>::value };
119 
122  //**********************************************************************************************
123 
124  //**Serial evaluation strategy******************************************************************
126 
132  enum : bool { useAssign = ( RequiresEvaluation<VT1>::value || RequiresEvaluation<VT2>::value || !returnExpr ) };
133 
135  template< typename VT >
137  struct UseAssign {
138  enum : bool { value = useAssign };
139  };
141  //**********************************************************************************************
142 
143  //**Parallel evaluation strategy****************************************************************
145 
151  template< typename VT >
152  struct UseSMPAssign {
153  enum : bool { value = ( !VT1::smpAssignable || !VT2::smpAssignable ) && useAssign };
154  };
156  //**********************************************************************************************
157 
158  public:
159  //**Type definitions****************************************************************************
164 
167 
170 
172  using LeftOperand = If_< IsExpression<VT1>, const VT1, const VT1& >;
173 
175  using RightOperand = If_< IsExpression<VT2>, const VT2, const VT2& >;
176  //**********************************************************************************************
177 
178  //**ConstIterator class definition**************************************************************
182  {
183  public:
184  //**Type definitions*************************************************************************
185  using IteratorCategory = std::random_access_iterator_tag;
190 
191  // STL iterator requirements
197 
200 
203  //*******************************************************************************************
204 
205  //**Constructor******************************************************************************
211  explicit inline ConstIterator( LeftIteratorType left, RightIteratorType right )
212  : left_ ( left ) // Iterator to the current left-hand side element
213  , right_( right ) // Iterator to the current right-hand side element
214  {}
215  //*******************************************************************************************
216 
217  //**Addition assignment operator*************************************************************
223  inline ConstIterator& operator+=( size_t inc ) {
224  left_ += inc;
225  right_ += inc;
226  return *this;
227  }
228  //*******************************************************************************************
229 
230  //**Subtraction assignment operator**********************************************************
236  inline ConstIterator& operator-=( size_t dec ) {
237  left_ -= dec;
238  right_ -= dec;
239  return *this;
240  }
241  //*******************************************************************************************
242 
243  //**Prefix increment operator****************************************************************
249  ++left_;
250  ++right_;
251  return *this;
252  }
253  //*******************************************************************************************
254 
255  //**Postfix increment operator***************************************************************
260  inline const ConstIterator operator++( int ) {
261  return ConstIterator( left_++, right_++ );
262  }
263  //*******************************************************************************************
264 
265  //**Prefix decrement operator****************************************************************
271  --left_;
272  --right_;
273  return *this;
274  }
275  //*******************************************************************************************
276 
277  //**Postfix decrement operator***************************************************************
282  inline const ConstIterator operator--( int ) {
283  return ConstIterator( left_--, right_-- );
284  }
285  //*******************************************************************************************
286 
287  //**Element access operator******************************************************************
292  inline ReturnType operator*() const {
293  return (*left_) * (*right_);
294  }
295  //*******************************************************************************************
296 
297  //**Load function****************************************************************************
302  inline auto load() const noexcept {
303  return left_.load() * right_.load();
304  }
305  //*******************************************************************************************
306 
307  //**Equality operator************************************************************************
313  inline bool operator==( const ConstIterator& rhs ) const {
314  return left_ == rhs.left_;
315  }
316  //*******************************************************************************************
317 
318  //**Inequality operator**********************************************************************
324  inline bool operator!=( const ConstIterator& rhs ) const {
325  return left_ != rhs.left_;
326  }
327  //*******************************************************************************************
328 
329  //**Less-than operator***********************************************************************
335  inline bool operator<( const ConstIterator& rhs ) const {
336  return left_ < rhs.left_;
337  }
338  //*******************************************************************************************
339 
340  //**Greater-than operator********************************************************************
346  inline bool operator>( const ConstIterator& rhs ) const {
347  return left_ > rhs.left_;
348  }
349  //*******************************************************************************************
350 
351  //**Less-or-equal-than operator**************************************************************
357  inline bool operator<=( const ConstIterator& rhs ) const {
358  return left_ <= rhs.left_;
359  }
360  //*******************************************************************************************
361 
362  //**Greater-or-equal-than operator***********************************************************
368  inline bool operator>=( const ConstIterator& rhs ) const {
369  return left_ >= rhs.left_;
370  }
371  //*******************************************************************************************
372 
373  //**Subtraction operator*********************************************************************
379  inline DifferenceType operator-( const ConstIterator& rhs ) const {
380  return left_ - rhs.left_;
381  }
382  //*******************************************************************************************
383 
384  //**Addition operator************************************************************************
391  friend inline const ConstIterator operator+( const ConstIterator& it, size_t inc ) {
392  return ConstIterator( it.left_ + inc, it.right_ + inc );
393  }
394  //*******************************************************************************************
395 
396  //**Addition operator************************************************************************
403  friend inline const ConstIterator operator+( size_t inc, const ConstIterator& it ) {
404  return ConstIterator( it.left_ + inc, it.right_ + inc );
405  }
406  //*******************************************************************************************
407 
408  //**Subtraction operator*********************************************************************
415  friend inline const ConstIterator operator-( const ConstIterator& it, size_t dec ) {
416  return ConstIterator( it.left_ - dec, it.right_ - dec );
417  }
418  //*******************************************************************************************
419 
420  private:
421  //**Member variables*************************************************************************
424  //*******************************************************************************************
425  };
426  //**********************************************************************************************
427 
428  //**Compilation flags***************************************************************************
430  enum : bool { simdEnabled = VT1::simdEnabled && VT2::simdEnabled &&
432 
434  enum : bool { smpAssignable = VT1::smpAssignable && VT2::smpAssignable };
435  //**********************************************************************************************
436 
437  //**SIMD properties*****************************************************************************
439  enum : size_t { SIMDSIZE = SIMDTrait<ElementType>::size };
440  //**********************************************************************************************
441 
442  //**Constructor*********************************************************************************
448  explicit inline DVecDVecMultExpr( const VT1& lhs, const VT2& rhs ) noexcept
449  : lhs_( lhs ) // Left-hand side dense vector of the multiplication expression
450  , rhs_( rhs ) // Right-hand side dense vector of the multiplication expression
451  {
452  BLAZE_INTERNAL_ASSERT( lhs.size() == rhs.size(), "Invalid vector sizes" );
453  }
454  //**********************************************************************************************
455 
456  //**Subscript operator**************************************************************************
462  inline ReturnType operator[]( size_t index ) const {
463  BLAZE_INTERNAL_ASSERT( index < lhs_.size(), "Invalid vector access index" );
464  return lhs_[index] * rhs_[index];
465  }
466  //**********************************************************************************************
467 
468  //**At function*********************************************************************************
475  inline ReturnType at( size_t index ) const {
476  if( index >= lhs_.size() ) {
477  BLAZE_THROW_OUT_OF_RANGE( "Invalid vector access index" );
478  }
479  return (*this)[index];
480  }
481  //**********************************************************************************************
482 
483  //**Load function*******************************************************************************
489  BLAZE_ALWAYS_INLINE auto load( size_t index ) const noexcept {
490  BLAZE_INTERNAL_ASSERT( index < lhs_.size() , "Invalid vector access index" );
491  BLAZE_INTERNAL_ASSERT( index % SIMDSIZE == 0UL, "Invalid vector access index" );
492  return lhs_.load( index ) * rhs_.load( index );
493  }
494  //**********************************************************************************************
495 
496  //**Begin function******************************************************************************
501  inline ConstIterator begin() const {
502  return ConstIterator( lhs_.begin(), rhs_.begin() );
503  }
504  //**********************************************************************************************
505 
506  //**End function********************************************************************************
511  inline ConstIterator end() const {
512  return ConstIterator( lhs_.end(), rhs_.end() );
513  }
514  //**********************************************************************************************
515 
516  //**Size function*******************************************************************************
521  inline size_t size() const noexcept {
522  return lhs_.size();
523  }
524  //**********************************************************************************************
525 
526  //**Left operand access*************************************************************************
531  inline LeftOperand leftOperand() const noexcept {
532  return lhs_;
533  }
534  //**********************************************************************************************
535 
536  //**Right operand access************************************************************************
541  inline RightOperand rightOperand() const noexcept {
542  return rhs_;
543  }
544  //**********************************************************************************************
545 
546  //**********************************************************************************************
552  template< typename T >
553  inline bool canAlias( const T* alias ) const noexcept {
554  return ( IsExpression<VT1>::value && ( RequiresEvaluation<VT1>::value ? lhs_.isAliased( alias ) : lhs_.canAlias( alias ) ) ) ||
555  ( IsExpression<VT2>::value && ( RequiresEvaluation<VT2>::value ? rhs_.isAliased( alias ) : rhs_.canAlias( alias ) ) );
556  }
557  //**********************************************************************************************
558 
559  //**********************************************************************************************
565  template< typename T >
566  inline bool isAliased( const T* alias ) const noexcept {
567  return ( lhs_.isAliased( alias ) || rhs_.isAliased( alias ) );
568  }
569  //**********************************************************************************************
570 
571  //**********************************************************************************************
576  inline bool isAligned() const noexcept {
577  return lhs_.isAligned() && rhs_.isAligned();
578  }
579  //**********************************************************************************************
580 
581  //**********************************************************************************************
586  inline bool canSMPAssign() const noexcept {
587  return lhs_.canSMPAssign() || rhs_.canSMPAssign() ||
588  ( size() > SMP_DVECDVECMULT_THRESHOLD );
589  }
590  //**********************************************************************************************
591 
592  private:
593  //**Member variables****************************************************************************
596  //**********************************************************************************************
597 
598  //**Assignment to dense vectors*****************************************************************
612  template< typename VT > // Type of the target dense vector
613  friend inline EnableIf_< UseAssign<VT> >
614  assign( DenseVector<VT,TF>& lhs, const DVecDVecMultExpr& rhs )
615  {
617 
618  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
619 
620  if( !IsComputation<VT1>::value && isSame( ~lhs, rhs.lhs_ ) ) {
621  multAssign( ~lhs, rhs.rhs_ );
622  }
623  else if( !IsComputation<VT2>::value && isSame( ~lhs, rhs.rhs_ ) ) {
624  multAssign( ~lhs, rhs.lhs_ );
625  }
626  else {
627  assign ( ~lhs, rhs.lhs_ );
628  multAssign( ~lhs, rhs.rhs_ );
629  }
630  }
632  //**********************************************************************************************
633 
634  //**Assignment to sparse vectors****************************************************************
648  template< typename VT > // Type of the target sparse vector
649  friend inline EnableIf_< UseAssign<VT> >
650  assign( SparseVector<VT,TF>& lhs, const DVecDVecMultExpr& rhs )
651  {
653 
657 
658  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
659 
660  const ResultType tmp( serial( rhs ) );
661  assign( ~lhs, tmp );
662  }
664  //**********************************************************************************************
665 
666  //**Addition assignment to dense vectors********************************************************
680  template< typename VT > // Type of the target dense vector
681  friend inline EnableIf_< UseAssign<VT> >
682  addAssign( DenseVector<VT,TF>& lhs, const DVecDVecMultExpr& rhs )
683  {
685 
689 
690  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
691 
692  const ResultType tmp( serial( rhs ) );
693  addAssign( ~lhs, tmp );
694  }
696  //**********************************************************************************************
697 
698  //**Addition assignment to sparse vectors*******************************************************
699  // No special implementation for the addition assignment to sparse vectors.
700  //**********************************************************************************************
701 
702  //**Subtraction assignment to dense vectors*****************************************************
716  template< typename VT > // Type of the target dense vector
717  friend inline EnableIf_< UseAssign<VT> >
718  subAssign( DenseVector<VT,TF>& lhs, const DVecDVecMultExpr& rhs )
719  {
721 
725 
726  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
727 
728  const ResultType tmp( serial( rhs ) );
729  subAssign( ~lhs, tmp );
730  }
732  //**********************************************************************************************
733 
734  //**Subtraction assignment to sparse vectors****************************************************
735  // No special implementation for the subtraction assignment to sparse vectors.
736  //**********************************************************************************************
737 
738  //**Multiplication assignment to dense vectors**************************************************
752  template< typename VT > // Type of the target dense vector
753  friend inline EnableIf_< UseAssign<VT> >
754  multAssign( DenseVector<VT,TF>& lhs, const DVecDVecMultExpr& rhs )
755  {
757 
758  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
759 
760  multAssign( ~lhs, rhs.lhs_ );
761  multAssign( ~lhs, rhs.rhs_ );
762  }
764  //**********************************************************************************************
765 
766  //**Multiplication assignment to sparse vectors*************************************************
780  template< typename VT > // Type of the target sparse vector
781  friend inline EnableIf_< UseAssign<VT> >
782  multAssign( SparseVector<VT,TF>& lhs, const DVecDVecMultExpr& rhs )
783  {
785 
786  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
787 
788  multAssign( ~lhs, rhs.lhs_ );
789  multAssign( ~lhs, rhs.rhs_ );
790  }
792  //**********************************************************************************************
793 
794  //**Division assignment to dense vectors********************************************************
808  template< typename VT > // Type of the target dense vector
809  friend inline EnableIf_< UseAssign<VT> >
810  divAssign( DenseVector<VT,TF>& lhs, const DVecDVecMultExpr& rhs )
811  {
813 
817 
818  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
819 
820  const ResultType tmp( serial( rhs ) );
821  divAssign( ~lhs, tmp );
822  }
824  //**********************************************************************************************
825 
826  //**Division assignment to sparse vectors*******************************************************
827  // No special implementation for the division assignment to sparse vectors.
828  //**********************************************************************************************
829 
830  //**SMP assignment to dense vectors*************************************************************
844  template< typename VT > // Type of the target dense vector
845  friend inline EnableIf_< UseSMPAssign<VT> >
846  smpAssign( DenseVector<VT,TF>& lhs, const DVecDVecMultExpr& rhs )
847  {
849 
850  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
851 
852  if( !IsComputation<VT1>::value && isSame( ~lhs, rhs.lhs_ ) ) {
853  smpMultAssign( ~lhs, rhs.rhs_ );
854  }
855  else if( !IsComputation<VT2>::value && isSame( ~lhs, rhs.rhs_ ) ) {
856  smpMultAssign( ~lhs, rhs.lhs_ );
857  }
858  else {
859  smpAssign ( ~lhs, rhs.lhs_ );
860  smpMultAssign( ~lhs, rhs.rhs_ );
861  }
862  }
864  //**********************************************************************************************
865 
866  //**SMP assignment to sparse vectors************************************************************
880  template< typename VT > // Type of the target sparse vector
881  friend inline EnableIf_< UseSMPAssign<VT> >
883  {
885 
889 
890  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
891 
892  const ResultType tmp( rhs );
893  smpAssign( ~lhs, tmp );
894  }
896  //**********************************************************************************************
897 
898  //**SMP addition assignment to dense vectors****************************************************
912  template< typename VT > // Type of the target dense vector
913  friend inline EnableIf_< UseSMPAssign<VT> >
915  {
917 
921 
922  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
923 
924  const ResultType tmp( rhs );
925  smpAddAssign( ~lhs, tmp );
926  }
928  //**********************************************************************************************
929 
930  //**SMP addition assignment to sparse vectors***************************************************
931  // No special implementation for the SMP addition assignment to sparse vectors.
932  //**********************************************************************************************
933 
934  //**SMP subtraction assignment to dense vectors*************************************************
949  template< typename VT > // Type of the target dense vector
950  friend inline EnableIf_< UseSMPAssign<VT> >
952  {
954 
958 
959  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
960 
961  const ResultType tmp( rhs );
962  smpSubAssign( ~lhs, tmp );
963  }
965  //**********************************************************************************************
966 
967  //**SMP subtraction assignment to sparse vectors************************************************
968  // No special implementation for the SMP subtraction assignment to sparse vectors.
969  //**********************************************************************************************
970 
971  //**SMP multiplication assignment to dense vectors**********************************************
986  template< typename VT > // Type of the target dense vector
987  friend inline EnableIf_< UseSMPAssign<VT> >
989  {
991 
992  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
993 
994  smpMultAssign( ~lhs, rhs.lhs_ );
995  smpMultAssign( ~lhs, rhs.rhs_ );
996  }
998  //**********************************************************************************************
999 
1000  //**SMP multiplication assignment to sparse vectors*********************************************
1015  template< typename VT > // Type of the target sparse vector
1016  friend inline EnableIf_< UseSMPAssign<VT> >
1018  {
1020 
1021  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
1022 
1023  smpMultAssign( ~lhs, rhs.lhs_ );
1024  smpMultAssign( ~lhs, rhs.rhs_ );
1025  }
1027  //**********************************************************************************************
1028 
1029  //**SMP division assignment to dense vectors****************************************************
1043  template< typename VT > // Type of the target dense vector
1044  friend inline EnableIf_< UseSMPAssign<VT> >
1046  {
1048 
1052 
1053  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
1054 
1055  const ResultType tmp( rhs );
1056  smpDivAssign( ~lhs, tmp );
1057  }
1059  //**********************************************************************************************
1060 
1061  //**SMP division assignment to sparse vectors***************************************************
1062  // No special implementation for the SMP division assignment to sparse vectors.
1063  //**********************************************************************************************
1064 
1065  //**Compile time checks*************************************************************************
1073  //**********************************************************************************************
1074 };
1075 //*************************************************************************************************
1076 
1077 
1078 
1079 
1080 //=================================================================================================
1081 //
1082 // GLOBAL BINARY ARITHMETIC OPERATORS
1083 //
1084 //=================================================================================================
1085 
1086 //*************************************************************************************************
1111 template< typename VT1 // Type of the left-hand side dense vector
1112  , typename VT2 // Type of the right-hand side dense vector
1113  , bool TF > // Transpose flag
1114 inline decltype(auto)
1115  operator*( const DenseVector<VT1,TF>& lhs, const DenseVector<VT2,TF>& rhs )
1116 {
1118 
1119  if( (~lhs).size() != (~rhs).size() ) {
1120  BLAZE_THROW_INVALID_ARGUMENT( "Vector sizes do not match" );
1121  }
1122 
1124  return ReturnType( ~lhs, ~rhs );
1125 }
1126 //*************************************************************************************************
1127 
1128 
1129 
1130 
1131 //=================================================================================================
1132 //
1133 // SIZE SPECIALIZATIONS
1134 //
1135 //=================================================================================================
1136 
1137 //*************************************************************************************************
1139 template< typename VT1, typename VT2, bool TF >
1140 struct Size< DVecDVecMultExpr<VT1,VT2,TF>, 0UL >
1141  : public Maximum< Size<VT1,0UL>, Size<VT2,0UL> >
1142 {};
1144 //*************************************************************************************************
1145 
1146 
1147 
1148 
1149 //=================================================================================================
1150 //
1151 // ISALIGNED SPECIALIZATIONS
1152 //
1153 //=================================================================================================
1154 
1155 //*************************************************************************************************
1157 template< typename VT1, typename VT2, bool TF >
1158 struct IsAligned< DVecDVecMultExpr<VT1,VT2,TF> >
1159  : public And< IsAligned<VT1>, IsAligned<VT2> >
1160 {};
1162 //*************************************************************************************************
1163 
1164 
1165 
1166 
1167 //=================================================================================================
1168 //
1169 // ISPADDED SPECIALIZATIONS
1170 //
1171 //=================================================================================================
1172 
1173 //*************************************************************************************************
1175 template< typename VT1, typename VT2, bool TF >
1176 struct IsPadded< DVecDVecMultExpr<VT1,VT2,TF> >
1177  : public And< IsPadded<VT1>, IsPadded<VT2> >
1178 {};
1180 //*************************************************************************************************
1181 
1182 } // namespace blaze
1183 
1184 #endif
ReturnType_< VT1 > RN1
Return type of the left-hand side dense vector expression.
Definition: DVecDVecMultExpr.h:103
RightIteratorType right_
Iterator to the current right-hand side element.
Definition: DVecDVecMultExpr.h:423
#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.
Compile time check whether the given type is a computational expression template.This type trait clas...
Definition: IsComputation.h:71
LeftOperand leftOperand() const noexcept
Returns the left-hand side dense vector operand.
Definition: DVecDVecMultExpr.h:531
Compile time check whether the given type is a temporary vector or matrix type.This type trait class ...
Definition: IsTemporary.h:69
CompositeType_< VT2 > CT2
Composite type of the right-hand side dense vector expression.
Definition: DVecDVecMultExpr.h:106
ConstIterator & operator++()
Pre-increment operator.
Definition: DVecDVecMultExpr.h:248
ConstIterator(LeftIteratorType left, RightIteratorType right)
Constructor for the ConstIterator class.
Definition: DVecDVecMultExpr.h:211
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:949
Header file for basic type definitions.
Iterator over the elements of the dense vector.
Definition: DVecDVecMultExpr.h:181
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:164
Header file for the serial shim.
bool canAlias(const T *alias) const noexcept
Returns whether the expression can alias with the given address alias.
Definition: DVecDVecMultExpr.h:553
MultTrait_< RT1, RT2 > ResultType
Result type for expression template evaluations.
Definition: DVecDVecMultExpr.h:161
LeftOperand lhs_
Left-hand side dense vector of the multiplication expression.
Definition: DVecDVecMultExpr.h:594
ReturnType operator*() const
Direct access to the element at the current iterator position.
Definition: DVecDVecMultExpr.h:292
ElementType * PointerType
Pointer return type.
Definition: DVecDVecMultExpr.h:187
If_< IsExpression< VT2 >, const VT2, const VT2 &> RightOperand
Composite type of the right-hand side dense vector expression.
Definition: DVecDVecMultExpr.h:175
Availability of a SIMD multiplication for the given data types.Depending on the available instruction...
Definition: HasSIMDMult.h:172
ReturnType at(size_t index) const
Checked access to the vector elements.
Definition: DVecDVecMultExpr.h:475
DifferenceType operator-(const ConstIterator &rhs) const
Calculating the number of elements between two iterators.
Definition: DVecDVecMultExpr.h:379
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
Header file for the And class template.
Compile time value evaluation.The Maximum alias declaration selects the larger of the two given templ...
Definition: Maximum.h:73
Header file for the DenseVector base class.
LeftIteratorType left_
Iterator to the current left-hand side element.
Definition: DVecDVecMultExpr.h:422
typename MultTrait< T1, T2 >::Type MultTrait_
Auxiliary alias declaration for the MultTrait class template.The MultTrait_ alias declaration provide...
Definition: MultTrait.h:291
Header file for the Computation base class.
PointerType pointer
Pointer return type.
Definition: DVecDVecMultExpr.h:194
Header file for the RequiresEvaluation type trait.
typename T::ResultType ResultType_
Alias declaration for nested ResultType type definitions.The ResultType_ alias declaration provides a...
Definition: Aliases.h:343
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:133
ConstIterator_< VT2 > RightIteratorType
ConstIterator type of the right-hand side dense vector expression.
Definition: DVecDVecMultExpr.h:202
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:363
ElementType ValueType
Type of the underlying elements.
Definition: DVecDVecMultExpr.h:186
ConstIterator begin() const
Returns an iterator to the first non-zero element of the dense vector.
Definition: DVecDVecMultExpr.h:501
bool operator>(const ConstIterator &rhs) const
Greater-than comparison between two ConstIterator objects.
Definition: DVecDVecMultExpr.h:346
Compile time check for the alignment of data types.This type trait tests whether the given data type ...
Definition: IsAligned.h:87
Header file for the Maximum class template.
typename MultExprTrait< T1, T2 >::Type MultExprTrait_
Auxiliary alias declaration for the MultExprTrait class template.The MultExprTrait_ alias declaration...
Definition: MultExprTrait.h:112
Header file for the MultExprTrait class template.
Compile time check to query the requirement to evaluate an expression.Via this type trait it is possi...
Definition: RequiresEvaluation.h:71
typename T::CompositeType CompositeType_
Alias declaration for nested CompositeType type definitions.The CompositeType_ alias declaration prov...
Definition: Aliases.h:83
Header file for the IsTemporary type trait class.
const ConstIterator operator++(int)
Post-increment operator.
Definition: DVecDVecMultExpr.h:260
Header file for the multiplication trait.
Namespace of the Blaze C++ math library.
Definition: Blaze.h:58
#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
Equality comparison between two ConstIterator objects.
Definition: DVecDVecMultExpr.h:313
bool isAligned() const noexcept
Returns whether the operands of the expression are properly aligned in memory.
Definition: DVecDVecMultExpr.h:576
Compile time check for data types with padding.This type trait tests whether the given data type empl...
Definition: IsPadded.h:76
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:102
bool canSMPAssign() const noexcept
Returns whether the expression can be used in SMP assignments.
Definition: DVecDVecMultExpr.h:586
#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
IfTrue_< useAssign, const ResultType, const DVecDVecMultExpr &> CompositeType
Data type for composite expression templates.
Definition: DVecDVecMultExpr.h:169
ConstIterator & operator-=(size_t dec)
Subtraction assignment operator.
Definition: DVecDVecMultExpr.h:236
const Element * ConstIterator
Iterator over constant elements.
Definition: CompressedMatrix.h:3085
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.
ResultType_< VT1 > RT1
Result type of the left-hand side dense vector expression.
Definition: DVecDVecMultExpr.h:101
Base class for N-dimensional dense vectors.The DenseVector class is a base class for all arbitrarily ...
Definition: DenseVector.h:76
TransposeType_< ResultType > TransposeType
Transpose type for expression template evaluations.
Definition: DVecDVecMultExpr.h:162
MultExprTrait_< RN1, RN2 > ExprReturnType
Expression return type for the subscript operator.
Definition: DVecDVecMultExpr.h:121
RightOperand rightOperand() const noexcept
Returns the right-hand side dense vector operand.
Definition: DVecDVecMultExpr.h:541
Header file for the IsAligned type trait.
auto load() const noexcept
Access to the SIMD elements of the vector.
Definition: DVecDVecMultExpr.h:302
Constraint on the data type.
CompositeType_< VT1 > CT1
Composite type of the left-hand side dense vector expression.
Definition: DVecDVecMultExpr.h:105
If_< IsExpression< VT1 >, const VT1, const VT1 &> LeftOperand
Composite type of the left-hand side dense vector expression.
Definition: DVecDVecMultExpr.h:172
const ConstIterator operator--(int)
Post-decrement operator.
Definition: DVecDVecMultExpr.h:282
Constraint on the data type.
Header file for the exception macros of the math module.
Header file for the VecVecMultExpr base class.
ResultType_< VT2 > RT2
Result type of the right-hand side dense vector expression.
Definition: DVecDVecMultExpr.h:102
Constraint on the data type.
Header file for all forward declarations for expression class templates.
ReturnType operator[](size_t index) const
Subscript operator for the direct access to the vector elements.
Definition: DVecDVecMultExpr.h:462
Expression object for dense vector-dense vector multiplications.The DVecDVecMultExpr class represents...
Definition: DVecDVecMultExpr.h:95
Header file for the EnableIf class template.
ElementType_< VT2 > ET2
Element type of the right-hand side dense vector expression.
Definition: DVecDVecMultExpr.h:108
Header file for the IsPadded type trait.
ReferenceType reference
Reference return type.
Definition: DVecDVecMultExpr.h:195
size_t size() const noexcept
Returns the current size/dimension of the vector.
Definition: DVecDVecMultExpr.h:521
ElementType & ReferenceType
Reference return type.
Definition: DVecDVecMultExpr.h:188
bool isAliased(const T *alias) const noexcept
Returns whether the expression is aliased with the given address alias.
Definition: DVecDVecMultExpr.h:566
BLAZE_ALWAYS_INLINE auto load(size_t index) const noexcept
Access to the SIMD elements of the vector.
Definition: DVecDVecMultExpr.h:489
bool operator<(const ConstIterator &rhs) const
Less-than comparison between two ConstIterator objects.
Definition: DVecDVecMultExpr.h:335
Header file for the HasSIMDMult type trait.
Header file for run time assertion macros.
bool operator!=(const ConstIterator &rhs) const
Inequality comparison between two ConstIterator objects.
Definition: DVecDVecMultExpr.h:324
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:154
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
SIMD characteristics of data types.The SIMDTrait class template provides the SIMD characteristics of ...
Definition: SIMDTrait.h:296
#define BLAZE_FUNCTION_TRACE
Function trace macro.This macro can be used to reliably trace function calls. In case function tracin...
Definition: FunctionTrace.h:94
DVecDVecMultExpr(const VT1 &lhs, const VT2 &rhs) noexcept
Constructor for the DVecDVecMultExpr class.
Definition: DVecDVecMultExpr.h:448
ConstIterator & operator--()
Pre-decrement operator.
Definition: DVecDVecMultExpr.h:270
ReturnType_< VT2 > RN2
Return type of the right-hand side dense vector expression.
Definition: DVecDVecMultExpr.h:104
friend const ConstIterator operator+(const ConstIterator &it, size_t inc)
Addition between a ConstIterator and an integral value.
Definition: DVecDVecMultExpr.h:391
decltype(auto) serial(const DenseMatrix< MT, SO > &dm)
Forces the serial evaluation of the given dense matrix expression dm.
Definition: DMatSerialExpr.h:816
std::random_access_iterator_tag IteratorCategory
The iterator category.
Definition: DVecDVecMultExpr.h:185
#define BLAZE_CONSTRAINT_MUST_NOT_REQUIRE_EVALUATION(T)
Constraint on the data type.In case the given data type T requires an intermediate evaluation within ...
Definition: RequiresEvaluation.h:81
bool operator<=(const ConstIterator &rhs) const
Less-than comparison between two ConstIterator objects.
Definition: DVecDVecMultExpr.h:357
typename EnableIf< Condition, T >::Type EnableIf_
Auxiliary alias declaration for the EnableIf class template.The EnableIf_ alias declaration provides ...
Definition: EnableIf.h:224
ConstIterator end() const
Returns an iterator just past the last non-zero element of the dense vector.
Definition: DVecDVecMultExpr.h:511
ConstIterator_< VT1 > LeftIteratorType
ConstIterator type of the left-hand side dense vector expression.
Definition: DVecDVecMultExpr.h:199
IteratorCategory iterator_category
The iterator category.
Definition: DVecDVecMultExpr.h:192
const Type & ReturnType
Return type for expression template evaluations.
Definition: CompressedMatrix.h:3080
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
ElementType_< VT1 > ET1
Element type of the left-hand side dense vector expression.
Definition: DVecDVecMultExpr.h:107
Constraint on the data type.
#define BLAZE_CONSTRAINT_MUST_FORM_VALID_VECVECMULTEXPR(T1, T2)
Constraint on the data type.In case the given data types T1 and T2 do not form a valid vector/vector ...
Definition: VecVecMultExpr.h:108
friend const ConstIterator operator-(const ConstIterator &it, size_t dec)
Subtraction between a ConstIterator and an integral value.
Definition: DVecDVecMultExpr.h:415
Header file for the IsComputation type trait class.
Base class for all compute expression templates.The Computation class serves as a tag for all computa...
Definition: Computation.h:66
Compile time evaluation of the size of vectors and matrices.The Size type trait evaluates the size of...
Definition: Size.h:80
Base class for sparse vectors.The SparseVector class is a base class for all arbitrarily sized (N-dim...
Definition: Forward.h:130
const IfTrue_< returnExpr, ExprReturnType, ElementType > ReturnType
Return type for expression template evaluations.
Definition: DVecDVecMultExpr.h:166
Compile time logical &#39;and&#39; evaluation.The And alias declaration performs at compile time a logical &#39;a...
Definition: And.h:76
RightOperand rhs_
Right-hand side dense vector of the multiplication expression.
Definition: DVecDVecMultExpr.h:595
typename T::TransposeType TransposeType_
Alias declaration for nested TransposeType type definitions.The TransposeType_ alias declaration prov...
Definition: Aliases.h:423
ConstIterator & operator+=(size_t inc)
Addition assignment operator.
Definition: DVecDVecMultExpr.h:223
friend const ConstIterator operator+(size_t inc, const ConstIterator &it)
Addition between an integral value and a ConstIterator.
Definition: DVecDVecMultExpr.h:403
System settings for the inline keywords.
Header file for the Size type trait.
ValueType value_type
Type of the underlying elements.
Definition: DVecDVecMultExpr.h:193
#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.
Base class for all vector/vector multiplication expression templates.The VecVecMultExpr class serves ...
Definition: VecVecMultExpr.h:66
#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
bool operator>=(const ConstIterator &rhs) const
Greater-than comparison between two ConstIterator objects.
Definition: DVecDVecMultExpr.h:368
ElementType_< ResultType > ElementType
Resulting element type.
Definition: DVecDVecMultExpr.h:163
Compile time check whether the given type is an expression template.This type trait class tests wheth...
Definition: IsExpression.h:95
Header file for the IsExpression type trait class.
Header file for the function trace functionality.