All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
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>
53 #include <blaze/math/Intrinsics.h>
74 #include <blaze/util/Assert.h>
79 #include <blaze/util/EnableIf.h>
80 #include <blaze/util/InvalidType.h>
82 #include <blaze/util/SelectType.h>
83 #include <blaze/util/Types.h>
87 
88 
89 namespace blaze {
90 
91 //=================================================================================================
92 //
93 // CLASS DVECSCALARMULTEXPR
94 //
95 //=================================================================================================
96 
97 //*************************************************************************************************
104 template< typename VT // Type of the left-hand side dense vector
105  , typename ST // Type of the right-hand side scalar value
106  , bool TF > // Transpose flag
107 class DVecScalarMultExpr : public DenseVector< DVecScalarMultExpr<VT,ST,TF>, TF >
108  , private VecScalarMultExpr
109  , private Computation
110 {
111  private:
112  //**Type definitions****************************************************************************
113  typedef typename VT::ResultType RT;
114  typedef typename VT::ReturnType RN;
115  typedef typename VT::ElementType ET;
116  typedef typename VT::CompositeType CT;
117  //**********************************************************************************************
118 
119  //**Return type evaluation**********************************************************************
121 
126  enum { returnExpr = !IsTemporary<RN>::value };
127 
130  //**********************************************************************************************
131 
132  //**Serial evaluation strategy******************************************************************
134 
141 
143  template< typename VT2 >
145  struct UseAssign {
146  enum { value = useAssign };
147  };
149  //**********************************************************************************************
150 
151  //**Parallel evaluation strategy****************************************************************
153 
159  template< typename VT2 >
160  struct UseSMPAssign {
161  enum { value = ( !VT2::smpAssignable || !VT::smpAssignable ) && useAssign };
162  };
164  //**********************************************************************************************
165 
166  public:
167  //**Type definitions****************************************************************************
173 
176 
179 
181  typedef typename SelectType< IsExpression<VT>::value, const VT, const VT& >::Type LeftOperand;
182 
184  typedef ST RightOperand;
185  //**********************************************************************************************
186 
187  //**ConstIterator class definition**************************************************************
191  {
192  public:
193  //**Type definitions*************************************************************************
194  typedef std::random_access_iterator_tag IteratorCategory;
199 
200  // STL iterator requirements
206 
208  typedef typename VT::ConstIterator IteratorType;
209  //*******************************************************************************************
210 
211  //**Constructor******************************************************************************
217  explicit inline ConstIterator( IteratorType iterator, RightOperand scalar )
218  : iterator_( iterator ) // Iterator to the current element
219  , scalar_ ( scalar ) // Scalar of the multiplication expression
220  {}
221  //*******************************************************************************************
222 
223  //**Addition assignment operator*************************************************************
229  inline ConstIterator& operator+=( size_t inc ) {
230  iterator_ += inc;
231  return *this;
232  }
233  //*******************************************************************************************
234 
235  //**Subtraction assignment operator**********************************************************
241  inline ConstIterator& operator-=( size_t dec ) {
242  iterator_ -= dec;
243  return *this;
244  }
245  //*******************************************************************************************
246 
247  //**Prefix increment operator****************************************************************
253  ++iterator_;
254  return *this;
255  }
256  //*******************************************************************************************
257 
258  //**Postfix increment operator***************************************************************
263  inline const ConstIterator operator++( int ) {
264  return ConstIterator( iterator_++ );
265  }
266  //*******************************************************************************************
267 
268  //**Prefix decrement operator****************************************************************
274  --iterator_;
275  return *this;
276  }
277  //*******************************************************************************************
278 
279  //**Postfix decrement operator***************************************************************
284  inline const ConstIterator operator--( int ) {
285  return ConstIterator( iterator_-- );
286  }
287  //*******************************************************************************************
288 
289  //**Element access operator******************************************************************
294  inline ReturnType operator*() const {
295  return *iterator_ * scalar_;
296  }
297  //*******************************************************************************************
298 
299  //**Load function****************************************************************************
304  inline IntrinsicType load() const {
305  return iterator_.load() * set( scalar_ );
306  }
307  //*******************************************************************************************
308 
309  //**Equality operator************************************************************************
315  inline bool operator==( const ConstIterator& rhs ) const {
316  return iterator_ == rhs.iterator_;
317  }
318  //*******************************************************************************************
319 
320  //**Inequality operator**********************************************************************
326  inline bool operator!=( const ConstIterator& rhs ) const {
327  return iterator_ != rhs.iterator_;
328  }
329  //*******************************************************************************************
330 
331  //**Less-than operator***********************************************************************
337  inline bool operator<( const ConstIterator& rhs ) const {
338  return iterator_ < rhs.iterator_;
339  }
340  //*******************************************************************************************
341 
342  //**Greater-than operator********************************************************************
348  inline bool operator>( const ConstIterator& rhs ) const {
349  return iterator_ > rhs.iterator_;
350  }
351  //*******************************************************************************************
352 
353  //**Less-or-equal-than operator**************************************************************
359  inline bool operator<=( const ConstIterator& rhs ) const {
360  return iterator_ <= rhs.iterator_;
361  }
362  //*******************************************************************************************
363 
364  //**Greater-or-equal-than operator***********************************************************
370  inline bool operator>=( const ConstIterator& rhs ) const {
371  return iterator_ >= rhs.iterator_;
372  }
373  //*******************************************************************************************
374 
375  //**Subtraction operator*********************************************************************
381  inline DifferenceType operator-( const ConstIterator& rhs ) const {
382  return iterator_ - rhs.iterator_;
383  }
384  //*******************************************************************************************
385 
386  //**Addition operator************************************************************************
393  friend inline const ConstIterator operator+( const ConstIterator& it, size_t inc ) {
394  return ConstIterator( it.iterator_ + inc );
395  }
396  //*******************************************************************************************
397 
398  //**Addition operator************************************************************************
405  friend inline const ConstIterator operator+( size_t inc, const ConstIterator& it ) {
406  return ConstIterator( it.iterator_ + inc );
407  }
408  //*******************************************************************************************
409 
410  //**Subtraction operator*********************************************************************
417  friend inline const ConstIterator operator-( const ConstIterator& it, size_t dec ) {
418  return ConstIterator( it.iterator_ - dec );
419  }
420  //*******************************************************************************************
421 
422  private:
423  //**Member variables*************************************************************************
426  //*******************************************************************************************
427  };
428  //**********************************************************************************************
429 
430  //**Compilation flags***************************************************************************
432  enum { vectorizable = VT::vectorizable &&
435 
437  enum { smpAssignable = VT::smpAssignable };
438  //**********************************************************************************************
439 
440  //**Constructor*********************************************************************************
446  explicit inline DVecScalarMultExpr( const VT& vector, ST scalar )
447  : vector_( vector ) // Left-hand side dense vector of the multiplication expression
448  , scalar_( scalar ) // Right-hand side scalar of the multiplication expression
449  {}
450  //**********************************************************************************************
451 
452  //**Subscript operator**************************************************************************
458  inline ReturnType operator[]( size_t index ) const {
459  BLAZE_INTERNAL_ASSERT( index < vector_.size(), "Invalid vector access index" );
460  return vector_[index] * scalar_;
461  }
462  //**********************************************************************************************
463 
464  //**Load function*******************************************************************************
470  inline IntrinsicType load( size_t index ) const {
471  typedef IntrinsicTrait<ElementType> IT;
472  BLAZE_INTERNAL_ASSERT( index < vector_.size() , "Invalid vector access index" );
473  BLAZE_INTERNAL_ASSERT( index % IT::size == 0UL, "Invalid vector access index" );
474  const IntrinsicType xmm1( vector_.load( index ) );
475  const IntrinsicType xmm2( set( scalar_ ) );
476  return xmm1 * xmm2;
477  }
478  //**********************************************************************************************
479 
480  //**Begin function******************************************************************************
485  inline ConstIterator begin() const {
486  return ConstIterator( vector_.begin(), scalar_ );
487  }
488  //**********************************************************************************************
489 
490  //**End function********************************************************************************
495  inline ConstIterator end() const {
496  return ConstIterator( vector_.end(), scalar_ );
497  }
498  //**********************************************************************************************
499 
500  //**Size function*******************************************************************************
505  inline size_t size() const {
506  return vector_.size();
507  }
508  //**********************************************************************************************
509 
510  //**Left operand access*************************************************************************
515  inline LeftOperand leftOperand() const {
516  return vector_;
517  }
518  //**********************************************************************************************
519 
520  //**Right operand access************************************************************************
525  inline RightOperand rightOperand() const {
526  return scalar_;
527  }
528  //**********************************************************************************************
529 
530  //**********************************************************************************************
536  template< typename T >
537  inline bool canAlias( const T* alias ) const {
538  return IsComputation<VT>::value && vector_.canAlias( alias );
539  }
540  //**********************************************************************************************
541 
542  //**********************************************************************************************
548  template< typename T >
549  inline bool isAliased( const T* alias ) const {
550  return vector_.isAliased( alias );
551  }
552  //**********************************************************************************************
553 
554  //**********************************************************************************************
559  inline bool isAligned() const {
560  return vector_.isAligned();
561  }
562  //**********************************************************************************************
563 
564  //**********************************************************************************************
569  inline bool canSMPAssign() const {
570  return vector_.canSMPAssign() || ( size() > SMP_DVECSCALARMULT_THRESHOLD );
571  }
572  //**********************************************************************************************
573 
574  private:
575  //**Member variables****************************************************************************
578  //**********************************************************************************************
579 
580  //**Assignment to dense vectors*****************************************************************
594  template< typename VT2 > // Type of the target dense vector
595  friend inline typename EnableIf< UseAssign<VT2> >::Type
596  assign( DenseVector<VT2,TF>& lhs, const DVecScalarMultExpr& rhs )
597  {
599 
600  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
601 
602  assign( ~lhs, rhs.vector_ );
603  assign( ~lhs, (~lhs) * rhs.scalar_ );
604  }
606  //**********************************************************************************************
607 
608  //**Assignment to sparse vectors****************************************************************
622  template< typename VT2 > // Type of the target sparse vector
623  friend inline typename EnableIf< UseAssign<VT2> >::Type
625  {
627 
628  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
629 
630  assign( ~lhs, rhs.vector_ );
631  (~lhs) *= rhs.scalar_;
632  }
634  //**********************************************************************************************
635 
636  //**Addition assignment to dense vectors********************************************************
650  template< typename VT2 > // Type of the target dense vector
651  friend inline typename EnableIf< UseAssign<VT2> >::Type
652  addAssign( DenseVector<VT2,TF>& lhs, const DVecScalarMultExpr& rhs )
653  {
655 
659 
660  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
661 
662  const ResultType tmp( serial( rhs ) );
663  addAssign( ~lhs, tmp );
664  }
666  //**********************************************************************************************
667 
668  //**Addition assignment to sparse vectors*******************************************************
669  // No special implementation for the addition assignment to sparse vectors.
670  //**********************************************************************************************
671 
672  //**Subtraction assignment to dense vectors*****************************************************
686  template< typename VT2 > // Type of the target dense vector
687  friend inline typename EnableIf< UseAssign<VT2> >::Type
688  subAssign( DenseVector<VT2,TF>& lhs, const DVecScalarMultExpr& rhs )
689  {
691 
695 
696  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
697 
698  const ResultType tmp( serial( rhs ) );
699  subAssign( ~lhs, tmp );
700  }
702  //**********************************************************************************************
703 
704  //**Subtraction assignment to sparse vectors****************************************************
705  // No special implementation for the subtraction assignment to sparse vectors.
706  //**********************************************************************************************
707 
708  //**Multiplication assignment to dense vectors**************************************************
722  template< typename VT2 > // Type of the target dense vector
723  friend inline typename EnableIf< UseAssign<VT2> >::Type
724  multAssign( DenseVector<VT2,TF>& lhs, const DVecScalarMultExpr& rhs )
725  {
727 
731 
732  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
733 
734  const ResultType tmp( serial( rhs ) );
735  multAssign( ~lhs, tmp );
736  }
738  //**********************************************************************************************
739 
740  //**Multiplication assignment to sparse vectors*************************************************
741  // No special implementation for the multiplication assignment to sparse vectors.
742  //**********************************************************************************************
743 
744  //**SMP assignment to dense vectors*************************************************************
758  template< typename VT2 > // Type of the target dense vector
759  friend inline typename EnableIf< UseSMPAssign<VT2> >::Type
760  smpAssign( DenseVector<VT2,TF>& lhs, const DVecScalarMultExpr& rhs )
761  {
763 
764  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
765 
766  smpAssign( ~lhs, rhs.vector_ );
767  smpAssign( ~lhs, (~lhs) * rhs.scalar_ );
768  }
770  //**********************************************************************************************
771 
772  //**SMP assignment to sparse vectors************************************************************
786  template< typename VT2 > // Type of the target sparse vector
787  friend inline typename EnableIf< UseSMPAssign<VT2> >::Type
788  smpAssign( SparseVector<VT2,TF>& lhs, const DVecScalarMultExpr& rhs )
789  {
791 
792  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
793 
794  smpAssign( ~lhs, rhs.vector_ );
795  (~lhs) *= rhs.scalar_;
796  }
798  //**********************************************************************************************
799 
800  //**SMP addition assignment to dense vectors****************************************************
814  template< typename VT2 > // Type of the target dense vector
815  friend inline typename EnableIf< UseSMPAssign<VT2> >::Type
816  smpAddAssign( DenseVector<VT2,TF>& lhs, const DVecScalarMultExpr& rhs )
817  {
819 
823 
824  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
825 
826  const ResultType tmp( rhs );
827  smpAddAssign( ~lhs, tmp );
828  }
830  //**********************************************************************************************
831 
832  //**SMP addition assignment to sparse vectors***************************************************
833  // No special implementation for the SMP addition assignment to sparse vectors.
834  //**********************************************************************************************
835 
836  //**SMP subtraction assignment to dense vectors*************************************************
850  template< typename VT2 > // Type of the target dense vector
851  friend inline typename EnableIf< UseSMPAssign<VT2> >::Type
852  smpSubAssign( DenseVector<VT2,TF>& lhs, const DVecScalarMultExpr& rhs )
853  {
855 
859 
860  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
861 
862  const ResultType tmp( rhs );
863  smpSubAssign( ~lhs, tmp );
864  }
866  //**********************************************************************************************
867 
868  //**SMP subtraction assignment to sparse vectors************************************************
869  // No special implementation for the SMP subtraction assignment to sparse vectors.
870  //**********************************************************************************************
871 
872  //**SMP multiplication assignment to dense vectors**********************************************
886  template< typename VT2 > // Type of the target dense vector
887  friend inline typename EnableIf< UseSMPAssign<VT2> >::Type
888  smpMultAssign( DenseVector<VT2,TF>& lhs, const DVecScalarMultExpr& rhs )
889  {
891 
895 
896  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
897 
898  const ResultType tmp( rhs );
899  smpMultAssign( ~lhs, tmp );
900  }
902  //**********************************************************************************************
903 
904  //**SMP multiplication assignment to sparse vectors*********************************************
905  // No special implementation for the SMP multiplication assignment to sparse vectors.
906  //**********************************************************************************************
907 
908  //**Compile time checks*************************************************************************
915  //**********************************************************************************************
916 };
917 //*************************************************************************************************
918 
919 
920 
921 
922 //=================================================================================================
923 //
924 // GLOBAL UNARY ARITHMETIC OPERATORS
925 //
926 //=================================================================================================
927 
928 //*************************************************************************************************
945 template< typename VT // Type of the dense vector
946  , bool TF > // Transpose flag
947 inline const DVecScalarMultExpr<VT,typename BaseElementType<VT>::Type,TF>
949 {
951 
952  typedef typename BaseElementType<VT>::Type ElementType;
954 }
955 //*************************************************************************************************
956 
957 
958 
959 
960 //=================================================================================================
961 //
962 // GLOBAL BINARY ARITHMETIC OPERATORS
963 //
964 //=================================================================================================
965 
966 //*************************************************************************************************
988 template< typename T1 // Type of the left-hand side dense vector
989  , typename T2 // Type of the right-hand side scalar
990  , bool TF > // Transpose flag
991 inline const typename EnableIf< IsNumeric<T2>, typename MultExprTrait<T1,T2>::Type >::Type
992  operator*( const DenseVector<T1,TF>& vec, T2 scalar )
993 {
995 
996  typedef typename MultExprTrait<T1,T2>::Type Type;
997  return Type( ~vec, scalar );
998 }
999 //*************************************************************************************************
1000 
1001 
1002 //*************************************************************************************************
1024 template< typename T1 // Type of the left-hand side scalar
1025  , typename T2 // Type of the right-hand side dense vector
1026  , bool TF > // Transpose flag
1027 inline const typename EnableIf< IsNumeric<T1>, typename MultExprTrait<T1,T2>::Type >::Type
1028  operator*( T1 scalar, const DenseVector<T2,TF>& vec )
1029 {
1031 
1032  typedef typename MultExprTrait<T1,T2>::Type Type;
1033  return Type( ~vec, scalar );
1034 }
1035 //*************************************************************************************************
1036 
1037 
1038 
1039 
1040 //=================================================================================================
1041 //
1042 // GLOBAL FUNCTIONS
1043 //
1044 //=================================================================================================
1045 
1046 //*************************************************************************************************
1064 template< typename VT // Type of the dense vector
1065  , bool TF > // Transpose flag
1066 inline const DVecScalarMultExpr<VT,typename VT::ElementType,TF>
1068 {
1069  typedef typename VT::ElementType ElementType;
1070 
1072 
1073  const ElementType len ( length( ~vec ) );
1074  const ElementType ilen( ( len != ElementType(0) )?( ElementType(1) / len ):( 0 ) );
1075 
1076  return DVecScalarMultExpr<VT,ElementType,TF>( ~vec, ilen );
1077 }
1078 //*************************************************************************************************
1079 
1080 
1081 
1082 
1083 //=================================================================================================
1084 //
1085 // GLOBAL RESTRUCTURING UNARY ARITHMETIC OPERATORS
1086 //
1087 //=================================================================================================
1088 
1089 //*************************************************************************************************
1101 template< typename VT // Type of the dense vector
1102  , typename ST // Type of the scalar
1103  , bool TF > // Transpose flag
1104 inline const DVecScalarMultExpr<VT,ST,TF>
1105  operator-( const DVecScalarMultExpr<VT,ST,TF>& dv )
1106 {
1108 
1109  return DVecScalarMultExpr<VT,ST,TF>( dv.leftOperand(), -dv.rightOperand() );
1110 }
1112 //*************************************************************************************************
1113 
1114 
1115 
1116 
1117 //=================================================================================================
1118 //
1119 // GLOBAL RESTRUCTURING BINARY ARITHMETIC OPERATORS
1120 //
1121 //=================================================================================================
1122 
1123 //*************************************************************************************************
1136 template< typename VT // Type of the dense vector of the left-hand side expression
1137  , typename ST1 // Type of the scalar of the left-hand side expression
1138  , bool TF // Transpose flag of the dense vector
1139  , typename ST2 > // Type of the right-hand side scalar
1140 inline const typename EnableIf< IsNumeric<ST2>
1141  , typename MultExprTrait< DVecScalarMultExpr<VT,ST1,TF>, ST2 >::Type >::Type
1142  operator*( const DVecScalarMultExpr<VT,ST1,TF>& vec, ST2 scalar )
1143 {
1145 
1146  return vec.leftOperand() * ( vec.rightOperand() * scalar );
1147 }
1149 //*************************************************************************************************
1150 
1151 
1152 //*************************************************************************************************
1165 template< typename ST1 // Type of the left-hand side scalar
1166  , typename VT // Type of the dense vector of the right-hand side expression
1167  , typename ST2 // Type of the scalar of the right-hand side expression
1168  , bool TF > // Transpose flag of the dense vector
1169 inline const typename EnableIf< IsNumeric<ST1>
1170  , typename MultExprTrait< ST1, DVecScalarMultExpr<VT,ST2,TF> >::Type >::Type
1171  operator*( ST1 scalar, const DVecScalarMultExpr<VT,ST2,TF>& vec )
1172 {
1174 
1175  return vec.leftOperand() * ( scalar * vec.rightOperand() );
1176 }
1178 //*************************************************************************************************
1179 
1180 
1181 //*************************************************************************************************
1194 template< typename VT // Type of the dense vector of the left-hand side expression
1195  , typename ST1 // Type of the scalar of the left-hand side expression
1196  , bool TF // Transpose flag of the dense vector
1197  , typename ST2 > // Type of the right-hand side scalar
1198 inline const typename EnableIf< IsFloatingPoint<typename DivTrait<ST1,ST2>::Type>
1199  , typename DivExprTrait< DVecScalarMultExpr<VT,ST1,TF>, ST2 >::Type >::Type
1200  operator/( const DVecScalarMultExpr<VT,ST1,TF>& vec, ST2 scalar )
1201 {
1203 
1204  return vec.leftOperand() * ( vec.rightOperand() / scalar );
1205 }
1207 //*************************************************************************************************
1208 
1209 
1210 //*************************************************************************************************
1224 template< typename VT1 // Type of the dense vector of the left-hand side expression
1225  , typename ST // Type of the scalar of the left-hand side expression
1226  , bool TF // Transpose flag of the dense vectors
1227  , typename VT2 > // Type of the right-hand side dense vector
1228 inline const typename MultExprTrait< DVecScalarMultExpr<VT1,ST,TF>, VT2 >::Type
1229  operator*( const DVecScalarMultExpr<VT1,ST,TF>& lhs, const DenseVector<VT2,TF>& rhs )
1230 {
1232 
1233  return ( lhs.leftOperand() * (~rhs) ) * lhs.rightOperand();
1234 }
1236 //*************************************************************************************************
1237 
1238 
1239 //*************************************************************************************************
1253 template< typename VT1 // Type of the left-hand side dense vector
1254  , bool TF // Transpose flag of the dense vectors
1255  , typename VT2 // Type of the dense vector of the right-hand side expression
1256  , typename ST > // Type of the scalar of the right-hand side expression
1257 inline const typename MultExprTrait< VT1, DVecScalarMultExpr<VT2,ST,TF> >::Type
1258  operator*( const DenseVector<VT1,TF>& lhs, const DVecScalarMultExpr<VT2,ST,TF>& rhs )
1259 {
1261 
1262  return ( (~lhs) * rhs.leftOperand() ) * rhs.rightOperand();
1263 }
1265 //*************************************************************************************************
1266 
1267 
1268 //*************************************************************************************************
1282 template< typename VT1 // Type of the dense vector of the left-hand side expression
1283  , typename ST1 // Type of the scalar of the left-hand side expression
1284  , bool TF // Transpose flag of the dense vectors
1285  , typename VT2 // Type of the dense vector of the right-hand side expression
1286  , typename ST2 > // Type of the scalar of the right-hand side expression
1287 inline const typename MultExprTrait< DVecScalarMultExpr<VT1,ST1,TF>, DVecScalarMultExpr<VT2,ST2,TF> >::Type
1288  operator*( const DVecScalarMultExpr<VT1,ST1,TF>& lhs, const DVecScalarMultExpr<VT2,ST2,TF>& rhs )
1289 {
1291 
1292  return ( lhs.leftOperand() * rhs.leftOperand() ) * ( lhs.rightOperand() * rhs.rightOperand() );
1293 }
1295 //*************************************************************************************************
1296 
1297 
1298 //*************************************************************************************************
1312 template< typename VT1 // Type of the dense vector of the left-hand side expression
1313  , typename ST // Type of the scalar of the left-hand side expression
1314  , typename VT2 > // Type of the right-hand side dense vector
1315 inline const typename MultExprTrait< DVecScalarMultExpr<VT1,ST,false>, VT2 >::Type
1316  operator*( const DVecScalarMultExpr<VT1,ST,false>& lhs, const DenseVector<VT2,true>& rhs )
1317 {
1319 
1320  return ( lhs.leftOperand() * (~rhs) ) * lhs.rightOperand();
1321 }
1323 //*************************************************************************************************
1324 
1325 
1326 //*************************************************************************************************
1340 template< typename VT1 // Type of the left-hand side dense vector
1341  , typename VT2 // Type of the dense vector of the right-hand side expression
1342  , typename ST > // Type of the scalar of the right-hand side expression
1343 inline const typename MultExprTrait< VT1, DVecScalarMultExpr<VT2,ST,true> >::Type
1344  operator*( const DenseVector<VT1,false>& lhs, const DVecScalarMultExpr<VT2,ST,true>& rhs )
1345 {
1347 
1348  return ( (~lhs) * rhs.leftOperand() ) * rhs.rightOperand();
1349 }
1351 //*************************************************************************************************
1352 
1353 
1354 //*************************************************************************************************
1368 template< typename VT1 // Type of the dense vector of the left-hand side expression
1369  , typename ST1 // Type of the scalar of the left-hand side expression
1370  , typename VT2 // Type of the dense vector of the right-hand side expression
1371  , typename ST2 > // Type of the scalar of the right-hand side expression
1372 inline const typename MultExprTrait< DVecScalarMultExpr<VT1,ST1,false>, DVecScalarMultExpr<VT2,ST2,true> >::Type
1373  operator*( const DVecScalarMultExpr<VT1,ST1,false>& lhs, const DVecScalarMultExpr<VT2,ST2,true>& rhs )
1374 {
1376 
1377  return ( lhs.leftOperand() * rhs.leftOperand() ) * ( lhs.rightOperand() * rhs.rightOperand() );
1378 }
1380 //*************************************************************************************************
1381 
1382 
1383 //*************************************************************************************************
1397 template< typename VT1 // Type of the dense vector of the left-hand side expression
1398  , typename ST // Type of the scalar of the left-hand side expression
1399  , bool TF // Transpose flag of the vectors
1400  , typename VT2 > // Type of the right-hand side sparse vector
1401 inline const typename MultExprTrait< DVecScalarMultExpr<VT1,ST,TF>, VT2 >::Type
1402  operator*( const DVecScalarMultExpr<VT1,ST,TF>& lhs, const SparseVector<VT2,TF>& rhs )
1403 {
1405 
1406  return ( lhs.leftOperand() * (~rhs) ) * lhs.rightOperand();
1407 }
1409 //*************************************************************************************************
1410 
1411 
1412 //*************************************************************************************************
1426 template< typename VT1 // Type of the left-hand side sparse vector
1427  , bool TF // Transpose flag of the vectors
1428  , typename VT2 // Type of the dense vector of the right-hand side expression
1429  , typename ST > // Type of the scalar of the right-hand side expression
1430 inline const typename MultExprTrait< VT1, DVecScalarMultExpr<VT2,ST,TF> >::Type
1431  operator*( const SparseVector<VT1,TF>& lhs, const DVecScalarMultExpr<VT2,ST,TF>& rhs )
1432 {
1434 
1435  return ( (~lhs) * rhs.leftOperand() ) * rhs.rightOperand();
1436 }
1438 //*************************************************************************************************
1439 
1440 
1441 //*************************************************************************************************
1456 template< typename VT1 // Type of the dense vector of the left-hand side expression
1457  , typename ST1 // Type of the scalar of the left-hand side expression
1458  , bool TF // Transpose flag of the vectors
1459  , typename VT2 // Type of the sparse vector of the right-hand side expression
1460  , typename ST2 > // Type of the scalar o the right-hand side expression
1461 inline const typename MultExprTrait< DVecScalarMultExpr<VT1,ST1,TF>, SVecScalarMultExpr<VT2,ST2,TF> >::Type
1462  operator*( const DVecScalarMultExpr<VT1,ST1,TF>& lhs, const SVecScalarMultExpr<VT2,ST2,TF>& rhs )
1463 {
1465 
1466  return ( lhs.leftOperand() * rhs.leftOperand() ) * ( lhs.rightOperand() * rhs.rightOperand() );
1467 }
1469 //*************************************************************************************************
1470 
1471 
1472 //*************************************************************************************************
1487 template< typename VT1 // Type of the sparse vector of the left-hand side expression
1488  , typename ST1 // Type of the scalar of the left-hand side expression
1489  , bool TF // Transpose flag of the vectors
1490  , typename VT2 // Type of the dense vector of the right-hand side expression
1491  , typename ST2 > // Type of the scalar o the right-hand side expression
1492 inline const typename MultExprTrait< SVecScalarMultExpr<VT1,ST1,TF>, DVecScalarMultExpr<VT2,ST2,TF> >::Type
1493  operator*( const SVecScalarMultExpr<VT1,ST1,TF>& lhs, const DVecScalarMultExpr<VT2,ST2,TF>& rhs )
1494 {
1496 
1497  return ( lhs.leftOperand() * rhs.leftOperand() ) * ( lhs.rightOperand() * rhs.rightOperand() );
1498 }
1500 //*************************************************************************************************
1501 
1502 
1503 //*************************************************************************************************
1517 template< typename VT1 // Type of the dense vector of the left-hand side expression
1518  , typename ST // Type of the scalar of the left-hand side expression
1519  , typename VT2 > // Type of the right-hand side sparse vector
1520 inline const typename MultExprTrait< DVecScalarMultExpr<VT1,ST,false>, VT2 >::Type
1521  operator*( const DVecScalarMultExpr<VT1,ST,false>& lhs, const SparseVector<VT2,true>& rhs )
1522 {
1524 
1525  return ( lhs.leftOperand() * (~rhs) ) * lhs.rightOperand();
1526 }
1528 //*************************************************************************************************
1529 
1530 
1531 //*************************************************************************************************
1545 template< typename VT1 // Type of the left-hand side sparse vector
1546  , typename VT2 // Type of the dense vector of the right-hand side expression
1547  , typename ST > // Type of the scalar of the right-hand side expression
1548 inline const typename MultExprTrait< VT1, DVecScalarMultExpr<VT2,ST,true> >::Type
1549  operator*( const SparseVector<VT1,false>& lhs, const DVecScalarMultExpr<VT2,ST,true>& rhs )
1550 {
1552 
1553  return ( (~lhs) * rhs.leftOperand() ) * rhs.rightOperand();
1554 }
1556 //*************************************************************************************************
1557 
1558 
1559 //*************************************************************************************************
1574 template< typename VT1 // Type of the dense vector of the left-hand side expression
1575  , typename ST1 // Type of the scalar of the left-hand side expression
1576  , typename VT2 // Type of the sparse vector of the right-hand side expression
1577  , typename ST2 > // Type of the scalar o the right-hand side expression
1578 inline const typename MultExprTrait< DVecScalarMultExpr<VT1,ST1,false>, SVecScalarMultExpr<VT2,ST2,true> >::Type
1579  operator*( const DVecScalarMultExpr<VT1,ST1,false>& lhs, const SVecScalarMultExpr<VT2,ST2,true>& rhs )
1580 {
1582 
1583  return ( lhs.leftOperand() * rhs.leftOperand() ) * ( lhs.rightOperand() * rhs.rightOperand() );
1584 }
1586 //*************************************************************************************************
1587 
1588 
1589 //*************************************************************************************************
1604 template< typename VT1 // Type of the sparse vector of the left-hand side expression
1605  , typename ST1 // Type of the scalar of the left-hand side expression
1606  , typename VT2 // Type of the dense vector of the right-hand side expression
1607  , typename ST2 > // Type of the scalar o the right-hand side expression
1608 inline const typename MultExprTrait< SVecScalarMultExpr<VT1,ST1,false>, DVecScalarMultExpr<VT2,ST2,true> >::Type
1609  operator*( const SVecScalarMultExpr<VT1,ST1,false>& lhs, const DVecScalarMultExpr<VT2,ST2,true>& rhs )
1610 {
1612 
1613  return ( lhs.leftOperand() * rhs.leftOperand() ) * ( lhs.rightOperand() * rhs.rightOperand() );
1614 }
1616 //*************************************************************************************************
1617 
1618 
1619 //*************************************************************************************************
1633 template< typename MT // Type of the left-hand side dense matrix
1634  , bool SO // Storage order of the left-hand side dense matrix
1635  , typename VT // Type of the dense vector of the right-hand side expression
1636  , typename ST > // Type of the scalar of the right-hand side expression
1637 inline const typename MultExprTrait< MT, DVecScalarMultExpr<VT,ST,false> >::Type
1638  operator*( const DenseMatrix<MT,SO>& mat, const DVecScalarMultExpr<VT,ST,false>& vec )
1639 {
1641 
1642  return ( (~mat) * vec.leftOperand() ) * vec.rightOperand();
1643 }
1645 //*************************************************************************************************
1646 
1647 
1648 //*************************************************************************************************
1662 template< typename VT // Type of the dense vector of the left-hand side expression
1663  , typename ST // Type of the scalar of the left-hand side expression
1664  , typename MT // Type of the right-hand side dense matrix
1665  , bool SO > // Storage order of the right-hand side dense matrix
1666 inline const typename MultExprTrait< DVecScalarMultExpr<VT,ST,true>, MT >::Type
1667  operator*( const DVecScalarMultExpr<VT,ST,true>& vec, const DenseMatrix<MT,SO>& mat )
1668 {
1670 
1671  return ( vec.leftOperand() * (~mat) ) * vec.rightOperand();
1672 }
1674 //*************************************************************************************************
1675 
1676 
1677 //*************************************************************************************************
1691 template< typename MT // Type of the left-hand side sparse matrix
1692  , bool SO // Storage order of the left-hand side sparse matrix
1693  , typename VT // Type of the dense vector of the right-hand side expression
1694  , typename ST > // Type of the scalar of the right-hand side expression
1695 inline const typename MultExprTrait< MT, DVecScalarMultExpr<VT,ST,false> >::Type
1696  operator*( const SparseMatrix<MT,SO>& mat, const DVecScalarMultExpr<VT,ST,false>& vec )
1697 {
1699 
1700  return ( (~mat) * vec.leftOperand() ) * vec.rightOperand();
1701 }
1703 //*************************************************************************************************
1704 
1705 
1706 //*************************************************************************************************
1720 template< typename VT // Type of the dense vector of the left-hand side expression
1721  , typename ST // Type of the scalar of the left-hand side expression
1722  , typename MT // Type of the right-hand side sparse matrix
1723  , bool SO > // Storage order of the right-hand side sparse matrix
1724 inline const typename MultExprTrait< DVecScalarMultExpr<VT,ST,true>, MT >::Type
1725  operator*( const DVecScalarMultExpr<VT,ST,true>& vec, const SparseMatrix<MT,SO>& mat )
1726 {
1728 
1729  return ( vec.leftOperand() * (~mat) ) * vec.rightOperand();
1730 }
1732 //*************************************************************************************************
1733 
1734 
1735 
1736 
1737 //=================================================================================================
1738 //
1739 // DVECSCALARMULTEXPRTRAIT SPECIALIZATIONS
1740 //
1741 //=================================================================================================
1742 
1743 //*************************************************************************************************
1745 template< typename VT, typename ST1, typename ST2 >
1746 struct DVecScalarMultExprTrait< DVecScalarMultExpr<VT,ST1,false>, ST2 >
1747 {
1748  public:
1749  //**********************************************************************************************
1750  typedef typename SelectType< IsDenseVector<VT>::value && IsColumnVector<VT>::value &&
1751  IsNumeric<ST1>::value && IsNumeric<ST2>::value
1752  , typename DVecScalarMultExprTrait<VT,typename MultTrait<ST1,ST2>::Type>::Type
1753  , INVALID_TYPE >::Type Type;
1754  //**********************************************************************************************
1755 };
1757 //*************************************************************************************************
1758 
1759 
1760 
1761 
1762 //=================================================================================================
1763 //
1764 // TDVECSCALARMULTEXPRTRAIT SPECIALIZATIONS
1765 //
1766 //=================================================================================================
1767 
1768 //*************************************************************************************************
1770 template< typename VT, typename ST1, typename ST2 >
1771 struct TDVecScalarMultExprTrait< DVecScalarMultExpr<VT,ST1,true>, ST2 >
1772 {
1773  public:
1774  //**********************************************************************************************
1775  typedef typename SelectType< IsDenseVector<VT>::value && IsRowVector<VT>::value &&
1776  IsNumeric<ST1>::value && IsNumeric<ST2>::value
1777  , typename TDVecScalarMultExprTrait<VT,typename MultTrait<ST1,ST2>::Type>::Type
1778  , INVALID_TYPE >::Type Type;
1779  //**********************************************************************************************
1780 };
1782 //*************************************************************************************************
1783 
1784 
1785 
1786 
1787 //=================================================================================================
1788 //
1789 // DVECSCALARDIVEXPRTRAIT SPECIALIZATIONS
1790 //
1791 //=================================================================================================
1792 
1793 //*************************************************************************************************
1795 template< typename VT, typename ST1, typename ST2 >
1796 struct DVecScalarDivExprTrait< DVecScalarMultExpr<VT,ST1,false>, ST2 >
1797 {
1798  private:
1799  //**********************************************************************************************
1800  enum { condition = IsFloatingPoint<typename DivTrait<ST1,ST2>::Type>::value };
1801  //**********************************************************************************************
1802 
1803  //**********************************************************************************************
1804  typedef typename DVecScalarMultExprTrait<VT,typename DivTrait<ST1,ST2>::Type>::Type T1;
1805  typedef typename DVecScalarDivExprTrait<VT,typename DivTrait<ST1,ST2>::Type>::Type T2;
1806  //**********************************************************************************************
1807 
1808  public:
1809  //**********************************************************************************************
1810  typedef typename SelectType< IsDenseVector<VT>::value && IsColumnVector<VT>::value &&
1811  IsNumeric<ST1>::value && IsNumeric<ST2>::value
1812  , typename SelectType<condition,T1,T2>::Type
1813  , INVALID_TYPE >::Type Type;
1814  //**********************************************************************************************
1815 };
1817 //*************************************************************************************************
1818 
1819 
1820 
1821 
1822 //=================================================================================================
1823 //
1824 // TDVECSCALARDIVEXPRTRAIT SPECIALIZATIONS
1825 //
1826 //=================================================================================================
1827 
1828 //*************************************************************************************************
1830 template< typename VT, typename ST1, typename ST2 >
1831 struct TDVecScalarDivExprTrait< DVecScalarMultExpr<VT,ST1,true>, ST2 >
1832 {
1833  private:
1834  //**********************************************************************************************
1835  enum { condition = IsFloatingPoint<typename DivTrait<ST1,ST2>::Type>::value };
1836  //**********************************************************************************************
1837 
1838  //**********************************************************************************************
1839  typedef typename TDVecScalarMultExprTrait<VT,typename DivTrait<ST1,ST2>::Type>::Type T1;
1840  typedef typename TDVecScalarDivExprTrait<VT,typename DivTrait<ST1,ST2>::Type>::Type T2;
1841  //**********************************************************************************************
1842 
1843  public:
1844  //**********************************************************************************************
1845  typedef typename SelectType< IsDenseVector<VT>::value && IsRowVector<VT>::value &&
1846  IsNumeric<ST1>::value && IsNumeric<ST2>::value
1847  , typename SelectType<condition,T1,T2>::Type
1848  , INVALID_TYPE >::Type Type;
1849  //**********************************************************************************************
1850 };
1852 //*************************************************************************************************
1853 
1854 
1855 
1856 
1857 //=================================================================================================
1858 //
1859 // DVECDVECMULTEXPRTRAIT SPECIALIZATIONS
1860 //
1861 //=================================================================================================
1862 
1863 //*************************************************************************************************
1865 template< typename VT1, typename ST, typename VT2 >
1866 struct DVecDVecMultExprTrait< DVecScalarMultExpr<VT1,ST,false>, VT2 >
1867 {
1868  public:
1869  //**********************************************************************************************
1870  typedef typename SelectType< IsDenseVector<VT1>::value && IsColumnVector<VT1>::value &&
1871  IsDenseVector<VT2>::value && IsColumnVector<VT2>::value &&
1872  IsNumeric<ST>::value
1873  , typename DVecScalarMultExprTrait<typename DVecDVecMultExprTrait<VT1,VT2>::Type,ST>::Type
1874  , INVALID_TYPE >::Type Type;
1875  //**********************************************************************************************
1876 };
1878 //*************************************************************************************************
1879 
1880 
1881 //*************************************************************************************************
1883 template< typename VT1, typename VT2, typename ST >
1884 struct DVecDVecMultExprTrait< VT1, DVecScalarMultExpr<VT2,ST,false> >
1885 {
1886  public:
1887  //**********************************************************************************************
1888  typedef typename SelectType< IsDenseVector<VT1>::value && IsColumnVector<VT1>::value &&
1889  IsDenseVector<VT2>::value && IsColumnVector<VT2>::value &&
1890  IsNumeric<ST>::value
1891  , typename DVecScalarMultExprTrait<typename DVecDVecMultExprTrait<VT1,VT2>::Type,ST>::Type
1892  , INVALID_TYPE >::Type Type;
1893  //**********************************************************************************************
1894 };
1896 //*************************************************************************************************
1897 
1898 
1899 //*************************************************************************************************
1901 template< typename VT1, typename ST1, typename VT2, typename ST2 >
1902 struct DVecDVecMultExprTrait< DVecScalarMultExpr<VT1,ST1,false>, DVecScalarMultExpr<VT2,ST2,false> >
1903 {
1904  public:
1905  //**********************************************************************************************
1906  typedef typename SelectType< IsDenseVector<VT1>::value && IsColumnVector<VT1>::value &&
1907  IsDenseVector<VT2>::value && IsColumnVector<VT2>::value &&
1908  IsNumeric<ST1>::value && IsNumeric<ST2>::value
1909  , typename DVecScalarMultExprTrait<typename DVecDVecMultExprTrait<VT1,VT2>::Type,typename MultTrait<ST1,ST2>::Type>::Type
1910  , INVALID_TYPE >::Type Type;
1911  //**********************************************************************************************
1912 };
1914 //*************************************************************************************************
1915 
1916 
1917 
1918 
1919 //=================================================================================================
1920 //
1921 // DVECTDVECMULTEXPRTRAIT SPECIALIZATIONS
1922 //
1923 //=================================================================================================
1924 
1925 //*************************************************************************************************
1927 template< typename VT1, typename ST, typename VT2 >
1928 struct DVecTDVecMultExprTrait< DVecScalarMultExpr<VT1,ST,false>, VT2 >
1929 {
1930  public:
1931  //**********************************************************************************************
1932  typedef typename SelectType< IsDenseVector<VT1>::value && IsColumnVector<VT1>::value &&
1933  IsDenseVector<VT2>::value && IsRowVector<VT2>::value &&
1934  IsNumeric<ST>::value
1935  , typename DMatScalarMultExprTrait<typename DVecTDVecMultExprTrait<VT1,VT2>::Type,ST>::Type
1936  , INVALID_TYPE >::Type Type;
1937  //**********************************************************************************************
1938 };
1940 //*************************************************************************************************
1941 
1942 
1943 //*************************************************************************************************
1945 template< typename VT1, typename VT2, typename ST >
1946 struct DVecTDVecMultExprTrait< VT1, DVecScalarMultExpr<VT2,ST,true> >
1947 {
1948  public:
1949  //**********************************************************************************************
1950  typedef typename SelectType< IsDenseVector<VT1>::value && IsColumnVector<VT1>::value &&
1951  IsDenseVector<VT2>::value && IsRowVector<VT2>::value &&
1952  IsNumeric<ST>::value
1953  , typename DMatScalarMultExprTrait<typename DVecTDVecMultExprTrait<VT1,VT2>::Type,ST>::Type
1954  , INVALID_TYPE >::Type Type;
1955  //**********************************************************************************************
1956 };
1958 //*************************************************************************************************
1959 
1960 
1961 //*************************************************************************************************
1963 template< typename VT1, typename ST1, typename VT2, typename ST2 >
1964 struct DVecTDVecMultExprTrait< DVecScalarMultExpr<VT1,ST1,false>, DVecScalarMultExpr<VT2,ST2,true> >
1965 {
1966  public:
1967  //**********************************************************************************************
1968  typedef typename SelectType< IsDenseVector<VT1>::value && IsColumnVector<VT1>::value &&
1969  IsDenseVector<VT2>::value && IsRowVector<VT2>::value &&
1970  IsNumeric<ST1>::value && IsNumeric<ST2>::value
1971  , typename DMatScalarMultExprTrait<typename DVecTDVecMultExprTrait<VT1,VT2>::Type,typename MultTrait<ST1,ST2>::Type>::Type
1972  , INVALID_TYPE >::Type Type;
1973  //**********************************************************************************************
1974 };
1976 //*************************************************************************************************
1977 
1978 
1979 
1980 
1981 //=================================================================================================
1982 //
1983 // TDVECTDVECMULTEXPRTRAIT SPECIALIZATIONS
1984 //
1985 //=================================================================================================
1986 
1987 //*************************************************************************************************
1989 template< typename VT1, typename ST, typename VT2 >
1990 struct TDVecTDVecMultExprTrait< DVecScalarMultExpr<VT1,ST,true>, VT2 >
1991 {
1992  public:
1993  //**********************************************************************************************
1994  typedef typename SelectType< IsDenseVector<VT1>::value && IsRowVector<VT1>::value &&
1995  IsDenseVector<VT2>::value && IsRowVector<VT2>::value &&
1996  IsNumeric<ST>::value
1997  , typename TDVecScalarMultExprTrait<typename TDVecTDVecMultExprTrait<VT1,VT2>::Type,ST>::Type
1998  , INVALID_TYPE >::Type Type;
1999  //**********************************************************************************************
2000 };
2002 //*************************************************************************************************
2003 
2004 
2005 //*************************************************************************************************
2007 template< typename VT1, typename VT2, typename ST >
2008 struct TDVecTDVecMultExprTrait< VT1, DVecScalarMultExpr<VT2,ST,true> >
2009 {
2010  public:
2011  //**********************************************************************************************
2012  typedef typename SelectType< IsDenseVector<VT1>::value && IsRowVector<VT1>::value &&
2013  IsDenseVector<VT2>::value && IsRowVector<VT2>::value &&
2014  IsNumeric<ST>::value
2015  , typename TDVecScalarMultExprTrait<typename TDVecTDVecMultExprTrait<VT1,VT2>::Type,ST>::Type
2016  , INVALID_TYPE >::Type Type;
2017  //**********************************************************************************************
2018 };
2020 //*************************************************************************************************
2021 
2022 
2023 //*************************************************************************************************
2025 template< typename VT1, typename ST1, typename VT2, typename ST2 >
2026 struct TDVecTDVecMultExprTrait< DVecScalarMultExpr<VT1,ST1,true>, DVecScalarMultExpr<VT2,ST2,true> >
2027 {
2028  public:
2029  //**********************************************************************************************
2030  typedef typename SelectType< IsDenseVector<VT1>::value && IsRowVector<VT1>::value &&
2031  IsDenseVector<VT2>::value && IsRowVector<VT2>::value &&
2032  IsNumeric<ST1>::value && IsNumeric<ST2>::value
2033  , typename TDVecScalarMultExprTrait<typename TDVecTDVecMultExprTrait<VT1,VT2>::Type,typename MultTrait<ST1,ST2>::Type>::Type
2034  , INVALID_TYPE >::Type Type;
2035  //**********************************************************************************************
2036 };
2038 //*************************************************************************************************
2039 
2040 
2041 
2042 
2043 //=================================================================================================
2044 //
2045 // DVECSVECMULTEXPRTRAIT SPECIALIZATIONS
2046 //
2047 //=================================================================================================
2048 
2049 //*************************************************************************************************
2051 template< typename VT1, typename VT2, typename ST >
2052 struct DVecSVecMultExprTrait< DVecScalarMultExpr<VT1,ST,false>, VT2 >
2053 {
2054  public:
2055  //**********************************************************************************************
2056  typedef typename SelectType< IsDenseVector<VT1>::value && IsColumnVector<VT1>::value &&
2057  IsSparseVector<VT2>::value && IsColumnVector<VT2>::value &&
2058  IsNumeric<ST>::value
2059  , typename SVecScalarMultExprTrait<typename DVecSVecMultExprTrait<VT1,VT2>::Type,ST>::Type
2060  , INVALID_TYPE >::Type Type;
2061  //**********************************************************************************************
2062 };
2064 //*************************************************************************************************
2065 
2066 
2067 //*************************************************************************************************
2069 template< typename VT1, typename ST1, typename VT2, typename ST2 >
2070 struct DVecSVecMultExprTrait< DVecScalarMultExpr<VT1,ST1,false>, SVecScalarMultExpr<VT2,ST2,false> >
2071 {
2072  public:
2073  //**********************************************************************************************
2074  typedef typename SelectType< IsDenseVector<VT1>::value && IsColumnVector<VT1>::value &&
2075  IsSparseVector<VT2>::value && IsColumnVector<VT2>::value &&
2076  IsNumeric<ST1>::value && IsNumeric<ST2>::value
2077  , typename SVecScalarMultExprTrait<typename DVecSVecMultExprTrait<VT1,VT2>::Type,typename MultTrait<ST1,ST2>::Type>::Type
2078  , INVALID_TYPE >::Type Type;
2079  //**********************************************************************************************
2080 };
2082 //*************************************************************************************************
2083 
2084 
2085 
2086 
2087 //=================================================================================================
2088 //
2089 // DVECTSVECMULTEXPRTRAIT SPECIALIZATIONS
2090 //
2091 //=================================================================================================
2092 
2093 //*************************************************************************************************
2095 template< typename VT1, typename ST, typename VT2 >
2096 struct DVecTSVecMultExprTrait< DVecScalarMultExpr<VT1,ST,false>, VT2 >
2097 {
2098  public:
2099  //**********************************************************************************************
2100  typedef typename SelectType< IsDenseVector<VT1>::value && IsColumnVector<VT1>::value &&
2101  IsSparseVector<VT2>::value && IsRowVector<VT2>::value &&
2102  IsNumeric<ST>::value
2103  , typename SMatScalarMultExprTrait<typename DVecTSVecMultExprTrait<VT1,VT2>::Type,ST>::Type
2104  , INVALID_TYPE >::Type Type;
2105  //**********************************************************************************************
2106 };
2108 //*************************************************************************************************
2109 
2110 
2111 //*************************************************************************************************
2113 template< typename VT1, typename ST1, typename VT2, typename ST2 >
2114 struct DVecTSVecMultExprTrait< DVecScalarMultExpr<VT1,ST1,false>, SVecScalarMultExpr<VT2,ST2,true> >
2115 {
2116  public:
2117  //**********************************************************************************************
2118  typedef typename SelectType< IsDenseVector<VT1>::value && IsColumnVector<VT1>::value &&
2119  IsSparseVector<VT2>::value && IsRowVector<VT2>::value &&
2120  IsNumeric<ST1>::value && IsNumeric<ST2>::value
2121  , typename SMatScalarMultExprTrait<typename DVecTSVecMultExprTrait<VT1,VT2>::Type,typename MultTrait<ST1,ST2>::Type>::Type
2122  , INVALID_TYPE >::Type Type;
2123  //**********************************************************************************************
2124 };
2126 //*************************************************************************************************
2127 
2128 
2129 
2130 
2131 //=================================================================================================
2132 //
2133 // TDVECTSVECMULTEXPRTRAIT SPECIALIZATIONS
2134 //
2135 //=================================================================================================
2136 
2137 //*************************************************************************************************
2139 template< typename VT1, typename ST, typename VT2 >
2140 struct TDVecTSVecMultExprTrait< DVecScalarMultExpr<VT1,ST,true>, VT2 >
2141 {
2142  public:
2143  //**********************************************************************************************
2144  typedef typename SelectType< IsDenseVector<VT1>::value && IsRowVector<VT1>::value &&
2145  IsSparseVector<VT2>::value && IsRowVector<VT2>::value &&
2146  IsNumeric<ST>::value
2147  , typename TSVecScalarMultExprTrait<typename TDVecTSVecMultExprTrait<VT1,VT2>::Type,ST>::Type
2148  , INVALID_TYPE >::Type Type;
2149  //**********************************************************************************************
2150 };
2152 //*************************************************************************************************
2153 
2154 
2155 //*************************************************************************************************
2157 template< typename VT1, typename ST1, typename VT2, typename ST2 >
2158 struct TDVecTSVecMultExprTrait< DVecScalarMultExpr<VT1,ST1,true>, SVecScalarMultExpr<VT2,ST2,true> >
2159 {
2160  public:
2161  //**********************************************************************************************
2162  typedef typename SelectType< IsDenseVector<VT1>::value && IsRowVector<VT1>::value &&
2163  IsSparseVector<VT2>::value && IsRowVector<VT2>::value &&
2164  IsNumeric<ST1>::value && IsNumeric<ST2>::value
2165  , typename TSVecScalarMultExprTrait<typename TDVecTSVecMultExprTrait<VT1,VT2>::Type,typename MultTrait<ST1,ST2>::Type>::Type
2166  , INVALID_TYPE >::Type Type;
2167  //**********************************************************************************************
2168 };
2170 //*************************************************************************************************
2171 
2172 
2173 
2174 
2175 //=================================================================================================
2176 //
2177 // SVECDVECMULTEXPRTRAIT SPECIALIZATIONS
2178 //
2179 //=================================================================================================
2180 
2181 //*************************************************************************************************
2183 template< typename VT1, typename VT2, typename ST >
2184 struct SVecDVecMultExprTrait< VT1, DVecScalarMultExpr<VT2,ST,false> >
2185 {
2186  public:
2187  //**********************************************************************************************
2188  typedef typename SelectType< IsSparseVector<VT1>::value && IsColumnVector<VT1>::value &&
2189  IsDenseVector<VT2>::value && IsColumnVector<VT2>::value &&
2190  IsNumeric<ST>::value
2191  , typename SVecScalarMultExprTrait<typename SVecDVecMultExprTrait<VT1,VT2>::Type,ST>::Type
2192  , INVALID_TYPE >::Type Type;
2193  //**********************************************************************************************
2194 };
2196 //*************************************************************************************************
2197 
2198 
2199 //*************************************************************************************************
2201 template< typename VT1, typename ST1, typename VT2, typename ST2 >
2202 struct SVecDVecMultExprTrait< SVecScalarMultExpr<VT1,ST1,false>, DVecScalarMultExpr<VT2,ST2,false> >
2203 {
2204  public:
2205  //**********************************************************************************************
2206  typedef typename SelectType< IsSparseVector<VT1>::value && IsColumnVector<VT1>::value &&
2207  IsDenseVector<VT2>::value && IsColumnVector<VT2>::value &&
2208  IsNumeric<ST1>::value && IsNumeric<ST2>::value
2209  , typename SVecScalarMultExprTrait<typename SVecDVecMultExprTrait<VT1,VT2>::Type,typename MultTrait<ST1,ST2>::Type>::Type
2210  , INVALID_TYPE >::Type Type;
2211  //**********************************************************************************************
2212 };
2214 //*************************************************************************************************
2215 
2216 
2217 
2218 
2219 //=================================================================================================
2220 //
2221 // SVECTDVECMULTEXPRTRAIT SPECIALIZATIONS
2222 //
2223 //=================================================================================================
2224 
2225 //*************************************************************************************************
2227 template< typename VT1, typename VT2, typename ST >
2228 struct SVecTDVecMultExprTrait< VT1, DVecScalarMultExpr<VT2,ST,true> >
2229 {
2230  public:
2231  //**********************************************************************************************
2232  typedef typename SelectType< IsSparseVector<VT1>::value && IsColumnVector<VT1>::value &&
2233  IsDenseVector<VT2>::value && IsRowVector<VT2>::value &&
2234  IsNumeric<ST>::value
2235  , typename TSMatScalarMultExprTrait<typename SVecTDVecMultExprTrait<VT1,VT2>::Type,ST>::Type
2236  , INVALID_TYPE >::Type Type;
2237  //**********************************************************************************************
2238 };
2240 //*************************************************************************************************
2241 
2242 
2243 //*************************************************************************************************
2245 template< typename VT1, typename ST1, typename VT2, typename ST2 >
2246 struct SVecTDVecMultExprTrait< SVecScalarMultExpr<VT1,ST1,false>, DVecScalarMultExpr<VT2,ST2,true> >
2247 {
2248  public:
2249  //**********************************************************************************************
2250  typedef typename SelectType< IsSparseVector<VT1>::value && IsColumnVector<VT1>::value &&
2251  IsDenseVector<VT2>::value && IsRowVector<VT2>::value &&
2252  IsNumeric<ST1>::value && IsNumeric<ST2>::value
2253  , typename TSMatScalarMultExprTrait<typename SVecTDVecMultExprTrait<VT1,VT2>::Type,typename MultTrait<ST1,ST2>::Type>::Type
2254  , INVALID_TYPE >::Type Type;
2255  //**********************************************************************************************
2256 };
2258 //*************************************************************************************************
2259 
2260 
2261 
2262 
2263 //=================================================================================================
2264 //
2265 // TSVECTDVECMULTEXPRTRAIT SPECIALIZATIONS
2266 //
2267 //=================================================================================================
2268 
2269 //*************************************************************************************************
2271 template< typename VT1, typename VT2, typename ST >
2272 struct TSVecTDVecMultExprTrait< VT1, DVecScalarMultExpr<VT2,ST,true> >
2273 {
2274  public:
2275  //**********************************************************************************************
2276  typedef typename SelectType< IsSparseVector<VT1>::value && IsRowVector<VT1>::value &&
2277  IsDenseVector<VT2>::value && IsRowVector<VT2>::value &&
2278  IsNumeric<ST>::value
2279  , typename TSVecScalarMultExprTrait<typename TSVecTDVecMultExprTrait<VT1,VT2>::Type,ST>::Type
2280  , INVALID_TYPE >::Type Type;
2281  //**********************************************************************************************
2282 };
2284 //*************************************************************************************************
2285 
2286 
2287 //*************************************************************************************************
2289 template< typename VT1, typename ST1, typename VT2, typename ST2 >
2290 struct TSVecTDVecMultExprTrait< SVecScalarMultExpr<VT1,ST1,true>, DVecScalarMultExpr<VT2,ST2,true> >
2291 {
2292  public:
2293  //**********************************************************************************************
2294  typedef typename SelectType< IsSparseVector<VT1>::value && IsRowVector<VT1>::value &&
2295  IsDenseVector<VT2>::value && IsRowVector<VT2>::value &&
2296  IsNumeric<ST1>::value && IsNumeric<ST2>::value
2297  , typename TSVecScalarMultExprTrait<typename TSVecTDVecMultExprTrait<VT1,VT2>::Type,typename MultTrait<ST1,ST2>::Type>::Type
2298  , INVALID_TYPE >::Type Type;
2299  //**********************************************************************************************
2300 };
2302 //*************************************************************************************************
2303 
2304 
2305 
2306 
2307 //=================================================================================================
2308 //
2309 // DMATDVECMULTEXPRTRAIT SPECIALIZATIONS
2310 //
2311 //=================================================================================================
2312 
2313 //*************************************************************************************************
2315 template< typename MT, typename VT, typename ST >
2316 struct DMatDVecMultExprTrait< MT, DVecScalarMultExpr<VT,ST,false> >
2317 {
2318  public:
2319  //**********************************************************************************************
2320  typedef typename SelectType< IsDenseMatrix<MT>::value && IsRowMajorMatrix<MT>::value &&
2321  IsDenseVector<VT>::value && IsColumnVector<VT>::value &&
2322  IsNumeric<ST>::value
2323  , typename DVecScalarMultExprTrait<typename DMatDVecMultExprTrait<MT,VT>::Type,ST>::Type
2324  , INVALID_TYPE >::Type Type;
2325  //**********************************************************************************************
2326 };
2328 //*************************************************************************************************
2329 
2330 
2331 
2332 
2333 //=================================================================================================
2334 //
2335 // TDMATDVECMULTEXPRTRAIT SPECIALIZATIONS
2336 //
2337 //=================================================================================================
2338 
2339 //*************************************************************************************************
2341 template< typename MT, typename VT, typename ST >
2342 struct TDMatDVecMultExprTrait< MT, DVecScalarMultExpr<VT,ST,false> >
2343 {
2344  public:
2345  //**********************************************************************************************
2346  typedef typename SelectType< IsDenseMatrix<MT>::value && IsColumnMajorMatrix<MT>::value &&
2347  IsDenseVector<VT>::value && IsColumnVector<VT>::value &&
2348  IsNumeric<ST>::value
2349  , typename DVecScalarMultExprTrait<typename TDMatDVecMultExprTrait<MT,VT>::Type,ST>::Type
2350  , INVALID_TYPE >::Type Type;
2351  //**********************************************************************************************
2352 };
2354 //*************************************************************************************************
2355 
2356 
2357 
2358 
2359 //=================================================================================================
2360 //
2361 // TDVECDMATMULTEXPRTRAIT SPECIALIZATIONS
2362 //
2363 //=================================================================================================
2364 
2365 //*************************************************************************************************
2367 template< typename VT, typename MT, typename ST >
2368 struct TDVecDMatMultExprTrait< DVecScalarMultExpr<VT,ST,true>, MT >
2369 {
2370  public:
2371  //**********************************************************************************************
2372  typedef typename SelectType< IsDenseVector<VT>::value && IsRowVector<VT>::value &&
2373  IsDenseMatrix<MT>::value && IsRowMajorMatrix<MT>::value &&
2374  IsNumeric<ST>::value
2375  , typename TDVecScalarMultExprTrait<typename TDVecDMatMultExprTrait<VT,MT>::Type,ST>::Type
2376  , INVALID_TYPE >::Type Type;
2377  //**********************************************************************************************
2378 };
2380 //*************************************************************************************************
2381 
2382 
2383 
2384 
2385 //=================================================================================================
2386 //
2387 // TDVECTDMATMULTEXPRTRAIT SPECIALIZATIONS
2388 //
2389 //=================================================================================================
2390 
2391 //*************************************************************************************************
2393 template< typename VT, typename MT, typename ST >
2394 struct TDVecTDMatMultExprTrait< DVecScalarMultExpr<VT,ST,true>, MT >
2395 {
2396  public:
2397  //**********************************************************************************************
2398  typedef typename SelectType< IsDenseVector<VT>::value && IsRowVector<VT>::value &&
2399  IsDenseMatrix<MT>::value && IsColumnMajorMatrix<MT>::value &&
2400  IsNumeric<ST>::value
2401  , typename TDVecScalarMultExprTrait<typename TDVecTDMatMultExprTrait<VT,MT>::Type,ST>::Type
2402  , INVALID_TYPE >::Type Type;
2403  //**********************************************************************************************
2404 };
2406 //*************************************************************************************************
2407 
2408 
2409 
2410 
2411 //=================================================================================================
2412 //
2413 // SMATDVECMULTEXPRTRAIT SPECIALIZATIONS
2414 //
2415 //=================================================================================================
2416 
2417 //*************************************************************************************************
2419 template< typename MT, typename VT, typename ST >
2420 struct SMatDVecMultExprTrait< MT, DVecScalarMultExpr<VT,ST,false> >
2421 {
2422  public:
2423  //**********************************************************************************************
2424  typedef typename SelectType< IsSparseMatrix<MT>::value && IsRowMajorMatrix<MT>::value &&
2425  IsDenseVector<VT>::value && IsColumnVector<VT>::value &&
2426  IsNumeric<ST>::value
2427  , typename DVecScalarMultExprTrait<typename SMatDVecMultExprTrait<MT,VT>::Type,ST>::Type
2428  , INVALID_TYPE >::Type Type;
2429  //**********************************************************************************************
2430 };
2432 //*************************************************************************************************
2433 
2434 
2435 
2436 
2437 //=================================================================================================
2438 //
2439 // TSMATDVECMULTEXPRTRAIT SPECIALIZATIONS
2440 //
2441 //=================================================================================================
2442 
2443 //*************************************************************************************************
2445 template< typename MT, typename VT, typename ST >
2446 struct TSMatDVecMultExprTrait< MT, DVecScalarMultExpr<VT,ST,false> >
2447 {
2448  public:
2449  //**********************************************************************************************
2450  typedef typename SelectType< IsSparseMatrix<MT>::value && IsColumnMajorMatrix<MT>::value &&
2451  IsDenseVector<VT>::value && IsColumnVector<VT>::value &&
2452  IsNumeric<ST>::value
2453  , typename DVecScalarMultExprTrait<typename TSMatDVecMultExprTrait<MT,VT>::Type,ST>::Type
2454  , INVALID_TYPE >::Type Type;
2455  //**********************************************************************************************
2456 };
2458 //*************************************************************************************************
2459 
2460 
2461 
2462 
2463 //=================================================================================================
2464 //
2465 // TDVECSMATMULTEXPRTRAIT SPECIALIZATIONS
2466 //
2467 //=================================================================================================
2468 
2469 //*************************************************************************************************
2471 template< typename VT, typename MT, typename ST >
2472 struct TDVecSMatMultExprTrait< DVecScalarMultExpr<VT,ST,true>, MT >
2473 {
2474  public:
2475  //**********************************************************************************************
2476  typedef typename SelectType< IsDenseVector<VT>::value && IsRowVector<VT>::value &&
2477  IsSparseMatrix<MT>::value && IsRowMajorMatrix<MT>::value &&
2478  IsNumeric<ST>::value
2479  , typename TDVecScalarMultExprTrait<typename TDVecSMatMultExprTrait<VT,MT>::Type,ST>::Type
2480  , INVALID_TYPE >::Type Type;
2481  //**********************************************************************************************
2482 };
2484 //*************************************************************************************************
2485 
2486 
2487 
2488 
2489 //=================================================================================================
2490 //
2491 // TDVECTSMATMULTEXPRTRAIT SPECIALIZATIONS
2492 //
2493 //=================================================================================================
2494 
2495 //*************************************************************************************************
2497 template< typename VT, typename MT, typename ST >
2498 struct TDVecTSMatMultExprTrait< DVecScalarMultExpr<VT,ST,true>, MT >
2499 {
2500  public:
2501  //**********************************************************************************************
2502  typedef typename SelectType< IsDenseVector<VT>::value && IsRowVector<VT>::value &&
2503  IsSparseMatrix<MT>::value && IsColumnMajorMatrix<MT>::value &&
2504  IsNumeric<ST>::value
2505  , typename TDVecScalarMultExprTrait<typename TDVecTSMatMultExprTrait<VT,MT>::Type,ST>::Type
2506  , INVALID_TYPE >::Type Type;
2507  //**********************************************************************************************
2508 };
2510 //*************************************************************************************************
2511 
2512 
2513 
2514 
2515 //=================================================================================================
2516 //
2517 // SUBVECTOREXPRTRAIT SPECIALIZATIONS
2518 //
2519 //=================================================================================================
2520 
2521 //*************************************************************************************************
2523 template< typename VT, typename ST, bool TF, bool AF >
2524 struct SubvectorExprTrait< DVecScalarMultExpr<VT,ST,TF>, AF >
2525 {
2526  public:
2527  //**********************************************************************************************
2528  typedef typename MultExprTrait< typename SubvectorExprTrait<const VT,AF>::Type, ST >::Type Type;
2529  //**********************************************************************************************
2530 };
2532 //*************************************************************************************************
2533 
2534 } // namespace blaze
2535 
2536 #endif
Pointer difference type of the Blaze library.
Data type constraint.
Compile time check whether the given type is a computational expression template.This type trait clas...
Definition: IsComputation.h:89
Constraint on the data type.
Compile time check whether the given type is a temporary vector or matrix type.This type trait class ...
Definition: IsTemporary.h:87
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:4329
const EnableIf< IsNumeric< T2 >, typename DivExprTrait< T1, T2 >::Type >::Type operator/(const DenseMatrix< T1, SO > &mat, T2 scalar)
Division operator for the division of a dense matrix by a scalar value ( ).
Definition: DMatScalarDivExpr.h:930
Header file for the SparseVector base class.
IntrinsicTrait< ElementType >::Type IntrinsicType
Resulting intrinsic element type.
Definition: DVecScalarMultExpr.h:172
ReturnType operator*() const
Direct access to the element at the current iterator position.
Definition: DVecScalarMultExpr.h:294
void smpSubAssign(DenseMatrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs)
Default implementation of the SMP subtraction assignment of a matrix to dense matrix.
Definition: DenseMatrix.h:152
Header file for the IsSparseMatrix type trait.
ConstIterator end() const
Returns an iterator just past the last non-zero element of the dense vector.
Definition: DVecScalarMultExpr.h:495
Efficient implementation of a compressed matrix.The CompressedMatrix class template is the represent...
Definition: CompressedMatrix.h:199
const ConstIterator operator++(int)
Post-increment operator.
Definition: DVecScalarMultExpr.h:263
void smpMultAssign(DenseVector< 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:179
Header file for the IsSame and IsStrictlySame type traits.
Header file for the IsColumnMajorMatrix type trait.
const This & CompositeType
Data type for composite expression templates.
Definition: CompressedMatrix.h:2408
Header file for the IsRowVector type trait.
Type ElementType
Type of the sparse matrix elements.
Definition: CompressedMatrix.h:251
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:458
const DMatSerialExpr< MT, SO > serial(const DenseMatrix< MT, SO > &dm)
Forces the serial evaluation of the given dense matrix expression dm.
Definition: DMatSerialExpr.h:690
Header file for the Computation base class.
Type relationship analysis.This class tests if the two data types A and B are equal. For this type comparison, the cv-qualifiers of both data types are ignored. If A and B are the same data type (ignoring the cv-qualifiers), then the value member enumeration is set to 1, the nested type definition Type is TrueType, and the class derives from TrueType. Otherwise value is set to 0, Type is FalseType, and the class derives from FalseType.
Definition: IsSame.h:158
Header file for the RequiresEvaluation type trait.
MultExprTrait< RN, ST >::Type ExprReturnType
Expression return type for the subscript operator.
Definition: DVecScalarMultExpr.h:129
bool operator!=(const ConstIterator &rhs) const
Inequality comparison between two ConstIterator objects.
Definition: DVecScalarMultExpr.h:326
ConstIterator(IteratorType iterator, RightOperand scalar)
Constructor for the ConstIterator class.
Definition: DVecScalarMultExpr.h:217
Header file for the VecScalarMultExpr base class.
LeftOperand leftOperand() const
Returns the left-hand side dense vector operand.
Definition: DVecScalarMultExpr.h:515
ResultType::ElementType ElementType
Resulting element type.
Definition: DVecScalarMultExpr.h:171
Constraint on the data type.
ValueType value_type
Type of the underlying elements.
Definition: DVecScalarMultExpr.h:202
bool operator<=(const ConstIterator &rhs) const
Less-than comparison between two ConstIterator objects.
Definition: DVecScalarMultExpr.h:359
Header file for the SparseMatrix base class.
Header file for the DivExprTrait class template.
bool isAligned() const
Returns whether the operands of the expression are properly aligned in memory.
Definition: DVecScalarMultExpr.h:559
PointerType pointer
Pointer return type.
Definition: DVecScalarMultExpr.h:203
VT::ConstIterator IteratorType
ConstIterator type of the dense vector expression.
Definition: DVecScalarMultExpr.h:208
IntrinsicType load(size_t index) const
Access to the intrinsic elements of the vector.
Definition: DVecScalarMultExpr.h:470
SelectType< IsExpression< VT >::value, const VT, const VT & >::Type LeftOperand
Composite type of the left-hand side dense vector expression.
Definition: DVecScalarMultExpr.h:181
Header file for the MultExprTrait class template.
void smpAddAssign(DenseMatrix< 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:122
Compile time check to query the requirement to evaluate an expression.Via this type trait it is possi...
Definition: RequiresEvaluation.h:90
const This & CompositeType
Data type for composite expression templates.
Definition: CompressedMatrix.h:253
DVecScalarMultExpr(const VT &vector, ST scalar)
Constructor for the DVecScalarMultExpr class.
Definition: DVecScalarMultExpr.h:446
ptrdiff_t DifferenceType
Difference between two iterators.
Definition: DVecScalarMultExpr.h:198
Compile time type selection.The SelectType class template selects one of the two given types T1 and T...
Definition: SelectType.h:59
Header file for the IsTemporary type trait class.
Header file for the multiplication trait.
Header file for the IsFloatingPoint type trait.
const Element * ConstIterator
Iterator over constant elements.
Definition: CompressedMatrix.h:2412
bool canAlias(const T *alias) const
Returns whether the expression can alias with the given address alias.
Definition: DVecScalarMultExpr.h:537
Iterator over the elements of the dense vector.
Definition: DVecScalarMultExpr.h:190
Header file for the DenseMatrix base class.
const SelectType< returnExpr, ExprReturnType, ElementType >::Type ReturnType
Return type for expression template evaluations.
Definition: DVecScalarMultExpr.h:175
bool operator>(const ConstIterator &rhs) const
Greater-than comparison between two ConstIterator objects.
Definition: DVecScalarMultExpr.h:348
ResultType::TransposeType TransposeType
Transpose type for expression template evaluations.
Definition: DVecScalarMultExpr.h:170
void assign(Matrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs)
Default implementation of the assignment of a matrix to a matrix.
Definition: Matrix.h:271
bool operator>=(const ConstIterator &rhs) const
Greater-than comparison between two ConstIterator objects.
Definition: DVecScalarMultExpr.h:370
ST RightOperand
Composite type of the right-hand side scalar value.
Definition: DVecScalarMultExpr.h:184
VT::ResultType RT
Result type of the dense vector expression.
Definition: DVecScalarMultExpr.h:113
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:89
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:78
std::random_access_iterator_tag IteratorCategory
The iterator category.
Definition: DVecScalarMultExpr.h:194
Constraint on the data type.
DVecScalarMultExpr< VT, ST, TF > This
Type of this DVecScalarMultExpr instance.
Definition: DVecScalarMultExpr.h:168
Type ElementType
Type of the sparse matrix elements.
Definition: CompressedMatrix.h:2406
void multAssign(Matrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs)
Default implementation of the multiplication assignment of a matrix to a matrix.
Definition: Matrix.h:361
bool operator<(const ConstIterator &rhs) const
Less-than comparison between two ConstIterator objects.
Definition: DVecScalarMultExpr.h:337
Header file for the SelectType class template.
LeftOperand vector_
Left-hand side dense vector of the multiplication expression.
Definition: DVecScalarMultExpr.h:576
Header file for all forward declarations for expression class templates.
CMathTrait< typename VT::ElementType >::Type length(const DenseVector< VT, TF > &dv)
Calculation of the dense vector length .
Definition: DenseVector.h:483
Header file for the IsDenseMatrix type trait.
size_t size() const
Returns the current size/dimension of the vector.
Definition: DVecScalarMultExpr.h:505
Header file for the EnableIf class template.
ReferenceType reference
Reference return type.
Definition: DVecScalarMultExpr.h:204
ConstIterator & operator++()
Pre-increment operator.
Definition: DVecScalarMultExpr.h:252
Header file for the serial shim.
Header file for the BaseElementType type trait.
bool canSMPAssign() const
Returns whether the expression can be used in SMP assignments.
Definition: DVecScalarMultExpr.h:569
friend const ConstIterator operator+(const ConstIterator &it, size_t inc)
Addition between a ConstIterator and an integral value.
Definition: DVecScalarMultExpr.h:393
void smpAssign(DenseMatrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs)
Default implementation of the SMP assignment of a matrix to a dense matrix.
Definition: DenseMatrix.h:92
Header file for the IsNumeric type trait.
RightOperand scalar_
Right-hand side scalar of the multiplication expression.
Definition: DVecScalarMultExpr.h:577
ElementType ValueType
Type of the underlying elements.
Definition: DVecScalarMultExpr.h:195
bool operator==(const ConstIterator &rhs) const
Equality comparison between two ConstIterator objects.
Definition: DVecScalarMultExpr.h:315
Base class for all vector/scalar multiplication expression templates.The VecScalarMultExpr class serv...
Definition: VecScalarMultExpr.h:66
Header file for the IsSparseVector type trait.
const Type & ReturnType
Return type for expression template evaluations.
Definition: CompressedMatrix.h:2407
Intrinsic characteristics of data types.The IntrinsicTrait class template provides the intrinsic char...
Definition: IntrinsicTrait.h:748
Header file for run time assertion macros.
Utility type for generic codes.
Base template for the MultTrait class.
Definition: MultTrait.h:141
Header file for the division trait.
IteratorType iterator_
Iterator to the current element.
Definition: DVecScalarMultExpr.h:424
void addAssign(Matrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs)
Default implementation of the addition assignment of a matrix to a matrix.
Definition: Matrix.h:301
bool isAliased(const T *alias) const
Returns whether the expression is aliased with the given address alias.
Definition: DVecScalarMultExpr.h:549
const DenseIterator< Type > operator-(const DenseIterator< Type > &it, ptrdiff_t inc)
Subtraction between a DenseIterator and an integral value.
Definition: DenseIterator.h:585
Substitution Failure Is Not An Error (SFINAE) class.The EnableIf class template is an auxiliary tool ...
Definition: EnableIf.h:184
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:79
RightOperand rightOperand() const
Returns the right-hand side scalar operand.
Definition: DVecScalarMultExpr.h:525
void subAssign(Matrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs)
Default implementation of the subtraction assignment of a matrix to matrix.
Definition: Matrix.h:331
VT::ElementType ET
Element type of the dense vector expression.
Definition: DVecScalarMultExpr.h:115
friend const ConstIterator operator+(size_t inc, const ConstIterator &it)
Addition between an integral value and a ConstIterator.
Definition: DVecScalarMultExpr.h:405
ElementType * PointerType
Pointer return type.
Definition: DVecScalarMultExpr.h:196
const size_t SMP_DVECSCALARMULT_THRESHOLD
SMP dense vector/scalar multiplication/division threshold.This threshold specifies when a dense vecto...
Definition: Thresholds.h:299
Evaluation of the base element type of a given data type.Via this type trait it is possible to evalua...
Definition: BaseElementType.h:75
VT::ReturnType RN
Return type of the dense vector expression.
Definition: DVecScalarMultExpr.h:114
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:417
Header file for all intrinsic functionality.
#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:79
ElementType & ReferenceType
Reference return type.
Definition: DVecScalarMultExpr.h:197
ConstIterator begin() const
Returns an iterator to the first non-zero element of the dense vector.
Definition: DVecScalarMultExpr.h:485
IntrinsicType load() const
Access to the intrinsic elements of the vector.
Definition: DVecScalarMultExpr.h:304
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:284
Expression object for dense vector-scalar multiplications.The DVecScalarMultExpr class represents the...
Definition: DVecScalarMultExpr.h:107
ConstIterator & operator+=(size_t inc)
Addition assignment operator.
Definition: DVecScalarMultExpr.h:229
Base class for all compute expression templates.The Computation class serves as a tag for all computa...
Definition: Computation.h:59
Base class for sparse vectors.The SparseVector class is a base class for all arbitrarily sized (N-dim...
Definition: Forward.h:108
#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
ConstIterator & operator-=(size_t dec)
Subtraction assignment operator.
Definition: DVecScalarMultExpr.h:241
This ResultType
Result type for expression template evaluations.
Definition: CompressedMatrix.h:2403
Header file for basic type definitions.
Header file for the SubvectorExprTrait class template.
SelectType< useAssign, const ResultType, const DVecScalarMultExpr & >::Type CompositeType
Data type for composite expression templates.
Definition: DVecScalarMultExpr.h:178
const DVecScalarMultExpr< VT, typename VT::ElementType, TF > normalize(const DenseVector< VT, TF > &vec)
Normalization of the dense vector ( ).
Definition: DVecScalarMultExpr.h:1067
MultTrait< RT, ST >::Type ResultType
Result type for expression template evaluations.
Definition: DVecScalarMultExpr.h:169
Header file for the IsColumnVector type trait.
IteratorCategory iterator_category
The iterator category.
Definition: DVecScalarMultExpr.h:201
VT::CompositeType CT
Composite type of the dense vector expression.
Definition: DVecScalarMultExpr.h:116
Evaluation of the resulting expression type of a multiplication.Via this type trait it is possible to...
Definition: MultExprTrait.h:137
RightOperand scalar_
Scalar of the multiplication expression.
Definition: DVecScalarMultExpr.h:425
#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:238
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
EnableIf< IsIntegral< T >, Set< T, sizeof(T)> >::Type::Type set(T value)
Sets all values in the vector to the given integral value.
Definition: Set.h:209
#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:79
Header file for the IsExpression type trait class.
Header file for the FunctionTrace class.
DifferenceType difference_type
Difference between two iterators.
Definition: DVecScalarMultExpr.h:205
DifferenceType operator-(const ConstIterator &rhs) const
Calculating the number of elements between two iterators.
Definition: DVecScalarMultExpr.h:381
ConstIterator & operator--()
Pre-decrement operator.
Definition: DVecScalarMultExpr.h:273