All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
DVecScalarMultExpr.h
Go to the documentation of this file.
1 //=================================================================================================
33 //=================================================================================================
34 
35 #ifndef _BLAZE_MATH_EXPRESSIONS_DVECSCALARMULTEXPR_H_
36 #define _BLAZE_MATH_EXPRESSIONS_DVECSCALARMULTEXPR_H_
37 
38 
39 //*************************************************************************************************
40 // Includes
41 //*************************************************************************************************
42 
43 #include <iterator>
53 #include <blaze/math/Intrinsics.h>
75 #include <blaze/util/Assert.h>
80 #include <blaze/util/EnableIf.h>
81 #include <blaze/util/InvalidType.h>
83 #include <blaze/util/SelectType.h>
84 #include <blaze/util/Types.h>
88 
89 
90 namespace blaze {
91 
92 //=================================================================================================
93 //
94 // CLASS DVECSCALARMULTEXPR
95 //
96 //=================================================================================================
97 
98 //*************************************************************************************************
105 template< typename VT // Type of the left-hand side dense vector
106  , typename ST // Type of the right-hand side scalar value
107  , bool TF > // Transpose flag
108 class DVecScalarMultExpr : public DenseVector< DVecScalarMultExpr<VT,ST,TF>, TF >
109  , private VecScalarMultExpr
110  , private Computation
111 {
112  private:
113  //**Type definitions****************************************************************************
114  typedef typename VT::ResultType RT;
115  typedef typename VT::ReturnType RN;
116  typedef typename VT::ElementType ET;
117  typedef typename VT::CompositeType CT;
118  //**********************************************************************************************
119 
120  //**Return type evaluation**********************************************************************
122 
127  enum { returnExpr = !IsTemporary<RN>::value };
128 
131  //**********************************************************************************************
132 
133  //**Serial evaluation strategy******************************************************************
135 
142 
144  template< typename VT2 >
146  struct UseAssign {
147  enum { value = useAssign };
148  };
150  //**********************************************************************************************
151 
152  //**Parallel evaluation strategy****************************************************************
154 
160  template< typename VT2 >
161  struct UseSMPAssign {
162  enum { value = ( !VT2::smpAssignable || !VT::smpAssignable ) && useAssign };
163  };
165  //**********************************************************************************************
166 
167  public:
168  //**Type definitions****************************************************************************
174 
177 
180 
182  typedef typename SelectType< IsExpression<VT>::value, const VT, const VT& >::Type LeftOperand;
183 
185  typedef ST RightOperand;
186  //**********************************************************************************************
187 
188  //**ConstIterator class definition**************************************************************
192  {
193  public:
194  //**Type definitions*************************************************************************
195  typedef std::random_access_iterator_tag IteratorCategory;
200 
201  // STL iterator requirements
207 
209  typedef typename VT::ConstIterator IteratorType;
210  //*******************************************************************************************
211 
212  //**Constructor******************************************************************************
218  explicit inline ConstIterator( IteratorType iterator, RightOperand scalar )
219  : iterator_( iterator ) // Iterator to the current element
220  , scalar_ ( scalar ) // Scalar of the multiplication expression
221  {}
222  //*******************************************************************************************
223 
224  //**Addition assignment operator*************************************************************
230  inline ConstIterator& operator+=( size_t inc ) {
231  iterator_ += inc;
232  return *this;
233  }
234  //*******************************************************************************************
235 
236  //**Subtraction assignment operator**********************************************************
242  inline ConstIterator& operator-=( size_t dec ) {
243  iterator_ -= dec;
244  return *this;
245  }
246  //*******************************************************************************************
247 
248  //**Prefix increment operator****************************************************************
254  ++iterator_;
255  return *this;
256  }
257  //*******************************************************************************************
258 
259  //**Postfix increment operator***************************************************************
264  inline const ConstIterator operator++( int ) {
265  return ConstIterator( iterator_++ );
266  }
267  //*******************************************************************************************
268 
269  //**Prefix decrement operator****************************************************************
275  --iterator_;
276  return *this;
277  }
278  //*******************************************************************************************
279 
280  //**Postfix decrement operator***************************************************************
285  inline const ConstIterator operator--( int ) {
286  return ConstIterator( iterator_-- );
287  }
288  //*******************************************************************************************
289 
290  //**Element access operator******************************************************************
295  inline ReturnType operator*() const {
296  return *iterator_ * scalar_;
297  }
298  //*******************************************************************************************
299 
300  //**Load function****************************************************************************
305  inline IntrinsicType load() const {
306  return iterator_.load() * set( scalar_ );
307  }
308  //*******************************************************************************************
309 
310  //**Equality operator************************************************************************
316  inline bool operator==( const ConstIterator& rhs ) const {
317  return iterator_ == rhs.iterator_;
318  }
319  //*******************************************************************************************
320 
321  //**Inequality operator**********************************************************************
327  inline bool operator!=( const ConstIterator& rhs ) const {
328  return iterator_ != rhs.iterator_;
329  }
330  //*******************************************************************************************
331 
332  //**Less-than operator***********************************************************************
338  inline bool operator<( const ConstIterator& rhs ) const {
339  return iterator_ < rhs.iterator_;
340  }
341  //*******************************************************************************************
342 
343  //**Greater-than operator********************************************************************
349  inline bool operator>( const ConstIterator& rhs ) const {
350  return iterator_ > rhs.iterator_;
351  }
352  //*******************************************************************************************
353 
354  //**Less-or-equal-than operator**************************************************************
360  inline bool operator<=( const ConstIterator& rhs ) const {
361  return iterator_ <= rhs.iterator_;
362  }
363  //*******************************************************************************************
364 
365  //**Greater-or-equal-than operator***********************************************************
371  inline bool operator>=( const ConstIterator& rhs ) const {
372  return iterator_ >= rhs.iterator_;
373  }
374  //*******************************************************************************************
375 
376  //**Subtraction operator*********************************************************************
382  inline DifferenceType operator-( const ConstIterator& rhs ) const {
383  return iterator_ - rhs.iterator_;
384  }
385  //*******************************************************************************************
386 
387  //**Addition operator************************************************************************
394  friend inline const ConstIterator operator+( const ConstIterator& it, size_t inc ) {
395  return ConstIterator( it.iterator_ + inc );
396  }
397  //*******************************************************************************************
398 
399  //**Addition operator************************************************************************
406  friend inline const ConstIterator operator+( size_t inc, const ConstIterator& it ) {
407  return ConstIterator( it.iterator_ + inc );
408  }
409  //*******************************************************************************************
410 
411  //**Subtraction operator*********************************************************************
418  friend inline const ConstIterator operator-( const ConstIterator& it, size_t dec ) {
419  return ConstIterator( it.iterator_ - dec );
420  }
421  //*******************************************************************************************
422 
423  private:
424  //**Member variables*************************************************************************
427  //*******************************************************************************************
428  };
429  //**********************************************************************************************
430 
431  //**Compilation flags***************************************************************************
433  enum { vectorizable = VT::vectorizable &&
436 
438  enum { smpAssignable = VT::smpAssignable };
439  //**********************************************************************************************
440 
441  //**Constructor*********************************************************************************
447  explicit inline DVecScalarMultExpr( const VT& vector, ST scalar )
448  : vector_( vector ) // Left-hand side dense vector of the multiplication expression
449  , scalar_( scalar ) // Right-hand side scalar of the multiplication expression
450  {}
451  //**********************************************************************************************
452 
453  //**Subscript operator**************************************************************************
459  inline ReturnType operator[]( size_t index ) const {
460  BLAZE_INTERNAL_ASSERT( index < vector_.size(), "Invalid vector access index" );
461  return vector_[index] * scalar_;
462  }
463  //**********************************************************************************************
464 
465  //**Load function*******************************************************************************
471  inline IntrinsicType load( size_t index ) const {
472  typedef IntrinsicTrait<ElementType> IT;
473  BLAZE_INTERNAL_ASSERT( index < vector_.size() , "Invalid vector access index" );
474  BLAZE_INTERNAL_ASSERT( index % IT::size == 0UL, "Invalid vector access index" );
475  const IntrinsicType xmm1( vector_.load( index ) );
476  const IntrinsicType xmm2( set( scalar_ ) );
477  return xmm1 * xmm2;
478  }
479  //**********************************************************************************************
480 
481  //**Begin function******************************************************************************
486  inline ConstIterator begin() const {
487  return ConstIterator( vector_.begin(), scalar_ );
488  }
489  //**********************************************************************************************
490 
491  //**End function********************************************************************************
496  inline ConstIterator end() const {
497  return ConstIterator( vector_.end(), scalar_ );
498  }
499  //**********************************************************************************************
500 
501  //**Size function*******************************************************************************
506  inline size_t size() const {
507  return vector_.size();
508  }
509  //**********************************************************************************************
510 
511  //**Left operand access*************************************************************************
516  inline LeftOperand leftOperand() const {
517  return vector_;
518  }
519  //**********************************************************************************************
520 
521  //**Right operand access************************************************************************
526  inline RightOperand rightOperand() const {
527  return scalar_;
528  }
529  //**********************************************************************************************
530 
531  //**********************************************************************************************
537  template< typename T >
538  inline bool canAlias( const T* alias ) const {
539  return IsComputation<VT>::value && vector_.canAlias( alias );
540  }
541  //**********************************************************************************************
542 
543  //**********************************************************************************************
549  template< typename T >
550  inline bool isAliased( const T* alias ) const {
551  return vector_.isAliased( alias );
552  }
553  //**********************************************************************************************
554 
555  //**********************************************************************************************
560  inline bool isAligned() const {
561  return vector_.isAligned();
562  }
563  //**********************************************************************************************
564 
565  //**********************************************************************************************
570  inline bool canSMPAssign() const {
571  return vector_.canSMPAssign() || ( size() > SMP_DVECSCALARMULT_THRESHOLD );
572  }
573  //**********************************************************************************************
574 
575  private:
576  //**Member variables****************************************************************************
579  //**********************************************************************************************
580 
581  //**Assignment to dense vectors*****************************************************************
595  template< typename VT2 > // Type of the target dense vector
596  friend inline typename EnableIf< UseAssign<VT2> >::Type
597  assign( DenseVector<VT2,TF>& lhs, const DVecScalarMultExpr& rhs )
598  {
600 
601  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
602 
603  assign( ~lhs, rhs.vector_ );
604  assign( ~lhs, (~lhs) * rhs.scalar_ );
605  }
607  //**********************************************************************************************
608 
609  //**Assignment to sparse vectors****************************************************************
623  template< typename VT2 > // Type of the target sparse vector
624  friend inline typename EnableIf< UseAssign<VT2> >::Type
626  {
628 
629  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
630 
631  assign( ~lhs, rhs.vector_ );
632  (~lhs) *= rhs.scalar_;
633  }
635  //**********************************************************************************************
636 
637  //**Addition assignment to dense vectors********************************************************
651  template< typename VT2 > // Type of the target dense vector
652  friend inline typename EnableIf< UseAssign<VT2> >::Type
653  addAssign( DenseVector<VT2,TF>& lhs, const DVecScalarMultExpr& rhs )
654  {
656 
660 
661  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
662 
663  const ResultType tmp( serial( rhs ) );
664  addAssign( ~lhs, tmp );
665  }
667  //**********************************************************************************************
668 
669  //**Addition assignment to sparse vectors*******************************************************
670  // No special implementation for the addition assignment to sparse vectors.
671  //**********************************************************************************************
672 
673  //**Subtraction assignment to dense vectors*****************************************************
687  template< typename VT2 > // Type of the target dense vector
688  friend inline typename EnableIf< UseAssign<VT2> >::Type
689  subAssign( DenseVector<VT2,TF>& lhs, const DVecScalarMultExpr& rhs )
690  {
692 
696 
697  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
698 
699  const ResultType tmp( serial( rhs ) );
700  subAssign( ~lhs, tmp );
701  }
703  //**********************************************************************************************
704 
705  //**Subtraction assignment to sparse vectors****************************************************
706  // No special implementation for the subtraction assignment to sparse vectors.
707  //**********************************************************************************************
708 
709  //**Multiplication assignment to dense vectors**************************************************
723  template< typename VT2 > // Type of the target dense vector
724  friend inline typename EnableIf< UseAssign<VT2> >::Type
725  multAssign( DenseVector<VT2,TF>& lhs, const DVecScalarMultExpr& rhs )
726  {
728 
732 
733  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
734 
735  const ResultType tmp( serial( rhs ) );
736  multAssign( ~lhs, tmp );
737  }
739  //**********************************************************************************************
740 
741  //**Multiplication assignment to sparse vectors*************************************************
742  // No special implementation for the multiplication assignment to sparse vectors.
743  //**********************************************************************************************
744 
745  //**SMP assignment to dense vectors*************************************************************
759  template< typename VT2 > // Type of the target dense vector
760  friend inline typename EnableIf< UseSMPAssign<VT2> >::Type
761  smpAssign( DenseVector<VT2,TF>& lhs, const DVecScalarMultExpr& rhs )
762  {
764 
765  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
766 
767  smpAssign( ~lhs, rhs.vector_ );
768  smpAssign( ~lhs, (~lhs) * rhs.scalar_ );
769  }
771  //**********************************************************************************************
772 
773  //**SMP assignment to sparse vectors************************************************************
787  template< typename VT2 > // Type of the target sparse vector
788  friend inline typename EnableIf< UseSMPAssign<VT2> >::Type
789  smpAssign( SparseVector<VT2,TF>& lhs, const DVecScalarMultExpr& rhs )
790  {
792 
793  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
794 
795  smpAssign( ~lhs, rhs.vector_ );
796  (~lhs) *= rhs.scalar_;
797  }
799  //**********************************************************************************************
800 
801  //**SMP addition assignment to dense vectors****************************************************
815  template< typename VT2 > // Type of the target dense vector
816  friend inline typename EnableIf< UseSMPAssign<VT2> >::Type
817  smpAddAssign( DenseVector<VT2,TF>& lhs, const DVecScalarMultExpr& rhs )
818  {
820 
824 
825  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
826 
827  const ResultType tmp( rhs );
828  smpAddAssign( ~lhs, tmp );
829  }
831  //**********************************************************************************************
832 
833  //**SMP addition assignment to sparse vectors***************************************************
834  // No special implementation for the SMP addition assignment to sparse vectors.
835  //**********************************************************************************************
836 
837  //**SMP subtraction assignment to dense vectors*************************************************
851  template< typename VT2 > // Type of the target dense vector
852  friend inline typename EnableIf< UseSMPAssign<VT2> >::Type
853  smpSubAssign( DenseVector<VT2,TF>& lhs, const DVecScalarMultExpr& rhs )
854  {
856 
860 
861  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
862 
863  const ResultType tmp( rhs );
864  smpSubAssign( ~lhs, tmp );
865  }
867  //**********************************************************************************************
868 
869  //**SMP subtraction assignment to sparse vectors************************************************
870  // No special implementation for the SMP subtraction assignment to sparse vectors.
871  //**********************************************************************************************
872 
873  //**SMP multiplication assignment to dense vectors**********************************************
887  template< typename VT2 > // Type of the target dense vector
888  friend inline typename EnableIf< UseSMPAssign<VT2> >::Type
889  smpMultAssign( DenseVector<VT2,TF>& lhs, const DVecScalarMultExpr& rhs )
890  {
892 
896 
897  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
898 
899  const ResultType tmp( rhs );
900  smpMultAssign( ~lhs, tmp );
901  }
903  //**********************************************************************************************
904 
905  //**SMP multiplication assignment to sparse vectors*********************************************
906  // No special implementation for the SMP multiplication assignment to sparse vectors.
907  //**********************************************************************************************
908 
909  //**Compile time checks*************************************************************************
916  //**********************************************************************************************
917 };
918 //*************************************************************************************************
919 
920 
921 
922 
923 //=================================================================================================
924 //
925 // GLOBAL UNARY ARITHMETIC OPERATORS
926 //
927 //=================================================================================================
928 
929 //*************************************************************************************************
946 template< typename VT // Type of the dense vector
947  , bool TF > // Transpose flag
948 inline const DVecScalarMultExpr<VT,typename BaseElementType<VT>::Type,TF>
950 {
952 
953  typedef typename BaseElementType<VT>::Type ElementType;
955 }
956 //*************************************************************************************************
957 
958 
959 
960 
961 //=================================================================================================
962 //
963 // GLOBAL BINARY ARITHMETIC OPERATORS
964 //
965 //=================================================================================================
966 
967 //*************************************************************************************************
989 template< typename T1 // Type of the left-hand side dense vector
990  , typename T2 // Type of the right-hand side scalar
991  , bool TF > // Transpose flag
992 inline const typename EnableIf< IsNumeric<T2>, typename MultExprTrait<T1,T2>::Type >::Type
993  operator*( const DenseVector<T1,TF>& vec, T2 scalar )
994 {
996 
997  typedef typename MultExprTrait<T1,T2>::Type Type;
998  return Type( ~vec, scalar );
999 }
1000 //*************************************************************************************************
1001 
1002 
1003 //*************************************************************************************************
1025 template< typename T1 // Type of the left-hand side scalar
1026  , typename T2 // Type of the right-hand side dense vector
1027  , bool TF > // Transpose flag
1028 inline const typename EnableIf< IsNumeric<T1>, typename MultExprTrait<T1,T2>::Type >::Type
1029  operator*( T1 scalar, const DenseVector<T2,TF>& vec )
1030 {
1032 
1033  typedef typename MultExprTrait<T1,T2>::Type Type;
1034  return Type( ~vec, scalar );
1035 }
1036 //*************************************************************************************************
1037 
1038 
1039 
1040 
1041 //=================================================================================================
1042 //
1043 // GLOBAL FUNCTIONS
1044 //
1045 //=================================================================================================
1046 
1047 //*************************************************************************************************
1065 template< typename VT // Type of the dense vector
1066  , bool TF > // Transpose flag
1067 inline const DVecScalarMultExpr<VT,typename VT::ElementType,TF>
1069 {
1070  typedef typename VT::ElementType ElementType;
1071 
1073 
1074  const ElementType len ( length( ~vec ) );
1075  const ElementType ilen( ( len != ElementType(0) )?( ElementType(1) / len ):( 0 ) );
1076 
1077  return DVecScalarMultExpr<VT,ElementType,TF>( ~vec, ilen );
1078 }
1079 //*************************************************************************************************
1080 
1081 
1082 
1083 
1084 //=================================================================================================
1085 //
1086 // GLOBAL RESTRUCTURING UNARY ARITHMETIC OPERATORS
1087 //
1088 //=================================================================================================
1089 
1090 //*************************************************************************************************
1102 template< typename VT // Type of the dense vector
1103  , typename ST // Type of the scalar
1104  , bool TF > // Transpose flag
1105 inline const DVecScalarMultExpr<VT,ST,TF>
1106  operator-( const DVecScalarMultExpr<VT,ST,TF>& dv )
1107 {
1109 
1110  return DVecScalarMultExpr<VT,ST,TF>( dv.leftOperand(), -dv.rightOperand() );
1111 }
1113 //*************************************************************************************************
1114 
1115 
1116 
1117 
1118 //=================================================================================================
1119 //
1120 // GLOBAL RESTRUCTURING BINARY ARITHMETIC OPERATORS
1121 //
1122 //=================================================================================================
1123 
1124 //*************************************************************************************************
1137 template< typename VT // Type of the dense vector of the left-hand side expression
1138  , typename ST1 // Type of the scalar of the left-hand side expression
1139  , bool TF // Transpose flag of the dense vector
1140  , typename ST2 > // Type of the right-hand side scalar
1141 inline const typename EnableIf< IsNumeric<ST2>
1142  , typename MultExprTrait< DVecScalarMultExpr<VT,ST1,TF>, ST2 >::Type >::Type
1143  operator*( const DVecScalarMultExpr<VT,ST1,TF>& vec, ST2 scalar )
1144 {
1146 
1147  return vec.leftOperand() * ( vec.rightOperand() * scalar );
1148 }
1150 //*************************************************************************************************
1151 
1152 
1153 //*************************************************************************************************
1166 template< typename ST1 // Type of the left-hand side scalar
1167  , typename VT // Type of the dense vector of the right-hand side expression
1168  , typename ST2 // Type of the scalar of the right-hand side expression
1169  , bool TF > // Transpose flag of the dense vector
1170 inline const typename EnableIf< IsNumeric<ST1>
1171  , typename MultExprTrait< ST1, DVecScalarMultExpr<VT,ST2,TF> >::Type >::Type
1172  operator*( ST1 scalar, const DVecScalarMultExpr<VT,ST2,TF>& vec )
1173 {
1175 
1176  return vec.leftOperand() * ( scalar * vec.rightOperand() );
1177 }
1179 //*************************************************************************************************
1180 
1181 
1182 //*************************************************************************************************
1195 template< typename VT // Type of the dense vector of the left-hand side expression
1196  , typename ST1 // Type of the scalar of the left-hand side expression
1197  , bool TF // Transpose flag of the dense vector
1198  , typename ST2 > // Type of the right-hand side scalar
1199 inline const typename EnableIf< IsFloatingPoint<typename DivTrait<ST1,ST2>::Type>
1200  , typename DivExprTrait< DVecScalarMultExpr<VT,ST1,TF>, ST2 >::Type >::Type
1201  operator/( const DVecScalarMultExpr<VT,ST1,TF>& vec, ST2 scalar )
1202 {
1204 
1205  return vec.leftOperand() * ( vec.rightOperand() / scalar );
1206 }
1208 //*************************************************************************************************
1209 
1210 
1211 //*************************************************************************************************
1225 template< typename VT1 // Type of the dense vector of the left-hand side expression
1226  , typename ST // Type of the scalar of the left-hand side expression
1227  , bool TF // Transpose flag of the dense vectors
1228  , typename VT2 > // Type of the right-hand side dense vector
1229 inline const typename MultExprTrait< DVecScalarMultExpr<VT1,ST,TF>, VT2 >::Type
1230  operator*( const DVecScalarMultExpr<VT1,ST,TF>& lhs, const DenseVector<VT2,TF>& rhs )
1231 {
1233 
1234  return ( lhs.leftOperand() * (~rhs) ) * lhs.rightOperand();
1235 }
1237 //*************************************************************************************************
1238 
1239 
1240 //*************************************************************************************************
1254 template< typename VT1 // Type of the left-hand side dense vector
1255  , bool TF // Transpose flag of the dense vectors
1256  , typename VT2 // Type of the dense vector of the right-hand side expression
1257  , typename ST > // Type of the scalar of the right-hand side expression
1258 inline const typename MultExprTrait< VT1, DVecScalarMultExpr<VT2,ST,TF> >::Type
1259  operator*( const DenseVector<VT1,TF>& lhs, const DVecScalarMultExpr<VT2,ST,TF>& rhs )
1260 {
1262 
1263  return ( (~lhs) * rhs.leftOperand() ) * rhs.rightOperand();
1264 }
1266 //*************************************************************************************************
1267 
1268 
1269 //*************************************************************************************************
1283 template< typename VT1 // Type of the dense vector of the left-hand side expression
1284  , typename ST1 // Type of the scalar of the left-hand side expression
1285  , bool TF // Transpose flag of the dense vectors
1286  , typename VT2 // Type of the dense vector of the right-hand side expression
1287  , typename ST2 > // Type of the scalar of the right-hand side expression
1288 inline const typename MultExprTrait< DVecScalarMultExpr<VT1,ST1,TF>, DVecScalarMultExpr<VT2,ST2,TF> >::Type
1289  operator*( const DVecScalarMultExpr<VT1,ST1,TF>& lhs, const DVecScalarMultExpr<VT2,ST2,TF>& rhs )
1290 {
1292 
1293  return ( lhs.leftOperand() * rhs.leftOperand() ) * ( lhs.rightOperand() * rhs.rightOperand() );
1294 }
1296 //*************************************************************************************************
1297 
1298 
1299 //*************************************************************************************************
1313 template< typename VT1 // Type of the dense vector of the left-hand side expression
1314  , typename ST // Type of the scalar of the left-hand side expression
1315  , typename VT2 > // Type of the right-hand side dense vector
1316 inline const typename MultExprTrait< DVecScalarMultExpr<VT1,ST,false>, VT2 >::Type
1317  operator*( const DVecScalarMultExpr<VT1,ST,false>& lhs, const DenseVector<VT2,true>& rhs )
1318 {
1320 
1321  return ( lhs.leftOperand() * (~rhs) ) * lhs.rightOperand();
1322 }
1324 //*************************************************************************************************
1325 
1326 
1327 //*************************************************************************************************
1341 template< typename VT1 // Type of the left-hand side dense vector
1342  , typename VT2 // Type of the dense vector of the right-hand side expression
1343  , typename ST > // Type of the scalar of the right-hand side expression
1344 inline const typename MultExprTrait< VT1, DVecScalarMultExpr<VT2,ST,true> >::Type
1345  operator*( const DenseVector<VT1,false>& lhs, const DVecScalarMultExpr<VT2,ST,true>& rhs )
1346 {
1348 
1349  return ( (~lhs) * rhs.leftOperand() ) * rhs.rightOperand();
1350 }
1352 //*************************************************************************************************
1353 
1354 
1355 //*************************************************************************************************
1369 template< typename VT1 // Type of the dense vector of the left-hand side expression
1370  , typename ST1 // Type of the scalar of the left-hand side expression
1371  , typename VT2 // Type of the dense vector of the right-hand side expression
1372  , typename ST2 > // Type of the scalar of the right-hand side expression
1373 inline const typename MultExprTrait< DVecScalarMultExpr<VT1,ST1,false>, DVecScalarMultExpr<VT2,ST2,true> >::Type
1374  operator*( const DVecScalarMultExpr<VT1,ST1,false>& lhs, const DVecScalarMultExpr<VT2,ST2,true>& rhs )
1375 {
1377 
1378  return ( lhs.leftOperand() * rhs.leftOperand() ) * ( lhs.rightOperand() * rhs.rightOperand() );
1379 }
1381 //*************************************************************************************************
1382 
1383 
1384 //*************************************************************************************************
1398 template< typename VT1 // Type of the dense vector of the left-hand side expression
1399  , typename ST // Type of the scalar of the left-hand side expression
1400  , bool TF // Transpose flag of the vectors
1401  , typename VT2 > // Type of the right-hand side sparse vector
1402 inline const typename MultExprTrait< DVecScalarMultExpr<VT1,ST,TF>, VT2 >::Type
1403  operator*( const DVecScalarMultExpr<VT1,ST,TF>& lhs, const SparseVector<VT2,TF>& rhs )
1404 {
1406 
1407  return ( lhs.leftOperand() * (~rhs) ) * lhs.rightOperand();
1408 }
1410 //*************************************************************************************************
1411 
1412 
1413 //*************************************************************************************************
1427 template< typename VT1 // Type of the left-hand side sparse vector
1428  , bool TF // Transpose flag of the vectors
1429  , typename VT2 // Type of the dense vector of the right-hand side expression
1430  , typename ST > // Type of the scalar of the right-hand side expression
1431 inline const typename MultExprTrait< VT1, DVecScalarMultExpr<VT2,ST,TF> >::Type
1432  operator*( const SparseVector<VT1,TF>& lhs, const DVecScalarMultExpr<VT2,ST,TF>& rhs )
1433 {
1435 
1436  return ( (~lhs) * rhs.leftOperand() ) * rhs.rightOperand();
1437 }
1439 //*************************************************************************************************
1440 
1441 
1442 //*************************************************************************************************
1457 template< typename VT1 // Type of the dense vector of the left-hand side expression
1458  , typename ST1 // Type of the scalar of the left-hand side expression
1459  , bool TF // Transpose flag of the vectors
1460  , typename VT2 // Type of the sparse vector of the right-hand side expression
1461  , typename ST2 > // Type of the scalar o the right-hand side expression
1462 inline const typename MultExprTrait< DVecScalarMultExpr<VT1,ST1,TF>, SVecScalarMultExpr<VT2,ST2,TF> >::Type
1463  operator*( const DVecScalarMultExpr<VT1,ST1,TF>& lhs, const SVecScalarMultExpr<VT2,ST2,TF>& rhs )
1464 {
1466 
1467  return ( lhs.leftOperand() * rhs.leftOperand() ) * ( lhs.rightOperand() * rhs.rightOperand() );
1468 }
1470 //*************************************************************************************************
1471 
1472 
1473 //*************************************************************************************************
1488 template< typename VT1 // Type of the sparse vector of the left-hand side expression
1489  , typename ST1 // Type of the scalar of the left-hand side expression
1490  , bool TF // Transpose flag of the vectors
1491  , typename VT2 // Type of the dense vector of the right-hand side expression
1492  , typename ST2 > // Type of the scalar o the right-hand side expression
1493 inline const typename MultExprTrait< SVecScalarMultExpr<VT1,ST1,TF>, DVecScalarMultExpr<VT2,ST2,TF> >::Type
1494  operator*( const SVecScalarMultExpr<VT1,ST1,TF>& lhs, const DVecScalarMultExpr<VT2,ST2,TF>& rhs )
1495 {
1497 
1498  return ( lhs.leftOperand() * rhs.leftOperand() ) * ( lhs.rightOperand() * rhs.rightOperand() );
1499 }
1501 //*************************************************************************************************
1502 
1503 
1504 //*************************************************************************************************
1518 template< typename VT1 // Type of the dense vector of the left-hand side expression
1519  , typename ST // Type of the scalar of the left-hand side expression
1520  , typename VT2 > // Type of the right-hand side sparse vector
1521 inline const typename MultExprTrait< DVecScalarMultExpr<VT1,ST,false>, VT2 >::Type
1522  operator*( const DVecScalarMultExpr<VT1,ST,false>& lhs, const SparseVector<VT2,true>& rhs )
1523 {
1525 
1526  return ( lhs.leftOperand() * (~rhs) ) * lhs.rightOperand();
1527 }
1529 //*************************************************************************************************
1530 
1531 
1532 //*************************************************************************************************
1546 template< typename VT1 // Type of the left-hand side sparse vector
1547  , typename VT2 // Type of the dense vector of the right-hand side expression
1548  , typename ST > // Type of the scalar of the right-hand side expression
1549 inline const typename MultExprTrait< VT1, DVecScalarMultExpr<VT2,ST,true> >::Type
1550  operator*( const SparseVector<VT1,false>& lhs, const DVecScalarMultExpr<VT2,ST,true>& rhs )
1551 {
1553 
1554  return ( (~lhs) * rhs.leftOperand() ) * rhs.rightOperand();
1555 }
1557 //*************************************************************************************************
1558 
1559 
1560 //*************************************************************************************************
1575 template< typename VT1 // Type of the dense vector of the left-hand side expression
1576  , typename ST1 // Type of the scalar of the left-hand side expression
1577  , typename VT2 // Type of the sparse vector of the right-hand side expression
1578  , typename ST2 > // Type of the scalar o the right-hand side expression
1579 inline const typename MultExprTrait< DVecScalarMultExpr<VT1,ST1,false>, SVecScalarMultExpr<VT2,ST2,true> >::Type
1580  operator*( const DVecScalarMultExpr<VT1,ST1,false>& lhs, const SVecScalarMultExpr<VT2,ST2,true>& rhs )
1581 {
1583 
1584  return ( lhs.leftOperand() * rhs.leftOperand() ) * ( lhs.rightOperand() * rhs.rightOperand() );
1585 }
1587 //*************************************************************************************************
1588 
1589 
1590 //*************************************************************************************************
1605 template< typename VT1 // Type of the sparse vector of the left-hand side expression
1606  , typename ST1 // Type of the scalar of the left-hand side expression
1607  , typename VT2 // Type of the dense vector of the right-hand side expression
1608  , typename ST2 > // Type of the scalar o the right-hand side expression
1609 inline const typename MultExprTrait< SVecScalarMultExpr<VT1,ST1,false>, DVecScalarMultExpr<VT2,ST2,true> >::Type
1610  operator*( const SVecScalarMultExpr<VT1,ST1,false>& lhs, const DVecScalarMultExpr<VT2,ST2,true>& rhs )
1611 {
1613 
1614  return ( lhs.leftOperand() * rhs.leftOperand() ) * ( lhs.rightOperand() * rhs.rightOperand() );
1615 }
1617 //*************************************************************************************************
1618 
1619 
1620 //*************************************************************************************************
1634 template< typename MT // Type of the left-hand side dense matrix
1635  , bool SO // Storage order of the left-hand side dense matrix
1636  , typename VT // Type of the dense vector of the right-hand side expression
1637  , typename ST > // Type of the scalar of the right-hand side expression
1638 inline const typename MultExprTrait< MT, DVecScalarMultExpr<VT,ST,false> >::Type
1639  operator*( const DenseMatrix<MT,SO>& mat, const DVecScalarMultExpr<VT,ST,false>& vec )
1640 {
1642 
1643  return ( (~mat) * vec.leftOperand() ) * vec.rightOperand();
1644 }
1646 //*************************************************************************************************
1647 
1648 
1649 //*************************************************************************************************
1663 template< typename VT // Type of the dense vector of the left-hand side expression
1664  , typename ST // Type of the scalar of the left-hand side expression
1665  , typename MT // Type of the right-hand side dense matrix
1666  , bool SO > // Storage order of the right-hand side dense matrix
1667 inline const typename MultExprTrait< DVecScalarMultExpr<VT,ST,true>, MT >::Type
1668  operator*( const DVecScalarMultExpr<VT,ST,true>& vec, const DenseMatrix<MT,SO>& mat )
1669 {
1671 
1672  return ( vec.leftOperand() * (~mat) ) * vec.rightOperand();
1673 }
1675 //*************************************************************************************************
1676 
1677 
1678 //*************************************************************************************************
1692 template< typename MT // Type of the left-hand side sparse matrix
1693  , bool SO // Storage order of the left-hand side sparse matrix
1694  , typename VT // Type of the dense vector of the right-hand side expression
1695  , typename ST > // Type of the scalar of the right-hand side expression
1696 inline const typename MultExprTrait< MT, DVecScalarMultExpr<VT,ST,false> >::Type
1697  operator*( const SparseMatrix<MT,SO>& mat, const DVecScalarMultExpr<VT,ST,false>& vec )
1698 {
1700 
1701  return ( (~mat) * vec.leftOperand() ) * vec.rightOperand();
1702 }
1704 //*************************************************************************************************
1705 
1706 
1707 //*************************************************************************************************
1721 template< typename VT // Type of the dense vector of the left-hand side expression
1722  , typename ST // Type of the scalar of the left-hand side expression
1723  , typename MT // Type of the right-hand side sparse matrix
1724  , bool SO > // Storage order of the right-hand side sparse matrix
1725 inline const typename MultExprTrait< DVecScalarMultExpr<VT,ST,true>, MT >::Type
1726  operator*( const DVecScalarMultExpr<VT,ST,true>& vec, const SparseMatrix<MT,SO>& mat )
1727 {
1729 
1730  return ( vec.leftOperand() * (~mat) ) * vec.rightOperand();
1731 }
1733 //*************************************************************************************************
1734 
1735 
1736 
1737 
1738 //=================================================================================================
1739 //
1740 // SIZE SPECIALIZATIONS
1741 //
1742 //=================================================================================================
1743 
1744 //*************************************************************************************************
1746 template< typename VT, typename ST, bool TF >
1747 struct Size< DVecScalarMultExpr<VT,ST,TF> >
1748  : public Size<VT>
1749 {};
1751 //*************************************************************************************************
1752 
1753 
1754 
1755 
1756 //=================================================================================================
1757 //
1758 // DVECSCALARMULTEXPRTRAIT SPECIALIZATIONS
1759 //
1760 //=================================================================================================
1761 
1762 //*************************************************************************************************
1764 template< typename VT, typename ST1, typename ST2 >
1765 struct DVecScalarMultExprTrait< DVecScalarMultExpr<VT,ST1,false>, ST2 >
1766 {
1767  public:
1768  //**********************************************************************************************
1769  typedef typename SelectType< IsDenseVector<VT>::value && IsColumnVector<VT>::value &&
1770  IsNumeric<ST1>::value && IsNumeric<ST2>::value
1771  , typename DVecScalarMultExprTrait<VT,typename MultTrait<ST1,ST2>::Type>::Type
1772  , INVALID_TYPE >::Type Type;
1773  //**********************************************************************************************
1774 };
1776 //*************************************************************************************************
1777 
1778 
1779 
1780 
1781 //=================================================================================================
1782 //
1783 // TDVECSCALARMULTEXPRTRAIT SPECIALIZATIONS
1784 //
1785 //=================================================================================================
1786 
1787 //*************************************************************************************************
1789 template< typename VT, typename ST1, typename ST2 >
1790 struct TDVecScalarMultExprTrait< DVecScalarMultExpr<VT,ST1,true>, ST2 >
1791 {
1792  public:
1793  //**********************************************************************************************
1794  typedef typename SelectType< IsDenseVector<VT>::value && IsRowVector<VT>::value &&
1795  IsNumeric<ST1>::value && IsNumeric<ST2>::value
1796  , typename TDVecScalarMultExprTrait<VT,typename MultTrait<ST1,ST2>::Type>::Type
1797  , INVALID_TYPE >::Type Type;
1798  //**********************************************************************************************
1799 };
1801 //*************************************************************************************************
1802 
1803 
1804 
1805 
1806 //=================================================================================================
1807 //
1808 // DVECSCALARDIVEXPRTRAIT SPECIALIZATIONS
1809 //
1810 //=================================================================================================
1811 
1812 //*************************************************************************************************
1814 template< typename VT, typename ST1, typename ST2 >
1815 struct DVecScalarDivExprTrait< DVecScalarMultExpr<VT,ST1,false>, ST2 >
1816 {
1817  private:
1818  //**********************************************************************************************
1819  enum { condition = IsFloatingPoint<typename DivTrait<ST1,ST2>::Type>::value };
1820  //**********************************************************************************************
1821 
1822  //**********************************************************************************************
1823  typedef typename DVecScalarMultExprTrait<VT,typename DivTrait<ST1,ST2>::Type>::Type T1;
1824  typedef typename DVecScalarDivExprTrait<VT,typename DivTrait<ST1,ST2>::Type>::Type T2;
1825  //**********************************************************************************************
1826 
1827  public:
1828  //**********************************************************************************************
1829  typedef typename SelectType< IsDenseVector<VT>::value && IsColumnVector<VT>::value &&
1830  IsNumeric<ST1>::value && IsNumeric<ST2>::value
1831  , typename SelectType<condition,T1,T2>::Type
1832  , INVALID_TYPE >::Type Type;
1833  //**********************************************************************************************
1834 };
1836 //*************************************************************************************************
1837 
1838 
1839 
1840 
1841 //=================================================================================================
1842 //
1843 // TDVECSCALARDIVEXPRTRAIT SPECIALIZATIONS
1844 //
1845 //=================================================================================================
1846 
1847 //*************************************************************************************************
1849 template< typename VT, typename ST1, typename ST2 >
1850 struct TDVecScalarDivExprTrait< DVecScalarMultExpr<VT,ST1,true>, ST2 >
1851 {
1852  private:
1853  //**********************************************************************************************
1854  enum { condition = IsFloatingPoint<typename DivTrait<ST1,ST2>::Type>::value };
1855  //**********************************************************************************************
1856 
1857  //**********************************************************************************************
1858  typedef typename TDVecScalarMultExprTrait<VT,typename DivTrait<ST1,ST2>::Type>::Type T1;
1859  typedef typename TDVecScalarDivExprTrait<VT,typename DivTrait<ST1,ST2>::Type>::Type T2;
1860  //**********************************************************************************************
1861 
1862  public:
1863  //**********************************************************************************************
1864  typedef typename SelectType< IsDenseVector<VT>::value && IsRowVector<VT>::value &&
1865  IsNumeric<ST1>::value && IsNumeric<ST2>::value
1866  , typename SelectType<condition,T1,T2>::Type
1867  , INVALID_TYPE >::Type Type;
1868  //**********************************************************************************************
1869 };
1871 //*************************************************************************************************
1872 
1873 
1874 
1875 
1876 //=================================================================================================
1877 //
1878 // DVECDVECMULTEXPRTRAIT SPECIALIZATIONS
1879 //
1880 //=================================================================================================
1881 
1882 //*************************************************************************************************
1884 template< typename VT1, typename ST, typename VT2 >
1885 struct DVecDVecMultExprTrait< DVecScalarMultExpr<VT1,ST,false>, VT2 >
1886 {
1887  public:
1888  //**********************************************************************************************
1889  typedef typename SelectType< IsDenseVector<VT1>::value && IsColumnVector<VT1>::value &&
1890  IsDenseVector<VT2>::value && IsColumnVector<VT2>::value &&
1891  IsNumeric<ST>::value
1892  , typename DVecScalarMultExprTrait<typename DVecDVecMultExprTrait<VT1,VT2>::Type,ST>::Type
1893  , INVALID_TYPE >::Type Type;
1894  //**********************************************************************************************
1895 };
1897 //*************************************************************************************************
1898 
1899 
1900 //*************************************************************************************************
1902 template< typename VT1, typename VT2, typename ST >
1903 struct DVecDVecMultExprTrait< VT1, DVecScalarMultExpr<VT2,ST,false> >
1904 {
1905  public:
1906  //**********************************************************************************************
1907  typedef typename SelectType< IsDenseVector<VT1>::value && IsColumnVector<VT1>::value &&
1908  IsDenseVector<VT2>::value && IsColumnVector<VT2>::value &&
1909  IsNumeric<ST>::value
1910  , typename DVecScalarMultExprTrait<typename DVecDVecMultExprTrait<VT1,VT2>::Type,ST>::Type
1911  , INVALID_TYPE >::Type Type;
1912  //**********************************************************************************************
1913 };
1915 //*************************************************************************************************
1916 
1917 
1918 //*************************************************************************************************
1920 template< typename VT1, typename ST1, typename VT2, typename ST2 >
1921 struct DVecDVecMultExprTrait< DVecScalarMultExpr<VT1,ST1,false>, DVecScalarMultExpr<VT2,ST2,false> >
1922 {
1923  public:
1924  //**********************************************************************************************
1925  typedef typename SelectType< IsDenseVector<VT1>::value && IsColumnVector<VT1>::value &&
1926  IsDenseVector<VT2>::value && IsColumnVector<VT2>::value &&
1927  IsNumeric<ST1>::value && IsNumeric<ST2>::value
1928  , typename DVecScalarMultExprTrait<typename DVecDVecMultExprTrait<VT1,VT2>::Type,typename MultTrait<ST1,ST2>::Type>::Type
1929  , INVALID_TYPE >::Type Type;
1930  //**********************************************************************************************
1931 };
1933 //*************************************************************************************************
1934 
1935 
1936 
1937 
1938 //=================================================================================================
1939 //
1940 // DVECTDVECMULTEXPRTRAIT SPECIALIZATIONS
1941 //
1942 //=================================================================================================
1943 
1944 //*************************************************************************************************
1946 template< typename VT1, typename ST, typename VT2 >
1947 struct DVecTDVecMultExprTrait< DVecScalarMultExpr<VT1,ST,false>, VT2 >
1948 {
1949  public:
1950  //**********************************************************************************************
1951  typedef typename SelectType< IsDenseVector<VT1>::value && IsColumnVector<VT1>::value &&
1952  IsDenseVector<VT2>::value && IsRowVector<VT2>::value &&
1953  IsNumeric<ST>::value
1954  , typename DMatScalarMultExprTrait<typename DVecTDVecMultExprTrait<VT1,VT2>::Type,ST>::Type
1955  , INVALID_TYPE >::Type Type;
1956  //**********************************************************************************************
1957 };
1959 //*************************************************************************************************
1960 
1961 
1962 //*************************************************************************************************
1964 template< typename VT1, typename VT2, typename ST >
1965 struct DVecTDVecMultExprTrait< VT1, DVecScalarMultExpr<VT2,ST,true> >
1966 {
1967  public:
1968  //**********************************************************************************************
1969  typedef typename SelectType< IsDenseVector<VT1>::value && IsColumnVector<VT1>::value &&
1970  IsDenseVector<VT2>::value && IsRowVector<VT2>::value &&
1971  IsNumeric<ST>::value
1972  , typename DMatScalarMultExprTrait<typename DVecTDVecMultExprTrait<VT1,VT2>::Type,ST>::Type
1973  , INVALID_TYPE >::Type Type;
1974  //**********************************************************************************************
1975 };
1977 //*************************************************************************************************
1978 
1979 
1980 //*************************************************************************************************
1982 template< typename VT1, typename ST1, typename VT2, typename ST2 >
1983 struct DVecTDVecMultExprTrait< DVecScalarMultExpr<VT1,ST1,false>, DVecScalarMultExpr<VT2,ST2,true> >
1984 {
1985  public:
1986  //**********************************************************************************************
1987  typedef typename SelectType< IsDenseVector<VT1>::value && IsColumnVector<VT1>::value &&
1988  IsDenseVector<VT2>::value && IsRowVector<VT2>::value &&
1989  IsNumeric<ST1>::value && IsNumeric<ST2>::value
1990  , typename DMatScalarMultExprTrait<typename DVecTDVecMultExprTrait<VT1,VT2>::Type,typename MultTrait<ST1,ST2>::Type>::Type
1991  , INVALID_TYPE >::Type Type;
1992  //**********************************************************************************************
1993 };
1995 //*************************************************************************************************
1996 
1997 
1998 
1999 
2000 //=================================================================================================
2001 //
2002 // TDVECTDVECMULTEXPRTRAIT SPECIALIZATIONS
2003 //
2004 //=================================================================================================
2005 
2006 //*************************************************************************************************
2008 template< typename VT1, typename ST, typename VT2 >
2009 struct TDVecTDVecMultExprTrait< DVecScalarMultExpr<VT1,ST,true>, VT2 >
2010 {
2011  public:
2012  //**********************************************************************************************
2013  typedef typename SelectType< IsDenseVector<VT1>::value && IsRowVector<VT1>::value &&
2014  IsDenseVector<VT2>::value && IsRowVector<VT2>::value &&
2015  IsNumeric<ST>::value
2016  , typename TDVecScalarMultExprTrait<typename TDVecTDVecMultExprTrait<VT1,VT2>::Type,ST>::Type
2017  , INVALID_TYPE >::Type Type;
2018  //**********************************************************************************************
2019 };
2021 //*************************************************************************************************
2022 
2023 
2024 //*************************************************************************************************
2026 template< typename VT1, typename VT2, typename ST >
2027 struct TDVecTDVecMultExprTrait< VT1, DVecScalarMultExpr<VT2,ST,true> >
2028 {
2029  public:
2030  //**********************************************************************************************
2031  typedef typename SelectType< IsDenseVector<VT1>::value && IsRowVector<VT1>::value &&
2032  IsDenseVector<VT2>::value && IsRowVector<VT2>::value &&
2033  IsNumeric<ST>::value
2034  , typename TDVecScalarMultExprTrait<typename TDVecTDVecMultExprTrait<VT1,VT2>::Type,ST>::Type
2035  , INVALID_TYPE >::Type Type;
2036  //**********************************************************************************************
2037 };
2039 //*************************************************************************************************
2040 
2041 
2042 //*************************************************************************************************
2044 template< typename VT1, typename ST1, typename VT2, typename ST2 >
2045 struct TDVecTDVecMultExprTrait< DVecScalarMultExpr<VT1,ST1,true>, DVecScalarMultExpr<VT2,ST2,true> >
2046 {
2047  public:
2048  //**********************************************************************************************
2049  typedef typename SelectType< IsDenseVector<VT1>::value && IsRowVector<VT1>::value &&
2050  IsDenseVector<VT2>::value && IsRowVector<VT2>::value &&
2051  IsNumeric<ST1>::value && IsNumeric<ST2>::value
2052  , typename TDVecScalarMultExprTrait<typename TDVecTDVecMultExprTrait<VT1,VT2>::Type,typename MultTrait<ST1,ST2>::Type>::Type
2053  , INVALID_TYPE >::Type Type;
2054  //**********************************************************************************************
2055 };
2057 //*************************************************************************************************
2058 
2059 
2060 
2061 
2062 //=================================================================================================
2063 //
2064 // DVECSVECMULTEXPRTRAIT SPECIALIZATIONS
2065 //
2066 //=================================================================================================
2067 
2068 //*************************************************************************************************
2070 template< typename VT1, typename VT2, typename ST >
2071 struct DVecSVecMultExprTrait< DVecScalarMultExpr<VT1,ST,false>, VT2 >
2072 {
2073  public:
2074  //**********************************************************************************************
2075  typedef typename SelectType< IsDenseVector<VT1>::value && IsColumnVector<VT1>::value &&
2076  IsSparseVector<VT2>::value && IsColumnVector<VT2>::value &&
2077  IsNumeric<ST>::value
2078  , typename SVecScalarMultExprTrait<typename DVecSVecMultExprTrait<VT1,VT2>::Type,ST>::Type
2079  , INVALID_TYPE >::Type Type;
2080  //**********************************************************************************************
2081 };
2083 //*************************************************************************************************
2084 
2085 
2086 //*************************************************************************************************
2088 template< typename VT1, typename ST1, typename VT2, typename ST2 >
2089 struct DVecSVecMultExprTrait< DVecScalarMultExpr<VT1,ST1,false>, SVecScalarMultExpr<VT2,ST2,false> >
2090 {
2091  public:
2092  //**********************************************************************************************
2093  typedef typename SelectType< IsDenseVector<VT1>::value && IsColumnVector<VT1>::value &&
2094  IsSparseVector<VT2>::value && IsColumnVector<VT2>::value &&
2095  IsNumeric<ST1>::value && IsNumeric<ST2>::value
2096  , typename SVecScalarMultExprTrait<typename DVecSVecMultExprTrait<VT1,VT2>::Type,typename MultTrait<ST1,ST2>::Type>::Type
2097  , INVALID_TYPE >::Type Type;
2098  //**********************************************************************************************
2099 };
2101 //*************************************************************************************************
2102 
2103 
2104 
2105 
2106 //=================================================================================================
2107 //
2108 // DVECTSVECMULTEXPRTRAIT SPECIALIZATIONS
2109 //
2110 //=================================================================================================
2111 
2112 //*************************************************************************************************
2114 template< typename VT1, typename ST, typename VT2 >
2115 struct DVecTSVecMultExprTrait< DVecScalarMultExpr<VT1,ST,false>, VT2 >
2116 {
2117  public:
2118  //**********************************************************************************************
2119  typedef typename SelectType< IsDenseVector<VT1>::value && IsColumnVector<VT1>::value &&
2120  IsSparseVector<VT2>::value && IsRowVector<VT2>::value &&
2121  IsNumeric<ST>::value
2122  , typename SMatScalarMultExprTrait<typename DVecTSVecMultExprTrait<VT1,VT2>::Type,ST>::Type
2123  , INVALID_TYPE >::Type Type;
2124  //**********************************************************************************************
2125 };
2127 //*************************************************************************************************
2128 
2129 
2130 //*************************************************************************************************
2132 template< typename VT1, typename ST1, typename VT2, typename ST2 >
2133 struct DVecTSVecMultExprTrait< DVecScalarMultExpr<VT1,ST1,false>, SVecScalarMultExpr<VT2,ST2,true> >
2134 {
2135  public:
2136  //**********************************************************************************************
2137  typedef typename SelectType< IsDenseVector<VT1>::value && IsColumnVector<VT1>::value &&
2138  IsSparseVector<VT2>::value && IsRowVector<VT2>::value &&
2139  IsNumeric<ST1>::value && IsNumeric<ST2>::value
2140  , typename SMatScalarMultExprTrait<typename DVecTSVecMultExprTrait<VT1,VT2>::Type,typename MultTrait<ST1,ST2>::Type>::Type
2141  , INVALID_TYPE >::Type Type;
2142  //**********************************************************************************************
2143 };
2145 //*************************************************************************************************
2146 
2147 
2148 
2149 
2150 //=================================================================================================
2151 //
2152 // TDVECTSVECMULTEXPRTRAIT SPECIALIZATIONS
2153 //
2154 //=================================================================================================
2155 
2156 //*************************************************************************************************
2158 template< typename VT1, typename ST, typename VT2 >
2159 struct TDVecTSVecMultExprTrait< DVecScalarMultExpr<VT1,ST,true>, VT2 >
2160 {
2161  public:
2162  //**********************************************************************************************
2163  typedef typename SelectType< IsDenseVector<VT1>::value && IsRowVector<VT1>::value &&
2164  IsSparseVector<VT2>::value && IsRowVector<VT2>::value &&
2165  IsNumeric<ST>::value
2166  , typename TSVecScalarMultExprTrait<typename TDVecTSVecMultExprTrait<VT1,VT2>::Type,ST>::Type
2167  , INVALID_TYPE >::Type Type;
2168  //**********************************************************************************************
2169 };
2171 //*************************************************************************************************
2172 
2173 
2174 //*************************************************************************************************
2176 template< typename VT1, typename ST1, typename VT2, typename ST2 >
2177 struct TDVecTSVecMultExprTrait< DVecScalarMultExpr<VT1,ST1,true>, SVecScalarMultExpr<VT2,ST2,true> >
2178 {
2179  public:
2180  //**********************************************************************************************
2181  typedef typename SelectType< IsDenseVector<VT1>::value && IsRowVector<VT1>::value &&
2182  IsSparseVector<VT2>::value && IsRowVector<VT2>::value &&
2183  IsNumeric<ST1>::value && IsNumeric<ST2>::value
2184  , typename TSVecScalarMultExprTrait<typename TDVecTSVecMultExprTrait<VT1,VT2>::Type,typename MultTrait<ST1,ST2>::Type>::Type
2185  , INVALID_TYPE >::Type Type;
2186  //**********************************************************************************************
2187 };
2189 //*************************************************************************************************
2190 
2191 
2192 
2193 
2194 //=================================================================================================
2195 //
2196 // SVECDVECMULTEXPRTRAIT SPECIALIZATIONS
2197 //
2198 //=================================================================================================
2199 
2200 //*************************************************************************************************
2202 template< typename VT1, typename VT2, typename ST >
2203 struct SVecDVecMultExprTrait< VT1, DVecScalarMultExpr<VT2,ST,false> >
2204 {
2205  public:
2206  //**********************************************************************************************
2207  typedef typename SelectType< IsSparseVector<VT1>::value && IsColumnVector<VT1>::value &&
2208  IsDenseVector<VT2>::value && IsColumnVector<VT2>::value &&
2209  IsNumeric<ST>::value
2210  , typename SVecScalarMultExprTrait<typename SVecDVecMultExprTrait<VT1,VT2>::Type,ST>::Type
2211  , INVALID_TYPE >::Type Type;
2212  //**********************************************************************************************
2213 };
2215 //*************************************************************************************************
2216 
2217 
2218 //*************************************************************************************************
2220 template< typename VT1, typename ST1, typename VT2, typename ST2 >
2221 struct SVecDVecMultExprTrait< SVecScalarMultExpr<VT1,ST1,false>, DVecScalarMultExpr<VT2,ST2,false> >
2222 {
2223  public:
2224  //**********************************************************************************************
2225  typedef typename SelectType< IsSparseVector<VT1>::value && IsColumnVector<VT1>::value &&
2226  IsDenseVector<VT2>::value && IsColumnVector<VT2>::value &&
2227  IsNumeric<ST1>::value && IsNumeric<ST2>::value
2228  , typename SVecScalarMultExprTrait<typename SVecDVecMultExprTrait<VT1,VT2>::Type,typename MultTrait<ST1,ST2>::Type>::Type
2229  , INVALID_TYPE >::Type Type;
2230  //**********************************************************************************************
2231 };
2233 //*************************************************************************************************
2234 
2235 
2236 
2237 
2238 //=================================================================================================
2239 //
2240 // SVECTDVECMULTEXPRTRAIT SPECIALIZATIONS
2241 //
2242 //=================================================================================================
2243 
2244 //*************************************************************************************************
2246 template< typename VT1, typename VT2, typename ST >
2247 struct SVecTDVecMultExprTrait< VT1, DVecScalarMultExpr<VT2,ST,true> >
2248 {
2249  public:
2250  //**********************************************************************************************
2251  typedef typename SelectType< IsSparseVector<VT1>::value && IsColumnVector<VT1>::value &&
2252  IsDenseVector<VT2>::value && IsRowVector<VT2>::value &&
2253  IsNumeric<ST>::value
2254  , typename TSMatScalarMultExprTrait<typename SVecTDVecMultExprTrait<VT1,VT2>::Type,ST>::Type
2255  , INVALID_TYPE >::Type Type;
2256  //**********************************************************************************************
2257 };
2259 //*************************************************************************************************
2260 
2261 
2262 //*************************************************************************************************
2264 template< typename VT1, typename ST1, typename VT2, typename ST2 >
2265 struct SVecTDVecMultExprTrait< SVecScalarMultExpr<VT1,ST1,false>, DVecScalarMultExpr<VT2,ST2,true> >
2266 {
2267  public:
2268  //**********************************************************************************************
2269  typedef typename SelectType< IsSparseVector<VT1>::value && IsColumnVector<VT1>::value &&
2270  IsDenseVector<VT2>::value && IsRowVector<VT2>::value &&
2271  IsNumeric<ST1>::value && IsNumeric<ST2>::value
2272  , typename TSMatScalarMultExprTrait<typename SVecTDVecMultExprTrait<VT1,VT2>::Type,typename MultTrait<ST1,ST2>::Type>::Type
2273  , INVALID_TYPE >::Type Type;
2274  //**********************************************************************************************
2275 };
2277 //*************************************************************************************************
2278 
2279 
2280 
2281 
2282 //=================================================================================================
2283 //
2284 // TSVECTDVECMULTEXPRTRAIT SPECIALIZATIONS
2285 //
2286 //=================================================================================================
2287 
2288 //*************************************************************************************************
2290 template< typename VT1, typename VT2, typename ST >
2291 struct TSVecTDVecMultExprTrait< VT1, DVecScalarMultExpr<VT2,ST,true> >
2292 {
2293  public:
2294  //**********************************************************************************************
2295  typedef typename SelectType< IsSparseVector<VT1>::value && IsRowVector<VT1>::value &&
2296  IsDenseVector<VT2>::value && IsRowVector<VT2>::value &&
2297  IsNumeric<ST>::value
2298  , typename TSVecScalarMultExprTrait<typename TSVecTDVecMultExprTrait<VT1,VT2>::Type,ST>::Type
2299  , INVALID_TYPE >::Type Type;
2300  //**********************************************************************************************
2301 };
2303 //*************************************************************************************************
2304 
2305 
2306 //*************************************************************************************************
2308 template< typename VT1, typename ST1, typename VT2, typename ST2 >
2309 struct TSVecTDVecMultExprTrait< SVecScalarMultExpr<VT1,ST1,true>, DVecScalarMultExpr<VT2,ST2,true> >
2310 {
2311  public:
2312  //**********************************************************************************************
2313  typedef typename SelectType< IsSparseVector<VT1>::value && IsRowVector<VT1>::value &&
2314  IsDenseVector<VT2>::value && IsRowVector<VT2>::value &&
2315  IsNumeric<ST1>::value && IsNumeric<ST2>::value
2316  , typename TSVecScalarMultExprTrait<typename TSVecTDVecMultExprTrait<VT1,VT2>::Type,typename MultTrait<ST1,ST2>::Type>::Type
2317  , INVALID_TYPE >::Type Type;
2318  //**********************************************************************************************
2319 };
2321 //*************************************************************************************************
2322 
2323 
2324 
2325 
2326 //=================================================================================================
2327 //
2328 // DMATDVECMULTEXPRTRAIT SPECIALIZATIONS
2329 //
2330 //=================================================================================================
2331 
2332 //*************************************************************************************************
2334 template< typename MT, typename VT, typename ST >
2335 struct DMatDVecMultExprTrait< MT, DVecScalarMultExpr<VT,ST,false> >
2336 {
2337  public:
2338  //**********************************************************************************************
2339  typedef typename SelectType< IsDenseMatrix<MT>::value && IsRowMajorMatrix<MT>::value &&
2340  IsDenseVector<VT>::value && IsColumnVector<VT>::value &&
2341  IsNumeric<ST>::value
2342  , typename DVecScalarMultExprTrait<typename DMatDVecMultExprTrait<MT,VT>::Type,ST>::Type
2343  , INVALID_TYPE >::Type Type;
2344  //**********************************************************************************************
2345 };
2347 //*************************************************************************************************
2348 
2349 
2350 
2351 
2352 //=================================================================================================
2353 //
2354 // TDMATDVECMULTEXPRTRAIT SPECIALIZATIONS
2355 //
2356 //=================================================================================================
2357 
2358 //*************************************************************************************************
2360 template< typename MT, typename VT, typename ST >
2361 struct TDMatDVecMultExprTrait< MT, DVecScalarMultExpr<VT,ST,false> >
2362 {
2363  public:
2364  //**********************************************************************************************
2365  typedef typename SelectType< IsDenseMatrix<MT>::value && IsColumnMajorMatrix<MT>::value &&
2366  IsDenseVector<VT>::value && IsColumnVector<VT>::value &&
2367  IsNumeric<ST>::value
2368  , typename DVecScalarMultExprTrait<typename TDMatDVecMultExprTrait<MT,VT>::Type,ST>::Type
2369  , INVALID_TYPE >::Type Type;
2370  //**********************************************************************************************
2371 };
2373 //*************************************************************************************************
2374 
2375 
2376 
2377 
2378 //=================================================================================================
2379 //
2380 // TDVECDMATMULTEXPRTRAIT SPECIALIZATIONS
2381 //
2382 //=================================================================================================
2383 
2384 //*************************************************************************************************
2386 template< typename VT, typename MT, typename ST >
2387 struct TDVecDMatMultExprTrait< DVecScalarMultExpr<VT,ST,true>, MT >
2388 {
2389  public:
2390  //**********************************************************************************************
2391  typedef typename SelectType< IsDenseVector<VT>::value && IsRowVector<VT>::value &&
2392  IsDenseMatrix<MT>::value && IsRowMajorMatrix<MT>::value &&
2393  IsNumeric<ST>::value
2394  , typename TDVecScalarMultExprTrait<typename TDVecDMatMultExprTrait<VT,MT>::Type,ST>::Type
2395  , INVALID_TYPE >::Type Type;
2396  //**********************************************************************************************
2397 };
2399 //*************************************************************************************************
2400 
2401 
2402 
2403 
2404 //=================================================================================================
2405 //
2406 // TDVECTDMATMULTEXPRTRAIT SPECIALIZATIONS
2407 //
2408 //=================================================================================================
2409 
2410 //*************************************************************************************************
2412 template< typename VT, typename MT, typename ST >
2413 struct TDVecTDMatMultExprTrait< DVecScalarMultExpr<VT,ST,true>, MT >
2414 {
2415  public:
2416  //**********************************************************************************************
2417  typedef typename SelectType< IsDenseVector<VT>::value && IsRowVector<VT>::value &&
2418  IsDenseMatrix<MT>::value && IsColumnMajorMatrix<MT>::value &&
2419  IsNumeric<ST>::value
2420  , typename TDVecScalarMultExprTrait<typename TDVecTDMatMultExprTrait<VT,MT>::Type,ST>::Type
2421  , INVALID_TYPE >::Type Type;
2422  //**********************************************************************************************
2423 };
2425 //*************************************************************************************************
2426 
2427 
2428 
2429 
2430 //=================================================================================================
2431 //
2432 // SMATDVECMULTEXPRTRAIT SPECIALIZATIONS
2433 //
2434 //=================================================================================================
2435 
2436 //*************************************************************************************************
2438 template< typename MT, typename VT, typename ST >
2439 struct SMatDVecMultExprTrait< MT, DVecScalarMultExpr<VT,ST,false> >
2440 {
2441  public:
2442  //**********************************************************************************************
2443  typedef typename SelectType< IsSparseMatrix<MT>::value && IsRowMajorMatrix<MT>::value &&
2444  IsDenseVector<VT>::value && IsColumnVector<VT>::value &&
2445  IsNumeric<ST>::value
2446  , typename DVecScalarMultExprTrait<typename SMatDVecMultExprTrait<MT,VT>::Type,ST>::Type
2447  , INVALID_TYPE >::Type Type;
2448  //**********************************************************************************************
2449 };
2451 //*************************************************************************************************
2452 
2453 
2454 
2455 
2456 //=================================================================================================
2457 //
2458 // TSMATDVECMULTEXPRTRAIT SPECIALIZATIONS
2459 //
2460 //=================================================================================================
2461 
2462 //*************************************************************************************************
2464 template< typename MT, typename VT, typename ST >
2465 struct TSMatDVecMultExprTrait< MT, DVecScalarMultExpr<VT,ST,false> >
2466 {
2467  public:
2468  //**********************************************************************************************
2469  typedef typename SelectType< IsSparseMatrix<MT>::value && IsColumnMajorMatrix<MT>::value &&
2470  IsDenseVector<VT>::value && IsColumnVector<VT>::value &&
2471  IsNumeric<ST>::value
2472  , typename DVecScalarMultExprTrait<typename TSMatDVecMultExprTrait<MT,VT>::Type,ST>::Type
2473  , INVALID_TYPE >::Type Type;
2474  //**********************************************************************************************
2475 };
2477 //*************************************************************************************************
2478 
2479 
2480 
2481 
2482 //=================================================================================================
2483 //
2484 // TDVECSMATMULTEXPRTRAIT SPECIALIZATIONS
2485 //
2486 //=================================================================================================
2487 
2488 //*************************************************************************************************
2490 template< typename VT, typename MT, typename ST >
2491 struct TDVecSMatMultExprTrait< DVecScalarMultExpr<VT,ST,true>, MT >
2492 {
2493  public:
2494  //**********************************************************************************************
2495  typedef typename SelectType< IsDenseVector<VT>::value && IsRowVector<VT>::value &&
2496  IsSparseMatrix<MT>::value && IsRowMajorMatrix<MT>::value &&
2497  IsNumeric<ST>::value
2498  , typename TDVecScalarMultExprTrait<typename TDVecSMatMultExprTrait<VT,MT>::Type,ST>::Type
2499  , INVALID_TYPE >::Type Type;
2500  //**********************************************************************************************
2501 };
2503 //*************************************************************************************************
2504 
2505 
2506 
2507 
2508 //=================================================================================================
2509 //
2510 // TDVECTSMATMULTEXPRTRAIT SPECIALIZATIONS
2511 //
2512 //=================================================================================================
2513 
2514 //*************************************************************************************************
2516 template< typename VT, typename MT, typename ST >
2517 struct TDVecTSMatMultExprTrait< DVecScalarMultExpr<VT,ST,true>, MT >
2518 {
2519  public:
2520  //**********************************************************************************************
2521  typedef typename SelectType< IsDenseVector<VT>::value && IsRowVector<VT>::value &&
2522  IsSparseMatrix<MT>::value && IsColumnMajorMatrix<MT>::value &&
2523  IsNumeric<ST>::value
2524  , typename TDVecScalarMultExprTrait<typename TDVecTSMatMultExprTrait<VT,MT>::Type,ST>::Type
2525  , INVALID_TYPE >::Type Type;
2526  //**********************************************************************************************
2527 };
2529 //*************************************************************************************************
2530 
2531 
2532 
2533 
2534 //=================================================================================================
2535 //
2536 // SUBVECTOREXPRTRAIT SPECIALIZATIONS
2537 //
2538 //=================================================================================================
2539 
2540 //*************************************************************************************************
2542 template< typename VT, typename ST, bool TF, bool AF >
2543 struct SubvectorExprTrait< DVecScalarMultExpr<VT,ST,TF>, AF >
2544 {
2545  public:
2546  //**********************************************************************************************
2547  typedef typename MultExprTrait< typename SubvectorExprTrait<const VT,AF>::Type, ST >::Type Type;
2548  //**********************************************************************************************
2549 };
2551 //*************************************************************************************************
2552 
2553 } // namespace blaze
2554 
2555 #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:4838
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:936
Header file for the SparseVector base class.
IntrinsicTrait< ElementType >::Type IntrinsicType
Resulting intrinsic element type.
Definition: DVecScalarMultExpr.h:173
ReturnType operator*() const
Direct access to the element at the current iterator position.
Definition: DVecScalarMultExpr.h:295
BLAZE_ALWAYS_INLINE size_t size(const Vector< VT, TF > &vector)
Returns the current size/dimension of the vector.
Definition: Vector.h:258
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:496
Efficient implementation of a compressed matrix.The CompressedMatrix class template is the represent...
Definition: CompressedMatrix.h:205
const ConstIterator operator++(int)
Post-increment operator.
Definition: DVecScalarMultExpr.h:264
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:2478
Header file for the IsRowVector type trait.
Type ElementType
Type of the sparse matrix elements.
Definition: CompressedMatrix.h:257
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:459
const DMatSerialExpr< MT, SO > serial(const DenseMatrix< MT, SO > &dm)
Forces the serial evaluation of the given dense matrix expression dm.
Definition: DMatSerialExpr.h:695
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:130
bool operator!=(const ConstIterator &rhs) const
Inequality comparison between two ConstIterator objects.
Definition: DVecScalarMultExpr.h:327
ConstIterator(IteratorType iterator, RightOperand scalar)
Constructor for the ConstIterator class.
Definition: DVecScalarMultExpr.h:218
Header file for the VecScalarMultExpr base class.
LeftOperand leftOperand() const
Returns the left-hand side dense vector operand.
Definition: DVecScalarMultExpr.h:516
ResultType::ElementType ElementType
Resulting element type.
Definition: DVecScalarMultExpr.h:172
Constraint on the data type.
ValueType value_type
Type of the underlying elements.
Definition: DVecScalarMultExpr.h:203
bool operator<=(const ConstIterator &rhs) const
Less-than comparison between two ConstIterator objects.
Definition: DVecScalarMultExpr.h:360
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:560
PointerType pointer
Pointer return type.
Definition: DVecScalarMultExpr.h:204
VT::ConstIterator IteratorType
ConstIterator type of the dense vector expression.
Definition: DVecScalarMultExpr.h:209
IntrinsicType load(size_t index) const
Access to the intrinsic elements of the vector.
Definition: DVecScalarMultExpr.h:471
SelectType< IsExpression< VT >::value, const VT, const VT & >::Type LeftOperand
Composite type of the left-hand side dense vector expression.
Definition: DVecScalarMultExpr.h:182
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:259
DVecScalarMultExpr(const VT &vector, ST scalar)
Constructor for the DVecScalarMultExpr class.
Definition: DVecScalarMultExpr.h:447
ptrdiff_t DifferenceType
Difference between two iterators.
Definition: DVecScalarMultExpr.h:199
Compile time type selection.The SelectType class template selects one of the two given types T1 and T...
Definition: SelectType.h:59
Header file for the IsTemporary type trait class.
Header file for the multiplication trait.
Header file for the IsFloatingPoint type trait.
const Element * ConstIterator
Iterator over constant elements.
Definition: CompressedMatrix.h:2482
bool canAlias(const T *alias) const
Returns whether the expression can alias with the given address alias.
Definition: DVecScalarMultExpr.h:538
Iterator over the elements of the dense vector.
Definition: DVecScalarMultExpr.h:191
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:176
bool operator>(const ConstIterator &rhs) const
Greater-than comparison between two ConstIterator objects.
Definition: DVecScalarMultExpr.h:349
ResultType::TransposeType TransposeType
Transpose type for expression template evaluations.
Definition: DVecScalarMultExpr.h:171
bool operator>=(const ConstIterator &rhs) const
Greater-than comparison between two ConstIterator objects.
Definition: DVecScalarMultExpr.h:371
ST RightOperand
Composite type of the right-hand side scalar value.
Definition: DVecScalarMultExpr.h:185
VT::ResultType RT
Result type of the dense vector expression.
Definition: DVecScalarMultExpr.h:114
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:195
Constraint on the data type.
DVecScalarMultExpr< VT, ST, TF > This
Type of this DVecScalarMultExpr instance.
Definition: DVecScalarMultExpr.h:169
Type ElementType
Type of the sparse matrix elements.
Definition: CompressedMatrix.h:2476
bool operator<(const ConstIterator &rhs) const
Less-than comparison between two ConstIterator objects.
Definition: DVecScalarMultExpr.h:338
Header file for the SelectType class template.
LeftOperand vector_
Left-hand side dense vector of the multiplication expression.
Definition: DVecScalarMultExpr.h:577
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:463
Header file for the IsDenseMatrix type trait.
size_t size() const
Returns the current size/dimension of the vector.
Definition: DVecScalarMultExpr.h:506
Header file for the EnableIf class template.
ReferenceType reference
Reference return type.
Definition: DVecScalarMultExpr.h:205
ConstIterator & operator++()
Pre-increment operator.
Definition: DVecScalarMultExpr.h:253
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:570
friend const ConstIterator operator+(const ConstIterator &it, size_t inc)
Addition between a ConstIterator and an integral value.
Definition: DVecScalarMultExpr.h:394
Header file for the IsNumeric type trait.
RightOperand scalar_
Right-hand side scalar of the multiplication expression.
Definition: DVecScalarMultExpr.h:578
ElementType ValueType
Type of the underlying elements.
Definition: DVecScalarMultExpr.h:196
BLAZE_ALWAYS_INLINE EnableIf< IsIntegral< T >, Set< T, sizeof(T)> >::Type::Type set(T value)
Sets all values in the vector to the given integral value.
Definition: Set.h:211
bool operator==(const ConstIterator &rhs) const
Equality comparison between two ConstIterator objects.
Definition: DVecScalarMultExpr.h:316
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:2477
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:142
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:425
bool isAliased(const T *alias) const
Returns whether the expression is aliased with the given address alias.
Definition: DVecScalarMultExpr.h:550
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:526
VT::ElementType ET
Element type of the dense vector expression.
Definition: DVecScalarMultExpr.h:116
friend const ConstIterator operator+(size_t inc, const ConstIterator &it)
Addition between an integral value and a ConstIterator.
Definition: DVecScalarMultExpr.h:406
ElementType * PointerType
Pointer return type.
Definition: DVecScalarMultExpr.h:197
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:115
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:418
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:198
ConstIterator begin() const
Returns an iterator to the first non-zero element of the dense vector.
Definition: DVecScalarMultExpr.h:486
IntrinsicType load() const
Access to the intrinsic elements of the vector.
Definition: DVecScalarMultExpr.h:305
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:285
Expression object for dense vector-scalar multiplications.The DVecScalarMultExpr class represents the...
Definition: DVecScalarMultExpr.h:108
ConstIterator & operator+=(size_t inc)
Addition assignment operator.
Definition: DVecScalarMultExpr.h:230
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:242
This ResultType
Result type for expression template evaluations.
Definition: CompressedMatrix.h:2473
Header file for basic type definitions.
Header file for the SubvectorExprTrait class template.
SelectType< useAssign, const ResultType, const DVecScalarMultExpr & >::Type CompositeType
Data type for composite expression templates.
Definition: DVecScalarMultExpr.h:179
const DVecScalarMultExpr< VT, typename VT::ElementType, TF > normalize(const DenseVector< VT, TF > &vec)
Normalization of the dense vector ( ).
Definition: DVecScalarMultExpr.h:1068
MultTrait< RT, ST >::Type ResultType
Result type for expression template evaluations.
Definition: DVecScalarMultExpr.h:170
Header file for the IsColumnVector type trait.
IteratorCategory iterator_category
The iterator category.
Definition: DVecScalarMultExpr.h:202
VT::CompositeType CT
Composite type of the dense vector expression.
Definition: DVecScalarMultExpr.h:117
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:426
#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:206
DifferenceType operator-(const ConstIterator &rhs) const
Calculating the number of elements between two iterators.
Definition: DVecScalarMultExpr.h:382
ConstIterator & operator--()
Pre-decrement operator.
Definition: DVecScalarMultExpr.h:274