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>
78 #include <blaze/system/Inline.h>
80 #include <blaze/util/Assert.h>
85 #include <blaze/util/EnableIf.h>
86 #include <blaze/util/Exception.h>
87 #include <blaze/util/InvalidType.h>
89 #include <blaze/util/mpl/And.h>
90 #include <blaze/util/SelectType.h>
91 #include <blaze/util/Types.h>
95 
96 
97 namespace blaze {
98 
99 //=================================================================================================
100 //
101 // CLASS DVECSCALARMULTEXPR
102 //
103 //=================================================================================================
104 
105 //*************************************************************************************************
112 template< typename VT // Type of the left-hand side dense vector
113  , typename ST // Type of the right-hand side scalar value
114  , bool TF > // Transpose flag
115 class DVecScalarMultExpr : public DenseVector< DVecScalarMultExpr<VT,ST,TF>, TF >
116  , private VecScalarMultExpr
117  , private Computation
118 {
119  private:
120  //**Type definitions****************************************************************************
121  typedef typename VT::ResultType RT;
122  typedef typename VT::ReturnType RN;
123  typedef typename VT::ElementType ET;
124  typedef typename VT::CompositeType CT;
125  //**********************************************************************************************
126 
127  //**Return type evaluation**********************************************************************
129 
134  enum { returnExpr = !IsTemporary<RN>::value };
135 
138  //**********************************************************************************************
139 
140  //**Serial evaluation strategy******************************************************************
142 
149 
151  template< typename VT2 >
153  struct UseAssign {
154  enum { value = useAssign };
155  };
157  //**********************************************************************************************
158 
159  //**Parallel evaluation strategy****************************************************************
161 
167  template< typename VT2 >
168  struct UseSMPAssign {
169  enum { value = ( !VT2::smpAssignable || !VT::smpAssignable ) && useAssign };
170  };
172  //**********************************************************************************************
173 
174  public:
175  //**Type definitions****************************************************************************
181 
184 
187 
189  typedef typename SelectType< IsExpression<VT>::value, const VT, const VT& >::Type LeftOperand;
190 
192  typedef ST RightOperand;
193  //**********************************************************************************************
194 
195  //**ConstIterator class definition**************************************************************
199  {
200  public:
201  //**Type definitions*************************************************************************
202  typedef std::random_access_iterator_tag IteratorCategory;
203  typedef ElementType ValueType;
204  typedef ElementType* PointerType;
205  typedef ElementType& ReferenceType;
207 
208  // STL iterator requirements
209  typedef IteratorCategory iterator_category;
210  typedef ValueType value_type;
211  typedef PointerType pointer;
212  typedef ReferenceType reference;
213  typedef DifferenceType difference_type;
214 
216  typedef typename VT::ConstIterator IteratorType;
217  //*******************************************************************************************
218 
219  //**Constructor******************************************************************************
225  explicit inline ConstIterator( IteratorType iterator, RightOperand scalar )
226  : iterator_( iterator ) // Iterator to the current element
227  , scalar_ ( scalar ) // Scalar of the multiplication expression
228  {}
229  //*******************************************************************************************
230 
231  //**Addition assignment operator*************************************************************
237  inline ConstIterator& operator+=( size_t inc ) {
238  iterator_ += inc;
239  return *this;
240  }
241  //*******************************************************************************************
242 
243  //**Subtraction assignment operator**********************************************************
249  inline ConstIterator& operator-=( size_t dec ) {
250  iterator_ -= dec;
251  return *this;
252  }
253  //*******************************************************************************************
254 
255  //**Prefix increment operator****************************************************************
261  ++iterator_;
262  return *this;
263  }
264  //*******************************************************************************************
265 
266  //**Postfix increment operator***************************************************************
271  inline const ConstIterator operator++( int ) {
272  return ConstIterator( iterator_++ );
273  }
274  //*******************************************************************************************
275 
276  //**Prefix decrement operator****************************************************************
282  --iterator_;
283  return *this;
284  }
285  //*******************************************************************************************
286 
287  //**Postfix decrement operator***************************************************************
292  inline const ConstIterator operator--( int ) {
293  return ConstIterator( iterator_-- );
294  }
295  //*******************************************************************************************
296 
297  //**Element access operator******************************************************************
302  inline ReturnType operator*() const {
303  return *iterator_ * scalar_;
304  }
305  //*******************************************************************************************
306 
307  //**Load function****************************************************************************
312  inline IntrinsicType load() const {
313  return iterator_.load() * set( scalar_ );
314  }
315  //*******************************************************************************************
316 
317  //**Equality operator************************************************************************
323  inline bool operator==( const ConstIterator& rhs ) const {
324  return iterator_ == rhs.iterator_;
325  }
326  //*******************************************************************************************
327 
328  //**Inequality operator**********************************************************************
334  inline bool operator!=( const ConstIterator& rhs ) const {
335  return iterator_ != rhs.iterator_;
336  }
337  //*******************************************************************************************
338 
339  //**Less-than operator***********************************************************************
345  inline bool operator<( const ConstIterator& rhs ) const {
346  return iterator_ < rhs.iterator_;
347  }
348  //*******************************************************************************************
349 
350  //**Greater-than operator********************************************************************
356  inline bool operator>( const ConstIterator& rhs ) const {
357  return iterator_ > rhs.iterator_;
358  }
359  //*******************************************************************************************
360 
361  //**Less-or-equal-than operator**************************************************************
367  inline bool operator<=( const ConstIterator& rhs ) const {
368  return iterator_ <= rhs.iterator_;
369  }
370  //*******************************************************************************************
371 
372  //**Greater-or-equal-than operator***********************************************************
378  inline bool operator>=( const ConstIterator& rhs ) const {
379  return iterator_ >= rhs.iterator_;
380  }
381  //*******************************************************************************************
382 
383  //**Subtraction operator*********************************************************************
389  inline DifferenceType operator-( const ConstIterator& rhs ) const {
390  return iterator_ - rhs.iterator_;
391  }
392  //*******************************************************************************************
393 
394  //**Addition operator************************************************************************
401  friend inline const ConstIterator operator+( const ConstIterator& it, size_t inc ) {
402  return ConstIterator( it.iterator_ + inc );
403  }
404  //*******************************************************************************************
405 
406  //**Addition operator************************************************************************
413  friend inline const ConstIterator operator+( size_t inc, const ConstIterator& it ) {
414  return ConstIterator( it.iterator_ + inc );
415  }
416  //*******************************************************************************************
417 
418  //**Subtraction operator*********************************************************************
425  friend inline const ConstIterator operator-( const ConstIterator& it, size_t dec ) {
426  return ConstIterator( it.iterator_ - dec );
427  }
428  //*******************************************************************************************
429 
430  private:
431  //**Member variables*************************************************************************
432  IteratorType iterator_;
433  RightOperand scalar_;
434  //*******************************************************************************************
435  };
436  //**********************************************************************************************
437 
438  //**Compilation flags***************************************************************************
440  enum { vectorizable = VT::vectorizable &&
443  IsSame<typename UnderlyingElement<ET>::Type,RightOperand>::value ) &&
445 
447  enum { smpAssignable = VT::smpAssignable };
448  //**********************************************************************************************
449 
450  //**Constructor*********************************************************************************
456  explicit inline DVecScalarMultExpr( const VT& vector, ST scalar )
457  : vector_( vector ) // Left-hand side dense vector of the multiplication expression
458  , scalar_( scalar ) // Right-hand side scalar of the multiplication expression
459  {}
460  //**********************************************************************************************
461 
462  //**Subscript operator**************************************************************************
468  inline ReturnType operator[]( size_t index ) const {
469  BLAZE_INTERNAL_ASSERT( index < vector_.size(), "Invalid vector access index" );
470  return vector_[index] * scalar_;
471  }
472  //**********************************************************************************************
473 
474  //**At function*********************************************************************************
481  inline ReturnType at( size_t index ) const {
482  if( index >= vector_.size() ) {
483  BLAZE_THROW_OUT_OF_RANGE( "Invalid vector access index" );
484  }
485  return (*this)[index];
486  }
487  //**********************************************************************************************
488 
489  //**Load function*******************************************************************************
495  BLAZE_ALWAYS_INLINE IntrinsicType load( size_t index ) const {
496  typedef IntrinsicTrait<ElementType> IT;
497  BLAZE_INTERNAL_ASSERT( index < vector_.size() , "Invalid vector access index" );
498  BLAZE_INTERNAL_ASSERT( index % IT::size == 0UL, "Invalid vector access index" );
499  return vector_.load( index ) * set( scalar_ );
500  }
501  //**********************************************************************************************
502 
503  //**Begin function******************************************************************************
508  inline ConstIterator begin() const {
509  return ConstIterator( vector_.begin(), scalar_ );
510  }
511  //**********************************************************************************************
512 
513  //**End function********************************************************************************
518  inline ConstIterator end() const {
519  return ConstIterator( vector_.end(), scalar_ );
520  }
521  //**********************************************************************************************
522 
523  //**Size function*******************************************************************************
528  inline size_t size() const {
529  return vector_.size();
530  }
531  //**********************************************************************************************
532 
533  //**Left operand access*************************************************************************
538  inline LeftOperand leftOperand() const {
539  return vector_;
540  }
541  //**********************************************************************************************
542 
543  //**Right operand access************************************************************************
548  inline RightOperand rightOperand() const {
549  return scalar_;
550  }
551  //**********************************************************************************************
552 
553  //**********************************************************************************************
559  template< typename T >
560  inline bool canAlias( const T* alias ) const {
561  return IsComputation<VT>::value && vector_.canAlias( alias );
562  }
563  //**********************************************************************************************
564 
565  //**********************************************************************************************
571  template< typename T >
572  inline bool isAliased( const T* alias ) const {
573  return vector_.isAliased( alias );
574  }
575  //**********************************************************************************************
576 
577  //**********************************************************************************************
582  inline bool isAligned() const {
583  return vector_.isAligned();
584  }
585  //**********************************************************************************************
586 
587  //**********************************************************************************************
592  inline bool canSMPAssign() const {
593  return vector_.canSMPAssign() || ( size() > SMP_DVECSCALARMULT_THRESHOLD );
594  }
595  //**********************************************************************************************
596 
597  private:
598  //**Member variables****************************************************************************
599  LeftOperand vector_;
600  RightOperand scalar_;
601  //**********************************************************************************************
602 
603  //**Assignment to dense vectors*****************************************************************
617  template< typename VT2 > // Type of the target dense vector
618  friend inline typename EnableIf< UseAssign<VT2> >::Type
619  assign( DenseVector<VT2,TF>& lhs, const DVecScalarMultExpr& rhs )
620  {
622 
623  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
624 
625  assign( ~lhs, rhs.vector_ );
626  assign( ~lhs, (~lhs) * rhs.scalar_ );
627  }
629  //**********************************************************************************************
630 
631  //**Assignment to sparse vectors****************************************************************
645  template< typename VT2 > // Type of the target sparse vector
646  friend inline typename EnableIf< UseAssign<VT2> >::Type
647  assign( SparseVector<VT2,TF>& lhs, const DVecScalarMultExpr& rhs )
648  {
650 
651  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
652 
653  assign( ~lhs, rhs.vector_ );
654  (~lhs) *= rhs.scalar_;
655  }
657  //**********************************************************************************************
658 
659  //**Addition assignment to dense vectors********************************************************
673  template< typename VT2 > // Type of the target dense vector
674  friend inline typename EnableIf< UseAssign<VT2> >::Type
675  addAssign( DenseVector<VT2,TF>& lhs, const DVecScalarMultExpr& rhs )
676  {
678 
682 
683  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
684 
685  const ResultType tmp( serial( rhs ) );
686  addAssign( ~lhs, tmp );
687  }
689  //**********************************************************************************************
690 
691  //**Addition assignment to sparse vectors*******************************************************
692  // No special implementation for the addition assignment to sparse vectors.
693  //**********************************************************************************************
694 
695  //**Subtraction assignment to dense vectors*****************************************************
709  template< typename VT2 > // Type of the target dense vector
710  friend inline typename EnableIf< UseAssign<VT2> >::Type
711  subAssign( DenseVector<VT2,TF>& lhs, const DVecScalarMultExpr& rhs )
712  {
714 
718 
719  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
720 
721  const ResultType tmp( serial( rhs ) );
722  subAssign( ~lhs, tmp );
723  }
725  //**********************************************************************************************
726 
727  //**Subtraction assignment to sparse vectors****************************************************
728  // No special implementation for the subtraction assignment to sparse vectors.
729  //**********************************************************************************************
730 
731  //**Multiplication assignment to dense vectors**************************************************
745  template< typename VT2 > // Type of the target dense vector
746  friend inline typename EnableIf< UseAssign<VT2> >::Type
747  multAssign( DenseVector<VT2,TF>& lhs, const DVecScalarMultExpr& rhs )
748  {
750 
754 
755  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
756 
757  const ResultType tmp( serial( rhs ) );
758  multAssign( ~lhs, tmp );
759  }
761  //**********************************************************************************************
762 
763  //**Multiplication assignment to sparse vectors*************************************************
764  // No special implementation for the multiplication assignment to sparse vectors.
765  //**********************************************************************************************
766 
767  //**SMP assignment to dense vectors*************************************************************
781  template< typename VT2 > // Type of the target dense vector
782  friend inline typename EnableIf< UseSMPAssign<VT2> >::Type
783  smpAssign( DenseVector<VT2,TF>& lhs, const DVecScalarMultExpr& rhs )
784  {
786 
787  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
788 
789  smpAssign( ~lhs, rhs.vector_ );
790  smpAssign( ~lhs, (~lhs) * rhs.scalar_ );
791  }
793  //**********************************************************************************************
794 
795  //**SMP assignment to sparse vectors************************************************************
809  template< typename VT2 > // Type of the target sparse vector
810  friend inline typename EnableIf< UseSMPAssign<VT2> >::Type
811  smpAssign( SparseVector<VT2,TF>& lhs, const DVecScalarMultExpr& rhs )
812  {
814 
815  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
816 
817  smpAssign( ~lhs, rhs.vector_ );
818  (~lhs) *= rhs.scalar_;
819  }
821  //**********************************************************************************************
822 
823  //**SMP addition assignment to dense vectors****************************************************
837  template< typename VT2 > // Type of the target dense vector
838  friend inline typename EnableIf< UseSMPAssign<VT2> >::Type
839  smpAddAssign( DenseVector<VT2,TF>& lhs, const DVecScalarMultExpr& rhs )
840  {
842 
846 
847  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
848 
849  const ResultType tmp( rhs );
850  smpAddAssign( ~lhs, tmp );
851  }
853  //**********************************************************************************************
854 
855  //**SMP addition assignment to sparse vectors***************************************************
856  // No special implementation for the SMP addition assignment to sparse vectors.
857  //**********************************************************************************************
858 
859  //**SMP subtraction assignment to dense vectors*************************************************
873  template< typename VT2 > // Type of the target dense vector
874  friend inline typename EnableIf< UseSMPAssign<VT2> >::Type
875  smpSubAssign( DenseVector<VT2,TF>& lhs, const DVecScalarMultExpr& rhs )
876  {
878 
882 
883  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
884 
885  const ResultType tmp( rhs );
886  smpSubAssign( ~lhs, tmp );
887  }
889  //**********************************************************************************************
890 
891  //**SMP subtraction assignment to sparse vectors************************************************
892  // No special implementation for the SMP subtraction assignment to sparse vectors.
893  //**********************************************************************************************
894 
895  //**SMP multiplication assignment to dense vectors**********************************************
909  template< typename VT2 > // Type of the target dense vector
910  friend inline typename EnableIf< UseSMPAssign<VT2> >::Type
911  smpMultAssign( DenseVector<VT2,TF>& lhs, const DVecScalarMultExpr& rhs )
912  {
914 
918 
919  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
920 
921  const ResultType tmp( rhs );
922  smpMultAssign( ~lhs, tmp );
923  }
925  //**********************************************************************************************
926 
927  //**SMP multiplication assignment to sparse vectors*********************************************
928  // No special implementation for the SMP multiplication assignment to sparse vectors.
929  //**********************************************************************************************
930 
931  //**Compile time checks*************************************************************************
936  BLAZE_CONSTRAINT_MUST_BE_SAME_TYPE( ST, RightOperand );
938  //**********************************************************************************************
939 };
940 //*************************************************************************************************
941 
942 
943 
944 
945 //=================================================================================================
946 //
947 // GLOBAL UNARY ARITHMETIC OPERATORS
948 //
949 //=================================================================================================
950 
951 //*************************************************************************************************
968 template< typename VT // Type of the dense vector
969  , bool TF > // Transpose flag
970 inline const DVecScalarMultExpr<VT,typename UnderlyingBuiltin<VT>::Type,TF>
972 {
974 
975  typedef typename UnderlyingBuiltin<VT>::Type ElementType;
977 }
978 //*************************************************************************************************
979 
980 
981 
982 
983 //=================================================================================================
984 //
985 // GLOBAL BINARY ARITHMETIC OPERATORS
986 //
987 //=================================================================================================
988 
989 //*************************************************************************************************
1011 template< typename T1 // Type of the left-hand side dense vector
1012  , typename T2 // Type of the right-hand side scalar
1013  , bool TF > // Transpose flag
1014 inline const typename EnableIf< IsNumeric<T2>, typename MultExprTrait<T1,T2>::Type >::Type
1015  operator*( const DenseVector<T1,TF>& vec, T2 scalar )
1016 {
1018 
1019  typedef typename MultExprTrait<T1,T2>::Type Type;
1020  return Type( ~vec, scalar );
1021 }
1022 //*************************************************************************************************
1023 
1024 
1025 //*************************************************************************************************
1047 template< typename T1 // Type of the left-hand side scalar
1048  , typename T2 // Type of the right-hand side dense vector
1049  , bool TF > // Transpose flag
1050 inline const typename EnableIf< IsNumeric<T1>, typename MultExprTrait<T1,T2>::Type >::Type
1051  operator*( T1 scalar, const DenseVector<T2,TF>& vec )
1052 {
1054 
1055  typedef typename MultExprTrait<T1,T2>::Type Type;
1056  return Type( ~vec, scalar );
1057 }
1058 //*************************************************************************************************
1059 
1060 
1061 
1062 
1063 //=================================================================================================
1064 //
1065 // GLOBAL FUNCTIONS
1066 //
1067 //=================================================================================================
1068 
1069 //*************************************************************************************************
1087 template< typename VT // Type of the dense vector
1088  , bool TF > // Transpose flag
1089 inline const DVecScalarMultExpr<VT,typename VT::ElementType,TF>
1091 {
1092  typedef typename VT::ElementType ElementType;
1093 
1095 
1096  const ElementType len ( length( ~vec ) );
1097  const ElementType ilen( ( len != ElementType(0) )?( ElementType(1) / len ):( 0 ) );
1098 
1099  return DVecScalarMultExpr<VT,ElementType,TF>( ~vec, ilen );
1100 }
1101 //*************************************************************************************************
1102 
1103 
1104 
1105 
1106 //=================================================================================================
1107 //
1108 // GLOBAL RESTRUCTURING UNARY ARITHMETIC OPERATORS
1109 //
1110 //=================================================================================================
1111 
1112 //*************************************************************************************************
1124 template< typename VT // Type of the dense vector
1125  , typename ST // Type of the scalar
1126  , bool TF > // Transpose flag
1127 inline const DVecScalarMultExpr<VT,ST,TF>
1128  operator-( const DVecScalarMultExpr<VT,ST,TF>& dv )
1129 {
1131 
1132  return DVecScalarMultExpr<VT,ST,TF>( dv.leftOperand(), -dv.rightOperand() );
1133 }
1135 //*************************************************************************************************
1136 
1137 
1138 
1139 
1140 //=================================================================================================
1141 //
1142 // GLOBAL RESTRUCTURING BINARY ARITHMETIC OPERATORS
1143 //
1144 //=================================================================================================
1145 
1146 //*************************************************************************************************
1159 template< typename VT // Type of the dense vector of the left-hand side expression
1160  , typename ST1 // Type of the scalar of the left-hand side expression
1161  , bool TF // Transpose flag of the dense vector
1162  , typename ST2 > // Type of the right-hand side scalar
1163 inline const typename EnableIf< IsNumeric<ST2>
1164  , typename MultExprTrait< DVecScalarMultExpr<VT,ST1,TF>, ST2 >::Type >::Type
1165  operator*( const DVecScalarMultExpr<VT,ST1,TF>& vec, ST2 scalar )
1166 {
1168 
1169  return vec.leftOperand() * ( vec.rightOperand() * scalar );
1170 }
1172 //*************************************************************************************************
1173 
1174 
1175 //*************************************************************************************************
1188 template< typename ST1 // Type of the left-hand side scalar
1189  , typename VT // Type of the dense vector of the right-hand side expression
1190  , typename ST2 // Type of the scalar of the right-hand side expression
1191  , bool TF > // Transpose flag of the dense vector
1192 inline const typename EnableIf< IsNumeric<ST1>
1193  , typename MultExprTrait< ST1, DVecScalarMultExpr<VT,ST2,TF> >::Type >::Type
1194  operator*( ST1 scalar, const DVecScalarMultExpr<VT,ST2,TF>& vec )
1195 {
1197 
1198  return vec.leftOperand() * ( scalar * vec.rightOperand() );
1199 }
1201 //*************************************************************************************************
1202 
1203 
1204 //*************************************************************************************************
1217 template< typename VT // Type of the dense vector of the left-hand side expression
1218  , typename ST1 // Type of the scalar of the left-hand side expression
1219  , bool TF // Transpose flag of the dense vector
1220  , typename ST2 > // Type of the right-hand side scalar
1221 inline const typename EnableIf< And< IsNumeric<ST2>, IsInvertible< typename DivTrait<ST1,ST2>::Type > >
1222  , typename DivExprTrait< DVecScalarMultExpr<VT,ST1,TF>, ST2 >::Type >::Type
1223  operator/( const DVecScalarMultExpr<VT,ST1,TF>& vec, ST2 scalar )
1224 {
1226 
1227  return vec.leftOperand() * ( vec.rightOperand() / scalar );
1228 }
1230 //*************************************************************************************************
1231 
1232 
1233 //*************************************************************************************************
1247 template< typename VT1 // Type of the dense vector of the left-hand side expression
1248  , typename ST // Type of the scalar of the left-hand side expression
1249  , bool TF // Transpose flag of the dense vectors
1250  , typename VT2 > // Type of the right-hand side dense vector
1251 inline const typename MultExprTrait< DVecScalarMultExpr<VT1,ST,TF>, VT2 >::Type
1252  operator*( const DVecScalarMultExpr<VT1,ST,TF>& lhs, const DenseVector<VT2,TF>& rhs )
1253 {
1255 
1256  return ( lhs.leftOperand() * (~rhs) ) * lhs.rightOperand();
1257 }
1259 //*************************************************************************************************
1260 
1261 
1262 //*************************************************************************************************
1276 template< typename VT1 // Type of the left-hand side dense vector
1277  , bool TF // Transpose flag of the dense vectors
1278  , typename VT2 // Type of the dense vector of the right-hand side expression
1279  , typename ST > // Type of the scalar of the right-hand side expression
1280 inline const typename MultExprTrait< VT1, DVecScalarMultExpr<VT2,ST,TF> >::Type
1281  operator*( const DenseVector<VT1,TF>& lhs, const DVecScalarMultExpr<VT2,ST,TF>& rhs )
1282 {
1284 
1285  return ( (~lhs) * rhs.leftOperand() ) * rhs.rightOperand();
1286 }
1288 //*************************************************************************************************
1289 
1290 
1291 //*************************************************************************************************
1305 template< typename VT1 // Type of the dense vector of the left-hand side expression
1306  , typename ST1 // Type of the scalar of the left-hand side expression
1307  , bool TF // Transpose flag of the dense vectors
1308  , typename VT2 // Type of the dense vector of the right-hand side expression
1309  , typename ST2 > // Type of the scalar of the right-hand side expression
1310 inline const typename MultExprTrait< DVecScalarMultExpr<VT1,ST1,TF>, DVecScalarMultExpr<VT2,ST2,TF> >::Type
1311  operator*( const DVecScalarMultExpr<VT1,ST1,TF>& lhs, const DVecScalarMultExpr<VT2,ST2,TF>& rhs )
1312 {
1314 
1315  return ( lhs.leftOperand() * rhs.leftOperand() ) * ( lhs.rightOperand() * rhs.rightOperand() );
1316 }
1318 //*************************************************************************************************
1319 
1320 
1321 //*************************************************************************************************
1335 template< typename VT1 // Type of the dense vector of the left-hand side expression
1336  , typename ST // Type of the scalar of the left-hand side expression
1337  , typename VT2 > // Type of the right-hand side dense vector
1338 inline const typename MultExprTrait< DVecScalarMultExpr<VT1,ST,false>, VT2 >::Type
1339  operator*( const DVecScalarMultExpr<VT1,ST,false>& lhs, const DenseVector<VT2,true>& rhs )
1340 {
1342 
1343  return ( lhs.leftOperand() * (~rhs) ) * lhs.rightOperand();
1344 }
1346 //*************************************************************************************************
1347 
1348 
1349 //*************************************************************************************************
1363 template< typename VT1 // Type of the left-hand side dense vector
1364  , typename VT2 // Type of the dense vector of the right-hand side expression
1365  , typename ST > // Type of the scalar of the right-hand side expression
1366 inline const typename MultExprTrait< VT1, DVecScalarMultExpr<VT2,ST,true> >::Type
1367  operator*( const DenseVector<VT1,false>& lhs, const DVecScalarMultExpr<VT2,ST,true>& rhs )
1368 {
1370 
1371  return ( (~lhs) * rhs.leftOperand() ) * rhs.rightOperand();
1372 }
1374 //*************************************************************************************************
1375 
1376 
1377 //*************************************************************************************************
1391 template< typename VT1 // Type of the dense vector of the left-hand side expression
1392  , typename ST1 // Type of the scalar of the left-hand side expression
1393  , typename VT2 // Type of the dense vector of the right-hand side expression
1394  , typename ST2 > // Type of the scalar of the right-hand side expression
1395 inline const typename MultExprTrait< DVecScalarMultExpr<VT1,ST1,false>, DVecScalarMultExpr<VT2,ST2,true> >::Type
1396  operator*( const DVecScalarMultExpr<VT1,ST1,false>& lhs, const DVecScalarMultExpr<VT2,ST2,true>& rhs )
1397 {
1399 
1400  return ( lhs.leftOperand() * rhs.leftOperand() ) * ( lhs.rightOperand() * rhs.rightOperand() );
1401 }
1403 //*************************************************************************************************
1404 
1405 
1406 //*************************************************************************************************
1420 template< typename VT1 // Type of the dense vector of the left-hand side expression
1421  , typename ST // Type of the scalar of the left-hand side expression
1422  , bool TF // Transpose flag of the vectors
1423  , typename VT2 > // Type of the right-hand side sparse vector
1424 inline const typename MultExprTrait< DVecScalarMultExpr<VT1,ST,TF>, VT2 >::Type
1425  operator*( const DVecScalarMultExpr<VT1,ST,TF>& lhs, const SparseVector<VT2,TF>& rhs )
1426 {
1428 
1429  return ( lhs.leftOperand() * (~rhs) ) * lhs.rightOperand();
1430 }
1432 //*************************************************************************************************
1433 
1434 
1435 //*************************************************************************************************
1449 template< typename VT1 // Type of the left-hand side sparse vector
1450  , bool TF // Transpose flag of the vectors
1451  , typename VT2 // Type of the dense vector of the right-hand side expression
1452  , typename ST > // Type of the scalar of the right-hand side expression
1453 inline const typename MultExprTrait< VT1, DVecScalarMultExpr<VT2,ST,TF> >::Type
1454  operator*( const SparseVector<VT1,TF>& lhs, const DVecScalarMultExpr<VT2,ST,TF>& rhs )
1455 {
1457 
1458  return ( (~lhs) * rhs.leftOperand() ) * rhs.rightOperand();
1459 }
1461 //*************************************************************************************************
1462 
1463 
1464 //*************************************************************************************************
1479 template< typename VT1 // Type of the dense vector of the left-hand side expression
1480  , typename ST1 // Type of the scalar of the left-hand side expression
1481  , bool TF // Transpose flag of the vectors
1482  , typename VT2 // Type of the sparse vector of the right-hand side expression
1483  , typename ST2 > // Type of the scalar o the right-hand side expression
1484 inline const typename MultExprTrait< DVecScalarMultExpr<VT1,ST1,TF>, SVecScalarMultExpr<VT2,ST2,TF> >::Type
1485  operator*( const DVecScalarMultExpr<VT1,ST1,TF>& lhs, const SVecScalarMultExpr<VT2,ST2,TF>& rhs )
1486 {
1488 
1489  return ( lhs.leftOperand() * rhs.leftOperand() ) * ( lhs.rightOperand() * rhs.rightOperand() );
1490 }
1492 //*************************************************************************************************
1493 
1494 
1495 //*************************************************************************************************
1510 template< typename VT1 // Type of the sparse vector of the left-hand side expression
1511  , typename ST1 // Type of the scalar of the left-hand side expression
1512  , bool TF // Transpose flag of the vectors
1513  , typename VT2 // Type of the dense vector of the right-hand side expression
1514  , typename ST2 > // Type of the scalar o the right-hand side expression
1515 inline const typename MultExprTrait< SVecScalarMultExpr<VT1,ST1,TF>, DVecScalarMultExpr<VT2,ST2,TF> >::Type
1516  operator*( const SVecScalarMultExpr<VT1,ST1,TF>& lhs, const DVecScalarMultExpr<VT2,ST2,TF>& rhs )
1517 {
1519 
1520  return ( lhs.leftOperand() * rhs.leftOperand() ) * ( lhs.rightOperand() * rhs.rightOperand() );
1521 }
1523 //*************************************************************************************************
1524 
1525 
1526 //*************************************************************************************************
1540 template< typename VT1 // Type of the dense vector of the left-hand side expression
1541  , typename ST // Type of the scalar of the left-hand side expression
1542  , typename VT2 > // Type of the right-hand side sparse vector
1543 inline const typename MultExprTrait< DVecScalarMultExpr<VT1,ST,false>, VT2 >::Type
1544  operator*( const DVecScalarMultExpr<VT1,ST,false>& lhs, const SparseVector<VT2,true>& rhs )
1545 {
1547 
1548  return ( lhs.leftOperand() * (~rhs) ) * lhs.rightOperand();
1549 }
1551 //*************************************************************************************************
1552 
1553 
1554 //*************************************************************************************************
1568 template< typename VT1 // Type of the left-hand side sparse vector
1569  , typename VT2 // Type of the dense vector of the right-hand side expression
1570  , typename ST > // Type of the scalar of the right-hand side expression
1571 inline const typename MultExprTrait< VT1, DVecScalarMultExpr<VT2,ST,true> >::Type
1572  operator*( const SparseVector<VT1,false>& lhs, const DVecScalarMultExpr<VT2,ST,true>& rhs )
1573 {
1575 
1576  return ( (~lhs) * rhs.leftOperand() ) * rhs.rightOperand();
1577 }
1579 //*************************************************************************************************
1580 
1581 
1582 //*************************************************************************************************
1597 template< typename VT1 // Type of the dense vector of the left-hand side expression
1598  , typename ST1 // Type of the scalar of the left-hand side expression
1599  , typename VT2 // Type of the sparse vector of the right-hand side expression
1600  , typename ST2 > // Type of the scalar o the right-hand side expression
1601 inline const typename MultExprTrait< DVecScalarMultExpr<VT1,ST1,false>, SVecScalarMultExpr<VT2,ST2,true> >::Type
1602  operator*( const DVecScalarMultExpr<VT1,ST1,false>& lhs, const SVecScalarMultExpr<VT2,ST2,true>& rhs )
1603 {
1605 
1606  return ( lhs.leftOperand() * rhs.leftOperand() ) * ( lhs.rightOperand() * rhs.rightOperand() );
1607 }
1609 //*************************************************************************************************
1610 
1611 
1612 //*************************************************************************************************
1627 template< typename VT1 // Type of the sparse vector of the left-hand side expression
1628  , typename ST1 // Type of the scalar of the left-hand side expression
1629  , typename VT2 // Type of the dense vector of the right-hand side expression
1630  , typename ST2 > // Type of the scalar o the right-hand side expression
1631 inline const typename MultExprTrait< SVecScalarMultExpr<VT1,ST1,false>, DVecScalarMultExpr<VT2,ST2,true> >::Type
1632  operator*( const SVecScalarMultExpr<VT1,ST1,false>& lhs, const DVecScalarMultExpr<VT2,ST2,true>& rhs )
1633 {
1635 
1636  return ( lhs.leftOperand() * rhs.leftOperand() ) * ( lhs.rightOperand() * rhs.rightOperand() );
1637 }
1639 //*************************************************************************************************
1640 
1641 
1642 //*************************************************************************************************
1656 template< typename MT // Type of the left-hand side dense matrix
1657  , bool SO // Storage order of the left-hand side dense matrix
1658  , typename VT // Type of the dense vector of the right-hand side expression
1659  , typename ST > // Type of the scalar of the right-hand side expression
1660 inline const typename MultExprTrait< MT, DVecScalarMultExpr<VT,ST,false> >::Type
1661  operator*( const DenseMatrix<MT,SO>& mat, const DVecScalarMultExpr<VT,ST,false>& vec )
1662 {
1664 
1665  return ( (~mat) * vec.leftOperand() ) * vec.rightOperand();
1666 }
1668 //*************************************************************************************************
1669 
1670 
1671 //*************************************************************************************************
1685 template< typename VT // Type of the dense vector of the left-hand side expression
1686  , typename ST // Type of the scalar of the left-hand side expression
1687  , typename MT // Type of the right-hand side dense matrix
1688  , bool SO > // Storage order of the right-hand side dense matrix
1689 inline const typename MultExprTrait< DVecScalarMultExpr<VT,ST,true>, MT >::Type
1690  operator*( const DVecScalarMultExpr<VT,ST,true>& vec, const DenseMatrix<MT,SO>& mat )
1691 {
1693 
1694  return ( vec.leftOperand() * (~mat) ) * vec.rightOperand();
1695 }
1697 //*************************************************************************************************
1698 
1699 
1700 //*************************************************************************************************
1714 template< typename MT // Type of the left-hand side sparse matrix
1715  , bool SO // Storage order of the left-hand side sparse matrix
1716  , typename VT // Type of the dense vector of the right-hand side expression
1717  , typename ST > // Type of the scalar of the right-hand side expression
1718 inline const typename MultExprTrait< MT, DVecScalarMultExpr<VT,ST,false> >::Type
1719  operator*( const SparseMatrix<MT,SO>& mat, const DVecScalarMultExpr<VT,ST,false>& vec )
1720 {
1722 
1723  return ( (~mat) * vec.leftOperand() ) * vec.rightOperand();
1724 }
1726 //*************************************************************************************************
1727 
1728 
1729 //*************************************************************************************************
1743 template< typename VT // Type of the dense vector of the left-hand side expression
1744  , typename ST // Type of the scalar of the left-hand side expression
1745  , typename MT // Type of the right-hand side sparse matrix
1746  , bool SO > // Storage order of the right-hand side sparse matrix
1747 inline const typename MultExprTrait< DVecScalarMultExpr<VT,ST,true>, MT >::Type
1748  operator*( const DVecScalarMultExpr<VT,ST,true>& vec, const SparseMatrix<MT,SO>& mat )
1749 {
1751 
1752  return ( vec.leftOperand() * (~mat) ) * vec.rightOperand();
1753 }
1755 //*************************************************************************************************
1756 
1757 
1758 
1759 
1760 //=================================================================================================
1761 //
1762 // SIZE SPECIALIZATIONS
1763 //
1764 //=================================================================================================
1765 
1766 //*************************************************************************************************
1768 template< typename VT, typename ST, bool TF >
1769 struct Size< DVecScalarMultExpr<VT,ST,TF> > : public Size<VT>
1770 {};
1772 //*************************************************************************************************
1773 
1774 
1775 
1776 
1777 //=================================================================================================
1778 //
1779 // ISALIGNED SPECIALIZATIONS
1780 //
1781 //=================================================================================================
1782 
1783 //*************************************************************************************************
1785 template< typename VT, typename ST, bool TF >
1786 struct IsAligned< DVecScalarMultExpr<VT,ST,TF> > : public IsTrue< IsAligned<VT>::value >
1787 {};
1789 //*************************************************************************************************
1790 
1791 
1792 
1793 
1794 //=================================================================================================
1795 //
1796 // ISPADDED SPECIALIZATIONS
1797 //
1798 //=================================================================================================
1799 
1800 //*************************************************************************************************
1802 template< typename VT, typename ST, bool TF >
1803 struct IsPadded< DVecScalarMultExpr<VT,ST,TF> > : public IsTrue< IsPadded<VT>::value >
1804 {};
1806 //*************************************************************************************************
1807 
1808 
1809 
1810 
1811 //=================================================================================================
1812 //
1813 // DVECSCALARMULTEXPRTRAIT SPECIALIZATIONS
1814 //
1815 //=================================================================================================
1816 
1817 //*************************************************************************************************
1819 template< typename VT, typename ST1, typename ST2 >
1820 struct DVecScalarMultExprTrait< DVecScalarMultExpr<VT,ST1,false>, ST2 >
1821 {
1822  public:
1823  //**********************************************************************************************
1824  typedef typename SelectType< IsDenseVector<VT>::value && IsColumnVector<VT>::value &&
1825  IsNumeric<ST1>::value && IsNumeric<ST2>::value
1826  , typename DVecScalarMultExprTrait<VT,typename MultTrait<ST1,ST2>::Type>::Type
1827  , INVALID_TYPE >::Type Type;
1828  //**********************************************************************************************
1829 };
1831 //*************************************************************************************************
1832 
1833 
1834 
1835 
1836 //=================================================================================================
1837 //
1838 // TDVECSCALARMULTEXPRTRAIT SPECIALIZATIONS
1839 //
1840 //=================================================================================================
1841 
1842 //*************************************************************************************************
1844 template< typename VT, typename ST1, typename ST2 >
1845 struct TDVecScalarMultExprTrait< DVecScalarMultExpr<VT,ST1,true>, ST2 >
1846 {
1847  public:
1848  //**********************************************************************************************
1849  typedef typename SelectType< IsDenseVector<VT>::value && IsRowVector<VT>::value &&
1850  IsNumeric<ST1>::value && IsNumeric<ST2>::value
1851  , typename TDVecScalarMultExprTrait<VT,typename MultTrait<ST1,ST2>::Type>::Type
1852  , INVALID_TYPE >::Type Type;
1853  //**********************************************************************************************
1854 };
1856 //*************************************************************************************************
1857 
1858 
1859 
1860 
1861 //=================================================================================================
1862 //
1863 // DVECSCALARDIVEXPRTRAIT SPECIALIZATIONS
1864 //
1865 //=================================================================================================
1866 
1867 //*************************************************************************************************
1869 template< typename VT, typename ST1, typename ST2 >
1870 struct DVecScalarDivExprTrait< DVecScalarMultExpr<VT,ST1,false>, ST2 >
1871 {
1872  private:
1873  //**********************************************************************************************
1874  typedef typename DivTrait<ST1,ST2>::Type ScalarType;
1875  //**********************************************************************************************
1876 
1877  //**********************************************************************************************
1878  enum { condition = IsInvertible<ScalarType>::value };
1879  //**********************************************************************************************
1880 
1881  //**********************************************************************************************
1882  typedef typename DVecScalarMultExprTrait<VT,ScalarType>::Type T1;
1883  typedef typename DVecScalarDivExprTrait<VT,ScalarType>::Type T2;
1884  //**********************************************************************************************
1885 
1886  public:
1887  //**********************************************************************************************
1888  typedef typename SelectType< IsDenseVector<VT>::value && IsColumnVector<VT>::value &&
1889  IsNumeric<ST1>::value && IsNumeric<ST2>::value
1890  , typename SelectType<condition,T1,T2>::Type
1891  , INVALID_TYPE >::Type Type;
1892  //**********************************************************************************************
1893 };
1895 //*************************************************************************************************
1896 
1897 
1898 
1899 
1900 //=================================================================================================
1901 //
1902 // TDVECSCALARDIVEXPRTRAIT SPECIALIZATIONS
1903 //
1904 //=================================================================================================
1905 
1906 //*************************************************************************************************
1908 template< typename VT, typename ST1, typename ST2 >
1909 struct TDVecScalarDivExprTrait< DVecScalarMultExpr<VT,ST1,true>, ST2 >
1910 {
1911  private:
1912  //**********************************************************************************************
1913  typedef typename DivTrait<ST1,ST2>::Type ScalarType;
1914  //**********************************************************************************************
1915 
1916  //**********************************************************************************************
1917  enum { condition = IsInvertible<ScalarType>::value };
1918  //**********************************************************************************************
1919 
1920  //**********************************************************************************************
1921  typedef typename TDVecScalarMultExprTrait<VT,ScalarType>::Type T1;
1922  typedef typename TDVecScalarDivExprTrait<VT,ScalarType>::Type T2;
1923  //**********************************************************************************************
1924 
1925  public:
1926  //**********************************************************************************************
1927  typedef typename SelectType< IsDenseVector<VT>::value && IsRowVector<VT>::value &&
1928  IsNumeric<ST1>::value && IsNumeric<ST2>::value
1929  , typename SelectType<condition,T1,T2>::Type
1930  , INVALID_TYPE >::Type Type;
1931  //**********************************************************************************************
1932 };
1934 //*************************************************************************************************
1935 
1936 
1937 
1938 
1939 //=================================================================================================
1940 //
1941 // DVECDVECMULTEXPRTRAIT SPECIALIZATIONS
1942 //
1943 //=================================================================================================
1944 
1945 //*************************************************************************************************
1947 template< typename VT1, typename ST, typename VT2 >
1948 struct DVecDVecMultExprTrait< DVecScalarMultExpr<VT1,ST,false>, VT2 >
1949 {
1950  public:
1951  //**********************************************************************************************
1952  typedef typename SelectType< IsDenseVector<VT1>::value && IsColumnVector<VT1>::value &&
1953  IsDenseVector<VT2>::value && IsColumnVector<VT2>::value &&
1954  IsNumeric<ST>::value
1955  , typename DVecScalarMultExprTrait<typename DVecDVecMultExprTrait<VT1,VT2>::Type,ST>::Type
1956  , INVALID_TYPE >::Type Type;
1957  //**********************************************************************************************
1958 };
1960 //*************************************************************************************************
1961 
1962 
1963 //*************************************************************************************************
1965 template< typename VT1, typename VT2, typename ST >
1966 struct DVecDVecMultExprTrait< VT1, DVecScalarMultExpr<VT2,ST,false> >
1967 {
1968  public:
1969  //**********************************************************************************************
1970  typedef typename SelectType< IsDenseVector<VT1>::value && IsColumnVector<VT1>::value &&
1971  IsDenseVector<VT2>::value && IsColumnVector<VT2>::value &&
1972  IsNumeric<ST>::value
1973  , typename DVecScalarMultExprTrait<typename DVecDVecMultExprTrait<VT1,VT2>::Type,ST>::Type
1974  , INVALID_TYPE >::Type Type;
1975  //**********************************************************************************************
1976 };
1978 //*************************************************************************************************
1979 
1980 
1981 //*************************************************************************************************
1983 template< typename VT1, typename ST1, typename VT2, typename ST2 >
1984 struct DVecDVecMultExprTrait< DVecScalarMultExpr<VT1,ST1,false>, DVecScalarMultExpr<VT2,ST2,false> >
1985 {
1986  public:
1987  //**********************************************************************************************
1988  typedef typename SelectType< IsDenseVector<VT1>::value && IsColumnVector<VT1>::value &&
1989  IsDenseVector<VT2>::value && IsColumnVector<VT2>::value &&
1990  IsNumeric<ST1>::value && IsNumeric<ST2>::value
1991  , typename DVecScalarMultExprTrait<typename DVecDVecMultExprTrait<VT1,VT2>::Type,typename MultTrait<ST1,ST2>::Type>::Type
1992  , INVALID_TYPE >::Type Type;
1993  //**********************************************************************************************
1994 };
1996 //*************************************************************************************************
1997 
1998 
1999 
2000 
2001 //=================================================================================================
2002 //
2003 // DVECTDVECMULTEXPRTRAIT SPECIALIZATIONS
2004 //
2005 //=================================================================================================
2006 
2007 //*************************************************************************************************
2009 template< typename VT1, typename ST, typename VT2 >
2010 struct DVecTDVecMultExprTrait< DVecScalarMultExpr<VT1,ST,false>, VT2 >
2011 {
2012  public:
2013  //**********************************************************************************************
2014  typedef typename SelectType< IsDenseVector<VT1>::value && IsColumnVector<VT1>::value &&
2015  IsDenseVector<VT2>::value && IsRowVector<VT2>::value &&
2016  IsNumeric<ST>::value
2017  , typename DMatScalarMultExprTrait<typename DVecTDVecMultExprTrait<VT1,VT2>::Type,ST>::Type
2018  , INVALID_TYPE >::Type Type;
2019  //**********************************************************************************************
2020 };
2022 //*************************************************************************************************
2023 
2024 
2025 //*************************************************************************************************
2027 template< typename VT1, typename VT2, typename ST >
2028 struct DVecTDVecMultExprTrait< VT1, DVecScalarMultExpr<VT2,ST,true> >
2029 {
2030  public:
2031  //**********************************************************************************************
2032  typedef typename SelectType< IsDenseVector<VT1>::value && IsColumnVector<VT1>::value &&
2033  IsDenseVector<VT2>::value && IsRowVector<VT2>::value &&
2034  IsNumeric<ST>::value
2035  , typename DMatScalarMultExprTrait<typename DVecTDVecMultExprTrait<VT1,VT2>::Type,ST>::Type
2036  , INVALID_TYPE >::Type Type;
2037  //**********************************************************************************************
2038 };
2040 //*************************************************************************************************
2041 
2042 
2043 //*************************************************************************************************
2045 template< typename VT1, typename ST1, typename VT2, typename ST2 >
2046 struct DVecTDVecMultExprTrait< DVecScalarMultExpr<VT1,ST1,false>, DVecScalarMultExpr<VT2,ST2,true> >
2047 {
2048  public:
2049  //**********************************************************************************************
2050  typedef typename SelectType< IsDenseVector<VT1>::value && IsColumnVector<VT1>::value &&
2051  IsDenseVector<VT2>::value && IsRowVector<VT2>::value &&
2052  IsNumeric<ST1>::value && IsNumeric<ST2>::value
2053  , typename DMatScalarMultExprTrait<typename DVecTDVecMultExprTrait<VT1,VT2>::Type,typename MultTrait<ST1,ST2>::Type>::Type
2054  , INVALID_TYPE >::Type Type;
2055  //**********************************************************************************************
2056 };
2058 //*************************************************************************************************
2059 
2060 
2061 
2062 
2063 //=================================================================================================
2064 //
2065 // TDVECTDVECMULTEXPRTRAIT SPECIALIZATIONS
2066 //
2067 //=================================================================================================
2068 
2069 //*************************************************************************************************
2071 template< typename VT1, typename ST, typename VT2 >
2072 struct TDVecTDVecMultExprTrait< DVecScalarMultExpr<VT1,ST,true>, VT2 >
2073 {
2074  public:
2075  //**********************************************************************************************
2076  typedef typename SelectType< IsDenseVector<VT1>::value && IsRowVector<VT1>::value &&
2077  IsDenseVector<VT2>::value && IsRowVector<VT2>::value &&
2078  IsNumeric<ST>::value
2079  , typename TDVecScalarMultExprTrait<typename TDVecTDVecMultExprTrait<VT1,VT2>::Type,ST>::Type
2080  , INVALID_TYPE >::Type Type;
2081  //**********************************************************************************************
2082 };
2084 //*************************************************************************************************
2085 
2086 
2087 //*************************************************************************************************
2089 template< typename VT1, typename VT2, typename ST >
2090 struct TDVecTDVecMultExprTrait< VT1, DVecScalarMultExpr<VT2,ST,true> >
2091 {
2092  public:
2093  //**********************************************************************************************
2094  typedef typename SelectType< IsDenseVector<VT1>::value && IsRowVector<VT1>::value &&
2095  IsDenseVector<VT2>::value && IsRowVector<VT2>::value &&
2096  IsNumeric<ST>::value
2097  , typename TDVecScalarMultExprTrait<typename TDVecTDVecMultExprTrait<VT1,VT2>::Type,ST>::Type
2098  , INVALID_TYPE >::Type Type;
2099  //**********************************************************************************************
2100 };
2102 //*************************************************************************************************
2103 
2104 
2105 //*************************************************************************************************
2107 template< typename VT1, typename ST1, typename VT2, typename ST2 >
2108 struct TDVecTDVecMultExprTrait< DVecScalarMultExpr<VT1,ST1,true>, DVecScalarMultExpr<VT2,ST2,true> >
2109 {
2110  public:
2111  //**********************************************************************************************
2112  typedef typename SelectType< IsDenseVector<VT1>::value && IsRowVector<VT1>::value &&
2113  IsDenseVector<VT2>::value && IsRowVector<VT2>::value &&
2114  IsNumeric<ST1>::value && IsNumeric<ST2>::value
2115  , typename TDVecScalarMultExprTrait<typename TDVecTDVecMultExprTrait<VT1,VT2>::Type,typename MultTrait<ST1,ST2>::Type>::Type
2116  , INVALID_TYPE >::Type Type;
2117  //**********************************************************************************************
2118 };
2120 //*************************************************************************************************
2121 
2122 
2123 
2124 
2125 //=================================================================================================
2126 //
2127 // DVECSVECMULTEXPRTRAIT SPECIALIZATIONS
2128 //
2129 //=================================================================================================
2130 
2131 //*************************************************************************************************
2133 template< typename VT1, typename VT2, typename ST >
2134 struct DVecSVecMultExprTrait< DVecScalarMultExpr<VT1,ST,false>, VT2 >
2135 {
2136  public:
2137  //**********************************************************************************************
2138  typedef typename SelectType< IsDenseVector<VT1>::value && IsColumnVector<VT1>::value &&
2139  IsSparseVector<VT2>::value && IsColumnVector<VT2>::value &&
2140  IsNumeric<ST>::value
2141  , typename SVecScalarMultExprTrait<typename DVecSVecMultExprTrait<VT1,VT2>::Type,ST>::Type
2142  , INVALID_TYPE >::Type Type;
2143  //**********************************************************************************************
2144 };
2146 //*************************************************************************************************
2147 
2148 
2149 //*************************************************************************************************
2151 template< typename VT1, typename ST1, typename VT2, typename ST2 >
2152 struct DVecSVecMultExprTrait< DVecScalarMultExpr<VT1,ST1,false>, SVecScalarMultExpr<VT2,ST2,false> >
2153 {
2154  public:
2155  //**********************************************************************************************
2156  typedef typename SelectType< IsDenseVector<VT1>::value && IsColumnVector<VT1>::value &&
2157  IsSparseVector<VT2>::value && IsColumnVector<VT2>::value &&
2158  IsNumeric<ST1>::value && IsNumeric<ST2>::value
2159  , typename SVecScalarMultExprTrait<typename DVecSVecMultExprTrait<VT1,VT2>::Type,typename MultTrait<ST1,ST2>::Type>::Type
2160  , INVALID_TYPE >::Type Type;
2161  //**********************************************************************************************
2162 };
2164 //*************************************************************************************************
2165 
2166 
2167 
2168 
2169 //=================================================================================================
2170 //
2171 // DVECTSVECMULTEXPRTRAIT SPECIALIZATIONS
2172 //
2173 //=================================================================================================
2174 
2175 //*************************************************************************************************
2177 template< typename VT1, typename ST, typename VT2 >
2178 struct DVecTSVecMultExprTrait< DVecScalarMultExpr<VT1,ST,false>, VT2 >
2179 {
2180  public:
2181  //**********************************************************************************************
2182  typedef typename SelectType< IsDenseVector<VT1>::value && IsColumnVector<VT1>::value &&
2183  IsSparseVector<VT2>::value && IsRowVector<VT2>::value &&
2184  IsNumeric<ST>::value
2185  , typename SMatScalarMultExprTrait<typename DVecTSVecMultExprTrait<VT1,VT2>::Type,ST>::Type
2186  , INVALID_TYPE >::Type Type;
2187  //**********************************************************************************************
2188 };
2190 //*************************************************************************************************
2191 
2192 
2193 //*************************************************************************************************
2195 template< typename VT1, typename ST1, typename VT2, typename ST2 >
2196 struct DVecTSVecMultExprTrait< DVecScalarMultExpr<VT1,ST1,false>, SVecScalarMultExpr<VT2,ST2,true> >
2197 {
2198  public:
2199  //**********************************************************************************************
2200  typedef typename SelectType< IsDenseVector<VT1>::value && IsColumnVector<VT1>::value &&
2201  IsSparseVector<VT2>::value && IsRowVector<VT2>::value &&
2202  IsNumeric<ST1>::value && IsNumeric<ST2>::value
2203  , typename SMatScalarMultExprTrait<typename DVecTSVecMultExprTrait<VT1,VT2>::Type,typename MultTrait<ST1,ST2>::Type>::Type
2204  , INVALID_TYPE >::Type Type;
2205  //**********************************************************************************************
2206 };
2208 //*************************************************************************************************
2209 
2210 
2211 
2212 
2213 //=================================================================================================
2214 //
2215 // TDVECTSVECMULTEXPRTRAIT SPECIALIZATIONS
2216 //
2217 //=================================================================================================
2218 
2219 //*************************************************************************************************
2221 template< typename VT1, typename ST, typename VT2 >
2222 struct TDVecTSVecMultExprTrait< DVecScalarMultExpr<VT1,ST,true>, VT2 >
2223 {
2224  public:
2225  //**********************************************************************************************
2226  typedef typename SelectType< IsDenseVector<VT1>::value && IsRowVector<VT1>::value &&
2227  IsSparseVector<VT2>::value && IsRowVector<VT2>::value &&
2228  IsNumeric<ST>::value
2229  , typename TSVecScalarMultExprTrait<typename TDVecTSVecMultExprTrait<VT1,VT2>::Type,ST>::Type
2230  , INVALID_TYPE >::Type Type;
2231  //**********************************************************************************************
2232 };
2234 //*************************************************************************************************
2235 
2236 
2237 //*************************************************************************************************
2239 template< typename VT1, typename ST1, typename VT2, typename ST2 >
2240 struct TDVecTSVecMultExprTrait< DVecScalarMultExpr<VT1,ST1,true>, SVecScalarMultExpr<VT2,ST2,true> >
2241 {
2242  public:
2243  //**********************************************************************************************
2244  typedef typename SelectType< IsDenseVector<VT1>::value && IsRowVector<VT1>::value &&
2245  IsSparseVector<VT2>::value && IsRowVector<VT2>::value &&
2246  IsNumeric<ST1>::value && IsNumeric<ST2>::value
2247  , typename TSVecScalarMultExprTrait<typename TDVecTSVecMultExprTrait<VT1,VT2>::Type,typename MultTrait<ST1,ST2>::Type>::Type
2248  , INVALID_TYPE >::Type Type;
2249  //**********************************************************************************************
2250 };
2252 //*************************************************************************************************
2253 
2254 
2255 
2256 
2257 //=================================================================================================
2258 //
2259 // SVECDVECMULTEXPRTRAIT SPECIALIZATIONS
2260 //
2261 //=================================================================================================
2262 
2263 //*************************************************************************************************
2265 template< typename VT1, typename VT2, typename ST >
2266 struct SVecDVecMultExprTrait< VT1, DVecScalarMultExpr<VT2,ST,false> >
2267 {
2268  public:
2269  //**********************************************************************************************
2270  typedef typename SelectType< IsSparseVector<VT1>::value && IsColumnVector<VT1>::value &&
2271  IsDenseVector<VT2>::value && IsColumnVector<VT2>::value &&
2272  IsNumeric<ST>::value
2273  , typename SVecScalarMultExprTrait<typename SVecDVecMultExprTrait<VT1,VT2>::Type,ST>::Type
2274  , INVALID_TYPE >::Type Type;
2275  //**********************************************************************************************
2276 };
2278 //*************************************************************************************************
2279 
2280 
2281 //*************************************************************************************************
2283 template< typename VT1, typename ST1, typename VT2, typename ST2 >
2284 struct SVecDVecMultExprTrait< SVecScalarMultExpr<VT1,ST1,false>, DVecScalarMultExpr<VT2,ST2,false> >
2285 {
2286  public:
2287  //**********************************************************************************************
2288  typedef typename SelectType< IsSparseVector<VT1>::value && IsColumnVector<VT1>::value &&
2289  IsDenseVector<VT2>::value && IsColumnVector<VT2>::value &&
2290  IsNumeric<ST1>::value && IsNumeric<ST2>::value
2291  , typename SVecScalarMultExprTrait<typename SVecDVecMultExprTrait<VT1,VT2>::Type,typename MultTrait<ST1,ST2>::Type>::Type
2292  , INVALID_TYPE >::Type Type;
2293  //**********************************************************************************************
2294 };
2296 //*************************************************************************************************
2297 
2298 
2299 
2300 
2301 //=================================================================================================
2302 //
2303 // SVECTDVECMULTEXPRTRAIT SPECIALIZATIONS
2304 //
2305 //=================================================================================================
2306 
2307 //*************************************************************************************************
2309 template< typename VT1, typename VT2, typename ST >
2310 struct SVecTDVecMultExprTrait< VT1, DVecScalarMultExpr<VT2,ST,true> >
2311 {
2312  public:
2313  //**********************************************************************************************
2314  typedef typename SelectType< IsSparseVector<VT1>::value && IsColumnVector<VT1>::value &&
2315  IsDenseVector<VT2>::value && IsRowVector<VT2>::value &&
2316  IsNumeric<ST>::value
2317  , typename TSMatScalarMultExprTrait<typename SVecTDVecMultExprTrait<VT1,VT2>::Type,ST>::Type
2318  , INVALID_TYPE >::Type Type;
2319  //**********************************************************************************************
2320 };
2322 //*************************************************************************************************
2323 
2324 
2325 //*************************************************************************************************
2327 template< typename VT1, typename ST1, typename VT2, typename ST2 >
2328 struct SVecTDVecMultExprTrait< SVecScalarMultExpr<VT1,ST1,false>, DVecScalarMultExpr<VT2,ST2,true> >
2329 {
2330  public:
2331  //**********************************************************************************************
2332  typedef typename SelectType< IsSparseVector<VT1>::value && IsColumnVector<VT1>::value &&
2333  IsDenseVector<VT2>::value && IsRowVector<VT2>::value &&
2334  IsNumeric<ST1>::value && IsNumeric<ST2>::value
2335  , typename TSMatScalarMultExprTrait<typename SVecTDVecMultExprTrait<VT1,VT2>::Type,typename MultTrait<ST1,ST2>::Type>::Type
2336  , INVALID_TYPE >::Type Type;
2337  //**********************************************************************************************
2338 };
2340 //*************************************************************************************************
2341 
2342 
2343 
2344 
2345 //=================================================================================================
2346 //
2347 // TSVECTDVECMULTEXPRTRAIT SPECIALIZATIONS
2348 //
2349 //=================================================================================================
2350 
2351 //*************************************************************************************************
2353 template< typename VT1, typename VT2, typename ST >
2354 struct TSVecTDVecMultExprTrait< VT1, DVecScalarMultExpr<VT2,ST,true> >
2355 {
2356  public:
2357  //**********************************************************************************************
2358  typedef typename SelectType< IsSparseVector<VT1>::value && IsRowVector<VT1>::value &&
2359  IsDenseVector<VT2>::value && IsRowVector<VT2>::value &&
2360  IsNumeric<ST>::value
2361  , typename TSVecScalarMultExprTrait<typename TSVecTDVecMultExprTrait<VT1,VT2>::Type,ST>::Type
2362  , INVALID_TYPE >::Type Type;
2363  //**********************************************************************************************
2364 };
2366 //*************************************************************************************************
2367 
2368 
2369 //*************************************************************************************************
2371 template< typename VT1, typename ST1, typename VT2, typename ST2 >
2372 struct TSVecTDVecMultExprTrait< SVecScalarMultExpr<VT1,ST1,true>, DVecScalarMultExpr<VT2,ST2,true> >
2373 {
2374  public:
2375  //**********************************************************************************************
2376  typedef typename SelectType< IsSparseVector<VT1>::value && IsRowVector<VT1>::value &&
2377  IsDenseVector<VT2>::value && IsRowVector<VT2>::value &&
2378  IsNumeric<ST1>::value && IsNumeric<ST2>::value
2379  , typename TSVecScalarMultExprTrait<typename TSVecTDVecMultExprTrait<VT1,VT2>::Type,typename MultTrait<ST1,ST2>::Type>::Type
2380  , INVALID_TYPE >::Type Type;
2381  //**********************************************************************************************
2382 };
2384 //*************************************************************************************************
2385 
2386 
2387 
2388 
2389 //=================================================================================================
2390 //
2391 // DMATDVECMULTEXPRTRAIT SPECIALIZATIONS
2392 //
2393 //=================================================================================================
2394 
2395 //*************************************************************************************************
2397 template< typename MT, typename VT, typename ST >
2398 struct DMatDVecMultExprTrait< MT, DVecScalarMultExpr<VT,ST,false> >
2399 {
2400  public:
2401  //**********************************************************************************************
2402  typedef typename SelectType< IsDenseMatrix<MT>::value && IsRowMajorMatrix<MT>::value &&
2403  IsDenseVector<VT>::value && IsColumnVector<VT>::value &&
2404  IsNumeric<ST>::value
2405  , typename DVecScalarMultExprTrait<typename DMatDVecMultExprTrait<MT,VT>::Type,ST>::Type
2406  , INVALID_TYPE >::Type Type;
2407  //**********************************************************************************************
2408 };
2410 //*************************************************************************************************
2411 
2412 
2413 
2414 
2415 //=================================================================================================
2416 //
2417 // TDMATDVECMULTEXPRTRAIT SPECIALIZATIONS
2418 //
2419 //=================================================================================================
2420 
2421 //*************************************************************************************************
2423 template< typename MT, typename VT, typename ST >
2424 struct TDMatDVecMultExprTrait< MT, DVecScalarMultExpr<VT,ST,false> >
2425 {
2426  public:
2427  //**********************************************************************************************
2428  typedef typename SelectType< IsDenseMatrix<MT>::value && IsColumnMajorMatrix<MT>::value &&
2429  IsDenseVector<VT>::value && IsColumnVector<VT>::value &&
2430  IsNumeric<ST>::value
2431  , typename DVecScalarMultExprTrait<typename TDMatDVecMultExprTrait<MT,VT>::Type,ST>::Type
2432  , INVALID_TYPE >::Type Type;
2433  //**********************************************************************************************
2434 };
2436 //*************************************************************************************************
2437 
2438 
2439 
2440 
2441 //=================================================================================================
2442 //
2443 // TDVECDMATMULTEXPRTRAIT SPECIALIZATIONS
2444 //
2445 //=================================================================================================
2446 
2447 //*************************************************************************************************
2449 template< typename VT, typename MT, typename ST >
2450 struct TDVecDMatMultExprTrait< DVecScalarMultExpr<VT,ST,true>, MT >
2451 {
2452  public:
2453  //**********************************************************************************************
2454  typedef typename SelectType< IsDenseVector<VT>::value && IsRowVector<VT>::value &&
2455  IsDenseMatrix<MT>::value && IsRowMajorMatrix<MT>::value &&
2456  IsNumeric<ST>::value
2457  , typename TDVecScalarMultExprTrait<typename TDVecDMatMultExprTrait<VT,MT>::Type,ST>::Type
2458  , INVALID_TYPE >::Type Type;
2459  //**********************************************************************************************
2460 };
2462 //*************************************************************************************************
2463 
2464 
2465 
2466 
2467 //=================================================================================================
2468 //
2469 // TDVECTDMATMULTEXPRTRAIT SPECIALIZATIONS
2470 //
2471 //=================================================================================================
2472 
2473 //*************************************************************************************************
2475 template< typename VT, typename MT, typename ST >
2476 struct TDVecTDMatMultExprTrait< DVecScalarMultExpr<VT,ST,true>, MT >
2477 {
2478  public:
2479  //**********************************************************************************************
2480  typedef typename SelectType< IsDenseVector<VT>::value && IsRowVector<VT>::value &&
2481  IsDenseMatrix<MT>::value && IsColumnMajorMatrix<MT>::value &&
2482  IsNumeric<ST>::value
2483  , typename TDVecScalarMultExprTrait<typename TDVecTDMatMultExprTrait<VT,MT>::Type,ST>::Type
2484  , INVALID_TYPE >::Type Type;
2485  //**********************************************************************************************
2486 };
2488 //*************************************************************************************************
2489 
2490 
2491 
2492 
2493 //=================================================================================================
2494 //
2495 // SMATDVECMULTEXPRTRAIT SPECIALIZATIONS
2496 //
2497 //=================================================================================================
2498 
2499 //*************************************************************************************************
2501 template< typename MT, typename VT, typename ST >
2502 struct SMatDVecMultExprTrait< MT, DVecScalarMultExpr<VT,ST,false> >
2503 {
2504  public:
2505  //**********************************************************************************************
2506  typedef typename SelectType< IsSparseMatrix<MT>::value && IsRowMajorMatrix<MT>::value &&
2507  IsDenseVector<VT>::value && IsColumnVector<VT>::value &&
2508  IsNumeric<ST>::value
2509  , typename DVecScalarMultExprTrait<typename SMatDVecMultExprTrait<MT,VT>::Type,ST>::Type
2510  , INVALID_TYPE >::Type Type;
2511  //**********************************************************************************************
2512 };
2514 //*************************************************************************************************
2515 
2516 
2517 
2518 
2519 //=================================================================================================
2520 //
2521 // TSMATDVECMULTEXPRTRAIT SPECIALIZATIONS
2522 //
2523 //=================================================================================================
2524 
2525 //*************************************************************************************************
2527 template< typename MT, typename VT, typename ST >
2528 struct TSMatDVecMultExprTrait< MT, DVecScalarMultExpr<VT,ST,false> >
2529 {
2530  public:
2531  //**********************************************************************************************
2532  typedef typename SelectType< IsSparseMatrix<MT>::value && IsColumnMajorMatrix<MT>::value &&
2533  IsDenseVector<VT>::value && IsColumnVector<VT>::value &&
2534  IsNumeric<ST>::value
2535  , typename DVecScalarMultExprTrait<typename TSMatDVecMultExprTrait<MT,VT>::Type,ST>::Type
2536  , INVALID_TYPE >::Type Type;
2537  //**********************************************************************************************
2538 };
2540 //*************************************************************************************************
2541 
2542 
2543 
2544 
2545 //=================================================================================================
2546 //
2547 // TDVECSMATMULTEXPRTRAIT SPECIALIZATIONS
2548 //
2549 //=================================================================================================
2550 
2551 //*************************************************************************************************
2553 template< typename VT, typename MT, typename ST >
2554 struct TDVecSMatMultExprTrait< DVecScalarMultExpr<VT,ST,true>, MT >
2555 {
2556  public:
2557  //**********************************************************************************************
2558  typedef typename SelectType< IsDenseVector<VT>::value && IsRowVector<VT>::value &&
2559  IsSparseMatrix<MT>::value && IsRowMajorMatrix<MT>::value &&
2560  IsNumeric<ST>::value
2561  , typename TDVecScalarMultExprTrait<typename TDVecSMatMultExprTrait<VT,MT>::Type,ST>::Type
2562  , INVALID_TYPE >::Type Type;
2563  //**********************************************************************************************
2564 };
2566 //*************************************************************************************************
2567 
2568 
2569 
2570 
2571 //=================================================================================================
2572 //
2573 // TDVECTSMATMULTEXPRTRAIT SPECIALIZATIONS
2574 //
2575 //=================================================================================================
2576 
2577 //*************************************************************************************************
2579 template< typename VT, typename MT, typename ST >
2580 struct TDVecTSMatMultExprTrait< DVecScalarMultExpr<VT,ST,true>, MT >
2581 {
2582  public:
2583  //**********************************************************************************************
2584  typedef typename SelectType< IsDenseVector<VT>::value && IsRowVector<VT>::value &&
2585  IsSparseMatrix<MT>::value && IsColumnMajorMatrix<MT>::value &&
2586  IsNumeric<ST>::value
2587  , typename TDVecScalarMultExprTrait<typename TDVecTSMatMultExprTrait<VT,MT>::Type,ST>::Type
2588  , INVALID_TYPE >::Type Type;
2589  //**********************************************************************************************
2590 };
2592 //*************************************************************************************************
2593 
2594 
2595 
2596 
2597 //=================================================================================================
2598 //
2599 // SUBVECTOREXPRTRAIT SPECIALIZATIONS
2600 //
2601 //=================================================================================================
2602 
2603 //*************************************************************************************************
2605 template< typename VT, typename ST, bool TF, bool AF >
2606 struct SubvectorExprTrait< DVecScalarMultExpr<VT,ST,TF>, AF >
2607 {
2608  public:
2609  //**********************************************************************************************
2610  typedef typename MultExprTrait< typename SubvectorExprTrait<const VT,AF>::Type, ST >::Type Type;
2611  //**********************************************************************************************
2612 };
2614 //*************************************************************************************************
2615 
2616 } // namespace blaze
2617 
2618 #endif
Pointer difference type of the Blaze library.
BLAZE_ALWAYS_INLINE EnableIf< And< IsIntegral< T >, HasSize< T, 2UL > >, simd_int16_t >::Type set(T value)
Sets all values in the vector to the given 2-byte integral value.
Definition: Set.h:73
Data type constraint.
Compile time check whether the given type is a computational expression template.This type trait clas...
Definition: IsComputation.h:89
Compile time check for numeric types.This type trait tests whether or not the given template paramete...
Definition: IsNumeric.h:98
Constraint on the data type.
Compile time check whether the given type is a temporary vector or matrix type.This type trait class ...
Definition: IsTemporary.h:87
const DMatDMatMultExpr< T1, T2 > operator*(const DenseMatrix< T1, false > &lhs, const DenseMatrix< T2, false > &rhs)
Multiplication operator for the multiplication of two row-major dense matrices ( ).
Definition: DMatDMatMultExpr.h:7820
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:962
Header file for basic type definitions.
Header file for the SparseVector base class.
IntrinsicTrait< ElementType >::Type IntrinsicType
Resulting intrinsic element type.
Definition: DVecScalarMultExpr.h:180
ReturnType operator*() const
Direct access to the element at the current iterator position.
Definition: DVecScalarMultExpr.h:302
BLAZE_ALWAYS_INLINE size_t size(const Vector< VT, TF > &vector)
Returns the current size/dimension of the vector.
Definition: Vector.h:252
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:518
Efficient implementation of a compressed matrix.The CompressedMatrix class template is the represent...
Definition: CompressedMatrix.h:207
const ConstIterator operator++(int)
Post-increment operator.
Definition: DVecScalarMultExpr.h:271
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:2588
Header file for the IsRowVector type trait.
Type ElementType
Type of the sparse matrix elements.
Definition: CompressedMatrix.h:259
Header file for the And class template.
Header file for the DenseVector base class.
ReturnType operator[](size_t index) const
Subscript operator for the direct access to the vector elements.
Definition: DVecScalarMultExpr.h:468
const DMatSerialExpr< MT, SO > serial(const DenseMatrix< MT, SO > &dm)
Forces the serial evaluation of the given dense matrix expression dm.
Definition: DMatSerialExpr.h:721
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 UnderlyingElement type trait.
Header file for the RequiresEvaluation type trait.
MultExprTrait< RN, ST >::Type ExprReturnType
Expression return type for the subscript operator.
Definition: DVecScalarMultExpr.h:137
bool operator!=(const ConstIterator &rhs) const
Inequality comparison between two ConstIterator objects.
Definition: DVecScalarMultExpr.h:334
ConstIterator(IteratorType iterator, RightOperand scalar)
Constructor for the ConstIterator class.
Definition: DVecScalarMultExpr.h:225
Header file for the VecScalarMultExpr base class.
LeftOperand leftOperand() const
Returns the left-hand side dense vector operand.
Definition: DVecScalarMultExpr.h:538
ResultType::ElementType ElementType
Resulting element type.
Definition: DVecScalarMultExpr.h:179
Constraint on the data type.
ValueType value_type
Type of the underlying elements.
Definition: DVecScalarMultExpr.h:210
bool operator<=(const ConstIterator &rhs) const
Less-than comparison between two ConstIterator objects.
Definition: DVecScalarMultExpr.h:367
Header file for the SparseMatrix base class.
ReturnType at(size_t index) const
Checked access to the vector elements.
Definition: DVecScalarMultExpr.h:481
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:582
PointerType pointer
Pointer return type.
Definition: DVecScalarMultExpr.h:211
VT::ConstIterator IteratorType
ConstIterator type of the dense vector expression.
Definition: DVecScalarMultExpr.h:216
SelectType< IsExpression< VT >::value, const VT, const VT & >::Type LeftOperand
Composite type of the left-hand side dense vector expression.
Definition: DVecScalarMultExpr.h:189
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:261
Evaluation of the underlying builtin element type of a given data type.Via this type trait it is poss...
Definition: UnderlyingBuiltin.h:80
DVecScalarMultExpr(const VT &vector, ST scalar)
Constructor for the DVecScalarMultExpr class.
Definition: DVecScalarMultExpr.h:456
ptrdiff_t DifferenceType
Difference between two iterators.
Definition: DVecScalarMultExpr.h:206
Compile time type selection.The SelectType class template selects one of the two given types T1 and T...
Definition: SelectType.h:59
Header file for the IsTemporary type trait class.
Header file for the multiplication trait.
Namespace of the Blaze C++ math library.
Definition: Blaze.h:57
#define BLAZE_ALWAYS_INLINE
Platform dependent setup of an enforced inline keyword.
Definition: Inline.h:85
Header file for the UnderlyingBuiltin type trait.
const Element * ConstIterator
Iterator over constant elements.
Definition: CompressedMatrix.h:2592
bool canAlias(const T *alias) const
Returns whether the expression can alias with the given address alias.
Definition: DVecScalarMultExpr.h:560
BLAZE_ALWAYS_INLINE IntrinsicType load(size_t index) const
Access to the intrinsic elements of the vector.
Definition: DVecScalarMultExpr.h:495
#define BLAZE_THROW_OUT_OF_RANGE(MESSAGE)
Macro for the emission of a std::out_of_range exceptionThis macro encapsulates the default way of Bla...
Definition: Exception.h:331
Iterator over the elements of the dense vector.
Definition: DVecScalarMultExpr.h:198
Header file for the DenseMatrix base class.
const SelectType< returnExpr, ExprReturnType, ElementType >::Type ReturnType
Return type for expression template evaluations.
Definition: DVecScalarMultExpr.h:183
bool operator>(const ConstIterator &rhs) const
Greater-than comparison between two ConstIterator objects.
Definition: DVecScalarMultExpr.h:356
ResultType::TransposeType TransposeType
Transpose type for expression template evaluations.
Definition: DVecScalarMultExpr.h:178
bool operator>=(const ConstIterator &rhs) const
Greater-than comparison between two ConstIterator objects.
Definition: DVecScalarMultExpr.h:378
ST RightOperand
Composite type of the right-hand side scalar value.
Definition: DVecScalarMultExpr.h:192
VT::ResultType RT
Result type of the dense vector expression.
Definition: DVecScalarMultExpr.h:121
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
Header file for the IsAligned type trait.
const DenseIterator< Type, AF > operator-(const DenseIterator< Type, AF > &it, ptrdiff_t inc)
Subtraction between a DenseIterator and an integral value.
Definition: DenseIterator.h:642
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:202
Constraint on the data type.
DVecScalarMultExpr< VT, ST, TF > This
Type of this DVecScalarMultExpr instance.
Definition: DVecScalarMultExpr.h:176
Type ElementType
Type of the sparse matrix elements.
Definition: CompressedMatrix.h:2586
bool operator<(const ConstIterator &rhs) const
Less-than comparison between two ConstIterator objects.
Definition: DVecScalarMultExpr.h:345
Header file for the SelectType class template.
LeftOperand vector_
Left-hand side dense vector of the multiplication expression.
Definition: DVecScalarMultExpr.h:599
Header file for all forward declarations for expression class templates.
CMathTrait< typename VT::ElementType >::Type length(const DenseVector< VT, TF > &dv)
Calculation of the dense vector length .
Definition: DenseVector.h:516
Header file for the IsDenseMatrix type trait.
size_t size() const
Returns the current size/dimension of the vector.
Definition: DVecScalarMultExpr.h:528
Header file for the EnableIf class template.
ReferenceType reference
Reference return type.
Definition: DVecScalarMultExpr.h:212
ConstIterator & operator++()
Pre-increment operator.
Definition: DVecScalarMultExpr.h:260
Header file for the IsPadded type trait.
Header file for the serial shim.
bool canSMPAssign() const
Returns whether the expression can be used in SMP assignments.
Definition: DVecScalarMultExpr.h:592
friend const ConstIterator operator+(const ConstIterator &it, size_t inc)
Addition between a ConstIterator and an integral value.
Definition: DVecScalarMultExpr.h:401
Header file for the IsNumeric type trait.
RightOperand scalar_
Right-hand side scalar of the multiplication expression.
Definition: DVecScalarMultExpr.h:600
ElementType ValueType
Type of the underlying elements.
Definition: DVecScalarMultExpr.h:203
bool operator==(const ConstIterator &rhs) const
Equality comparison between two ConstIterator objects.
Definition: DVecScalarMultExpr.h:323
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:2587
Intrinsic characteristics of data types.The IntrinsicTrait class template provides the intrinsic char...
Definition: IntrinsicTrait.h:1232
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:138
Header file for the division trait.
IteratorType iterator_
Iterator to the current element.
Definition: DVecScalarMultExpr.h:432
bool isAliased(const T *alias) const
Returns whether the expression is aliased with the given address alias.
Definition: DVecScalarMultExpr.h:572
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:548
VT::ElementType ET
Element type of the dense vector expression.
Definition: DVecScalarMultExpr.h:123
friend const ConstIterator operator+(size_t inc, const ConstIterator &it)
Addition between an integral value and a ConstIterator.
Definition: DVecScalarMultExpr.h:413
ElementType * PointerType
Pointer return type.
Definition: DVecScalarMultExpr.h:204
VT::ReturnType RN
Return type of the dense vector expression.
Definition: DVecScalarMultExpr.h:122
Header file for the IsInvertible type trait.
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:425
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:205
ConstIterator begin() const
Returns an iterator to the first non-zero element of the dense vector.
Definition: DVecScalarMultExpr.h:508
IntrinsicType load() const
Access to the intrinsic elements of the vector.
Definition: DVecScalarMultExpr.h:312
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:292
Expression object for dense vector-scalar multiplications.The DVecScalarMultExpr class represents the...
Definition: DVecScalarMultExpr.h:115
ConstIterator & operator+=(size_t inc)
Addition assignment operator.
Definition: DVecScalarMultExpr.h:237
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:118
#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:249
This ResultType
Result type for expression template evaluations.
Definition: CompressedMatrix.h:2583
Header file for the IsTrue value trait.
Header file for the SubvectorExprTrait class template.
SelectType< useAssign, const ResultType, const DVecScalarMultExpr & >::Type CompositeType
Data type for composite expression templates.
Definition: DVecScalarMultExpr.h:186
const DVecScalarMultExpr< VT, typename VT::ElementType, TF > normalize(const DenseVector< VT, TF > &vec)
Normalization of the dense vector ( ).
Definition: DVecScalarMultExpr.h:1090
Header file for exception macros.
MultTrait< RT, ST >::Type ResultType
Result type for expression template evaluations.
Definition: DVecScalarMultExpr.h:177
Header file for the IsColumnVector type trait.
IteratorCategory iterator_category
The iterator category.
Definition: DVecScalarMultExpr.h:209
VT::CompositeType CT
Composite type of the dense vector expression.
Definition: DVecScalarMultExpr.h:124
System settings for the inline keywords.
EnableIf< IsDenseVector< VT1 > >::Type smpMultAssign(Vector< VT1, TF1 > &lhs, const Vector< VT2, TF2 > &rhs)
Default implementation of the SMP multiplication assignment of a vector to a dense vector...
Definition: DenseVector.h:189
Header file for the Size type trait.
Evaluation of the resulting expression type of a multiplication.Via this type trait it is possible to...
Definition: MultExprTrait.h:137
RightOperand scalar_
Scalar of the multiplication expression.
Definition: DVecScalarMultExpr.h:433
#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:81
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.
DifferenceType difference_type
Difference between two iterators.
Definition: DVecScalarMultExpr.h:213
DifferenceType operator-(const ConstIterator &rhs) const
Calculating the number of elements between two iterators.
Definition: DVecScalarMultExpr.h:389
ConstIterator & operator--()
Pre-decrement operator.
Definition: DVecScalarMultExpr.h:281