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/system/Inline.h>
76 #include <blaze/util/Assert.h>
81 #include <blaze/util/EnableIf.h>
82 #include <blaze/util/InvalidType.h>
84 #include <blaze/util/SelectType.h>
85 #include <blaze/util/Types.h>
89 
90 
91 namespace blaze {
92 
93 //=================================================================================================
94 //
95 // CLASS DVECSCALARMULTEXPR
96 //
97 //=================================================================================================
98 
99 //*************************************************************************************************
106 template< typename VT // Type of the left-hand side dense vector
107  , typename ST // Type of the right-hand side scalar value
108  , bool TF > // Transpose flag
109 class DVecScalarMultExpr : public DenseVector< DVecScalarMultExpr<VT,ST,TF>, TF >
110  , private VecScalarMultExpr
111  , private Computation
112 {
113  private:
114  //**Type definitions****************************************************************************
115  typedef typename VT::ResultType RT;
116  typedef typename VT::ReturnType RN;
117  typedef typename VT::ElementType ET;
118  typedef typename VT::CompositeType CT;
119  //**********************************************************************************************
120 
121  //**Return type evaluation**********************************************************************
123 
128  enum { returnExpr = !IsTemporary<RN>::value };
129 
132  //**********************************************************************************************
133 
134  //**Serial evaluation strategy******************************************************************
136 
143 
145  template< typename VT2 >
147  struct UseAssign {
148  enum { value = useAssign };
149  };
151  //**********************************************************************************************
152 
153  //**Parallel evaluation strategy****************************************************************
155 
161  template< typename VT2 >
162  struct UseSMPAssign {
163  enum { value = ( !VT2::smpAssignable || !VT::smpAssignable ) && useAssign };
164  };
166  //**********************************************************************************************
167 
168  public:
169  //**Type definitions****************************************************************************
175 
178 
181 
183  typedef typename SelectType< IsExpression<VT>::value, const VT, const VT& >::Type LeftOperand;
184 
186  typedef ST RightOperand;
187  //**********************************************************************************************
188 
189  //**ConstIterator class definition**************************************************************
193  {
194  public:
195  //**Type definitions*************************************************************************
196  typedef std::random_access_iterator_tag IteratorCategory;
197  typedef ElementType ValueType;
198  typedef ElementType* PointerType;
199  typedef ElementType& ReferenceType;
201 
202  // STL iterator requirements
203  typedef IteratorCategory iterator_category;
204  typedef ValueType value_type;
205  typedef PointerType pointer;
206  typedef ReferenceType reference;
207  typedef DifferenceType difference_type;
208 
210  typedef typename VT::ConstIterator IteratorType;
211  //*******************************************************************************************
212 
213  //**Constructor******************************************************************************
219  explicit inline ConstIterator( IteratorType iterator, RightOperand scalar )
220  : iterator_( iterator ) // Iterator to the current element
221  , scalar_ ( scalar ) // Scalar of the multiplication expression
222  {}
223  //*******************************************************************************************
224 
225  //**Addition assignment operator*************************************************************
231  inline ConstIterator& operator+=( size_t inc ) {
232  iterator_ += inc;
233  return *this;
234  }
235  //*******************************************************************************************
236 
237  //**Subtraction assignment operator**********************************************************
243  inline ConstIterator& operator-=( size_t dec ) {
244  iterator_ -= dec;
245  return *this;
246  }
247  //*******************************************************************************************
248 
249  //**Prefix increment operator****************************************************************
255  ++iterator_;
256  return *this;
257  }
258  //*******************************************************************************************
259 
260  //**Postfix increment operator***************************************************************
265  inline const ConstIterator operator++( int ) {
266  return ConstIterator( iterator_++ );
267  }
268  //*******************************************************************************************
269 
270  //**Prefix decrement operator****************************************************************
276  --iterator_;
277  return *this;
278  }
279  //*******************************************************************************************
280 
281  //**Postfix decrement operator***************************************************************
286  inline const ConstIterator operator--( int ) {
287  return ConstIterator( iterator_-- );
288  }
289  //*******************************************************************************************
290 
291  //**Element access operator******************************************************************
296  inline ReturnType operator*() const {
297  return *iterator_ * scalar_;
298  }
299  //*******************************************************************************************
300 
301  //**Load function****************************************************************************
306  inline IntrinsicType load() const {
307  return iterator_.load() * set( scalar_ );
308  }
309  //*******************************************************************************************
310 
311  //**Equality operator************************************************************************
317  inline bool operator==( const ConstIterator& rhs ) const {
318  return iterator_ == rhs.iterator_;
319  }
320  //*******************************************************************************************
321 
322  //**Inequality operator**********************************************************************
328  inline bool operator!=( const ConstIterator& rhs ) const {
329  return iterator_ != rhs.iterator_;
330  }
331  //*******************************************************************************************
332 
333  //**Less-than operator***********************************************************************
339  inline bool operator<( const ConstIterator& rhs ) const {
340  return iterator_ < rhs.iterator_;
341  }
342  //*******************************************************************************************
343 
344  //**Greater-than operator********************************************************************
350  inline bool operator>( const ConstIterator& rhs ) const {
351  return iterator_ > rhs.iterator_;
352  }
353  //*******************************************************************************************
354 
355  //**Less-or-equal-than operator**************************************************************
361  inline bool operator<=( const ConstIterator& rhs ) const {
362  return iterator_ <= rhs.iterator_;
363  }
364  //*******************************************************************************************
365 
366  //**Greater-or-equal-than operator***********************************************************
372  inline bool operator>=( const ConstIterator& rhs ) const {
373  return iterator_ >= rhs.iterator_;
374  }
375  //*******************************************************************************************
376 
377  //**Subtraction operator*********************************************************************
383  inline DifferenceType operator-( const ConstIterator& rhs ) const {
384  return iterator_ - rhs.iterator_;
385  }
386  //*******************************************************************************************
387 
388  //**Addition operator************************************************************************
395  friend inline const ConstIterator operator+( const ConstIterator& it, size_t inc ) {
396  return ConstIterator( it.iterator_ + inc );
397  }
398  //*******************************************************************************************
399 
400  //**Addition operator************************************************************************
407  friend inline const ConstIterator operator+( size_t inc, const ConstIterator& it ) {
408  return ConstIterator( it.iterator_ + inc );
409  }
410  //*******************************************************************************************
411 
412  //**Subtraction operator*********************************************************************
419  friend inline const ConstIterator operator-( const ConstIterator& it, size_t dec ) {
420  return ConstIterator( it.iterator_ - dec );
421  }
422  //*******************************************************************************************
423 
424  private:
425  //**Member variables*************************************************************************
426  IteratorType iterator_;
427  RightOperand scalar_;
428  //*******************************************************************************************
429  };
430  //**********************************************************************************************
431 
432  //**Compilation flags***************************************************************************
434  enum { vectorizable = VT::vectorizable &&
437 
439  enum { smpAssignable = VT::smpAssignable };
440  //**********************************************************************************************
441 
442  //**Constructor*********************************************************************************
448  explicit inline DVecScalarMultExpr( const VT& vector, ST scalar )
449  : vector_( vector ) // Left-hand side dense vector of the multiplication expression
450  , scalar_( scalar ) // Right-hand side scalar of the multiplication expression
451  {}
452  //**********************************************************************************************
453 
454  //**Subscript operator**************************************************************************
460  inline ReturnType operator[]( size_t index ) const {
461  BLAZE_INTERNAL_ASSERT( index < vector_.size(), "Invalid vector access index" );
462  return vector_[index] * scalar_;
463  }
464  //**********************************************************************************************
465 
466  //**Load function*******************************************************************************
472  BLAZE_ALWAYS_INLINE IntrinsicType load( size_t index ) const {
473  typedef IntrinsicTrait<ElementType> IT;
474  BLAZE_INTERNAL_ASSERT( index < vector_.size() , "Invalid vector access index" );
475  BLAZE_INTERNAL_ASSERT( index % IT::size == 0UL, "Invalid vector access index" );
476  const IntrinsicType xmm1( vector_.load( index ) );
477  const IntrinsicType xmm2( set( scalar_ ) );
478  return xmm1 * xmm2;
479  }
480  //**********************************************************************************************
481 
482  //**Begin function******************************************************************************
487  inline ConstIterator begin() const {
488  return ConstIterator( vector_.begin(), scalar_ );
489  }
490  //**********************************************************************************************
491 
492  //**End function********************************************************************************
497  inline ConstIterator end() const {
498  return ConstIterator( vector_.end(), scalar_ );
499  }
500  //**********************************************************************************************
501 
502  //**Size function*******************************************************************************
507  inline size_t size() const {
508  return vector_.size();
509  }
510  //**********************************************************************************************
511 
512  //**Left operand access*************************************************************************
517  inline LeftOperand leftOperand() const {
518  return vector_;
519  }
520  //**********************************************************************************************
521 
522  //**Right operand access************************************************************************
527  inline RightOperand rightOperand() const {
528  return scalar_;
529  }
530  //**********************************************************************************************
531 
532  //**********************************************************************************************
538  template< typename T >
539  inline bool canAlias( const T* alias ) const {
540  return IsComputation<VT>::value && vector_.canAlias( alias );
541  }
542  //**********************************************************************************************
543 
544  //**********************************************************************************************
550  template< typename T >
551  inline bool isAliased( const T* alias ) const {
552  return vector_.isAliased( alias );
553  }
554  //**********************************************************************************************
555 
556  //**********************************************************************************************
561  inline bool isAligned() const {
562  return vector_.isAligned();
563  }
564  //**********************************************************************************************
565 
566  //**********************************************************************************************
571  inline bool canSMPAssign() const {
572  return vector_.canSMPAssign() || ( size() > SMP_DVECSCALARMULT_THRESHOLD );
573  }
574  //**********************************************************************************************
575 
576  private:
577  //**Member variables****************************************************************************
578  LeftOperand vector_;
579  RightOperand scalar_;
580  //**********************************************************************************************
581 
582  //**Assignment to dense vectors*****************************************************************
596  template< typename VT2 > // Type of the target dense vector
597  friend inline typename EnableIf< UseAssign<VT2> >::Type
598  assign( DenseVector<VT2,TF>& lhs, const DVecScalarMultExpr& rhs )
599  {
601 
602  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
603 
604  assign( ~lhs, rhs.vector_ );
605  assign( ~lhs, (~lhs) * rhs.scalar_ );
606  }
608  //**********************************************************************************************
609 
610  //**Assignment to sparse vectors****************************************************************
624  template< typename VT2 > // Type of the target sparse vector
625  friend inline typename EnableIf< UseAssign<VT2> >::Type
627  {
629 
630  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
631 
632  assign( ~lhs, rhs.vector_ );
633  (~lhs) *= rhs.scalar_;
634  }
636  //**********************************************************************************************
637 
638  //**Addition assignment to dense vectors********************************************************
652  template< typename VT2 > // Type of the target dense vector
653  friend inline typename EnableIf< UseAssign<VT2> >::Type
654  addAssign( DenseVector<VT2,TF>& lhs, const DVecScalarMultExpr& rhs )
655  {
657 
661 
662  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
663 
664  const ResultType tmp( serial( rhs ) );
665  addAssign( ~lhs, tmp );
666  }
668  //**********************************************************************************************
669 
670  //**Addition assignment to sparse vectors*******************************************************
671  // No special implementation for the addition assignment to sparse vectors.
672  //**********************************************************************************************
673 
674  //**Subtraction assignment to dense vectors*****************************************************
688  template< typename VT2 > // Type of the target dense vector
689  friend inline typename EnableIf< UseAssign<VT2> >::Type
690  subAssign( DenseVector<VT2,TF>& lhs, const DVecScalarMultExpr& rhs )
691  {
693 
697 
698  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
699 
700  const ResultType tmp( serial( rhs ) );
701  subAssign( ~lhs, tmp );
702  }
704  //**********************************************************************************************
705 
706  //**Subtraction assignment to sparse vectors****************************************************
707  // No special implementation for the subtraction assignment to sparse vectors.
708  //**********************************************************************************************
709 
710  //**Multiplication assignment to dense vectors**************************************************
724  template< typename VT2 > // Type of the target dense vector
725  friend inline typename EnableIf< UseAssign<VT2> >::Type
726  multAssign( DenseVector<VT2,TF>& lhs, const DVecScalarMultExpr& rhs )
727  {
729 
733 
734  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
735 
736  const ResultType tmp( serial( rhs ) );
737  multAssign( ~lhs, tmp );
738  }
740  //**********************************************************************************************
741 
742  //**Multiplication assignment to sparse vectors*************************************************
743  // No special implementation for the multiplication assignment to sparse vectors.
744  //**********************************************************************************************
745 
746  //**SMP assignment to dense vectors*************************************************************
760  template< typename VT2 > // Type of the target dense vector
761  friend inline typename EnableIf< UseSMPAssign<VT2> >::Type
762  smpAssign( DenseVector<VT2,TF>& lhs, const DVecScalarMultExpr& rhs )
763  {
765 
766  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
767 
768  smpAssign( ~lhs, rhs.vector_ );
769  smpAssign( ~lhs, (~lhs) * rhs.scalar_ );
770  }
772  //**********************************************************************************************
773 
774  //**SMP assignment to sparse vectors************************************************************
788  template< typename VT2 > // Type of the target sparse vector
789  friend inline typename EnableIf< UseSMPAssign<VT2> >::Type
790  smpAssign( SparseVector<VT2,TF>& lhs, const DVecScalarMultExpr& rhs )
791  {
793 
794  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
795 
796  smpAssign( ~lhs, rhs.vector_ );
797  (~lhs) *= rhs.scalar_;
798  }
800  //**********************************************************************************************
801 
802  //**SMP addition assignment to dense vectors****************************************************
816  template< typename VT2 > // Type of the target dense vector
817  friend inline typename EnableIf< UseSMPAssign<VT2> >::Type
818  smpAddAssign( DenseVector<VT2,TF>& lhs, const DVecScalarMultExpr& rhs )
819  {
821 
825 
826  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
827 
828  const ResultType tmp( rhs );
829  smpAddAssign( ~lhs, tmp );
830  }
832  //**********************************************************************************************
833 
834  //**SMP addition assignment to sparse vectors***************************************************
835  // No special implementation for the SMP addition assignment to sparse vectors.
836  //**********************************************************************************************
837 
838  //**SMP subtraction assignment to dense vectors*************************************************
852  template< typename VT2 > // Type of the target dense vector
853  friend inline typename EnableIf< UseSMPAssign<VT2> >::Type
854  smpSubAssign( DenseVector<VT2,TF>& lhs, const DVecScalarMultExpr& rhs )
855  {
857 
861 
862  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
863 
864  const ResultType tmp( rhs );
865  smpSubAssign( ~lhs, tmp );
866  }
868  //**********************************************************************************************
869 
870  //**SMP subtraction assignment to sparse vectors************************************************
871  // No special implementation for the SMP subtraction assignment to sparse vectors.
872  //**********************************************************************************************
873 
874  //**SMP multiplication assignment to dense vectors**********************************************
888  template< typename VT2 > // Type of the target dense vector
889  friend inline typename EnableIf< UseSMPAssign<VT2> >::Type
890  smpMultAssign( DenseVector<VT2,TF>& lhs, const DVecScalarMultExpr& rhs )
891  {
893 
897 
898  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
899 
900  const ResultType tmp( rhs );
901  smpMultAssign( ~lhs, tmp );
902  }
904  //**********************************************************************************************
905 
906  //**SMP multiplication assignment to sparse vectors*********************************************
907  // No special implementation for the SMP multiplication assignment to sparse vectors.
908  //**********************************************************************************************
909 
910  //**Compile time checks*************************************************************************
915  BLAZE_CONSTRAINT_MUST_BE_SAME_TYPE( ST, RightOperand );
917  //**********************************************************************************************
918 };
919 //*************************************************************************************************
920 
921 
922 
923 
924 //=================================================================================================
925 //
926 // GLOBAL UNARY ARITHMETIC OPERATORS
927 //
928 //=================================================================================================
929 
930 //*************************************************************************************************
947 template< typename VT // Type of the dense vector
948  , bool TF > // Transpose flag
949 inline const DVecScalarMultExpr<VT,typename BaseElementType<VT>::Type,TF>
951 {
953 
954  typedef typename BaseElementType<VT>::Type ElementType;
956 }
957 //*************************************************************************************************
958 
959 
960 
961 
962 //=================================================================================================
963 //
964 // GLOBAL BINARY ARITHMETIC OPERATORS
965 //
966 //=================================================================================================
967 
968 //*************************************************************************************************
990 template< typename T1 // Type of the left-hand side dense vector
991  , typename T2 // Type of the right-hand side scalar
992  , bool TF > // Transpose flag
993 inline const typename EnableIf< IsNumeric<T2>, typename MultExprTrait<T1,T2>::Type >::Type
994  operator*( const DenseVector<T1,TF>& vec, T2 scalar )
995 {
997 
998  typedef typename MultExprTrait<T1,T2>::Type Type;
999  return Type( ~vec, scalar );
1000 }
1001 //*************************************************************************************************
1002 
1003 
1004 //*************************************************************************************************
1026 template< typename T1 // Type of the left-hand side scalar
1027  , typename T2 // Type of the right-hand side dense vector
1028  , bool TF > // Transpose flag
1029 inline const typename EnableIf< IsNumeric<T1>, typename MultExprTrait<T1,T2>::Type >::Type
1030  operator*( T1 scalar, const DenseVector<T2,TF>& vec )
1031 {
1033 
1034  typedef typename MultExprTrait<T1,T2>::Type Type;
1035  return Type( ~vec, scalar );
1036 }
1037 //*************************************************************************************************
1038 
1039 
1040 
1041 
1042 //=================================================================================================
1043 //
1044 // GLOBAL FUNCTIONS
1045 //
1046 //=================================================================================================
1047 
1048 //*************************************************************************************************
1066 template< typename VT // Type of the dense vector
1067  , bool TF > // Transpose flag
1068 inline const DVecScalarMultExpr<VT,typename VT::ElementType,TF>
1070 {
1071  typedef typename VT::ElementType ElementType;
1072 
1074 
1075  const ElementType len ( length( ~vec ) );
1076  const ElementType ilen( ( len != ElementType(0) )?( ElementType(1) / len ):( 0 ) );
1077 
1078  return DVecScalarMultExpr<VT,ElementType,TF>( ~vec, ilen );
1079 }
1080 //*************************************************************************************************
1081 
1082 
1083 
1084 
1085 //=================================================================================================
1086 //
1087 // GLOBAL RESTRUCTURING UNARY ARITHMETIC OPERATORS
1088 //
1089 //=================================================================================================
1090 
1091 //*************************************************************************************************
1103 template< typename VT // Type of the dense vector
1104  , typename ST // Type of the scalar
1105  , bool TF > // Transpose flag
1106 inline const DVecScalarMultExpr<VT,ST,TF>
1107  operator-( const DVecScalarMultExpr<VT,ST,TF>& dv )
1108 {
1110 
1111  return DVecScalarMultExpr<VT,ST,TF>( dv.leftOperand(), -dv.rightOperand() );
1112 }
1114 //*************************************************************************************************
1115 
1116 
1117 
1118 
1119 //=================================================================================================
1120 //
1121 // GLOBAL RESTRUCTURING BINARY ARITHMETIC OPERATORS
1122 //
1123 //=================================================================================================
1124 
1125 //*************************************************************************************************
1138 template< typename VT // Type of the dense vector of the left-hand side expression
1139  , typename ST1 // Type of the scalar of the left-hand side expression
1140  , bool TF // Transpose flag of the dense vector
1141  , typename ST2 > // Type of the right-hand side scalar
1142 inline const typename EnableIf< IsNumeric<ST2>
1143  , typename MultExprTrait< DVecScalarMultExpr<VT,ST1,TF>, ST2 >::Type >::Type
1144  operator*( const DVecScalarMultExpr<VT,ST1,TF>& vec, ST2 scalar )
1145 {
1147 
1148  return vec.leftOperand() * ( vec.rightOperand() * scalar );
1149 }
1151 //*************************************************************************************************
1152 
1153 
1154 //*************************************************************************************************
1167 template< typename ST1 // Type of the left-hand side scalar
1168  , typename VT // Type of the dense vector of the right-hand side expression
1169  , typename ST2 // Type of the scalar of the right-hand side expression
1170  , bool TF > // Transpose flag of the dense vector
1171 inline const typename EnableIf< IsNumeric<ST1>
1172  , typename MultExprTrait< ST1, DVecScalarMultExpr<VT,ST2,TF> >::Type >::Type
1173  operator*( ST1 scalar, const DVecScalarMultExpr<VT,ST2,TF>& vec )
1174 {
1176 
1177  return vec.leftOperand() * ( scalar * vec.rightOperand() );
1178 }
1180 //*************************************************************************************************
1181 
1182 
1183 //*************************************************************************************************
1196 template< typename VT // Type of the dense vector of the left-hand side expression
1197  , typename ST1 // Type of the scalar of the left-hand side expression
1198  , bool TF // Transpose flag of the dense vector
1199  , typename ST2 > // Type of the right-hand side scalar
1200 inline const typename EnableIf< IsFloatingPoint<typename DivTrait<ST1,ST2>::Type>
1201  , typename DivExprTrait< DVecScalarMultExpr<VT,ST1,TF>, ST2 >::Type >::Type
1202  operator/( const DVecScalarMultExpr<VT,ST1,TF>& vec, ST2 scalar )
1203 {
1205 
1206  return vec.leftOperand() * ( vec.rightOperand() / scalar );
1207 }
1209 //*************************************************************************************************
1210 
1211 
1212 //*************************************************************************************************
1226 template< typename VT1 // Type of the dense vector of the left-hand side expression
1227  , typename ST // Type of the scalar of the left-hand side expression
1228  , bool TF // Transpose flag of the dense vectors
1229  , typename VT2 > // Type of the right-hand side dense vector
1230 inline const typename MultExprTrait< DVecScalarMultExpr<VT1,ST,TF>, VT2 >::Type
1231  operator*( const DVecScalarMultExpr<VT1,ST,TF>& lhs, const DenseVector<VT2,TF>& rhs )
1232 {
1234 
1235  return ( lhs.leftOperand() * (~rhs) ) * lhs.rightOperand();
1236 }
1238 //*************************************************************************************************
1239 
1240 
1241 //*************************************************************************************************
1255 template< typename VT1 // Type of the left-hand side dense vector
1256  , bool TF // Transpose flag of the dense vectors
1257  , typename VT2 // Type of the dense vector of the right-hand side expression
1258  , typename ST > // Type of the scalar of the right-hand side expression
1259 inline const typename MultExprTrait< VT1, DVecScalarMultExpr<VT2,ST,TF> >::Type
1260  operator*( const DenseVector<VT1,TF>& lhs, const DVecScalarMultExpr<VT2,ST,TF>& rhs )
1261 {
1263 
1264  return ( (~lhs) * rhs.leftOperand() ) * rhs.rightOperand();
1265 }
1267 //*************************************************************************************************
1268 
1269 
1270 //*************************************************************************************************
1284 template< typename VT1 // Type of the dense vector of the left-hand side expression
1285  , typename ST1 // Type of the scalar of the left-hand side expression
1286  , bool TF // Transpose flag of the dense vectors
1287  , typename VT2 // Type of the dense vector of the right-hand side expression
1288  , typename ST2 > // Type of the scalar of the right-hand side expression
1289 inline const typename MultExprTrait< DVecScalarMultExpr<VT1,ST1,TF>, DVecScalarMultExpr<VT2,ST2,TF> >::Type
1290  operator*( const DVecScalarMultExpr<VT1,ST1,TF>& lhs, const DVecScalarMultExpr<VT2,ST2,TF>& rhs )
1291 {
1293 
1294  return ( lhs.leftOperand() * rhs.leftOperand() ) * ( lhs.rightOperand() * rhs.rightOperand() );
1295 }
1297 //*************************************************************************************************
1298 
1299 
1300 //*************************************************************************************************
1314 template< typename VT1 // Type of the dense vector of the left-hand side expression
1315  , typename ST // Type of the scalar of the left-hand side expression
1316  , typename VT2 > // Type of the right-hand side dense vector
1317 inline const typename MultExprTrait< DVecScalarMultExpr<VT1,ST,false>, VT2 >::Type
1318  operator*( const DVecScalarMultExpr<VT1,ST,false>& lhs, const DenseVector<VT2,true>& rhs )
1319 {
1321 
1322  return ( lhs.leftOperand() * (~rhs) ) * lhs.rightOperand();
1323 }
1325 //*************************************************************************************************
1326 
1327 
1328 //*************************************************************************************************
1342 template< typename VT1 // Type of the left-hand side dense vector
1343  , typename VT2 // Type of the dense vector of the right-hand side expression
1344  , typename ST > // Type of the scalar of the right-hand side expression
1345 inline const typename MultExprTrait< VT1, DVecScalarMultExpr<VT2,ST,true> >::Type
1346  operator*( const DenseVector<VT1,false>& lhs, const DVecScalarMultExpr<VT2,ST,true>& rhs )
1347 {
1349 
1350  return ( (~lhs) * rhs.leftOperand() ) * rhs.rightOperand();
1351 }
1353 //*************************************************************************************************
1354 
1355 
1356 //*************************************************************************************************
1370 template< typename VT1 // Type of the dense vector of the left-hand side expression
1371  , typename ST1 // Type of the scalar of the left-hand side expression
1372  , typename VT2 // Type of the dense vector of the right-hand side expression
1373  , typename ST2 > // Type of the scalar of the right-hand side expression
1374 inline const typename MultExprTrait< DVecScalarMultExpr<VT1,ST1,false>, DVecScalarMultExpr<VT2,ST2,true> >::Type
1375  operator*( const DVecScalarMultExpr<VT1,ST1,false>& lhs, const DVecScalarMultExpr<VT2,ST2,true>& rhs )
1376 {
1378 
1379  return ( lhs.leftOperand() * rhs.leftOperand() ) * ( lhs.rightOperand() * rhs.rightOperand() );
1380 }
1382 //*************************************************************************************************
1383 
1384 
1385 //*************************************************************************************************
1399 template< typename VT1 // Type of the dense vector of the left-hand side expression
1400  , typename ST // Type of the scalar of the left-hand side expression
1401  , bool TF // Transpose flag of the vectors
1402  , typename VT2 > // Type of the right-hand side sparse vector
1403 inline const typename MultExprTrait< DVecScalarMultExpr<VT1,ST,TF>, VT2 >::Type
1404  operator*( const DVecScalarMultExpr<VT1,ST,TF>& lhs, const SparseVector<VT2,TF>& rhs )
1405 {
1407 
1408  return ( lhs.leftOperand() * (~rhs) ) * lhs.rightOperand();
1409 }
1411 //*************************************************************************************************
1412 
1413 
1414 //*************************************************************************************************
1428 template< typename VT1 // Type of the left-hand side sparse vector
1429  , bool TF // Transpose flag of the vectors
1430  , typename VT2 // Type of the dense vector of the right-hand side expression
1431  , typename ST > // Type of the scalar of the right-hand side expression
1432 inline const typename MultExprTrait< VT1, DVecScalarMultExpr<VT2,ST,TF> >::Type
1433  operator*( const SparseVector<VT1,TF>& lhs, const DVecScalarMultExpr<VT2,ST,TF>& rhs )
1434 {
1436 
1437  return ( (~lhs) * rhs.leftOperand() ) * rhs.rightOperand();
1438 }
1440 //*************************************************************************************************
1441 
1442 
1443 //*************************************************************************************************
1458 template< typename VT1 // Type of the dense vector of the left-hand side expression
1459  , typename ST1 // Type of the scalar of the left-hand side expression
1460  , bool TF // Transpose flag of the vectors
1461  , typename VT2 // Type of the sparse vector of the right-hand side expression
1462  , typename ST2 > // Type of the scalar o the right-hand side expression
1463 inline const typename MultExprTrait< DVecScalarMultExpr<VT1,ST1,TF>, SVecScalarMultExpr<VT2,ST2,TF> >::Type
1464  operator*( const DVecScalarMultExpr<VT1,ST1,TF>& lhs, const SVecScalarMultExpr<VT2,ST2,TF>& rhs )
1465 {
1467 
1468  return ( lhs.leftOperand() * rhs.leftOperand() ) * ( lhs.rightOperand() * rhs.rightOperand() );
1469 }
1471 //*************************************************************************************************
1472 
1473 
1474 //*************************************************************************************************
1489 template< typename VT1 // Type of the sparse vector of the left-hand side expression
1490  , typename ST1 // Type of the scalar of the left-hand side expression
1491  , bool TF // Transpose flag of the vectors
1492  , typename VT2 // Type of the dense vector of the right-hand side expression
1493  , typename ST2 > // Type of the scalar o the right-hand side expression
1494 inline const typename MultExprTrait< SVecScalarMultExpr<VT1,ST1,TF>, DVecScalarMultExpr<VT2,ST2,TF> >::Type
1495  operator*( const SVecScalarMultExpr<VT1,ST1,TF>& lhs, const DVecScalarMultExpr<VT2,ST2,TF>& rhs )
1496 {
1498 
1499  return ( lhs.leftOperand() * rhs.leftOperand() ) * ( lhs.rightOperand() * rhs.rightOperand() );
1500 }
1502 //*************************************************************************************************
1503 
1504 
1505 //*************************************************************************************************
1519 template< typename VT1 // Type of the dense vector of the left-hand side expression
1520  , typename ST // Type of the scalar of the left-hand side expression
1521  , typename VT2 > // Type of the right-hand side sparse vector
1522 inline const typename MultExprTrait< DVecScalarMultExpr<VT1,ST,false>, VT2 >::Type
1523  operator*( const DVecScalarMultExpr<VT1,ST,false>& lhs, const SparseVector<VT2,true>& rhs )
1524 {
1526 
1527  return ( lhs.leftOperand() * (~rhs) ) * lhs.rightOperand();
1528 }
1530 //*************************************************************************************************
1531 
1532 
1533 //*************************************************************************************************
1547 template< typename VT1 // Type of the left-hand side sparse vector
1548  , typename VT2 // Type of the dense vector of the right-hand side expression
1549  , typename ST > // Type of the scalar of the right-hand side expression
1550 inline const typename MultExprTrait< VT1, DVecScalarMultExpr<VT2,ST,true> >::Type
1551  operator*( const SparseVector<VT1,false>& lhs, const DVecScalarMultExpr<VT2,ST,true>& rhs )
1552 {
1554 
1555  return ( (~lhs) * rhs.leftOperand() ) * rhs.rightOperand();
1556 }
1558 //*************************************************************************************************
1559 
1560 
1561 //*************************************************************************************************
1576 template< typename VT1 // Type of the dense vector of the left-hand side expression
1577  , typename ST1 // Type of the scalar of the left-hand side expression
1578  , typename VT2 // Type of the sparse vector of the right-hand side expression
1579  , typename ST2 > // Type of the scalar o the right-hand side expression
1580 inline const typename MultExprTrait< DVecScalarMultExpr<VT1,ST1,false>, SVecScalarMultExpr<VT2,ST2,true> >::Type
1581  operator*( const DVecScalarMultExpr<VT1,ST1,false>& lhs, const SVecScalarMultExpr<VT2,ST2,true>& rhs )
1582 {
1584 
1585  return ( lhs.leftOperand() * rhs.leftOperand() ) * ( lhs.rightOperand() * rhs.rightOperand() );
1586 }
1588 //*************************************************************************************************
1589 
1590 
1591 //*************************************************************************************************
1606 template< typename VT1 // Type of the sparse vector of the left-hand side expression
1607  , typename ST1 // Type of the scalar of the left-hand side expression
1608  , typename VT2 // Type of the dense vector of the right-hand side expression
1609  , typename ST2 > // Type of the scalar o the right-hand side expression
1610 inline const typename MultExprTrait< SVecScalarMultExpr<VT1,ST1,false>, DVecScalarMultExpr<VT2,ST2,true> >::Type
1611  operator*( const SVecScalarMultExpr<VT1,ST1,false>& lhs, const DVecScalarMultExpr<VT2,ST2,true>& rhs )
1612 {
1614 
1615  return ( lhs.leftOperand() * rhs.leftOperand() ) * ( lhs.rightOperand() * rhs.rightOperand() );
1616 }
1618 //*************************************************************************************************
1619 
1620 
1621 //*************************************************************************************************
1635 template< typename MT // Type of the left-hand side dense matrix
1636  , bool SO // Storage order of the left-hand side dense matrix
1637  , typename VT // Type of the dense vector of the right-hand side expression
1638  , typename ST > // Type of the scalar of the right-hand side expression
1639 inline const typename MultExprTrait< MT, DVecScalarMultExpr<VT,ST,false> >::Type
1640  operator*( const DenseMatrix<MT,SO>& mat, const DVecScalarMultExpr<VT,ST,false>& vec )
1641 {
1643 
1644  return ( (~mat) * vec.leftOperand() ) * vec.rightOperand();
1645 }
1647 //*************************************************************************************************
1648 
1649 
1650 //*************************************************************************************************
1664 template< typename VT // Type of the dense vector of the left-hand side expression
1665  , typename ST // Type of the scalar of the left-hand side expression
1666  , typename MT // Type of the right-hand side dense matrix
1667  , bool SO > // Storage order of the right-hand side dense matrix
1668 inline const typename MultExprTrait< DVecScalarMultExpr<VT,ST,true>, MT >::Type
1669  operator*( const DVecScalarMultExpr<VT,ST,true>& vec, const DenseMatrix<MT,SO>& mat )
1670 {
1672 
1673  return ( vec.leftOperand() * (~mat) ) * vec.rightOperand();
1674 }
1676 //*************************************************************************************************
1677 
1678 
1679 //*************************************************************************************************
1693 template< typename MT // Type of the left-hand side sparse matrix
1694  , bool SO // Storage order of the left-hand side sparse matrix
1695  , typename VT // Type of the dense vector of the right-hand side expression
1696  , typename ST > // Type of the scalar of the right-hand side expression
1697 inline const typename MultExprTrait< MT, DVecScalarMultExpr<VT,ST,false> >::Type
1698  operator*( const SparseMatrix<MT,SO>& mat, const DVecScalarMultExpr<VT,ST,false>& vec )
1699 {
1701 
1702  return ( (~mat) * vec.leftOperand() ) * vec.rightOperand();
1703 }
1705 //*************************************************************************************************
1706 
1707 
1708 //*************************************************************************************************
1722 template< typename VT // Type of the dense vector of the left-hand side expression
1723  , typename ST // Type of the scalar of the left-hand side expression
1724  , typename MT // Type of the right-hand side sparse matrix
1725  , bool SO > // Storage order of the right-hand side sparse matrix
1726 inline const typename MultExprTrait< DVecScalarMultExpr<VT,ST,true>, MT >::Type
1727  operator*( const DVecScalarMultExpr<VT,ST,true>& vec, const SparseMatrix<MT,SO>& mat )
1728 {
1730 
1731  return ( vec.leftOperand() * (~mat) ) * vec.rightOperand();
1732 }
1734 //*************************************************************************************************
1735 
1736 
1737 
1738 
1739 //=================================================================================================
1740 //
1741 // SIZE SPECIALIZATIONS
1742 //
1743 //=================================================================================================
1744 
1745 //*************************************************************************************************
1747 template< typename VT, typename ST, bool TF >
1748 struct Size< DVecScalarMultExpr<VT,ST,TF> >
1749  : public Size<VT>
1750 {};
1752 //*************************************************************************************************
1753 
1754 
1755 
1756 
1757 //=================================================================================================
1758 //
1759 // DVECSCALARMULTEXPRTRAIT SPECIALIZATIONS
1760 //
1761 //=================================================================================================
1762 
1763 //*************************************************************************************************
1765 template< typename VT, typename ST1, typename ST2 >
1766 struct DVecScalarMultExprTrait< DVecScalarMultExpr<VT,ST1,false>, ST2 >
1767 {
1768  public:
1769  //**********************************************************************************************
1770  typedef typename SelectType< IsDenseVector<VT>::value && IsColumnVector<VT>::value &&
1771  IsNumeric<ST1>::value && IsNumeric<ST2>::value
1772  , typename DVecScalarMultExprTrait<VT,typename MultTrait<ST1,ST2>::Type>::Type
1773  , INVALID_TYPE >::Type Type;
1774  //**********************************************************************************************
1775 };
1777 //*************************************************************************************************
1778 
1779 
1780 
1781 
1782 //=================================================================================================
1783 //
1784 // TDVECSCALARMULTEXPRTRAIT SPECIALIZATIONS
1785 //
1786 //=================================================================================================
1787 
1788 //*************************************************************************************************
1790 template< typename VT, typename ST1, typename ST2 >
1791 struct TDVecScalarMultExprTrait< DVecScalarMultExpr<VT,ST1,true>, ST2 >
1792 {
1793  public:
1794  //**********************************************************************************************
1795  typedef typename SelectType< IsDenseVector<VT>::value && IsRowVector<VT>::value &&
1796  IsNumeric<ST1>::value && IsNumeric<ST2>::value
1797  , typename TDVecScalarMultExprTrait<VT,typename MultTrait<ST1,ST2>::Type>::Type
1798  , INVALID_TYPE >::Type Type;
1799  //**********************************************************************************************
1800 };
1802 //*************************************************************************************************
1803 
1804 
1805 
1806 
1807 //=================================================================================================
1808 //
1809 // DVECSCALARDIVEXPRTRAIT SPECIALIZATIONS
1810 //
1811 //=================================================================================================
1812 
1813 //*************************************************************************************************
1815 template< typename VT, typename ST1, typename ST2 >
1816 struct DVecScalarDivExprTrait< DVecScalarMultExpr<VT,ST1,false>, ST2 >
1817 {
1818  private:
1819  //**********************************************************************************************
1820  enum { condition = IsFloatingPoint<typename DivTrait<ST1,ST2>::Type>::value };
1821  //**********************************************************************************************
1822 
1823  //**********************************************************************************************
1824  typedef typename DVecScalarMultExprTrait<VT,typename DivTrait<ST1,ST2>::Type>::Type T1;
1825  typedef typename DVecScalarDivExprTrait<VT,typename DivTrait<ST1,ST2>::Type>::Type T2;
1826  //**********************************************************************************************
1827 
1828  public:
1829  //**********************************************************************************************
1830  typedef typename SelectType< IsDenseVector<VT>::value && IsColumnVector<VT>::value &&
1831  IsNumeric<ST1>::value && IsNumeric<ST2>::value
1832  , typename SelectType<condition,T1,T2>::Type
1833  , INVALID_TYPE >::Type Type;
1834  //**********************************************************************************************
1835 };
1837 //*************************************************************************************************
1838 
1839 
1840 
1841 
1842 //=================================================================================================
1843 //
1844 // TDVECSCALARDIVEXPRTRAIT SPECIALIZATIONS
1845 //
1846 //=================================================================================================
1847 
1848 //*************************************************************************************************
1850 template< typename VT, typename ST1, typename ST2 >
1851 struct TDVecScalarDivExprTrait< DVecScalarMultExpr<VT,ST1,true>, ST2 >
1852 {
1853  private:
1854  //**********************************************************************************************
1855  enum { condition = IsFloatingPoint<typename DivTrait<ST1,ST2>::Type>::value };
1856  //**********************************************************************************************
1857 
1858  //**********************************************************************************************
1859  typedef typename TDVecScalarMultExprTrait<VT,typename DivTrait<ST1,ST2>::Type>::Type T1;
1860  typedef typename TDVecScalarDivExprTrait<VT,typename DivTrait<ST1,ST2>::Type>::Type T2;
1861  //**********************************************************************************************
1862 
1863  public:
1864  //**********************************************************************************************
1865  typedef typename SelectType< IsDenseVector<VT>::value && IsRowVector<VT>::value &&
1866  IsNumeric<ST1>::value && IsNumeric<ST2>::value
1867  , typename SelectType<condition,T1,T2>::Type
1868  , INVALID_TYPE >::Type Type;
1869  //**********************************************************************************************
1870 };
1872 //*************************************************************************************************
1873 
1874 
1875 
1876 
1877 //=================================================================================================
1878 //
1879 // DVECDVECMULTEXPRTRAIT SPECIALIZATIONS
1880 //
1881 //=================================================================================================
1882 
1883 //*************************************************************************************************
1885 template< typename VT1, typename ST, typename VT2 >
1886 struct DVecDVecMultExprTrait< DVecScalarMultExpr<VT1,ST,false>, VT2 >
1887 {
1888  public:
1889  //**********************************************************************************************
1890  typedef typename SelectType< IsDenseVector<VT1>::value && IsColumnVector<VT1>::value &&
1891  IsDenseVector<VT2>::value && IsColumnVector<VT2>::value &&
1892  IsNumeric<ST>::value
1893  , typename DVecScalarMultExprTrait<typename DVecDVecMultExprTrait<VT1,VT2>::Type,ST>::Type
1894  , INVALID_TYPE >::Type Type;
1895  //**********************************************************************************************
1896 };
1898 //*************************************************************************************************
1899 
1900 
1901 //*************************************************************************************************
1903 template< typename VT1, typename VT2, typename ST >
1904 struct DVecDVecMultExprTrait< VT1, DVecScalarMultExpr<VT2,ST,false> >
1905 {
1906  public:
1907  //**********************************************************************************************
1908  typedef typename SelectType< IsDenseVector<VT1>::value && IsColumnVector<VT1>::value &&
1909  IsDenseVector<VT2>::value && IsColumnVector<VT2>::value &&
1910  IsNumeric<ST>::value
1911  , typename DVecScalarMultExprTrait<typename DVecDVecMultExprTrait<VT1,VT2>::Type,ST>::Type
1912  , INVALID_TYPE >::Type Type;
1913  //**********************************************************************************************
1914 };
1916 //*************************************************************************************************
1917 
1918 
1919 //*************************************************************************************************
1921 template< typename VT1, typename ST1, typename VT2, typename ST2 >
1922 struct DVecDVecMultExprTrait< DVecScalarMultExpr<VT1,ST1,false>, DVecScalarMultExpr<VT2,ST2,false> >
1923 {
1924  public:
1925  //**********************************************************************************************
1926  typedef typename SelectType< IsDenseVector<VT1>::value && IsColumnVector<VT1>::value &&
1927  IsDenseVector<VT2>::value && IsColumnVector<VT2>::value &&
1928  IsNumeric<ST1>::value && IsNumeric<ST2>::value
1929  , typename DVecScalarMultExprTrait<typename DVecDVecMultExprTrait<VT1,VT2>::Type,typename MultTrait<ST1,ST2>::Type>::Type
1930  , INVALID_TYPE >::Type Type;
1931  //**********************************************************************************************
1932 };
1934 //*************************************************************************************************
1935 
1936 
1937 
1938 
1939 //=================================================================================================
1940 //
1941 // DVECTDVECMULTEXPRTRAIT SPECIALIZATIONS
1942 //
1943 //=================================================================================================
1944 
1945 //*************************************************************************************************
1947 template< typename VT1, typename ST, typename VT2 >
1948 struct DVecTDVecMultExprTrait< DVecScalarMultExpr<VT1,ST,false>, VT2 >
1949 {
1950  public:
1951  //**********************************************************************************************
1952  typedef typename SelectType< IsDenseVector<VT1>::value && IsColumnVector<VT1>::value &&
1953  IsDenseVector<VT2>::value && IsRowVector<VT2>::value &&
1954  IsNumeric<ST>::value
1955  , typename DMatScalarMultExprTrait<typename DVecTDVecMultExprTrait<VT1,VT2>::Type,ST>::Type
1956  , INVALID_TYPE >::Type Type;
1957  //**********************************************************************************************
1958 };
1960 //*************************************************************************************************
1961 
1962 
1963 //*************************************************************************************************
1965 template< typename VT1, typename VT2, typename ST >
1966 struct DVecTDVecMultExprTrait< VT1, DVecScalarMultExpr<VT2,ST,true> >
1967 {
1968  public:
1969  //**********************************************************************************************
1970  typedef typename SelectType< IsDenseVector<VT1>::value && IsColumnVector<VT1>::value &&
1971  IsDenseVector<VT2>::value && IsRowVector<VT2>::value &&
1972  IsNumeric<ST>::value
1973  , typename DMatScalarMultExprTrait<typename DVecTDVecMultExprTrait<VT1,VT2>::Type,ST>::Type
1974  , INVALID_TYPE >::Type Type;
1975  //**********************************************************************************************
1976 };
1978 //*************************************************************************************************
1979 
1980 
1981 //*************************************************************************************************
1983 template< typename VT1, typename ST1, typename VT2, typename ST2 >
1984 struct DVecTDVecMultExprTrait< DVecScalarMultExpr<VT1,ST1,false>, DVecScalarMultExpr<VT2,ST2,true> >
1985 {
1986  public:
1987  //**********************************************************************************************
1988  typedef typename SelectType< IsDenseVector<VT1>::value && IsColumnVector<VT1>::value &&
1989  IsDenseVector<VT2>::value && IsRowVector<VT2>::value &&
1990  IsNumeric<ST1>::value && IsNumeric<ST2>::value
1991  , typename DMatScalarMultExprTrait<typename DVecTDVecMultExprTrait<VT1,VT2>::Type,typename MultTrait<ST1,ST2>::Type>::Type
1992  , INVALID_TYPE >::Type Type;
1993  //**********************************************************************************************
1994 };
1996 //*************************************************************************************************
1997 
1998 
1999 
2000 
2001 //=================================================================================================
2002 //
2003 // TDVECTDVECMULTEXPRTRAIT SPECIALIZATIONS
2004 //
2005 //=================================================================================================
2006 
2007 //*************************************************************************************************
2009 template< typename VT1, typename ST, typename VT2 >
2010 struct TDVecTDVecMultExprTrait< DVecScalarMultExpr<VT1,ST,true>, VT2 >
2011 {
2012  public:
2013  //**********************************************************************************************
2014  typedef typename SelectType< IsDenseVector<VT1>::value && IsRowVector<VT1>::value &&
2015  IsDenseVector<VT2>::value && IsRowVector<VT2>::value &&
2016  IsNumeric<ST>::value
2017  , typename TDVecScalarMultExprTrait<typename TDVecTDVecMultExprTrait<VT1,VT2>::Type,ST>::Type
2018  , INVALID_TYPE >::Type Type;
2019  //**********************************************************************************************
2020 };
2022 //*************************************************************************************************
2023 
2024 
2025 //*************************************************************************************************
2027 template< typename VT1, typename VT2, typename ST >
2028 struct TDVecTDVecMultExprTrait< VT1, DVecScalarMultExpr<VT2,ST,true> >
2029 {
2030  public:
2031  //**********************************************************************************************
2032  typedef typename SelectType< IsDenseVector<VT1>::value && IsRowVector<VT1>::value &&
2033  IsDenseVector<VT2>::value && IsRowVector<VT2>::value &&
2034  IsNumeric<ST>::value
2035  , typename TDVecScalarMultExprTrait<typename TDVecTDVecMultExprTrait<VT1,VT2>::Type,ST>::Type
2036  , INVALID_TYPE >::Type Type;
2037  //**********************************************************************************************
2038 };
2040 //*************************************************************************************************
2041 
2042 
2043 //*************************************************************************************************
2045 template< typename VT1, typename ST1, typename VT2, typename ST2 >
2046 struct TDVecTDVecMultExprTrait< DVecScalarMultExpr<VT1,ST1,true>, DVecScalarMultExpr<VT2,ST2,true> >
2047 {
2048  public:
2049  //**********************************************************************************************
2050  typedef typename SelectType< IsDenseVector<VT1>::value && IsRowVector<VT1>::value &&
2051  IsDenseVector<VT2>::value && IsRowVector<VT2>::value &&
2052  IsNumeric<ST1>::value && IsNumeric<ST2>::value
2053  , typename TDVecScalarMultExprTrait<typename TDVecTDVecMultExprTrait<VT1,VT2>::Type,typename MultTrait<ST1,ST2>::Type>::Type
2054  , INVALID_TYPE >::Type Type;
2055  //**********************************************************************************************
2056 };
2058 //*************************************************************************************************
2059 
2060 
2061 
2062 
2063 //=================================================================================================
2064 //
2065 // DVECSVECMULTEXPRTRAIT SPECIALIZATIONS
2066 //
2067 //=================================================================================================
2068 
2069 //*************************************************************************************************
2071 template< typename VT1, typename VT2, typename ST >
2072 struct DVecSVecMultExprTrait< DVecScalarMultExpr<VT1,ST,false>, VT2 >
2073 {
2074  public:
2075  //**********************************************************************************************
2076  typedef typename SelectType< IsDenseVector<VT1>::value && IsColumnVector<VT1>::value &&
2077  IsSparseVector<VT2>::value && IsColumnVector<VT2>::value &&
2078  IsNumeric<ST>::value
2079  , typename SVecScalarMultExprTrait<typename DVecSVecMultExprTrait<VT1,VT2>::Type,ST>::Type
2080  , INVALID_TYPE >::Type Type;
2081  //**********************************************************************************************
2082 };
2084 //*************************************************************************************************
2085 
2086 
2087 //*************************************************************************************************
2089 template< typename VT1, typename ST1, typename VT2, typename ST2 >
2090 struct DVecSVecMultExprTrait< DVecScalarMultExpr<VT1,ST1,false>, SVecScalarMultExpr<VT2,ST2,false> >
2091 {
2092  public:
2093  //**********************************************************************************************
2094  typedef typename SelectType< IsDenseVector<VT1>::value && IsColumnVector<VT1>::value &&
2095  IsSparseVector<VT2>::value && IsColumnVector<VT2>::value &&
2096  IsNumeric<ST1>::value && IsNumeric<ST2>::value
2097  , typename SVecScalarMultExprTrait<typename DVecSVecMultExprTrait<VT1,VT2>::Type,typename MultTrait<ST1,ST2>::Type>::Type
2098  , INVALID_TYPE >::Type Type;
2099  //**********************************************************************************************
2100 };
2102 //*************************************************************************************************
2103 
2104 
2105 
2106 
2107 //=================================================================================================
2108 //
2109 // DVECTSVECMULTEXPRTRAIT SPECIALIZATIONS
2110 //
2111 //=================================================================================================
2112 
2113 //*************************************************************************************************
2115 template< typename VT1, typename ST, typename VT2 >
2116 struct DVecTSVecMultExprTrait< DVecScalarMultExpr<VT1,ST,false>, VT2 >
2117 {
2118  public:
2119  //**********************************************************************************************
2120  typedef typename SelectType< IsDenseVector<VT1>::value && IsColumnVector<VT1>::value &&
2121  IsSparseVector<VT2>::value && IsRowVector<VT2>::value &&
2122  IsNumeric<ST>::value
2123  , typename SMatScalarMultExprTrait<typename DVecTSVecMultExprTrait<VT1,VT2>::Type,ST>::Type
2124  , INVALID_TYPE >::Type Type;
2125  //**********************************************************************************************
2126 };
2128 //*************************************************************************************************
2129 
2130 
2131 //*************************************************************************************************
2133 template< typename VT1, typename ST1, typename VT2, typename ST2 >
2134 struct DVecTSVecMultExprTrait< DVecScalarMultExpr<VT1,ST1,false>, SVecScalarMultExpr<VT2,ST2,true> >
2135 {
2136  public:
2137  //**********************************************************************************************
2138  typedef typename SelectType< IsDenseVector<VT1>::value && IsColumnVector<VT1>::value &&
2139  IsSparseVector<VT2>::value && IsRowVector<VT2>::value &&
2140  IsNumeric<ST1>::value && IsNumeric<ST2>::value
2141  , typename SMatScalarMultExprTrait<typename DVecTSVecMultExprTrait<VT1,VT2>::Type,typename MultTrait<ST1,ST2>::Type>::Type
2142  , INVALID_TYPE >::Type Type;
2143  //**********************************************************************************************
2144 };
2146 //*************************************************************************************************
2147 
2148 
2149 
2150 
2151 //=================================================================================================
2152 //
2153 // TDVECTSVECMULTEXPRTRAIT SPECIALIZATIONS
2154 //
2155 //=================================================================================================
2156 
2157 //*************************************************************************************************
2159 template< typename VT1, typename ST, typename VT2 >
2160 struct TDVecTSVecMultExprTrait< DVecScalarMultExpr<VT1,ST,true>, VT2 >
2161 {
2162  public:
2163  //**********************************************************************************************
2164  typedef typename SelectType< IsDenseVector<VT1>::value && IsRowVector<VT1>::value &&
2165  IsSparseVector<VT2>::value && IsRowVector<VT2>::value &&
2166  IsNumeric<ST>::value
2167  , typename TSVecScalarMultExprTrait<typename TDVecTSVecMultExprTrait<VT1,VT2>::Type,ST>::Type
2168  , INVALID_TYPE >::Type Type;
2169  //**********************************************************************************************
2170 };
2172 //*************************************************************************************************
2173 
2174 
2175 //*************************************************************************************************
2177 template< typename VT1, typename ST1, typename VT2, typename ST2 >
2178 struct TDVecTSVecMultExprTrait< DVecScalarMultExpr<VT1,ST1,true>, SVecScalarMultExpr<VT2,ST2,true> >
2179 {
2180  public:
2181  //**********************************************************************************************
2182  typedef typename SelectType< IsDenseVector<VT1>::value && IsRowVector<VT1>::value &&
2183  IsSparseVector<VT2>::value && IsRowVector<VT2>::value &&
2184  IsNumeric<ST1>::value && IsNumeric<ST2>::value
2185  , typename TSVecScalarMultExprTrait<typename TDVecTSVecMultExprTrait<VT1,VT2>::Type,typename MultTrait<ST1,ST2>::Type>::Type
2186  , INVALID_TYPE >::Type Type;
2187  //**********************************************************************************************
2188 };
2190 //*************************************************************************************************
2191 
2192 
2193 
2194 
2195 //=================================================================================================
2196 //
2197 // SVECDVECMULTEXPRTRAIT SPECIALIZATIONS
2198 //
2199 //=================================================================================================
2200 
2201 //*************************************************************************************************
2203 template< typename VT1, typename VT2, typename ST >
2204 struct SVecDVecMultExprTrait< VT1, DVecScalarMultExpr<VT2,ST,false> >
2205 {
2206  public:
2207  //**********************************************************************************************
2208  typedef typename SelectType< IsSparseVector<VT1>::value && IsColumnVector<VT1>::value &&
2209  IsDenseVector<VT2>::value && IsColumnVector<VT2>::value &&
2210  IsNumeric<ST>::value
2211  , typename SVecScalarMultExprTrait<typename SVecDVecMultExprTrait<VT1,VT2>::Type,ST>::Type
2212  , INVALID_TYPE >::Type Type;
2213  //**********************************************************************************************
2214 };
2216 //*************************************************************************************************
2217 
2218 
2219 //*************************************************************************************************
2221 template< typename VT1, typename ST1, typename VT2, typename ST2 >
2222 struct SVecDVecMultExprTrait< SVecScalarMultExpr<VT1,ST1,false>, DVecScalarMultExpr<VT2,ST2,false> >
2223 {
2224  public:
2225  //**********************************************************************************************
2226  typedef typename SelectType< IsSparseVector<VT1>::value && IsColumnVector<VT1>::value &&
2227  IsDenseVector<VT2>::value && IsColumnVector<VT2>::value &&
2228  IsNumeric<ST1>::value && IsNumeric<ST2>::value
2229  , typename SVecScalarMultExprTrait<typename SVecDVecMultExprTrait<VT1,VT2>::Type,typename MultTrait<ST1,ST2>::Type>::Type
2230  , INVALID_TYPE >::Type Type;
2231  //**********************************************************************************************
2232 };
2234 //*************************************************************************************************
2235 
2236 
2237 
2238 
2239 //=================================================================================================
2240 //
2241 // SVECTDVECMULTEXPRTRAIT SPECIALIZATIONS
2242 //
2243 //=================================================================================================
2244 
2245 //*************************************************************************************************
2247 template< typename VT1, typename VT2, typename ST >
2248 struct SVecTDVecMultExprTrait< VT1, DVecScalarMultExpr<VT2,ST,true> >
2249 {
2250  public:
2251  //**********************************************************************************************
2252  typedef typename SelectType< IsSparseVector<VT1>::value && IsColumnVector<VT1>::value &&
2253  IsDenseVector<VT2>::value && IsRowVector<VT2>::value &&
2254  IsNumeric<ST>::value
2255  , typename TSMatScalarMultExprTrait<typename SVecTDVecMultExprTrait<VT1,VT2>::Type,ST>::Type
2256  , INVALID_TYPE >::Type Type;
2257  //**********************************************************************************************
2258 };
2260 //*************************************************************************************************
2261 
2262 
2263 //*************************************************************************************************
2265 template< typename VT1, typename ST1, typename VT2, typename ST2 >
2266 struct SVecTDVecMultExprTrait< SVecScalarMultExpr<VT1,ST1,false>, DVecScalarMultExpr<VT2,ST2,true> >
2267 {
2268  public:
2269  //**********************************************************************************************
2270  typedef typename SelectType< IsSparseVector<VT1>::value && IsColumnVector<VT1>::value &&
2271  IsDenseVector<VT2>::value && IsRowVector<VT2>::value &&
2272  IsNumeric<ST1>::value && IsNumeric<ST2>::value
2273  , typename TSMatScalarMultExprTrait<typename SVecTDVecMultExprTrait<VT1,VT2>::Type,typename MultTrait<ST1,ST2>::Type>::Type
2274  , INVALID_TYPE >::Type Type;
2275  //**********************************************************************************************
2276 };
2278 //*************************************************************************************************
2279 
2280 
2281 
2282 
2283 //=================================================================================================
2284 //
2285 // TSVECTDVECMULTEXPRTRAIT SPECIALIZATIONS
2286 //
2287 //=================================================================================================
2288 
2289 //*************************************************************************************************
2291 template< typename VT1, typename VT2, typename ST >
2292 struct TSVecTDVecMultExprTrait< VT1, DVecScalarMultExpr<VT2,ST,true> >
2293 {
2294  public:
2295  //**********************************************************************************************
2296  typedef typename SelectType< IsSparseVector<VT1>::value && IsRowVector<VT1>::value &&
2297  IsDenseVector<VT2>::value && IsRowVector<VT2>::value &&
2298  IsNumeric<ST>::value
2299  , typename TSVecScalarMultExprTrait<typename TSVecTDVecMultExprTrait<VT1,VT2>::Type,ST>::Type
2300  , INVALID_TYPE >::Type Type;
2301  //**********************************************************************************************
2302 };
2304 //*************************************************************************************************
2305 
2306 
2307 //*************************************************************************************************
2309 template< typename VT1, typename ST1, typename VT2, typename ST2 >
2310 struct TSVecTDVecMultExprTrait< SVecScalarMultExpr<VT1,ST1,true>, DVecScalarMultExpr<VT2,ST2,true> >
2311 {
2312  public:
2313  //**********************************************************************************************
2314  typedef typename SelectType< IsSparseVector<VT1>::value && IsRowVector<VT1>::value &&
2315  IsDenseVector<VT2>::value && IsRowVector<VT2>::value &&
2316  IsNumeric<ST1>::value && IsNumeric<ST2>::value
2317  , typename TSVecScalarMultExprTrait<typename TSVecTDVecMultExprTrait<VT1,VT2>::Type,typename MultTrait<ST1,ST2>::Type>::Type
2318  , INVALID_TYPE >::Type Type;
2319  //**********************************************************************************************
2320 };
2322 //*************************************************************************************************
2323 
2324 
2325 
2326 
2327 //=================================================================================================
2328 //
2329 // DMATDVECMULTEXPRTRAIT SPECIALIZATIONS
2330 //
2331 //=================================================================================================
2332 
2333 //*************************************************************************************************
2335 template< typename MT, typename VT, typename ST >
2336 struct DMatDVecMultExprTrait< MT, DVecScalarMultExpr<VT,ST,false> >
2337 {
2338  public:
2339  //**********************************************************************************************
2340  typedef typename SelectType< IsDenseMatrix<MT>::value && IsRowMajorMatrix<MT>::value &&
2341  IsDenseVector<VT>::value && IsColumnVector<VT>::value &&
2342  IsNumeric<ST>::value
2343  , typename DVecScalarMultExprTrait<typename DMatDVecMultExprTrait<MT,VT>::Type,ST>::Type
2344  , INVALID_TYPE >::Type Type;
2345  //**********************************************************************************************
2346 };
2348 //*************************************************************************************************
2349 
2350 
2351 
2352 
2353 //=================================================================================================
2354 //
2355 // TDMATDVECMULTEXPRTRAIT SPECIALIZATIONS
2356 //
2357 //=================================================================================================
2358 
2359 //*************************************************************************************************
2361 template< typename MT, typename VT, typename ST >
2362 struct TDMatDVecMultExprTrait< MT, DVecScalarMultExpr<VT,ST,false> >
2363 {
2364  public:
2365  //**********************************************************************************************
2366  typedef typename SelectType< IsDenseMatrix<MT>::value && IsColumnMajorMatrix<MT>::value &&
2367  IsDenseVector<VT>::value && IsColumnVector<VT>::value &&
2368  IsNumeric<ST>::value
2369  , typename DVecScalarMultExprTrait<typename TDMatDVecMultExprTrait<MT,VT>::Type,ST>::Type
2370  , INVALID_TYPE >::Type Type;
2371  //**********************************************************************************************
2372 };
2374 //*************************************************************************************************
2375 
2376 
2377 
2378 
2379 //=================================================================================================
2380 //
2381 // TDVECDMATMULTEXPRTRAIT SPECIALIZATIONS
2382 //
2383 //=================================================================================================
2384 
2385 //*************************************************************************************************
2387 template< typename VT, typename MT, typename ST >
2388 struct TDVecDMatMultExprTrait< DVecScalarMultExpr<VT,ST,true>, MT >
2389 {
2390  public:
2391  //**********************************************************************************************
2392  typedef typename SelectType< IsDenseVector<VT>::value && IsRowVector<VT>::value &&
2393  IsDenseMatrix<MT>::value && IsRowMajorMatrix<MT>::value &&
2394  IsNumeric<ST>::value
2395  , typename TDVecScalarMultExprTrait<typename TDVecDMatMultExprTrait<VT,MT>::Type,ST>::Type
2396  , INVALID_TYPE >::Type Type;
2397  //**********************************************************************************************
2398 };
2400 //*************************************************************************************************
2401 
2402 
2403 
2404 
2405 //=================================================================================================
2406 //
2407 // TDVECTDMATMULTEXPRTRAIT SPECIALIZATIONS
2408 //
2409 //=================================================================================================
2410 
2411 //*************************************************************************************************
2413 template< typename VT, typename MT, typename ST >
2414 struct TDVecTDMatMultExprTrait< DVecScalarMultExpr<VT,ST,true>, MT >
2415 {
2416  public:
2417  //**********************************************************************************************
2418  typedef typename SelectType< IsDenseVector<VT>::value && IsRowVector<VT>::value &&
2419  IsDenseMatrix<MT>::value && IsColumnMajorMatrix<MT>::value &&
2420  IsNumeric<ST>::value
2421  , typename TDVecScalarMultExprTrait<typename TDVecTDMatMultExprTrait<VT,MT>::Type,ST>::Type
2422  , INVALID_TYPE >::Type Type;
2423  //**********************************************************************************************
2424 };
2426 //*************************************************************************************************
2427 
2428 
2429 
2430 
2431 //=================================================================================================
2432 //
2433 // SMATDVECMULTEXPRTRAIT SPECIALIZATIONS
2434 //
2435 //=================================================================================================
2436 
2437 //*************************************************************************************************
2439 template< typename MT, typename VT, typename ST >
2440 struct SMatDVecMultExprTrait< MT, DVecScalarMultExpr<VT,ST,false> >
2441 {
2442  public:
2443  //**********************************************************************************************
2444  typedef typename SelectType< IsSparseMatrix<MT>::value && IsRowMajorMatrix<MT>::value &&
2445  IsDenseVector<VT>::value && IsColumnVector<VT>::value &&
2446  IsNumeric<ST>::value
2447  , typename DVecScalarMultExprTrait<typename SMatDVecMultExprTrait<MT,VT>::Type,ST>::Type
2448  , INVALID_TYPE >::Type Type;
2449  //**********************************************************************************************
2450 };
2452 //*************************************************************************************************
2453 
2454 
2455 
2456 
2457 //=================================================================================================
2458 //
2459 // TSMATDVECMULTEXPRTRAIT SPECIALIZATIONS
2460 //
2461 //=================================================================================================
2462 
2463 //*************************************************************************************************
2465 template< typename MT, typename VT, typename ST >
2466 struct TSMatDVecMultExprTrait< MT, DVecScalarMultExpr<VT,ST,false> >
2467 {
2468  public:
2469  //**********************************************************************************************
2470  typedef typename SelectType< IsSparseMatrix<MT>::value && IsColumnMajorMatrix<MT>::value &&
2471  IsDenseVector<VT>::value && IsColumnVector<VT>::value &&
2472  IsNumeric<ST>::value
2473  , typename DVecScalarMultExprTrait<typename TSMatDVecMultExprTrait<MT,VT>::Type,ST>::Type
2474  , INVALID_TYPE >::Type Type;
2475  //**********************************************************************************************
2476 };
2478 //*************************************************************************************************
2479 
2480 
2481 
2482 
2483 //=================================================================================================
2484 //
2485 // TDVECSMATMULTEXPRTRAIT SPECIALIZATIONS
2486 //
2487 //=================================================================================================
2488 
2489 //*************************************************************************************************
2491 template< typename VT, typename MT, typename ST >
2492 struct TDVecSMatMultExprTrait< DVecScalarMultExpr<VT,ST,true>, MT >
2493 {
2494  public:
2495  //**********************************************************************************************
2496  typedef typename SelectType< IsDenseVector<VT>::value && IsRowVector<VT>::value &&
2497  IsSparseMatrix<MT>::value && IsRowMajorMatrix<MT>::value &&
2498  IsNumeric<ST>::value
2499  , typename TDVecScalarMultExprTrait<typename TDVecSMatMultExprTrait<VT,MT>::Type,ST>::Type
2500  , INVALID_TYPE >::Type Type;
2501  //**********************************************************************************************
2502 };
2504 //*************************************************************************************************
2505 
2506 
2507 
2508 
2509 //=================================================================================================
2510 //
2511 // TDVECTSMATMULTEXPRTRAIT SPECIALIZATIONS
2512 //
2513 //=================================================================================================
2514 
2515 //*************************************************************************************************
2517 template< typename VT, typename MT, typename ST >
2518 struct TDVecTSMatMultExprTrait< DVecScalarMultExpr<VT,ST,true>, MT >
2519 {
2520  public:
2521  //**********************************************************************************************
2522  typedef typename SelectType< IsDenseVector<VT>::value && IsRowVector<VT>::value &&
2523  IsSparseMatrix<MT>::value && IsColumnMajorMatrix<MT>::value &&
2524  IsNumeric<ST>::value
2525  , typename TDVecScalarMultExprTrait<typename TDVecTSMatMultExprTrait<VT,MT>::Type,ST>::Type
2526  , INVALID_TYPE >::Type Type;
2527  //**********************************************************************************************
2528 };
2530 //*************************************************************************************************
2531 
2532 
2533 
2534 
2535 //=================================================================================================
2536 //
2537 // SUBVECTOREXPRTRAIT SPECIALIZATIONS
2538 //
2539 //=================================================================================================
2540 
2541 //*************************************************************************************************
2543 template< typename VT, typename ST, bool TF, bool AF >
2544 struct SubvectorExprTrait< DVecScalarMultExpr<VT,ST,TF>, AF >
2545 {
2546  public:
2547  //**********************************************************************************************
2548  typedef typename MultExprTrait< typename SubvectorExprTrait<const VT,AF>::Type, ST >::Type Type;
2549  //**********************************************************************************************
2550 };
2552 //*************************************************************************************************
2553 
2554 } // namespace blaze
2555 
2556 #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.
BLAZE_ALWAYS_INLINE 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:879
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:8247
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:939
Header file for basic type definitions.
Header file for the SparseVector base class.
IntrinsicTrait< ElementType >::Type IntrinsicType
Resulting intrinsic element type.
Definition: DVecScalarMultExpr.h:174
ReturnType operator*() const
Direct access to the element at the current iterator position.
Definition: DVecScalarMultExpr.h:296
BLAZE_ALWAYS_INLINE size_t size(const Vector< VT, TF > &vector)
Returns the current size/dimension of the vector.
Definition: Vector.h:264
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:497
Efficient implementation of a compressed matrix.The CompressedMatrix class template is the represent...
Definition: CompressedMatrix.h:209
const ConstIterator operator++(int)
Post-increment operator.
Definition: DVecScalarMultExpr.h:265
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:2507
Header file for the IsRowVector type trait.
Type ElementType
Type of the sparse matrix elements.
Definition: CompressedMatrix.h:261
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:460
const DMatSerialExpr< MT, SO > serial(const DenseMatrix< MT, SO > &dm)
Forces the serial evaluation of the given dense matrix expression dm.
Definition: DMatSerialExpr.h:699
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:131
bool operator!=(const ConstIterator &rhs) const
Inequality comparison between two ConstIterator objects.
Definition: DVecScalarMultExpr.h:328
ConstIterator(IteratorType iterator, RightOperand scalar)
Constructor for the ConstIterator class.
Definition: DVecScalarMultExpr.h:219
Header file for the VecScalarMultExpr base class.
LeftOperand leftOperand() const
Returns the left-hand side dense vector operand.
Definition: DVecScalarMultExpr.h:517
ResultType::ElementType ElementType
Resulting element type.
Definition: DVecScalarMultExpr.h:173
Constraint on the data type.
ValueType value_type
Type of the underlying elements.
Definition: DVecScalarMultExpr.h:204
bool operator<=(const ConstIterator &rhs) const
Less-than comparison between two ConstIterator objects.
Definition: DVecScalarMultExpr.h:361
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:561
PointerType pointer
Pointer return type.
Definition: DVecScalarMultExpr.h:205
VT::ConstIterator IteratorType
ConstIterator type of the dense vector expression.
Definition: DVecScalarMultExpr.h:210
SelectType< IsExpression< VT >::value, const VT, const VT & >::Type LeftOperand
Composite type of the left-hand side dense vector expression.
Definition: DVecScalarMultExpr.h:183
Header file for the MultExprTrait class template.
Compile time check to query the requirement to evaluate an expression.Via this type trait it is possi...
Definition: RequiresEvaluation.h:90
const This & CompositeType
Data type for composite expression templates.
Definition: CompressedMatrix.h:263
DVecScalarMultExpr(const VT &vector, ST scalar)
Constructor for the DVecScalarMultExpr class.
Definition: DVecScalarMultExpr.h:448
ptrdiff_t DifferenceType
Difference between two iterators.
Definition: DVecScalarMultExpr.h:200
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.
Namespace of the Blaze C++ math library.
Definition: Blaze.h:57
#define BLAZE_ALWAYS_INLINE
Platform dependent setup of an enforced inline keyword.
Definition: Inline.h:85
Header file for the IsFloatingPoint type trait.
const Element * ConstIterator
Iterator over constant elements.
Definition: CompressedMatrix.h:2511
bool canAlias(const T *alias) const
Returns whether the expression can alias with the given address alias.
Definition: DVecScalarMultExpr.h:539
BLAZE_ALWAYS_INLINE IntrinsicType load(size_t index) const
Access to the intrinsic elements of the vector.
Definition: DVecScalarMultExpr.h:472
Iterator over the elements of the dense vector.
Definition: DVecScalarMultExpr.h:192
Header file for the DenseMatrix base class.
BLAZE_ALWAYS_INLINE 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:635
const SelectType< returnExpr, ExprReturnType, ElementType >::Type ReturnType
Return type for expression template evaluations.
Definition: DVecScalarMultExpr.h:177
bool operator>(const ConstIterator &rhs) const
Greater-than comparison between two ConstIterator objects.
Definition: DVecScalarMultExpr.h:350
ResultType::TransposeType TransposeType
Transpose type for expression template evaluations.
Definition: DVecScalarMultExpr.h:172
bool operator>=(const ConstIterator &rhs) const
Greater-than comparison between two ConstIterator objects.
Definition: DVecScalarMultExpr.h:372
ST RightOperand
Composite type of the right-hand side scalar value.
Definition: DVecScalarMultExpr.h:186
VT::ResultType RT
Result type of the dense vector expression.
Definition: DVecScalarMultExpr.h:115
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:196
Constraint on the data type.
DVecScalarMultExpr< VT, ST, TF > This
Type of this DVecScalarMultExpr instance.
Definition: DVecScalarMultExpr.h:170
Type ElementType
Type of the sparse matrix elements.
Definition: CompressedMatrix.h:2505
bool operator<(const ConstIterator &rhs) const
Less-than comparison between two ConstIterator objects.
Definition: DVecScalarMultExpr.h:339
Header file for the SelectType class template.
LeftOperand vector_
Left-hand side dense vector of the multiplication expression.
Definition: DVecScalarMultExpr.h:578
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:516
Header file for the IsDenseMatrix type trait.
size_t size() const
Returns the current size/dimension of the vector.
Definition: DVecScalarMultExpr.h:507
Header file for the EnableIf class template.
ReferenceType reference
Reference return type.
Definition: DVecScalarMultExpr.h:206
ConstIterator & operator++()
Pre-increment operator.
Definition: DVecScalarMultExpr.h:254
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:571
friend const ConstIterator operator+(const ConstIterator &it, size_t inc)
Addition between a ConstIterator and an integral value.
Definition: DVecScalarMultExpr.h:395
Header file for the IsNumeric type trait.
RightOperand scalar_
Right-hand side scalar of the multiplication expression.
Definition: DVecScalarMultExpr.h:579
ElementType ValueType
Type of the underlying elements.
Definition: DVecScalarMultExpr.h:197
bool operator==(const ConstIterator &rhs) const
Equality comparison between two ConstIterator objects.
Definition: DVecScalarMultExpr.h:317
Base class for all vector/scalar multiplication expression templates.The VecScalarMultExpr class serv...
Definition: VecScalarMultExpr.h:66
EnableIf< IsDenseMatrix< MT1 > >::Type smpSubAssign(Matrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs)
Default implementation of the SMP subtraction assignment of a matrix to dense matrix.
Definition: DenseMatrix.h:160
Header file for the IsSparseVector type trait.
const Type & ReturnType
Return type for expression template evaluations.
Definition: CompressedMatrix.h:2506
Intrinsic characteristics of data types.The IntrinsicTrait class template provides the intrinsic char...
Definition: IntrinsicTrait.h:749
Header file for run time assertion macros.
EnableIf< IsDenseMatrix< MT1 > >::Type smpAssign(Matrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs)
Default implementation of the SMP assignment of a matrix to a dense matrix.
Definition: DenseMatrix.h:98
Utility type for generic codes.
Base template for the MultTrait class.
Definition: MultTrait.h:150
BLAZE_ALWAYS_INLINE 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:742
Header file for the division trait.
IteratorType iterator_
Iterator to the current element.
Definition: DVecScalarMultExpr.h:426
bool isAliased(const T *alias) const
Returns whether the expression is aliased with the given address alias.
Definition: DVecScalarMultExpr.h:551
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:527
VT::ElementType ET
Element type of the dense vector expression.
Definition: DVecScalarMultExpr.h:117
friend const ConstIterator operator+(size_t inc, const ConstIterator &it)
Addition between an integral value and a ConstIterator.
Definition: DVecScalarMultExpr.h:407
ElementType * PointerType
Pointer return type.
Definition: DVecScalarMultExpr.h:198
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:80
VT::ReturnType RN
Return type of the dense vector expression.
Definition: DVecScalarMultExpr.h:116
BLAZE_ALWAYS_INLINE EnableIf< And< IsIntegral< T >, HasSize< T, 2UL > >, sse_int16_t >::Type set(T value)
Sets all values in the vector to the given 2-byte integral value.
Definition: Set.h:73
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:419
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:199
ConstIterator begin() const
Returns an iterator to the first non-zero element of the dense vector.
Definition: DVecScalarMultExpr.h:487
IntrinsicType load() const
Access to the intrinsic elements of the vector.
Definition: DVecScalarMultExpr.h:306
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:286
Expression object for dense vector-scalar multiplications.The DVecScalarMultExpr class represents the...
Definition: DVecScalarMultExpr.h:109
ConstIterator & operator+=(size_t inc)
Addition assignment operator.
Definition: DVecScalarMultExpr.h:231
Base class for all compute expression templates.The Computation class serves as a tag for all computa...
Definition: Computation.h:59
EnableIf< IsDenseMatrix< MT1 > >::Type smpAddAssign(Matrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs)
Default implementation of the SMP addition assignment of a matrix to a dense matrix.
Definition: DenseMatrix.h:129
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:243
This ResultType
Result type for expression template evaluations.
Definition: CompressedMatrix.h:2502
Header file for the SubvectorExprTrait class template.
SelectType< useAssign, const ResultType, const DVecScalarMultExpr & >::Type CompositeType
Data type for composite expression templates.
Definition: DVecScalarMultExpr.h:180
const DVecScalarMultExpr< VT, typename VT::ElementType, TF > normalize(const DenseVector< VT, TF > &vec)
Normalization of the dense vector ( ).
Definition: DVecScalarMultExpr.h:1069
MultTrait< RT, ST >::Type ResultType
Result type for expression template evaluations.
Definition: DVecScalarMultExpr.h:171
Header file for the IsColumnVector type trait.
IteratorCategory iterator_category
The iterator category.
Definition: DVecScalarMultExpr.h:203
VT::CompositeType CT
Composite type of the dense vector expression.
Definition: DVecScalarMultExpr.h:118
System settings for the inline keywords.
EnableIf< IsDenseVector< VT1 > >::Type smpMultAssign(Vector< VT1, TF1 > &lhs, const Vector< VT2, TF2 > &rhs)
Default implementation of the SMP multiplication assignment of a vector to a dense vector...
Definition: DenseVector.h:189
Header file for the Size type trait.
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:427
#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
#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.
BLAZE_ALWAYS_INLINE 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:849
DifferenceType difference_type
Difference between two iterators.
Definition: DVecScalarMultExpr.h:207
DifferenceType operator-(const ConstIterator &rhs) const
Calculating the number of elements between two iterators.
Definition: DVecScalarMultExpr.h:383
ConstIterator & operator--()
Pre-decrement operator.
Definition: DVecScalarMultExpr.h:275