DVecScalarMultExpr.h
Go to the documentation of this file.
1 //=================================================================================================
33 //=================================================================================================
34 
35 #ifndef _BLAZE_MATH_EXPRESSIONS_DVECSCALARMULTEXPR_H_
36 #define _BLAZE_MATH_EXPRESSIONS_DVECSCALARMULTEXPR_H_
37 
38 
39 //*************************************************************************************************
40 // Includes
41 //*************************************************************************************************
42 
43 #include <iterator>
44 #include <blaze/math/Aliases.h>
47 #include <blaze/math/Exception.h>
56 #include <blaze/math/SIMD.h>
81 #include <blaze/system/Inline.h>
83 #include <blaze/util/Assert.h>
88 #include <blaze/util/EnableIf.h>
90 #include <blaze/util/InvalidType.h>
92 #include <blaze/util/mpl/And.h>
93 #include <blaze/util/mpl/If.h>
94 #include <blaze/util/mpl/Or.h>
95 #include <blaze/util/Types.h>
97 
98 
99 namespace blaze {
100 
101 //=================================================================================================
102 //
103 // CLASS DVECSCALARMULTEXPR
104 //
105 //=================================================================================================
106 
107 //*************************************************************************************************
114 template< typename VT // Type of the left-hand side dense vector
115  , typename ST // Type of the right-hand side scalar value
116  , bool TF > // Transpose flag
117 class DVecScalarMultExpr : public DenseVector< DVecScalarMultExpr<VT,ST,TF>, TF >
118  , private VecScalarMultExpr
119  , private Computation
120 {
121  private:
122  //**Type definitions****************************************************************************
123  typedef ResultType_<VT> RT;
124  typedef ReturnType_<VT> RN;
127  //**********************************************************************************************
128 
129  //**Return type evaluation**********************************************************************
131 
136  enum : bool { returnExpr = !IsTemporary<RN>::value };
137 
140  //**********************************************************************************************
141 
142  //**Serial evaluation strategy******************************************************************
144 
150  enum : bool { useAssign = IsComputation<VT>::value && RequiresEvaluation<VT>::value };
151 
153  template< typename VT2 >
155  struct UseAssign {
156  enum : bool { value = useAssign };
157  };
159  //**********************************************************************************************
160 
161  //**Parallel evaluation strategy****************************************************************
163 
169  template< typename VT2 >
170  struct UseSMPAssign {
171  enum : bool { value = ( !VT2::smpAssignable || !VT::smpAssignable ) && useAssign };
172  };
174  //**********************************************************************************************
175 
176  public:
177  //**Type definitions****************************************************************************
182 
185 
188 
190  typedef If_< IsExpression<VT>, const VT, const VT& > LeftOperand;
191 
193  typedef ST RightOperand;
194  //**********************************************************************************************
195 
196  //**ConstIterator class definition**************************************************************
200  {
201  public:
202  //**Type definitions*************************************************************************
203  typedef std::random_access_iterator_tag IteratorCategory;
204  typedef ElementType ValueType;
205  typedef ElementType* PointerType;
206  typedef ElementType& ReferenceType;
208 
209  // STL iterator requirements
210  typedef IteratorCategory iterator_category;
211  typedef ValueType value_type;
212  typedef PointerType pointer;
213  typedef ReferenceType reference;
214  typedef DifferenceType difference_type;
215 
218  //*******************************************************************************************
219 
220  //**Constructor******************************************************************************
226  explicit inline ConstIterator( IteratorType iterator, RightOperand scalar )
227  : iterator_( iterator ) // Iterator to the current element
228  , scalar_ ( scalar ) // Scalar of the multiplication expression
229  {}
230  //*******************************************************************************************
231 
232  //**Addition assignment operator*************************************************************
238  inline ConstIterator& operator+=( size_t inc ) {
239  iterator_ += inc;
240  return *this;
241  }
242  //*******************************************************************************************
243 
244  //**Subtraction assignment operator**********************************************************
250  inline ConstIterator& operator-=( size_t dec ) {
251  iterator_ -= dec;
252  return *this;
253  }
254  //*******************************************************************************************
255 
256  //**Prefix increment operator****************************************************************
262  ++iterator_;
263  return *this;
264  }
265  //*******************************************************************************************
266 
267  //**Postfix increment operator***************************************************************
272  inline const ConstIterator operator++( int ) {
273  return ConstIterator( iterator_++ );
274  }
275  //*******************************************************************************************
276 
277  //**Prefix decrement operator****************************************************************
283  --iterator_;
284  return *this;
285  }
286  //*******************************************************************************************
287 
288  //**Postfix decrement operator***************************************************************
293  inline const ConstIterator operator--( int ) {
294  return ConstIterator( iterator_-- );
295  }
296  //*******************************************************************************************
297 
298  //**Element access operator******************************************************************
303  inline ReturnType operator*() const {
304  return *iterator_ * scalar_;
305  }
306  //*******************************************************************************************
307 
308  //**Load function****************************************************************************
313  inline auto load() const noexcept {
314  return iterator_.load() * set( scalar_ );
315  }
316  //*******************************************************************************************
317 
318  //**Equality operator************************************************************************
324  inline bool operator==( const ConstIterator& rhs ) const {
325  return iterator_ == rhs.iterator_;
326  }
327  //*******************************************************************************************
328 
329  //**Inequality operator**********************************************************************
335  inline bool operator!=( const ConstIterator& rhs ) const {
336  return iterator_ != rhs.iterator_;
337  }
338  //*******************************************************************************************
339 
340  //**Less-than operator***********************************************************************
346  inline bool operator<( const ConstIterator& rhs ) const {
347  return iterator_ < rhs.iterator_;
348  }
349  //*******************************************************************************************
350 
351  //**Greater-than operator********************************************************************
357  inline bool operator>( const ConstIterator& rhs ) const {
358  return iterator_ > rhs.iterator_;
359  }
360  //*******************************************************************************************
361 
362  //**Less-or-equal-than operator**************************************************************
368  inline bool operator<=( const ConstIterator& rhs ) const {
369  return iterator_ <= rhs.iterator_;
370  }
371  //*******************************************************************************************
372 
373  //**Greater-or-equal-than operator***********************************************************
379  inline bool operator>=( const ConstIterator& rhs ) const {
380  return iterator_ >= rhs.iterator_;
381  }
382  //*******************************************************************************************
383 
384  //**Subtraction operator*********************************************************************
390  inline DifferenceType operator-( const ConstIterator& rhs ) const {
391  return iterator_ - rhs.iterator_;
392  }
393  //*******************************************************************************************
394 
395  //**Addition operator************************************************************************
402  friend inline const ConstIterator operator+( const ConstIterator& it, size_t inc ) {
403  return ConstIterator( it.iterator_ + inc );
404  }
405  //*******************************************************************************************
406 
407  //**Addition operator************************************************************************
414  friend inline const ConstIterator operator+( size_t inc, const ConstIterator& it ) {
415  return ConstIterator( it.iterator_ + inc );
416  }
417  //*******************************************************************************************
418 
419  //**Subtraction operator*********************************************************************
426  friend inline const ConstIterator operator-( const ConstIterator& it, size_t dec ) {
427  return ConstIterator( it.iterator_ - dec );
428  }
429  //*******************************************************************************************
430 
431  private:
432  //**Member variables*************************************************************************
433  IteratorType iterator_;
434  RightOperand scalar_;
435  //*******************************************************************************************
436  };
437  //**********************************************************************************************
438 
439  //**Compilation flags***************************************************************************
441  enum : bool { simdEnabled = VT::simdEnabled &&
444  HasSIMDMult<UnderlyingElement_<ET>,ST>::value ) };
445 
447  enum : bool { smpAssignable = VT::smpAssignable };
448  //**********************************************************************************************
449 
450  //**SIMD properties*****************************************************************************
452  enum : size_t { SIMDSIZE = SIMDTrait<ElementType>::size };
453  //**********************************************************************************************
454 
455  //**Constructor*********************************************************************************
461  explicit inline DVecScalarMultExpr( const VT& vector, ST scalar ) noexcept
462  : vector_( vector ) // Left-hand side dense vector of the multiplication expression
463  , scalar_( scalar ) // Right-hand side scalar of the multiplication expression
464  {}
465  //**********************************************************************************************
466 
467  //**Subscript operator**************************************************************************
473  inline ReturnType operator[]( size_t index ) const {
474  BLAZE_INTERNAL_ASSERT( index < vector_.size(), "Invalid vector access index" );
475  return vector_[index] * scalar_;
476  }
477  //**********************************************************************************************
478 
479  //**At function*********************************************************************************
486  inline ReturnType at( size_t index ) const {
487  if( index >= vector_.size() ) {
488  BLAZE_THROW_OUT_OF_RANGE( "Invalid vector access index" );
489  }
490  return (*this)[index];
491  }
492  //**********************************************************************************************
493 
494  //**Load function*******************************************************************************
500  BLAZE_ALWAYS_INLINE auto load( size_t index ) const noexcept {
501  BLAZE_INTERNAL_ASSERT( index < vector_.size() , "Invalid vector access index" );
502  BLAZE_INTERNAL_ASSERT( index % SIMDSIZE == 0UL, "Invalid vector access index" );
503  return vector_.load( index ) * set( scalar_ );
504  }
505  //**********************************************************************************************
506 
507  //**Begin function******************************************************************************
512  inline ConstIterator begin() const {
513  return ConstIterator( vector_.begin(), scalar_ );
514  }
515  //**********************************************************************************************
516 
517  //**End function********************************************************************************
522  inline ConstIterator end() const {
523  return ConstIterator( vector_.end(), scalar_ );
524  }
525  //**********************************************************************************************
526 
527  //**Size function*******************************************************************************
532  inline size_t size() const noexcept {
533  return vector_.size();
534  }
535  //**********************************************************************************************
536 
537  //**Left operand access*************************************************************************
542  inline LeftOperand leftOperand() const noexcept {
543  return vector_;
544  }
545  //**********************************************************************************************
546 
547  //**Right operand access************************************************************************
552  inline RightOperand rightOperand() const noexcept {
553  return scalar_;
554  }
555  //**********************************************************************************************
556 
557  //**********************************************************************************************
563  template< typename T >
564  inline bool canAlias( const T* alias ) const noexcept {
565  return IsComputation<VT>::value && vector_.canAlias( alias );
566  }
567  //**********************************************************************************************
568 
569  //**********************************************************************************************
575  template< typename T >
576  inline bool isAliased( const T* alias ) const noexcept {
577  return vector_.isAliased( alias );
578  }
579  //**********************************************************************************************
580 
581  //**********************************************************************************************
586  inline bool isAligned() const noexcept {
587  return vector_.isAligned();
588  }
589  //**********************************************************************************************
590 
591  //**********************************************************************************************
596  inline bool canSMPAssign() const noexcept {
597  return vector_.canSMPAssign() || ( size() > SMP_DVECSCALARMULT_THRESHOLD );
598  }
599  //**********************************************************************************************
600 
601  private:
602  //**Member variables****************************************************************************
603  LeftOperand vector_;
604  RightOperand scalar_;
605  //**********************************************************************************************
606 
607  //**Assignment to dense vectors*****************************************************************
621  template< typename VT2 > // Type of the target dense vector
622  friend inline EnableIf_< UseAssign<VT2> >
623  assign( DenseVector<VT2,TF>& lhs, const DVecScalarMultExpr& rhs )
624  {
626 
627  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
628 
629  assign( ~lhs, rhs.vector_ );
630  assign( ~lhs, (~lhs) * rhs.scalar_ );
631  }
633  //**********************************************************************************************
634 
635  //**Assignment to sparse vectors****************************************************************
649  template< typename VT2 > // Type of the target sparse vector
650  friend inline EnableIf_< UseAssign<VT2> >
651  assign( SparseVector<VT2,TF>& lhs, const DVecScalarMultExpr& rhs )
652  {
654 
655  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
656 
657  assign( ~lhs, rhs.vector_ );
658  (~lhs) *= rhs.scalar_;
659  }
661  //**********************************************************************************************
662 
663  //**Addition assignment to dense vectors********************************************************
677  template< typename VT2 > // Type of the target dense vector
678  friend inline EnableIf_< UseAssign<VT2> >
679  addAssign( DenseVector<VT2,TF>& lhs, const DVecScalarMultExpr& rhs )
680  {
682 
685  BLAZE_CONSTRAINT_MUST_BE_REFERENCE_TYPE( CompositeType_<ResultType> );
686 
687  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
688 
689  const ResultType tmp( serial( rhs ) );
690  addAssign( ~lhs, tmp );
691  }
693  //**********************************************************************************************
694 
695  //**Addition assignment to sparse vectors*******************************************************
696  // No special implementation for the addition assignment to sparse vectors.
697  //**********************************************************************************************
698 
699  //**Subtraction assignment to dense vectors*****************************************************
713  template< typename VT2 > // Type of the target dense vector
714  friend inline EnableIf_< UseAssign<VT2> >
715  subAssign( DenseVector<VT2,TF>& lhs, const DVecScalarMultExpr& rhs )
716  {
718 
721  BLAZE_CONSTRAINT_MUST_BE_REFERENCE_TYPE( CompositeType_<ResultType> );
722 
723  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
724 
725  const ResultType tmp( serial( rhs ) );
726  subAssign( ~lhs, tmp );
727  }
729  //**********************************************************************************************
730 
731  //**Subtraction assignment to sparse vectors****************************************************
732  // No special implementation for the subtraction assignment to sparse vectors.
733  //**********************************************************************************************
734 
735  //**Multiplication assignment to dense vectors**************************************************
749  template< typename VT2 > // Type of the target dense vector
750  friend inline EnableIf_< UseAssign<VT2> >
751  multAssign( DenseVector<VT2,TF>& lhs, const DVecScalarMultExpr& rhs )
752  {
754 
757  BLAZE_CONSTRAINT_MUST_BE_REFERENCE_TYPE( CompositeType_<ResultType> );
758 
759  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
760 
761  const ResultType tmp( serial( rhs ) );
762  multAssign( ~lhs, tmp );
763  }
765  //**********************************************************************************************
766 
767  //**Multiplication assignment to sparse vectors*************************************************
768  // No special implementation for the multiplication assignment to sparse vectors.
769  //**********************************************************************************************
770 
771  //**Division assignment to dense vectors********************************************************
785  template< typename VT2 > // Type of the target dense vector
786  friend inline EnableIf_< UseAssign<VT2> >
787  divAssign( DenseVector<VT2,TF>& lhs, const DVecScalarMultExpr& rhs )
788  {
790 
793  BLAZE_CONSTRAINT_MUST_BE_REFERENCE_TYPE( CompositeType_<ResultType> );
794 
795  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
796 
797  const ResultType tmp( serial( rhs ) );
798  divAssign( ~lhs, tmp );
799  }
801  //**********************************************************************************************
802 
803  //**Division assignment to sparse vectors*******************************************************
804  // No special implementation for the division assignment to sparse vectors.
805  //**********************************************************************************************
806 
807  //**SMP assignment to dense vectors*************************************************************
821  template< typename VT2 > // Type of the target dense vector
822  friend inline EnableIf_< UseSMPAssign<VT2> >
823  smpAssign( DenseVector<VT2,TF>& lhs, const DVecScalarMultExpr& rhs )
824  {
826 
827  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
828 
829  smpAssign( ~lhs, rhs.vector_ );
830  smpAssign( ~lhs, (~lhs) * rhs.scalar_ );
831  }
833  //**********************************************************************************************
834 
835  //**SMP assignment to sparse vectors************************************************************
849  template< typename VT2 > // Type of the target sparse vector
850  friend inline EnableIf_< UseSMPAssign<VT2> >
851  smpAssign( SparseVector<VT2,TF>& lhs, const DVecScalarMultExpr& rhs )
852  {
854 
855  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
856 
857  smpAssign( ~lhs, rhs.vector_ );
858  (~lhs) *= rhs.scalar_;
859  }
861  //**********************************************************************************************
862 
863  //**SMP addition assignment to dense vectors****************************************************
877  template< typename VT2 > // Type of the target dense vector
878  friend inline EnableIf_< UseSMPAssign<VT2> >
879  smpAddAssign( DenseVector<VT2,TF>& lhs, const DVecScalarMultExpr& rhs )
880  {
882 
885  BLAZE_CONSTRAINT_MUST_BE_REFERENCE_TYPE( CompositeType_<ResultType> );
886 
887  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
888 
889  const ResultType tmp( rhs );
890  smpAddAssign( ~lhs, tmp );
891  }
893  //**********************************************************************************************
894 
895  //**SMP addition assignment to sparse vectors***************************************************
896  // No special implementation for the SMP addition assignment to sparse vectors.
897  //**********************************************************************************************
898 
899  //**SMP subtraction assignment to dense vectors*************************************************
913  template< typename VT2 > // Type of the target dense vector
914  friend inline EnableIf_< UseSMPAssign<VT2> >
915  smpSubAssign( DenseVector<VT2,TF>& lhs, const DVecScalarMultExpr& rhs )
916  {
918 
921  BLAZE_CONSTRAINT_MUST_BE_REFERENCE_TYPE( CompositeType_<ResultType> );
922 
923  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
924 
925  const ResultType tmp( rhs );
926  smpSubAssign( ~lhs, tmp );
927  }
929  //**********************************************************************************************
930 
931  //**SMP subtraction assignment to sparse vectors************************************************
932  // No special implementation for the SMP subtraction assignment to sparse vectors.
933  //**********************************************************************************************
934 
935  //**SMP multiplication assignment to dense vectors**********************************************
949  template< typename VT2 > // Type of the target dense vector
950  friend inline EnableIf_< UseSMPAssign<VT2> >
951  smpMultAssign( DenseVector<VT2,TF>& lhs, const DVecScalarMultExpr& rhs )
952  {
954 
957  BLAZE_CONSTRAINT_MUST_BE_REFERENCE_TYPE( CompositeType_<ResultType> );
958 
959  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
960 
961  const ResultType tmp( rhs );
962  smpMultAssign( ~lhs, tmp );
963  }
965  //**********************************************************************************************
966 
967  //**SMP multiplication assignment to sparse vectors*********************************************
968  // No special implementation for the SMP multiplication assignment to sparse vectors.
969  //**********************************************************************************************
970 
971  //**SMP division assignment to dense vectors****************************************************
985  template< typename VT2 > // Type of the target dense vector
986  friend inline EnableIf_< UseSMPAssign<VT2> >
987  smpDivAssign( DenseVector<VT2,TF>& lhs, const DVecScalarMultExpr& rhs )
988  {
990 
993  BLAZE_CONSTRAINT_MUST_BE_REFERENCE_TYPE( CompositeType_<ResultType> );
994 
995  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
996 
997  const ResultType tmp( rhs );
998  smpDivAssign( ~lhs, tmp );
999  }
1001  //**********************************************************************************************
1002 
1003  //**SMP division assignment to sparse vectors***************************************************
1004  // No special implementation for the SMP division assignment to sparse vectors.
1005  //**********************************************************************************************
1006 
1007  //**Compile time checks*************************************************************************
1012  BLAZE_CONSTRAINT_MUST_BE_SAME_TYPE( ST, RightOperand );
1014  //**********************************************************************************************
1015 };
1016 //*************************************************************************************************
1017 
1018 
1019 
1020 
1021 //=================================================================================================
1022 //
1023 // GLOBAL UNARY ARITHMETIC OPERATORS
1024 //
1025 //=================================================================================================
1026 
1027 //*************************************************************************************************
1044 template< typename VT // Type of the dense vector
1045  , bool TF > // Transpose flag
1046 inline const DVecScalarMultExpr<VT,UnderlyingBuiltin_<VT>,TF>
1048 {
1050 
1053 }
1054 //*************************************************************************************************
1055 
1056 
1057 
1058 
1059 //=================================================================================================
1060 //
1061 // GLOBAL BINARY ARITHMETIC OPERATORS
1062 //
1063 //=================================================================================================
1064 
1065 //*************************************************************************************************
1087 template< typename T1 // Type of the left-hand side dense vector
1088  , typename T2 // Type of the right-hand side scalar
1089  , bool TF > // Transpose flag
1090 inline const EnableIf_< IsNumeric<T2>, MultExprTrait_<T1,T2> >
1091  operator*( const DenseVector<T1,TF>& vec, T2 scalar )
1092 {
1094 
1095  return MultExprTrait_<T1,T2>( ~vec, scalar );
1096 }
1097 //*************************************************************************************************
1098 
1099 
1100 //*************************************************************************************************
1122 template< typename T1 // Type of the left-hand side scalar
1123  , typename T2 // Type of the right-hand side dense vector
1124  , bool TF > // Transpose flag
1125 inline const EnableIf_< IsNumeric<T1>, MultExprTrait_<T1,T2> >
1126  operator*( T1 scalar, const DenseVector<T2,TF>& vec )
1127 {
1129 
1130  return MultExprTrait_<T1,T2>( ~vec, scalar );
1131 }
1132 //*************************************************************************************************
1133 
1134 
1135 
1136 
1137 //=================================================================================================
1138 //
1139 // GLOBAL FUNCTIONS
1140 //
1141 //=================================================================================================
1142 
1143 //*************************************************************************************************
1161 template< typename VT // Type of the dense vector
1162  , bool TF > // Transpose flag
1163 inline const DVecScalarMultExpr<VT,ElementType_<VT>,TF>
1165 {
1166  typedef ElementType_<VT> ElementType;
1167 
1169 
1170  const ElementType len ( length( ~vec ) );
1171  const ElementType ilen( ( len != ElementType(0) )?( ElementType(1) / len ):( 0 ) );
1172 
1173  return DVecScalarMultExpr<VT,ElementType,TF>( ~vec, ilen );
1174 }
1175 //*************************************************************************************************
1176 
1177 
1178 
1179 
1180 //=================================================================================================
1181 //
1182 // GLOBAL RESTRUCTURING UNARY ARITHMETIC OPERATORS
1183 //
1184 //=================================================================================================
1185 
1186 //*************************************************************************************************
1198 template< typename VT // Type of the dense vector
1199  , typename ST // Type of the scalar
1200  , bool TF > // Transpose flag
1201 inline const DVecScalarMultExpr<VT,ST,TF>
1202  operator-( const DVecScalarMultExpr<VT,ST,TF>& dv )
1203 {
1205 
1206  return DVecScalarMultExpr<VT,ST,TF>( dv.leftOperand(), -dv.rightOperand() );
1207 }
1209 //*************************************************************************************************
1210 
1211 
1212 
1213 
1214 //=================================================================================================
1215 //
1216 // GLOBAL RESTRUCTURING BINARY ARITHMETIC OPERATORS
1217 //
1218 //=================================================================================================
1219 
1220 //*************************************************************************************************
1233 template< typename VT // Type of the dense vector of the left-hand side expression
1234  , typename ST1 // Type of the scalar of the left-hand side expression
1235  , bool TF // Transpose flag of the dense vector
1236  , typename ST2 > // Type of the right-hand side scalar
1237 inline const EnableIf_< IsNumeric<ST2>, MultExprTrait_< DVecScalarMultExpr<VT,ST1,TF>, ST2 > >
1238  operator*( const DVecScalarMultExpr<VT,ST1,TF>& vec, ST2 scalar )
1239 {
1241 
1242  return vec.leftOperand() * ( vec.rightOperand() * scalar );
1243 }
1245 //*************************************************************************************************
1246 
1247 
1248 //*************************************************************************************************
1261 template< typename ST1 // Type of the left-hand side scalar
1262  , typename VT // Type of the dense vector of the right-hand side expression
1263  , typename ST2 // Type of the scalar of the right-hand side expression
1264  , bool TF > // Transpose flag of the dense vector
1265 inline const EnableIf_< IsNumeric<ST1>, MultExprTrait_< ST1, DVecScalarMultExpr<VT,ST2,TF> > >
1266  operator*( ST1 scalar, const DVecScalarMultExpr<VT,ST2,TF>& vec )
1267 {
1269 
1270  return vec.leftOperand() * ( scalar * vec.rightOperand() );
1271 }
1273 //*************************************************************************************************
1274 
1275 
1276 //*************************************************************************************************
1289 template< typename VT // Type of the dense vector of the left-hand side expression
1290  , typename ST1 // Type of the scalar of the left-hand side expression
1291  , bool TF // Transpose flag of the dense vector
1292  , typename ST2 > // Type of the right-hand side scalar
1293 inline const EnableIf_< And< IsNumeric<ST2>, Or< IsInvertible<ST1>, IsInvertible<ST2> > >
1294  , DivExprTrait_< DVecScalarMultExpr<VT,ST1,TF>, ST2 > >
1295  operator/( const DVecScalarMultExpr<VT,ST1,TF>& vec, ST2 scalar )
1296 {
1298 
1299  return vec.leftOperand() * ( vec.rightOperand() / scalar );
1300 }
1302 //*************************************************************************************************
1303 
1304 
1305 //*************************************************************************************************
1319 template< typename VT1 // Type of the dense vector of the left-hand side expression
1320  , typename ST // Type of the scalar of the left-hand side expression
1321  , bool TF // Transpose flag of the dense vectors
1322  , typename VT2 > // Type of the right-hand side dense vector
1323 inline const MultExprTrait_< DVecScalarMultExpr<VT1,ST,TF>, VT2 >
1324  operator*( const DVecScalarMultExpr<VT1,ST,TF>& lhs, const DenseVector<VT2,TF>& rhs )
1325 {
1327 
1328  return ( lhs.leftOperand() * (~rhs) ) * lhs.rightOperand();
1329 }
1331 //*************************************************************************************************
1332 
1333 
1334 //*************************************************************************************************
1348 template< typename VT1 // Type of the left-hand side dense vector
1349  , bool TF // Transpose flag of the dense vectors
1350  , typename VT2 // Type of the dense vector of the right-hand side expression
1351  , typename ST > // Type of the scalar of the right-hand side expression
1352 inline const MultExprTrait_< VT1, DVecScalarMultExpr<VT2,ST,TF> >
1353  operator*( const DenseVector<VT1,TF>& lhs, const DVecScalarMultExpr<VT2,ST,TF>& rhs )
1354 {
1356 
1357  return ( (~lhs) * rhs.leftOperand() ) * rhs.rightOperand();
1358 }
1360 //*************************************************************************************************
1361 
1362 
1363 //*************************************************************************************************
1377 template< typename VT1 // Type of the dense vector of the left-hand side expression
1378  , typename ST1 // Type of the scalar of the left-hand side expression
1379  , bool TF // Transpose flag of the dense vectors
1380  , typename VT2 // Type of the dense vector of the right-hand side expression
1381  , typename ST2 > // Type of the scalar of the right-hand side expression
1382 inline const MultExprTrait_< DVecScalarMultExpr<VT1,ST1,TF>, DVecScalarMultExpr<VT2,ST2,TF> >
1383  operator*( const DVecScalarMultExpr<VT1,ST1,TF>& lhs, const DVecScalarMultExpr<VT2,ST2,TF>& rhs )
1384 {
1386 
1387  return ( lhs.leftOperand() * rhs.leftOperand() ) * ( lhs.rightOperand() * rhs.rightOperand() );
1388 }
1390 //*************************************************************************************************
1391 
1392 
1393 //*************************************************************************************************
1407 template< typename VT1 // Type of the dense vector of the left-hand side expression
1408  , typename ST // Type of the scalar of the left-hand side expression
1409  , typename VT2 > // Type of the right-hand side dense vector
1410 inline const MultExprTrait_< DVecScalarMultExpr<VT1,ST,false>, VT2 >
1411  operator*( const DVecScalarMultExpr<VT1,ST,false>& lhs, const DenseVector<VT2,true>& rhs )
1412 {
1414 
1415  return ( lhs.leftOperand() * (~rhs) ) * lhs.rightOperand();
1416 }
1418 //*************************************************************************************************
1419 
1420 
1421 //*************************************************************************************************
1435 template< typename VT1 // Type of the left-hand side dense vector
1436  , typename VT2 // Type of the dense vector of the right-hand side expression
1437  , typename ST > // Type of the scalar of the right-hand side expression
1438 inline const MultExprTrait_< VT1, DVecScalarMultExpr<VT2,ST,true> >
1439  operator*( const DenseVector<VT1,false>& lhs, const DVecScalarMultExpr<VT2,ST,true>& rhs )
1440 {
1442 
1443  return ( (~lhs) * rhs.leftOperand() ) * rhs.rightOperand();
1444 }
1446 //*************************************************************************************************
1447 
1448 
1449 //*************************************************************************************************
1463 template< typename VT1 // Type of the dense vector of the left-hand side expression
1464  , typename ST1 // Type of the scalar of the left-hand side expression
1465  , typename VT2 // Type of the dense vector of the right-hand side expression
1466  , typename ST2 > // Type of the scalar of the right-hand side expression
1467 inline const MultExprTrait_< DVecScalarMultExpr<VT1,ST1,false>, DVecScalarMultExpr<VT2,ST2,true> >
1468  operator*( const DVecScalarMultExpr<VT1,ST1,false>& lhs, const DVecScalarMultExpr<VT2,ST2,true>& rhs )
1469 {
1471 
1472  return ( lhs.leftOperand() * rhs.leftOperand() ) * ( lhs.rightOperand() * rhs.rightOperand() );
1473 }
1475 //*************************************************************************************************
1476 
1477 
1478 //*************************************************************************************************
1492 template< typename VT1 // Type of the dense vector of the left-hand side expression
1493  , typename ST // Type of the scalar of the left-hand side expression
1494  , bool TF // Transpose flag of the vectors
1495  , typename VT2 > // Type of the right-hand side sparse vector
1496 inline const MultExprTrait_< DVecScalarMultExpr<VT1,ST,TF>, VT2 >
1497  operator*( const DVecScalarMultExpr<VT1,ST,TF>& lhs, const SparseVector<VT2,TF>& rhs )
1498 {
1500 
1501  return ( lhs.leftOperand() * (~rhs) ) * lhs.rightOperand();
1502 }
1504 //*************************************************************************************************
1505 
1506 
1507 //*************************************************************************************************
1521 template< typename VT1 // Type of the left-hand side sparse vector
1522  , bool TF // Transpose flag of the vectors
1523  , typename VT2 // Type of the dense vector of the right-hand side expression
1524  , typename ST > // Type of the scalar of the right-hand side expression
1525 inline const MultExprTrait_< VT1, DVecScalarMultExpr<VT2,ST,TF> >
1526  operator*( const SparseVector<VT1,TF>& lhs, const DVecScalarMultExpr<VT2,ST,TF>& rhs )
1527 {
1529 
1530  return ( (~lhs) * rhs.leftOperand() ) * rhs.rightOperand();
1531 }
1533 //*************************************************************************************************
1534 
1535 
1536 //*************************************************************************************************
1551 template< typename VT1 // Type of the dense vector of the left-hand side expression
1552  , typename ST1 // Type of the scalar of the left-hand side expression
1553  , bool TF // Transpose flag of the vectors
1554  , typename VT2 // Type of the sparse vector of the right-hand side expression
1555  , typename ST2 > // Type of the scalar o the right-hand side expression
1556 inline const MultExprTrait_< DVecScalarMultExpr<VT1,ST1,TF>, SVecScalarMultExpr<VT2,ST2,TF> >
1557  operator*( const DVecScalarMultExpr<VT1,ST1,TF>& lhs, const SVecScalarMultExpr<VT2,ST2,TF>& rhs )
1558 {
1560 
1561  return ( lhs.leftOperand() * rhs.leftOperand() ) * ( lhs.rightOperand() * rhs.rightOperand() );
1562 }
1564 //*************************************************************************************************
1565 
1566 
1567 //*************************************************************************************************
1582 template< typename VT1 // Type of the sparse vector of the left-hand side expression
1583  , typename ST1 // Type of the scalar of the left-hand side expression
1584  , bool TF // Transpose flag of the vectors
1585  , typename VT2 // Type of the dense vector of the right-hand side expression
1586  , typename ST2 > // Type of the scalar o the right-hand side expression
1587 inline const MultExprTrait_< SVecScalarMultExpr<VT1,ST1,TF>, DVecScalarMultExpr<VT2,ST2,TF> >
1588  operator*( const SVecScalarMultExpr<VT1,ST1,TF>& lhs, const DVecScalarMultExpr<VT2,ST2,TF>& rhs )
1589 {
1591 
1592  return ( lhs.leftOperand() * rhs.leftOperand() ) * ( lhs.rightOperand() * rhs.rightOperand() );
1593 }
1595 //*************************************************************************************************
1596 
1597 
1598 //*************************************************************************************************
1612 template< typename VT1 // Type of the dense vector of the left-hand side expression
1613  , typename ST // Type of the scalar of the left-hand side expression
1614  , typename VT2 > // Type of the right-hand side sparse vector
1615 inline const MultExprTrait_< DVecScalarMultExpr<VT1,ST,false>, VT2 >
1616  operator*( const DVecScalarMultExpr<VT1,ST,false>& lhs, const SparseVector<VT2,true>& rhs )
1617 {
1619 
1620  return ( lhs.leftOperand() * (~rhs) ) * lhs.rightOperand();
1621 }
1623 //*************************************************************************************************
1624 
1625 
1626 //*************************************************************************************************
1640 template< typename VT1 // Type of the left-hand side sparse vector
1641  , typename VT2 // Type of the dense vector of the right-hand side expression
1642  , typename ST > // Type of the scalar of the right-hand side expression
1643 inline const MultExprTrait_< VT1, DVecScalarMultExpr<VT2,ST,true> >
1644  operator*( const SparseVector<VT1,false>& lhs, const DVecScalarMultExpr<VT2,ST,true>& rhs )
1645 {
1647 
1648  return ( (~lhs) * rhs.leftOperand() ) * rhs.rightOperand();
1649 }
1651 //*************************************************************************************************
1652 
1653 
1654 //*************************************************************************************************
1669 template< typename VT1 // Type of the dense vector of the left-hand side expression
1670  , typename ST1 // Type of the scalar of the left-hand side expression
1671  , typename VT2 // Type of the sparse vector of the right-hand side expression
1672  , typename ST2 > // Type of the scalar o the right-hand side expression
1673 inline const MultExprTrait_< DVecScalarMultExpr<VT1,ST1,false>, SVecScalarMultExpr<VT2,ST2,true> >
1674  operator*( const DVecScalarMultExpr<VT1,ST1,false>& lhs, const SVecScalarMultExpr<VT2,ST2,true>& rhs )
1675 {
1677 
1678  return ( lhs.leftOperand() * rhs.leftOperand() ) * ( lhs.rightOperand() * rhs.rightOperand() );
1679 }
1681 //*************************************************************************************************
1682 
1683 
1684 //*************************************************************************************************
1699 template< typename VT1 // Type of the sparse vector of the left-hand side expression
1700  , typename ST1 // Type of the scalar of the left-hand side expression
1701  , typename VT2 // Type of the dense vector of the right-hand side expression
1702  , typename ST2 > // Type of the scalar o the right-hand side expression
1703 inline const MultExprTrait_< SVecScalarMultExpr<VT1,ST1,false>, DVecScalarMultExpr<VT2,ST2,true> >
1704  operator*( const SVecScalarMultExpr<VT1,ST1,false>& lhs, const DVecScalarMultExpr<VT2,ST2,true>& rhs )
1705 {
1707 
1708  return ( lhs.leftOperand() * rhs.leftOperand() ) * ( lhs.rightOperand() * rhs.rightOperand() );
1709 }
1711 //*************************************************************************************************
1712 
1713 
1714 //*************************************************************************************************
1728 template< typename MT // Type of the left-hand side dense matrix
1729  , bool SO // Storage order of the left-hand side dense matrix
1730  , typename VT // Type of the dense vector of the right-hand side expression
1731  , typename ST > // Type of the scalar of the right-hand side expression
1732 inline const MultExprTrait_< MT, DVecScalarMultExpr<VT,ST,false> >
1733  operator*( const DenseMatrix<MT,SO>& mat, const DVecScalarMultExpr<VT,ST,false>& vec )
1734 {
1736 
1737  return ( (~mat) * vec.leftOperand() ) * vec.rightOperand();
1738 }
1740 //*************************************************************************************************
1741 
1742 
1743 //*************************************************************************************************
1757 template< typename VT // Type of the dense vector of the left-hand side expression
1758  , typename ST // Type of the scalar of the left-hand side expression
1759  , typename MT // Type of the right-hand side dense matrix
1760  , bool SO > // Storage order of the right-hand side dense matrix
1761 inline const MultExprTrait_< DVecScalarMultExpr<VT,ST,true>, MT >
1762  operator*( const DVecScalarMultExpr<VT,ST,true>& vec, const DenseMatrix<MT,SO>& mat )
1763 {
1765 
1766  return ( vec.leftOperand() * (~mat) ) * vec.rightOperand();
1767 }
1769 //*************************************************************************************************
1770 
1771 
1772 //*************************************************************************************************
1786 template< typename MT // Type of the left-hand side sparse matrix
1787  , bool SO // Storage order of the left-hand side sparse matrix
1788  , typename VT // Type of the dense vector of the right-hand side expression
1789  , typename ST > // Type of the scalar of the right-hand side expression
1790 inline const MultExprTrait_< MT, DVecScalarMultExpr<VT,ST,false> >
1791  operator*( const SparseMatrix<MT,SO>& mat, const DVecScalarMultExpr<VT,ST,false>& vec )
1792 {
1794 
1795  return ( (~mat) * vec.leftOperand() ) * vec.rightOperand();
1796 }
1798 //*************************************************************************************************
1799 
1800 
1801 //*************************************************************************************************
1815 template< typename VT // Type of the dense vector of the left-hand side expression
1816  , typename ST // Type of the scalar of the left-hand side expression
1817  , typename MT // Type of the right-hand side sparse matrix
1818  , bool SO > // Storage order of the right-hand side sparse matrix
1819 inline const MultExprTrait_< DVecScalarMultExpr<VT,ST,true>, MT >
1820  operator*( const DVecScalarMultExpr<VT,ST,true>& vec, const SparseMatrix<MT,SO>& mat )
1821 {
1823 
1824  return ( vec.leftOperand() * (~mat) ) * vec.rightOperand();
1825 }
1827 //*************************************************************************************************
1828 
1829 
1830 
1831 
1832 //=================================================================================================
1833 //
1834 // SIZE SPECIALIZATIONS
1835 //
1836 //=================================================================================================
1837 
1838 //*************************************************************************************************
1840 template< typename VT, typename ST, bool TF >
1841 struct Size< DVecScalarMultExpr<VT,ST,TF> > : public Size<VT>
1842 {};
1844 //*************************************************************************************************
1845 
1846 
1847 
1848 
1849 //=================================================================================================
1850 //
1851 // ISALIGNED SPECIALIZATIONS
1852 //
1853 //=================================================================================================
1854 
1855 //*************************************************************************************************
1857 template< typename VT, typename ST, bool TF >
1858 struct IsAligned< DVecScalarMultExpr<VT,ST,TF> >
1859  : public BoolConstant< IsAligned<VT>::value >
1860 {};
1862 //*************************************************************************************************
1863 
1864 
1865 
1866 
1867 //=================================================================================================
1868 //
1869 // ISPADDED SPECIALIZATIONS
1870 //
1871 //=================================================================================================
1872 
1873 //*************************************************************************************************
1875 template< typename VT, typename ST, bool TF >
1876 struct IsPadded< DVecScalarMultExpr<VT,ST,TF> >
1877  : public BoolConstant< IsPadded<VT>::value >
1878 {};
1880 //*************************************************************************************************
1881 
1882 
1883 
1884 
1885 //=================================================================================================
1886 //
1887 // DVECSCALARMULTEXPRTRAIT SPECIALIZATIONS
1888 //
1889 //=================================================================================================
1890 
1891 //*************************************************************************************************
1893 template< typename VT, typename ST1, typename ST2 >
1894 struct DVecScalarMultExprTrait< DVecScalarMultExpr<VT,ST1,false>, ST2 >
1895 {
1896  public:
1897  //**********************************************************************************************
1898  using Type = If_< And< IsDenseVector<VT>, IsColumnVector<VT>
1899  , IsNumeric<ST1>, IsNumeric<ST2> >
1900  , DVecScalarMultExprTrait_< VT, MultTrait_<ST1,ST2> >
1901  , INVALID_TYPE >;
1902  //**********************************************************************************************
1903 };
1905 //*************************************************************************************************
1906 
1907 
1908 
1909 
1910 //=================================================================================================
1911 //
1912 // TDVECSCALARMULTEXPRTRAIT SPECIALIZATIONS
1913 //
1914 //=================================================================================================
1915 
1916 //*************************************************************************************************
1918 template< typename VT, typename ST1, typename ST2 >
1919 struct TDVecScalarMultExprTrait< DVecScalarMultExpr<VT,ST1,true>, ST2 >
1920 {
1921  public:
1922  //**********************************************************************************************
1923  using Type = If_< And< IsDenseVector<VT>, IsRowVector<VT>
1924  , IsNumeric<ST1>, IsNumeric<ST2> >
1925  , TDVecScalarMultExprTrait_< VT, MultTrait_<ST1,ST2> >
1926  , INVALID_TYPE >;
1927  //**********************************************************************************************
1928 };
1930 //*************************************************************************************************
1931 
1932 
1933 
1934 
1935 //=================================================================================================
1936 //
1937 // DVECSCALARDIVEXPRTRAIT SPECIALIZATIONS
1938 //
1939 //=================================================================================================
1940 
1941 //*************************************************************************************************
1943 template< typename VT, typename ST1, typename ST2 >
1944 struct DVecScalarDivExprTrait< DVecScalarMultExpr<VT,ST1,false>, ST2 >
1945 {
1946  private:
1947  //**********************************************************************************************
1948  typedef DivTrait_<ST1,ST2> ScalarType;
1949  //**********************************************************************************************
1950 
1951  public:
1952  //**********************************************************************************************
1953  using Type = If_< And< IsDenseVector<VT>, IsColumnVector<VT>
1954  , IsNumeric<ST1>, IsNumeric<ST2> >
1955  , If_< IsInvertible<ScalarType>
1956  , DVecScalarMultExprTrait_<VT,ScalarType>
1957  , DVecScalarDivExprTrait_<VT,ScalarType> >
1958  , INVALID_TYPE >;
1959  //**********************************************************************************************
1960 };
1962 //*************************************************************************************************
1963 
1964 
1965 
1966 
1967 //=================================================================================================
1968 //
1969 // TDVECSCALARDIVEXPRTRAIT SPECIALIZATIONS
1970 //
1971 //=================================================================================================
1972 
1973 //*************************************************************************************************
1975 template< typename VT, typename ST1, typename ST2 >
1976 struct TDVecScalarDivExprTrait< DVecScalarMultExpr<VT,ST1,true>, ST2 >
1977 {
1978  private:
1979  //**********************************************************************************************
1980  typedef DivTrait_<ST1,ST2> ScalarType;
1981  //**********************************************************************************************
1982 
1983  public:
1984  //**********************************************************************************************
1985  using Type = If_< And< IsDenseVector<VT>, IsRowVector<VT>
1986  , IsNumeric<ST1>, IsNumeric<ST2> >
1987  , If_< IsInvertible<ScalarType>
1988  , TDVecScalarMultExprTrait_<VT,ScalarType>
1989  , TDVecScalarDivExprTrait_<VT,ScalarType> >
1990  , INVALID_TYPE >;
1991  //**********************************************************************************************
1992 };
1994 //*************************************************************************************************
1995 
1996 
1997 
1998 
1999 //=================================================================================================
2000 //
2001 // DVECDVECMULTEXPRTRAIT SPECIALIZATIONS
2002 //
2003 //=================================================================================================
2004 
2005 //*************************************************************************************************
2007 template< typename VT1, typename ST, typename VT2 >
2008 struct DVecDVecMultExprTrait< DVecScalarMultExpr<VT1,ST,false>, VT2 >
2009 {
2010  public:
2011  //**********************************************************************************************
2012  using Type = If_< And< IsDenseVector<VT1>, IsColumnVector<VT1>
2013  , IsDenseVector<VT2>, IsColumnVector<VT2>
2014  , IsNumeric<ST> >
2015  , DVecScalarMultExprTrait_< DVecDVecMultExprTrait_<VT1,VT2>, ST >
2016  , INVALID_TYPE >;
2017  //**********************************************************************************************
2018 };
2020 //*************************************************************************************************
2021 
2022 
2023 //*************************************************************************************************
2025 template< typename VT1, typename VT2, typename ST >
2026 struct DVecDVecMultExprTrait< VT1, DVecScalarMultExpr<VT2,ST,false> >
2027 {
2028  public:
2029  //**********************************************************************************************
2030  using Type = If_< And< IsDenseVector<VT1>, IsColumnVector<VT1>
2031  , IsDenseVector<VT2>, IsColumnVector<VT2>
2032  , IsNumeric<ST> >
2033  , DVecScalarMultExprTrait_< DVecDVecMultExprTrait_<VT1,VT2>, ST >
2034  , INVALID_TYPE >;
2035  //**********************************************************************************************
2036 };
2038 //*************************************************************************************************
2039 
2040 
2041 //*************************************************************************************************
2043 template< typename VT1, typename ST1, typename VT2, typename ST2 >
2044 struct DVecDVecMultExprTrait< DVecScalarMultExpr<VT1,ST1,false>, DVecScalarMultExpr<VT2,ST2,false> >
2045 {
2046  public:
2047  //**********************************************************************************************
2048  using Type = If_< And< IsDenseVector<VT1>, IsColumnVector<VT1>
2049  , IsDenseVector<VT2>, IsColumnVector<VT2>
2050  , IsNumeric<ST1>, IsNumeric<ST2> >
2051  , DVecScalarMultExprTrait_< DVecDVecMultExprTrait_<VT1,VT2>, MultTrait_<ST1,ST2> >
2052  , INVALID_TYPE >;
2053  //**********************************************************************************************
2054 };
2056 //*************************************************************************************************
2057 
2058 
2059 
2060 
2061 //=================================================================================================
2062 //
2063 // DVECTDVECMULTEXPRTRAIT SPECIALIZATIONS
2064 //
2065 //=================================================================================================
2066 
2067 //*************************************************************************************************
2069 template< typename VT1, typename ST, typename VT2 >
2070 struct DVecTDVecMultExprTrait< DVecScalarMultExpr<VT1,ST,false>, VT2 >
2071 {
2072  public:
2073  //**********************************************************************************************
2074  using Type = If_< And< IsDenseVector<VT1>, IsColumnVector<VT1>
2075  , IsDenseVector<VT2>, IsRowVector<VT2>
2076  , IsNumeric<ST> >
2077  , DMatScalarMultExprTrait_< DVecTDVecMultExprTrait_<VT1,VT2>, ST >
2078  , INVALID_TYPE >;
2079  //**********************************************************************************************
2080 };
2082 //*************************************************************************************************
2083 
2084 
2085 //*************************************************************************************************
2087 template< typename VT1, typename VT2, typename ST >
2088 struct DVecTDVecMultExprTrait< VT1, DVecScalarMultExpr<VT2,ST,true> >
2089 {
2090  public:
2091  //**********************************************************************************************
2092  using Type = If_< And< IsDenseVector<VT1>, IsColumnVector<VT1>
2093  , IsDenseVector<VT2>, IsRowVector<VT2>
2094  , IsNumeric<ST> >
2095  , DMatScalarMultExprTrait_< DVecTDVecMultExprTrait_<VT1,VT2>, ST >
2096  , INVALID_TYPE >;
2097  //**********************************************************************************************
2098 };
2100 //*************************************************************************************************
2101 
2102 
2103 //*************************************************************************************************
2105 template< typename VT1, typename ST1, typename VT2, typename ST2 >
2106 struct DVecTDVecMultExprTrait< DVecScalarMultExpr<VT1,ST1,false>, DVecScalarMultExpr<VT2,ST2,true> >
2107 {
2108  public:
2109  //**********************************************************************************************
2110  using Type = If_< And< IsDenseVector<VT1>, IsColumnVector<VT1>
2111  , IsDenseVector<VT2>, IsRowVector<VT2>
2112  , IsNumeric<ST1>, IsNumeric<ST2> >
2113  , DMatScalarMultExprTrait_< DVecTDVecMultExprTrait_<VT1,VT2>, MultTrait_<ST1,ST2> >
2114  , INVALID_TYPE >;
2115  //**********************************************************************************************
2116 };
2118 //*************************************************************************************************
2119 
2120 
2121 
2122 
2123 //=================================================================================================
2124 //
2125 // TDVECTDVECMULTEXPRTRAIT SPECIALIZATIONS
2126 //
2127 //=================================================================================================
2128 
2129 //*************************************************************************************************
2131 template< typename VT1, typename ST, typename VT2 >
2132 struct TDVecTDVecMultExprTrait< DVecScalarMultExpr<VT1,ST,true>, VT2 >
2133 {
2134  public:
2135  //**********************************************************************************************
2136  using Type = If_< And< IsDenseVector<VT1>, IsRowVector<VT1>
2137  , IsDenseVector<VT2>, IsRowVector<VT2>
2138  , IsNumeric<ST> >
2139  , TDVecScalarMultExprTrait_< TDVecTDVecMultExprTrait_<VT1,VT2>, ST >
2140  , INVALID_TYPE >;
2141  //**********************************************************************************************
2142 };
2144 //*************************************************************************************************
2145 
2146 
2147 //*************************************************************************************************
2149 template< typename VT1, typename VT2, typename ST >
2150 struct TDVecTDVecMultExprTrait< VT1, DVecScalarMultExpr<VT2,ST,true> >
2151 {
2152  public:
2153  //**********************************************************************************************
2154  using Type = If_< And< IsDenseVector<VT1>, IsRowVector<VT1>
2155  , IsDenseVector<VT2>, IsRowVector<VT2>
2156  , IsNumeric<ST> >
2157  , TDVecScalarMultExprTrait_< TDVecTDVecMultExprTrait_<VT1,VT2>, ST >
2158  , INVALID_TYPE >;
2159  //**********************************************************************************************
2160 };
2162 //*************************************************************************************************
2163 
2164 
2165 //*************************************************************************************************
2167 template< typename VT1, typename ST1, typename VT2, typename ST2 >
2168 struct TDVecTDVecMultExprTrait< DVecScalarMultExpr<VT1,ST1,true>, DVecScalarMultExpr<VT2,ST2,true> >
2169 {
2170  public:
2171  //**********************************************************************************************
2172  using Type = If_< And< IsDenseVector<VT1>, IsRowVector<VT1>
2173  , IsDenseVector<VT2>, IsRowVector<VT2>
2174  , IsNumeric<ST1>, IsNumeric<ST2> >
2175  , TDVecScalarMultExprTrait_< TDVecTDVecMultExprTrait_<VT1,VT2>, MultTrait_<ST1,ST2> >
2176  , INVALID_TYPE >;
2177  //**********************************************************************************************
2178 };
2180 //*************************************************************************************************
2181 
2182 
2183 
2184 
2185 //=================================================================================================
2186 //
2187 // DVECSVECMULTEXPRTRAIT SPECIALIZATIONS
2188 //
2189 //=================================================================================================
2190 
2191 //*************************************************************************************************
2193 template< typename VT1, typename VT2, typename ST >
2194 struct DVecSVecMultExprTrait< DVecScalarMultExpr<VT1,ST,false>, VT2 >
2195 {
2196  public:
2197  //**********************************************************************************************
2198  using Type = If_< And< IsDenseVector<VT1>, IsColumnVector<VT1>
2199  , IsSparseVector<VT2>, IsColumnVector<VT2>
2200  , IsNumeric<ST> >
2201  , SVecScalarMultExprTrait_< DVecSVecMultExprTrait_<VT1,VT2>, ST >
2202  , INVALID_TYPE >;
2203  //**********************************************************************************************
2204 };
2206 //*************************************************************************************************
2207 
2208 
2209 //*************************************************************************************************
2211 template< typename VT1, typename ST1, typename VT2, typename ST2 >
2212 struct DVecSVecMultExprTrait< DVecScalarMultExpr<VT1,ST1,false>, SVecScalarMultExpr<VT2,ST2,false> >
2213 {
2214  public:
2215  //**********************************************************************************************
2216  using Type = If_< And< IsDenseVector<VT1>, IsColumnVector<VT1>
2217  , IsSparseVector<VT2>, IsColumnVector<VT2>
2218  , IsNumeric<ST1>, IsNumeric<ST2> >
2219  , SVecScalarMultExprTrait_< DVecSVecMultExprTrait_<VT1,VT2>, MultTrait_<ST1,ST2> >
2220  , INVALID_TYPE >;
2221  //**********************************************************************************************
2222 };
2224 //*************************************************************************************************
2225 
2226 
2227 
2228 
2229 //=================================================================================================
2230 //
2231 // DVECTSVECMULTEXPRTRAIT SPECIALIZATIONS
2232 //
2233 //=================================================================================================
2234 
2235 //*************************************************************************************************
2237 template< typename VT1, typename ST, typename VT2 >
2238 struct DVecTSVecMultExprTrait< DVecScalarMultExpr<VT1,ST,false>, VT2 >
2239 {
2240  public:
2241  //**********************************************************************************************
2242  using Type = If_< And< IsDenseVector<VT1>, IsColumnVector<VT1>
2243  , IsSparseVector<VT2>, IsRowVector<VT2>
2244  , IsNumeric<ST> >
2245  , SMatScalarMultExprTrait_< DVecTSVecMultExprTrait_<VT1,VT2>, ST >
2246  , INVALID_TYPE >;
2247  //**********************************************************************************************
2248 };
2250 //*************************************************************************************************
2251 
2252 
2253 //*************************************************************************************************
2255 template< typename VT1, typename ST1, typename VT2, typename ST2 >
2256 struct DVecTSVecMultExprTrait< DVecScalarMultExpr<VT1,ST1,false>, SVecScalarMultExpr<VT2,ST2,true> >
2257 {
2258  public:
2259  //**********************************************************************************************
2260  using Type = If_< And< IsDenseVector<VT1>, IsColumnVector<VT1>
2261  , IsSparseVector<VT2>, IsRowVector<VT2>
2262  , IsNumeric<ST1>, IsNumeric<ST2> >
2263  , SMatScalarMultExprTrait_< DVecTSVecMultExprTrait_<VT1,VT2>, MultTrait_<ST1,ST2> >
2264  , INVALID_TYPE >;
2265  //**********************************************************************************************
2266 };
2268 //*************************************************************************************************
2269 
2270 
2271 
2272 
2273 //=================================================================================================
2274 //
2275 // TDVECTSVECMULTEXPRTRAIT SPECIALIZATIONS
2276 //
2277 //=================================================================================================
2278 
2279 //*************************************************************************************************
2281 template< typename VT1, typename ST, typename VT2 >
2282 struct TDVecTSVecMultExprTrait< DVecScalarMultExpr<VT1,ST,true>, VT2 >
2283 {
2284  public:
2285  //**********************************************************************************************
2286  using Type = If_< And< IsDenseVector<VT1>, IsRowVector<VT1>
2287  , IsSparseVector<VT2>, IsRowVector<VT2>
2288  , IsNumeric<ST> >
2289  , TSVecScalarMultExprTrait_< TDVecTSVecMultExprTrait_<VT1,VT2>, ST >
2290  , INVALID_TYPE >;
2291  //**********************************************************************************************
2292 };
2294 //*************************************************************************************************
2295 
2296 
2297 //*************************************************************************************************
2299 template< typename VT1, typename ST1, typename VT2, typename ST2 >
2300 struct TDVecTSVecMultExprTrait< DVecScalarMultExpr<VT1,ST1,true>, SVecScalarMultExpr<VT2,ST2,true> >
2301 {
2302  public:
2303  //**********************************************************************************************
2304  using Type = If_< And< IsDenseVector<VT1>, IsRowVector<VT1>
2305  , IsSparseVector<VT2>, IsRowVector<VT2>
2306  , IsNumeric<ST1>, IsNumeric<ST2> >
2307  , TSVecScalarMultExprTrait_< TDVecTSVecMultExprTrait_<VT1,VT2>, MultTrait_<ST1,ST2> >
2308  , INVALID_TYPE >;
2309  //**********************************************************************************************
2310 };
2312 //*************************************************************************************************
2313 
2314 
2315 
2316 
2317 //=================================================================================================
2318 //
2319 // SVECDVECMULTEXPRTRAIT SPECIALIZATIONS
2320 //
2321 //=================================================================================================
2322 
2323 //*************************************************************************************************
2325 template< typename VT1, typename VT2, typename ST >
2326 struct SVecDVecMultExprTrait< VT1, DVecScalarMultExpr<VT2,ST,false> >
2327 {
2328  public:
2329  //**********************************************************************************************
2330  using Type = If_< And< IsSparseVector<VT1>, IsColumnVector<VT1>
2331  , IsDenseVector<VT2>, IsColumnVector<VT2>
2332  , IsNumeric<ST> >
2333  , SVecScalarMultExprTrait_< SVecDVecMultExprTrait_<VT1,VT2>, ST >
2334  , INVALID_TYPE >;
2335  //**********************************************************************************************
2336 };
2338 //*************************************************************************************************
2339 
2340 
2341 //*************************************************************************************************
2343 template< typename VT1, typename ST1, typename VT2, typename ST2 >
2344 struct SVecDVecMultExprTrait< SVecScalarMultExpr<VT1,ST1,false>, DVecScalarMultExpr<VT2,ST2,false> >
2345 {
2346  public:
2347  //**********************************************************************************************
2348  using Type = If_< And< IsSparseVector<VT1>, IsColumnVector<VT1>
2349  , IsDenseVector<VT2>, IsColumnVector<VT2>
2350  , IsNumeric<ST1>, IsNumeric<ST2> >
2351  , SVecScalarMultExprTrait_< SVecDVecMultExprTrait_<VT1,VT2>, MultTrait_<ST1,ST2> >
2352  , INVALID_TYPE >;
2353  //**********************************************************************************************
2354 };
2356 //*************************************************************************************************
2357 
2358 
2359 
2360 
2361 //=================================================================================================
2362 //
2363 // SVECTDVECMULTEXPRTRAIT SPECIALIZATIONS
2364 //
2365 //=================================================================================================
2366 
2367 //*************************************************************************************************
2369 template< typename VT1, typename VT2, typename ST >
2370 struct SVecTDVecMultExprTrait< VT1, DVecScalarMultExpr<VT2,ST,true> >
2371 {
2372  public:
2373  //**********************************************************************************************
2374  using Type = If_< And< IsSparseVector<VT1>, IsColumnVector<VT1>
2375  , IsDenseVector<VT2>, IsRowVector<VT2>
2376  , IsNumeric<ST> >
2377  , TSMatScalarMultExprTrait_< SVecTDVecMultExprTrait_<VT1,VT2>, ST >
2378  , INVALID_TYPE >;
2379  //**********************************************************************************************
2380 };
2382 //*************************************************************************************************
2383 
2384 
2385 //*************************************************************************************************
2387 template< typename VT1, typename ST1, typename VT2, typename ST2 >
2388 struct SVecTDVecMultExprTrait< SVecScalarMultExpr<VT1,ST1,false>, DVecScalarMultExpr<VT2,ST2,true> >
2389 {
2390  public:
2391  //**********************************************************************************************
2392  using Type = If_< And< IsSparseVector<VT1>, IsColumnVector<VT1>
2393  , IsDenseVector<VT2>, IsRowVector<VT2>
2394  , IsNumeric<ST1>, IsNumeric<ST2> >
2395  , TSMatScalarMultExprTrait_< SVecTDVecMultExprTrait_<VT1,VT2>, MultTrait_<ST1,ST2> >
2396  , INVALID_TYPE >;
2397  //**********************************************************************************************
2398 };
2400 //*************************************************************************************************
2401 
2402 
2403 
2404 
2405 //=================================================================================================
2406 //
2407 // TSVECTDVECMULTEXPRTRAIT SPECIALIZATIONS
2408 //
2409 //=================================================================================================
2410 
2411 //*************************************************************************************************
2413 template< typename VT1, typename VT2, typename ST >
2414 struct TSVecTDVecMultExprTrait< VT1, DVecScalarMultExpr<VT2,ST,true> >
2415 {
2416  public:
2417  //**********************************************************************************************
2418  using Type = If_< And< IsSparseVector<VT1>, IsRowVector<VT1>
2419  , IsDenseVector<VT2>, IsRowVector<VT2>
2420  , IsNumeric<ST> >
2421  , TSVecScalarMultExprTrait_< TSVecTDVecMultExprTrait_<VT1,VT2>, ST >
2422  , INVALID_TYPE >;
2423  //**********************************************************************************************
2424 };
2426 //*************************************************************************************************
2427 
2428 
2429 //*************************************************************************************************
2431 template< typename VT1, typename ST1, typename VT2, typename ST2 >
2432 struct TSVecTDVecMultExprTrait< SVecScalarMultExpr<VT1,ST1,true>, DVecScalarMultExpr<VT2,ST2,true> >
2433 {
2434  public:
2435  //**********************************************************************************************
2436  using Type = If_< And< IsSparseVector<VT1>, IsRowVector<VT1>
2437  , IsDenseVector<VT2>, IsRowVector<VT2>
2438  , IsNumeric<ST1>, IsNumeric<ST2> >
2439  , TSVecScalarMultExprTrait_< TSVecTDVecMultExprTrait_<VT1,VT2>, MultTrait_<ST1,ST2> >
2440  , INVALID_TYPE >;
2441  //**********************************************************************************************
2442 };
2444 //*************************************************************************************************
2445 
2446 
2447 
2448 
2449 //=================================================================================================
2450 //
2451 // DMATDVECMULTEXPRTRAIT SPECIALIZATIONS
2452 //
2453 //=================================================================================================
2454 
2455 //*************************************************************************************************
2457 template< typename MT, typename VT, typename ST >
2458 struct DMatDVecMultExprTrait< MT, DVecScalarMultExpr<VT,ST,false> >
2459 {
2460  public:
2461  //**********************************************************************************************
2462  using Type = If_< And< IsDenseMatrix<MT>, IsRowMajorMatrix<MT>
2463  , IsDenseVector<VT>, IsColumnVector<VT>
2464  , IsNumeric<ST> >
2465  , DVecScalarMultExprTrait_< DMatDVecMultExprTrait_<MT,VT>, ST >
2466  , INVALID_TYPE >;
2467  //**********************************************************************************************
2468 };
2470 //*************************************************************************************************
2471 
2472 
2473 
2474 
2475 //=================================================================================================
2476 //
2477 // TDMATDVECMULTEXPRTRAIT SPECIALIZATIONS
2478 //
2479 //=================================================================================================
2480 
2481 //*************************************************************************************************
2483 template< typename MT, typename VT, typename ST >
2484 struct TDMatDVecMultExprTrait< MT, DVecScalarMultExpr<VT,ST,false> >
2485 {
2486  public:
2487  //**********************************************************************************************
2488  using Type = If_< And< IsDenseMatrix<MT>, IsColumnMajorMatrix<MT>
2489  , IsDenseVector<VT>, IsColumnVector<VT>
2490  , IsNumeric<ST> >
2491  , DVecScalarMultExprTrait_< TDMatDVecMultExprTrait_<MT,VT>, ST >
2492  , INVALID_TYPE >;
2493  //**********************************************************************************************
2494 };
2496 //*************************************************************************************************
2497 
2498 
2499 
2500 
2501 //=================================================================================================
2502 //
2503 // TDVECDMATMULTEXPRTRAIT SPECIALIZATIONS
2504 //
2505 //=================================================================================================
2506 
2507 //*************************************************************************************************
2509 template< typename VT, typename MT, typename ST >
2510 struct TDVecDMatMultExprTrait< DVecScalarMultExpr<VT,ST,true>, MT >
2511 {
2512  public:
2513  //**********************************************************************************************
2514  using Type = If_< And< IsDenseVector<VT>, IsRowVector<VT>
2515  , IsDenseMatrix<MT>, IsRowMajorMatrix<MT>
2516  , IsNumeric<ST> >
2517  , TDVecScalarMultExprTrait_< TDVecDMatMultExprTrait_<VT,MT>, ST >
2518  , INVALID_TYPE >;
2519  //**********************************************************************************************
2520 };
2522 //*************************************************************************************************
2523 
2524 
2525 
2526 
2527 //=================================================================================================
2528 //
2529 // TDVECTDMATMULTEXPRTRAIT SPECIALIZATIONS
2530 //
2531 //=================================================================================================
2532 
2533 //*************************************************************************************************
2535 template< typename VT, typename MT, typename ST >
2536 struct TDVecTDMatMultExprTrait< DVecScalarMultExpr<VT,ST,true>, MT >
2537 {
2538  public:
2539  //**********************************************************************************************
2540  using Type = If_< And< IsDenseVector<VT>, IsRowVector<VT>
2541  , IsDenseMatrix<MT>, IsColumnMajorMatrix<MT>
2542  , IsNumeric<ST> >
2543  , TDVecScalarMultExprTrait_< TDVecTDMatMultExprTrait_<VT,MT>, ST >
2544  , INVALID_TYPE >;
2545  //**********************************************************************************************
2546 };
2548 //*************************************************************************************************
2549 
2550 
2551 
2552 
2553 //=================================================================================================
2554 //
2555 // SMATDVECMULTEXPRTRAIT SPECIALIZATIONS
2556 //
2557 //=================================================================================================
2558 
2559 //*************************************************************************************************
2561 template< typename MT, typename VT, typename ST >
2562 struct SMatDVecMultExprTrait< MT, DVecScalarMultExpr<VT,ST,false> >
2563 {
2564  public:
2565  //**********************************************************************************************
2566  using Type = If_< And< IsSparseMatrix<MT>, IsRowMajorMatrix<MT>
2567  , IsDenseVector<VT>, IsColumnVector<VT>
2568  , IsNumeric<ST> >
2569  , DVecScalarMultExprTrait_< SMatDVecMultExprTrait_<MT,VT>, ST >
2570  , INVALID_TYPE >;
2571  //**********************************************************************************************
2572 };
2574 //*************************************************************************************************
2575 
2576 
2577 
2578 
2579 //=================================================================================================
2580 //
2581 // TSMATDVECMULTEXPRTRAIT SPECIALIZATIONS
2582 //
2583 //=================================================================================================
2584 
2585 //*************************************************************************************************
2587 template< typename MT, typename VT, typename ST >
2588 struct TSMatDVecMultExprTrait< MT, DVecScalarMultExpr<VT,ST,false> >
2589 {
2590  public:
2591  //**********************************************************************************************
2592  using Type = If_< And< IsSparseMatrix<MT>, IsColumnMajorMatrix<MT>
2593  , IsDenseVector<VT>, IsColumnVector<VT>
2594  , IsNumeric<ST> >
2595  , DVecScalarMultExprTrait_< TSMatDVecMultExprTrait_<MT,VT>, ST >
2596  , INVALID_TYPE >;
2597  //**********************************************************************************************
2598 };
2600 //*************************************************************************************************
2601 
2602 
2603 
2604 
2605 //=================================================================================================
2606 //
2607 // TDVECSMATMULTEXPRTRAIT SPECIALIZATIONS
2608 //
2609 //=================================================================================================
2610 
2611 //*************************************************************************************************
2613 template< typename VT, typename MT, typename ST >
2614 struct TDVecSMatMultExprTrait< DVecScalarMultExpr<VT,ST,true>, MT >
2615 {
2616  public:
2617  //**********************************************************************************************
2618  using Type = If_< And< IsDenseVector<VT>, IsRowVector<VT>
2619  , IsSparseMatrix<MT>, IsRowMajorMatrix<MT>
2620  , IsNumeric<ST> >
2621  , TDVecScalarMultExprTrait_< TDVecSMatMultExprTrait_<VT,MT>, ST >
2622  , INVALID_TYPE >;
2623  //**********************************************************************************************
2624 };
2626 //*************************************************************************************************
2627 
2628 
2629 
2630 
2631 //=================================================================================================
2632 //
2633 // TDVECTSMATMULTEXPRTRAIT SPECIALIZATIONS
2634 //
2635 //=================================================================================================
2636 
2637 //*************************************************************************************************
2639 template< typename VT, typename MT, typename ST >
2640 struct TDVecTSMatMultExprTrait< DVecScalarMultExpr<VT,ST,true>, MT >
2641 {
2642  public:
2643  //**********************************************************************************************
2644  using Type = If_< And< IsDenseVector<VT>, IsRowVector<VT>
2645  , IsSparseMatrix<MT>, IsColumnMajorMatrix<MT>
2646  , IsNumeric<ST> >
2647  , TDVecScalarMultExprTrait_< TDVecTSMatMultExprTrait_<VT,MT>, ST >
2648  , INVALID_TYPE >;
2649  //**********************************************************************************************
2650 };
2652 //*************************************************************************************************
2653 
2654 
2655 
2656 
2657 //=================================================================================================
2658 //
2659 // SUBVECTOREXPRTRAIT SPECIALIZATIONS
2660 //
2661 //=================================================================================================
2662 
2663 //*************************************************************************************************
2665 template< typename VT, typename ST, bool TF, bool AF >
2666 struct SubvectorExprTrait< DVecScalarMultExpr<VT,ST,TF>, AF >
2667 {
2668  public:
2669  //**********************************************************************************************
2670  using Type = MultExprTrait_< SubvectorExprTrait_<const VT,AF>, ST >;
2671  //**********************************************************************************************
2672 };
2674 //*************************************************************************************************
2675 
2676 } // namespace blaze
2677 
2678 #endif
Pointer difference type of the Blaze library.
Header file for auxiliary alias declarations.
Data type constraint.
Compile time check whether the given type is a computational expression template.This type trait clas...
Definition: IsComputation.h:72
Compile time check for numeric types.This type trait tests whether or not the given template paramete...
Definition: IsNumeric.h:79
Constraint on the data type.
TransposeType_< ResultType > TransposeType
Transpose type for expression template evaluations.
Definition: DVecScalarMultExpr.h:180
Compile time check whether the given type is a temporary vector or matrix type.This type trait class ...
Definition: IsTemporary.h:70
const DMatDMatMultExpr< T1, T2 > operator*(const DenseMatrix< T1, false > &lhs, const DenseMatrix< T2, false > &rhs)
Multiplication operator for the multiplication of two row-major dense matrices ( ).
Definition: DMatDMatMultExpr.h:7800
Header file for basic type definitions.
Header file for the SparseVector base class.
ReturnType operator*() const
Direct access to the element at the current iterator position.
Definition: DVecScalarMultExpr.h:303
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 IsSparseMatrix type trait.
Header file for the serial shim.
ConstIterator end() const
Returns an iterator just past the last non-zero element of the dense vector.
Definition: DVecScalarMultExpr.h:522
const ConstIterator operator++(int)
Post-increment operator.
Definition: DVecScalarMultExpr.h:272
Availability of a SIMD multiplication for the given data types.Depending on the available instruction...
Definition: HasSIMDMult.h:162
ResultType_< VT > RT
Result type of the dense vector expression.
Definition: DVecScalarMultExpr.h:123
Header file for the IsColumnMajorMatrix type trait.
Header file for the IsRowVector type trait.
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.
Header file for the DenseVector base class.
ReturnType operator[](size_t index) const
Subscript operator for the direct access to the vector elements.
Definition: DVecScalarMultExpr.h:473
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
typename MultTrait< T1, T2 >::Type MultTrait_
Auxiliary alias declaration for the MultTrait class template.The MultTrait_ alias declaration provide...
Definition: MultTrait.h:245
Header file for the Computation base class.
Header file for the UnderlyingElement type trait.
const DenseIterator< Type, AF > operator-(const DenseIterator< Type, AF > &it, ptrdiff_t inc) noexcept
Subtraction between a DenseIterator and an integral value.
Definition: DenseIterator.h:731
Header file for the RequiresEvaluation type trait.
bool operator!=(const ConstIterator &rhs) const
Inequality comparison between two ConstIterator objects.
Definition: DVecScalarMultExpr.h:335
ConstIterator(IteratorType iterator, RightOperand scalar)
Constructor for the ConstIterator class.
Definition: DVecScalarMultExpr.h:226
Header file for the VecScalarMultExpr base class.
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
ConstIterator_< VT > IteratorType
ConstIterator type of the dense vector expression.
Definition: DVecScalarMultExpr.h:217
bool canAlias(const T *alias) const noexcept
Returns whether the expression can alias with the given address alias.
Definition: DVecScalarMultExpr.h:564
typename UnderlyingBuiltin< T >::Type UnderlyingBuiltin_
Auxiliary alias declaration for the UnderlyingBuiltin type trait.The UnderlyingBuiltin_ alias declara...
Definition: UnderlyingBuiltin.h:133
Constraint on the data type.
auto length(const DenseVector< VT, TF > &dv) -> decltype(sqrt(sqrLength(~dv)))
Calculation of the dense vector length .
Definition: DenseVector.h:574
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
ValueType value_type
Type of the underlying elements.
Definition: DVecScalarMultExpr.h:211
typename T::ReturnType ReturnType_
Alias declaration for nested ReturnType type definitions.The ReturnType_ alias declaration provides a...
Definition: Aliases.h:343
bool operator<=(const ConstIterator &rhs) const
Less-than comparison between two ConstIterator objects.
Definition: DVecScalarMultExpr.h:368
BLAZE_ALWAYS_INLINE auto load(size_t index) const noexcept
Access to the SIMD elements of the vector.
Definition: DVecScalarMultExpr.h:500
Header file for the SparseMatrix base class.
ReturnType at(size_t index) const
Checked access to the vector elements.
Definition: DVecScalarMultExpr.h:486
Header file for the DivExprTrait class template.
ReturnType_< VT > RN
Return type of the dense vector expression.
Definition: DVecScalarMultExpr.h:124
PointerType pointer
Pointer return type.
Definition: DVecScalarMultExpr.h:212
typename MultExprTrait< T1, T2 >::Type MultExprTrait_
Auxiliary alias declaration for the MultExprTrait class template.The MultExprTrait_ alias declaration...
Definition: MultExprTrait.h:344
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:72
typename T::CompositeType CompositeType_
Alias declaration for nested CompositeType type definitions.The CompositeType_ alias declaration prov...
Definition: Aliases.h:83
ptrdiff_t DifferenceType
Difference between two iterators.
Definition: DVecScalarMultExpr.h:207
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
Header file for the IsTemporary type trait class.
CompositeType_< VT > CT
Composite type of the dense vector expression.
Definition: DVecScalarMultExpr.h:126
Header file for the multiplication trait.
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
LeftOperand leftOperand() const noexcept
Returns the left-hand side dense vector operand.
Definition: DVecScalarMultExpr.h:542
Header file for the If class template.
Header file for the UnderlyingBuiltin type trait.
const Element * ConstIterator
Iterator over constant elements.
Definition: CompressedMatrix.h:2647
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
Header file for the Or class template.
#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
Iterator over the elements of the dense vector.
Definition: DVecScalarMultExpr.h:199
Header file for the DenseMatrix base class.
bool operator>(const ConstIterator &rhs) const
Greater-than comparison between two ConstIterator objects.
Definition: DVecScalarMultExpr.h:357
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.
bool operator>=(const ConstIterator &rhs) const
Greater-than comparison between two ConstIterator objects.
Definition: DVecScalarMultExpr.h:379
ST RightOperand
Composite type of the right-hand side scalar value.
Definition: DVecScalarMultExpr.h:193
Base class for N-dimensional dense vectors.The DenseVector class is a base class for all arbitrarily ...
Definition: DenseVector.h:70
#define BLAZE_CONSTRAINT_MUST_BE_SAME_TYPE(A, B)
Data type constraint.In case the two types A and B are not the same (ignoring all cv-qualifiers of bo...
Definition: SameType.h:71
Header file for the IsAligned type trait.
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
std::random_access_iterator_tag IteratorCategory
The iterator category.
Definition: DVecScalarMultExpr.h:203
Constraint on the data type.
Header file for the exception macros of the math module.
DVecScalarMultExpr< VT, ST, TF > This
Type of this DVecScalarMultExpr instance.
Definition: DVecScalarMultExpr.h:178
bool operator<(const ConstIterator &rhs) const
Less-than comparison between two ConstIterator objects.
Definition: DVecScalarMultExpr.h:346
LeftOperand vector_
Left-hand side dense vector of the multiplication expression.
Definition: DVecScalarMultExpr.h:603
Header file for all forward declarations for expression class templates.
Header file for the IsDenseMatrix type trait.
Header file for the EnableIf class template.
ReferenceType reference
Reference return type.
Definition: DVecScalarMultExpr.h:213
ConstIterator & operator++()
Pre-increment operator.
Definition: DVecScalarMultExpr.h:261
Header file for the IsPadded type trait.
auto load() const noexcept
Access to the SIMD elements of the vector.
Definition: DVecScalarMultExpr.h:313
friend const ConstIterator operator+(const ConstIterator &it, size_t inc)
Addition between a ConstIterator and an integral value.
Definition: DVecScalarMultExpr.h:402
If_< IsExpression< VT >, const VT, const VT & > LeftOperand
Composite type of the left-hand side dense vector expression.
Definition: DVecScalarMultExpr.h:190
Header file for the IsNumeric type trait.
BLAZE_ALWAYS_INLINE const EnableIf_< And< IsIntegral< T >, HasSize< T, 1UL > >, If_< IsSigned< T >, SIMDint8, SIMDuint8 > > set(T value) noexcept
Sets all values in the vector to the given 1-byte integral value.
Definition: Set.h:76
RightOperand scalar_
Right-hand side scalar of the multiplication expression.
Definition: DVecScalarMultExpr.h:604
ElementType ValueType
Type of the underlying elements.
Definition: DVecScalarMultExpr.h:204
bool operator==(const ConstIterator &rhs) const
Equality comparison between two ConstIterator objects.
Definition: DVecScalarMultExpr.h:324
Base class for all vector/scalar multiplication expression templates.The VecScalarMultExpr class serv...
Definition: VecScalarMultExpr.h:66
ElementType_< VT > ET
Element type of the dense vector expression.
Definition: DVecScalarMultExpr.h:125
Header file for the IsSparseVector type trait.
Header file for the HasSIMDMult type trait.
Header file for run time assertion macros.
Utility type for generic codes.
Header file for the division trait.
IteratorType iterator_
Iterator to the current element.
Definition: DVecScalarMultExpr.h:433
RightOperand rightOperand() const noexcept
Returns the right-hand side scalar operand.
Definition: DVecScalarMultExpr.h:552
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
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
Constraint on the data type.
#define BLAZE_CONSTRAINT_MUST_BE_NUMERIC_TYPE(T)
Constraint on the data type.In case the given data type T is not a numeric (integral or floating poin...
Definition: Numeric.h:61
SIMD characteristics of data types.The SIMDTrait class template provides the SIMD characteristics of ...
Definition: SIMDTrait.h:296
friend const ConstIterator operator+(size_t inc, const ConstIterator &it)
Addition between an integral value and a ConstIterator.
Definition: DVecScalarMultExpr.h:414
ElementType * PointerType
Pointer return type.
Definition: DVecScalarMultExpr.h:205
size_t size() const noexcept
Returns the current size/dimension of the vector.
Definition: DVecScalarMultExpr.h:532
IntegralConstant< bool, B > BoolConstant
Generic wrapper for a compile time constant boolean value.The BoolConstant class template represents ...
Definition: IntegralConstant.h:100
Header file for the IsInvertible type trait.
bool isAliased(const T *alias) const noexcept
Returns whether the expression is aliased with the given address alias.
Definition: DVecScalarMultExpr.h:576
typename EnableIf< Condition, T >::Type EnableIf_
Auxiliary alias declaration for the EnableIf class template.The EnableIf_ alias declaration provides ...
Definition: EnableIf.h:223
Header file for the IsDenseVector type trait.
friend const ConstIterator operator-(const ConstIterator &it, size_t dec)
Subtraction between a ConstIterator and an integral value.
Definition: DVecScalarMultExpr.h:426
MultTrait_< RT, ST > ResultType
Result type for expression template evaluations.
Definition: DVecScalarMultExpr.h:179
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 & ReferenceType
Reference return type.
Definition: DVecScalarMultExpr.h:206
MultExprTrait_< RN, ST > ExprReturnType
Expression return type for the subscript operator.
Definition: DVecScalarMultExpr.h:139
ConstIterator begin() const
Returns an iterator to the first non-zero element of the dense vector.
Definition: DVecScalarMultExpr.h:512
const DVecScalarMultExpr< VT, ElementType_< VT >, TF > normalize(const DenseVector< VT, TF > &vec)
Normalization of the dense vector ( ).
Definition: DVecScalarMultExpr.h:1164
IfTrue_< useAssign, const ResultType, const DVecScalarMultExpr & > CompositeType
Data type for composite expression templates.
Definition: DVecScalarMultExpr.h:187
const IfTrue_< returnExpr, ExprReturnType, ElementType > ReturnType
Return type for expression template evaluations.
Definition: DVecScalarMultExpr.h:184
Header file for the IsRowMajorMatrix type trait.
Header file for the IsComputation type trait class.
const ConstIterator operator--(int)
Post-decrement operator.
Definition: DVecScalarMultExpr.h:293
Expression object for dense vector-scalar multiplications.The DVecScalarMultExpr class represents the...
Definition: DVecScalarMultExpr.h:117
ConstIterator & operator+=(size_t inc)
Addition assignment operator.
Definition: DVecScalarMultExpr.h:238
Base class for all compute expression templates.The Computation class serves as a tag for all computa...
Definition: Computation.h:59
DVecScalarMultExpr(const VT &vector, ST scalar) noexcept
Constructor for the DVecScalarMultExpr class.
Definition: DVecScalarMultExpr.h:461
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
bool canSMPAssign() const noexcept
Returns whether the expression can be used in SMP assignments.
Definition: DVecScalarMultExpr.h:596
ConstIterator & operator-=(size_t dec)
Subtraction assignment operator.
Definition: DVecScalarMultExpr.h:250
Header file for the IntegralConstant class template.
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
Header file for the IsColumnVector type trait.
IteratorCategory iterator_category
The iterator category.
Definition: DVecScalarMultExpr.h:210
bool isAligned() const noexcept
Returns whether the operands of the expression are properly aligned in memory.
Definition: DVecScalarMultExpr.h:586
System settings for the inline keywords.
Header file for the Size type trait.
RightOperand scalar_
Scalar of the multiplication expression.
Definition: DVecScalarMultExpr.h:434
#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
ElementType_< ResultType > ElementType
Resulting element type.
Definition: DVecScalarMultExpr.h:181
#define BLAZE_CONSTRAINT_MUST_BE_FLOATING_POINT_TYPE(T)
Constraint on the data type.In case the given data type T is not a floating point data type...
Definition: FloatingPoint.h:61
Header file for the IsExpression type trait class.
Header file for the FunctionTrace class.
DifferenceType difference_type
Difference between two iterators.
Definition: DVecScalarMultExpr.h:214
DifferenceType operator-(const ConstIterator &rhs) const
Calculating the number of elements between two iterators.
Definition: DVecScalarMultExpr.h:390
ConstIterator & operator--()
Pre-decrement operator.
Definition: DVecScalarMultExpr.h:282