All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
DVecScalarMultExpr.h
Go to the documentation of this file.
1 //=================================================================================================
33 //=================================================================================================
34 
35 #ifndef _BLAZE_MATH_EXPRESSIONS_DVECSCALARMULTEXPR_H_
36 #define _BLAZE_MATH_EXPRESSIONS_DVECSCALARMULTEXPR_H_
37 
38 
39 //*************************************************************************************************
40 // Includes
41 //*************************************************************************************************
42 
43 #include <iterator>
53 #include <blaze/math/Intrinsics.h>
75 #include <blaze/util/Assert.h>
80 #include <blaze/util/EnableIf.h>
81 #include <blaze/util/InvalidType.h>
83 #include <blaze/util/SelectType.h>
84 #include <blaze/util/Types.h>
88 
89 
90 namespace blaze {
91 
92 //=================================================================================================
93 //
94 // CLASS DVECSCALARMULTEXPR
95 //
96 //=================================================================================================
97 
98 //*************************************************************************************************
105 template< typename VT // Type of the left-hand side dense vector
106  , typename ST // Type of the right-hand side scalar value
107  , bool TF > // Transpose flag
108 class DVecScalarMultExpr : public DenseVector< DVecScalarMultExpr<VT,ST,TF>, TF >
109  , private VecScalarMultExpr
110  , private Computation
111 {
112  private:
113  //**Type definitions****************************************************************************
114  typedef typename VT::ResultType RT;
115  typedef typename VT::ReturnType RN;
116  typedef typename VT::ElementType ET;
117  typedef typename VT::CompositeType CT;
118  //**********************************************************************************************
119 
120  //**Return type evaluation**********************************************************************
122 
127  enum { returnExpr = !IsTemporary<RN>::value };
128 
131  //**********************************************************************************************
132 
133  //**Evaluation strategy*************************************************************************
135 
141  enum { useAssign = RequiresEvaluation<VT>::value };
142 
144  template< typename VT2 >
146  struct UseAssign {
147  enum { value = useAssign };
148  };
150  //**********************************************************************************************
151 
152  public:
153  //**Type definitions****************************************************************************
159 
162 
165 
167  typedef typename SelectType< IsExpression<VT>::value, const VT, const VT& >::Type LeftOperand;
168 
170  typedef ST RightOperand;
171  //**********************************************************************************************
172 
173  //**ConstIterator class definition**************************************************************
177  {
178  public:
179  //**Type definitions*************************************************************************
180  typedef std::random_access_iterator_tag IteratorCategory;
185 
186  // STL iterator requirements
192 
194  typedef typename VT::ConstIterator IteratorType;
195  //*******************************************************************************************
196 
197  //**Constructor******************************************************************************
203  explicit inline ConstIterator( IteratorType iterator, RightOperand scalar )
204  : iterator_( iterator ) // Iterator to the current element
205  , scalar_ ( scalar ) // Scalar of the multiplication expression
206  {}
207  //*******************************************************************************************
208 
209  //**Addition assignment operator*************************************************************
215  inline ConstIterator& operator+=( size_t inc ) {
216  iterator_ += inc;
217  return *this;
218  }
219  //*******************************************************************************************
220 
221  //**Subtraction assignment operator**********************************************************
227  inline ConstIterator& operator-=( size_t dec ) {
228  iterator_ -= dec;
229  return *this;
230  }
231  //*******************************************************************************************
232 
233  //**Prefix increment operator****************************************************************
239  ++iterator_;
240  return *this;
241  }
242  //*******************************************************************************************
243 
244  //**Postfix increment operator***************************************************************
249  inline const ConstIterator operator++( int ) {
250  return ConstIterator( iterator_++ );
251  }
252  //*******************************************************************************************
253 
254  //**Prefix decrement operator****************************************************************
260  --iterator_;
261  return *this;
262  }
263  //*******************************************************************************************
264 
265  //**Postfix decrement operator***************************************************************
270  inline const ConstIterator operator--( int ) {
271  return ConstIterator( iterator_-- );
272  }
273  //*******************************************************************************************
274 
275  //**Element access operator******************************************************************
280  inline ReturnType operator*() const {
281  return *iterator_ * scalar_;
282  }
283  //*******************************************************************************************
284 
285  //**Load function****************************************************************************
290  inline IntrinsicType load() const {
291  return iterator_.load() * set( scalar_ );
292  }
293  //*******************************************************************************************
294 
295  //**Equality operator************************************************************************
301  inline bool operator==( const ConstIterator& rhs ) const {
302  return iterator_ == rhs.iterator_;
303  }
304  //*******************************************************************************************
305 
306  //**Inequality operator**********************************************************************
312  inline bool operator!=( const ConstIterator& rhs ) const {
313  return iterator_ != rhs.iterator_;
314  }
315  //*******************************************************************************************
316 
317  //**Less-than operator***********************************************************************
323  inline bool operator<( const ConstIterator& rhs ) const {
324  return iterator_ < rhs.iterator_;
325  }
326  //*******************************************************************************************
327 
328  //**Greater-than operator********************************************************************
334  inline bool operator>( const ConstIterator& rhs ) const {
335  return iterator_ > rhs.iterator_;
336  }
337  //*******************************************************************************************
338 
339  //**Less-or-equal-than operator**************************************************************
345  inline bool operator<=( const ConstIterator& rhs ) const {
346  return iterator_ <= rhs.iterator_;
347  }
348  //*******************************************************************************************
349 
350  //**Greater-or-equal-than operator***********************************************************
356  inline bool operator>=( const ConstIterator& rhs ) const {
357  return iterator_ >= rhs.iterator_;
358  }
359  //*******************************************************************************************
360 
361  //**Subtraction operator*********************************************************************
367  inline DifferenceType operator-( const ConstIterator& rhs ) const {
368  return iterator_ - rhs.iterator_;
369  }
370  //*******************************************************************************************
371 
372  //**Addition operator************************************************************************
379  friend inline const ConstIterator operator+( const ConstIterator& it, size_t inc ) {
380  return ConstIterator( it.iterator_ + inc );
381  }
382  //*******************************************************************************************
383 
384  //**Addition operator************************************************************************
391  friend inline const ConstIterator operator+( size_t inc, const ConstIterator& it ) {
392  return ConstIterator( it.iterator_ + inc );
393  }
394  //*******************************************************************************************
395 
396  //**Subtraction operator*********************************************************************
403  friend inline const ConstIterator operator-( const ConstIterator& it, size_t dec ) {
404  return ConstIterator( it.iterator_ - dec );
405  }
406  //*******************************************************************************************
407 
408  private:
409  //**Member variables*************************************************************************
412  //*******************************************************************************************
413  };
414  //**********************************************************************************************
415 
416  //**Compilation flags***************************************************************************
418  enum { vectorizable = VT::vectorizable &&
421 
423  enum { smpAssignable = VT::smpAssignable };
424  //**********************************************************************************************
425 
426  //**Constructor*********************************************************************************
432  explicit inline DVecScalarMultExpr( const VT& vector, ST scalar )
433  : vector_( vector ) // Left-hand side dense vector of the multiplication expression
434  , scalar_( scalar ) // Right-hand side scalar of the multiplication expression
435  {}
436  //**********************************************************************************************
437 
438  //**Subscript operator**************************************************************************
444  inline ReturnType operator[]( size_t index ) const {
445  BLAZE_INTERNAL_ASSERT( index < vector_.size(), "Invalid vector access index" );
446  return vector_[index] * scalar_;
447  }
448  //**********************************************************************************************
449 
450  //**Load function*******************************************************************************
456  inline IntrinsicType load( size_t index ) const {
457  typedef IntrinsicTrait<ElementType> IT;
458  BLAZE_INTERNAL_ASSERT( index < vector_.size() , "Invalid vector access index" );
459  BLAZE_INTERNAL_ASSERT( index % IT::size == 0UL, "Invalid vector access index" );
460  const IntrinsicType xmm1( vector_.load( index ) );
461  const IntrinsicType xmm2( set( scalar_ ) );
462  return xmm1 * xmm2;
463  }
464  //**********************************************************************************************
465 
466  //**Begin function******************************************************************************
471  inline ConstIterator begin() const {
472  return ConstIterator( vector_.begin(), scalar_ );
473  }
474  //**********************************************************************************************
475 
476  //**End function********************************************************************************
481  inline ConstIterator end() const {
482  return ConstIterator( vector_.end(), scalar_ );
483  }
484  //**********************************************************************************************
485 
486  //**Size function*******************************************************************************
491  inline size_t size() const {
492  return vector_.size();
493  }
494  //**********************************************************************************************
495 
496  //**Left operand access*************************************************************************
501  inline LeftOperand leftOperand() const {
502  return vector_;
503  }
504  //**********************************************************************************************
505 
506  //**Right operand access************************************************************************
511  inline RightOperand rightOperand() const {
512  return scalar_;
513  }
514  //**********************************************************************************************
515 
516  //**********************************************************************************************
522  template< typename T >
523  inline bool canAlias( const T* alias ) const {
524  return IsComputation<VT>::value && vector_.canAlias( alias );
525  }
526  //**********************************************************************************************
527 
528  //**********************************************************************************************
534  template< typename T >
535  inline bool isAliased( const T* alias ) const {
536  return vector_.isAliased( alias );
537  }
538  //**********************************************************************************************
539 
540  //**********************************************************************************************
545  inline bool isAligned() const {
546  return vector_.isAligned();
547  }
548  //**********************************************************************************************
549 
550  //**********************************************************************************************
555  inline bool canSMPAssign() const {
556  return vector_.canSMPAssign() || ( size() > SMP_DVECSCALARMULT_THRESHOLD );
557  }
558  //**********************************************************************************************
559 
560  private:
561  //**Member variables****************************************************************************
564  //**********************************************************************************************
565 
566  //**Assignment to dense vectors*****************************************************************
580  template< typename VT2 > // Type of the target dense vector
581  friend inline typename EnableIf< UseAssign<VT2> >::Type
582  assign( DenseVector<VT2,TF>& lhs, const DVecScalarMultExpr& rhs )
583  {
585 
586  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
587 
588  assign( ~lhs, rhs.vector_ );
589  (~lhs) *= rhs.scalar_;
590  }
592  //**********************************************************************************************
593 
594  //**Assignment to sparse vectors****************************************************************
608  template< typename VT2 > // Type of the target sparse vector
609  friend inline typename EnableIf< UseAssign<VT2> >::Type
611  {
613 
614  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
615 
616  assign( ~lhs, rhs.vector_ );
617  (~lhs) *= rhs.scalar_;
618  }
620  //**********************************************************************************************
621 
622  //**Addition assignment to dense vectors********************************************************
636  template< typename VT2 > // Type of the target dense vector
637  friend inline typename EnableIf< UseAssign<VT2> >::Type
638  addAssign( DenseVector<VT2,TF>& lhs, const DVecScalarMultExpr& rhs )
639  {
641 
645 
646  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
647 
648  const ResultType tmp( rhs );
649  smpAddAssign( ~lhs, tmp );
650  }
652  //**********************************************************************************************
653 
654  //**Addition assignment to sparse vectors*******************************************************
655  // No special implementation for the addition assignment to sparse vectors.
656  //**********************************************************************************************
657 
658  //**Subtraction assignment to dense vectors*****************************************************
672  template< typename VT2 > // Type of the target dense vector
673  friend inline typename EnableIf< UseAssign<VT2> >::Type
674  subAssign( DenseVector<VT2,TF>& lhs, const DVecScalarMultExpr& rhs )
675  {
677 
681 
682  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
683 
684  const ResultType tmp( rhs );
685  smpSubAssign( ~lhs, tmp );
686  }
688  //**********************************************************************************************
689 
690  //**Subtraction assignment to sparse vectors****************************************************
691  // No special implementation for the subtraction assignment to sparse vectors.
692  //**********************************************************************************************
693 
694  //**Multiplication assignment to dense vectors**************************************************
708  template< typename VT2 > // Type of the target dense vector
709  friend inline typename EnableIf< UseAssign<VT2> >::Type
710  multAssign( DenseVector<VT2,TF>& lhs, const DVecScalarMultExpr& rhs )
711  {
713 
717 
718  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
719 
720  const ResultType tmp( rhs );
721  smpMultAssign( ~lhs, tmp );
722  }
724  //**********************************************************************************************
725 
726  //**Multiplication assignment to sparse vectors*************************************************
727  // No special implementation for the multiplication assignment to sparse vectors.
728  //**********************************************************************************************
729 
730  //**Compile time checks*************************************************************************
737  //**********************************************************************************************
738 };
739 //*************************************************************************************************
740 
741 
742 
743 
744 //=================================================================================================
745 //
746 // GLOBAL UNARY ARITHMETIC OPERATORS
747 //
748 //=================================================================================================
749 
750 //*************************************************************************************************
767 template< typename VT // Type of the dense vector
768  , bool TF > // Transpose flag
769 inline const DVecScalarMultExpr<VT,typename BaseElementType<VT>::Type,TF>
771 {
773 
774  typedef typename BaseElementType<VT>::Type ElementType;
776 }
777 //*************************************************************************************************
778 
779 
780 
781 
782 //=================================================================================================
783 //
784 // GLOBAL BINARY ARITHMETIC OPERATORS
785 //
786 //=================================================================================================
787 
788 //*************************************************************************************************
810 template< typename T1 // Type of the left-hand side dense vector
811  , typename T2 // Type of the right-hand side scalar
812  , bool TF > // Transpose flag
813 inline const typename EnableIf< IsNumeric<T2>, typename MultExprTrait<T1,T2>::Type >::Type
814  operator*( const DenseVector<T1,TF>& vec, T2 scalar )
815 {
817 
818  typedef typename MultExprTrait<T1,T2>::Type Type;
819  return Type( ~vec, scalar );
820 }
821 //*************************************************************************************************
822 
823 
824 //*************************************************************************************************
846 template< typename T1 // Type of the left-hand side scalar
847  , typename T2 // Type of the right-hand side dense vector
848  , bool TF > // Transpose flag
849 inline const typename EnableIf< IsNumeric<T1>, typename MultExprTrait<T1,T2>::Type >::Type
850  operator*( T1 scalar, const DenseVector<T2,TF>& vec )
851 {
853 
854  typedef typename MultExprTrait<T1,T2>::Type Type;
855  return Type( ~vec, scalar );
856 }
857 //*************************************************************************************************
858 
859 
860 
861 
862 //=================================================================================================
863 //
864 // GLOBAL FUNCTIONS
865 //
866 //=================================================================================================
867 
868 //*************************************************************************************************
886 template< typename VT // Type of the dense vector
887  , bool TF > // Transpose flag
888 inline const DVecScalarMultExpr<VT,typename VT::ElementType,TF>
890 {
891  typedef typename VT::ElementType ElementType;
892 
894 
895  const ElementType len ( length( ~vec ) );
896  const ElementType ilen( ( len != ElementType(0) )?( ElementType(1) / len ):( 0 ) );
897 
898  return DVecScalarMultExpr<VT,ElementType,TF>( ~vec, ilen );
899 }
900 //*************************************************************************************************
901 
902 
903 
904 
905 //=================================================================================================
906 //
907 // GLOBAL RESTRUCTURING UNARY ARITHMETIC OPERATORS
908 //
909 //=================================================================================================
910 
911 //*************************************************************************************************
923 template< typename VT // Type of the dense vector
924  , typename ST // Type of the scalar
925  , bool TF > // Transpose flag
926 inline const DVecScalarMultExpr<VT,ST,TF>
927  operator-( const DVecScalarMultExpr<VT,ST,TF>& dv )
928 {
930 
931  return DVecScalarMultExpr<VT,ST,TF>( dv.leftOperand(), -dv.rightOperand() );
932 }
934 //*************************************************************************************************
935 
936 
937 
938 
939 //=================================================================================================
940 //
941 // GLOBAL RESTRUCTURING BINARY ARITHMETIC OPERATORS
942 //
943 //=================================================================================================
944 
945 //*************************************************************************************************
958 template< typename VT // Type of the dense vector of the left-hand side expression
959  , typename ST1 // Type of the scalar of the left-hand side expression
960  , bool TF // Transpose flag of the dense vector
961  , typename ST2 > // Type of the right-hand side scalar
962 inline const typename EnableIf< IsNumeric<ST2>
963  , typename MultExprTrait< DVecScalarMultExpr<VT,ST1,TF>, ST2 >::Type >::Type
964  operator*( const DVecScalarMultExpr<VT,ST1,TF>& vec, ST2 scalar )
965 {
967 
968  return vec.leftOperand() * ( vec.rightOperand() * scalar );
969 }
971 //*************************************************************************************************
972 
973 
974 //*************************************************************************************************
987 template< typename ST1 // Type of the left-hand side scalar
988  , typename VT // Type of the dense vector of the right-hand side expression
989  , typename ST2 // Type of the scalar of the right-hand side expression
990  , bool TF > // Transpose flag of the dense vector
991 inline const typename EnableIf< IsNumeric<ST1>
992  , typename MultExprTrait< ST1, DVecScalarMultExpr<VT,ST2,TF> >::Type >::Type
993  operator*( ST1 scalar, const DVecScalarMultExpr<VT,ST2,TF>& vec )
994 {
996 
997  return vec.leftOperand() * ( scalar * vec.rightOperand() );
998 }
1000 //*************************************************************************************************
1001 
1002 
1003 //*************************************************************************************************
1016 template< typename VT // Type of the dense vector of the left-hand side expression
1017  , typename ST1 // Type of the scalar of the left-hand side expression
1018  , bool TF // Transpose flag of the dense vector
1019  , typename ST2 > // Type of the right-hand side scalar
1020 inline const typename EnableIf< IsFloatingPoint<typename DivTrait<ST1,ST2>::Type>
1021  , typename DivExprTrait< DVecScalarMultExpr<VT,ST1,TF>, ST2 >::Type >::Type
1022  operator/( const DVecScalarMultExpr<VT,ST1,TF>& vec, ST2 scalar )
1023 {
1025 
1026  return vec.leftOperand() * ( vec.rightOperand() / scalar );
1027 }
1029 //*************************************************************************************************
1030 
1031 
1032 //*************************************************************************************************
1046 template< typename VT1 // Type of the dense vector of the left-hand side expression
1047  , typename ST // Type of the scalar of the left-hand side expression
1048  , bool TF // Transpose flag of the dense vectors
1049  , typename VT2 > // Type of the right-hand side dense vector
1050 inline const typename MultExprTrait< DVecScalarMultExpr<VT1,ST,TF>, VT2 >::Type
1051  operator*( const DVecScalarMultExpr<VT1,ST,TF>& lhs, const DenseVector<VT2,TF>& rhs )
1052 {
1054 
1055  return ( lhs.leftOperand() * (~rhs) ) * lhs.rightOperand();
1056 }
1058 //*************************************************************************************************
1059 
1060 
1061 //*************************************************************************************************
1075 template< typename VT1 // Type of the left-hand side dense vector
1076  , bool TF // Transpose flag of the dense vectors
1077  , typename VT2 // Type of the dense vector of the right-hand side expression
1078  , typename ST > // Type of the scalar of the right-hand side expression
1079 inline const typename MultExprTrait< VT1, DVecScalarMultExpr<VT2,ST,TF> >::Type
1080  operator*( const DenseVector<VT1,TF>& lhs, const DVecScalarMultExpr<VT2,ST,TF>& rhs )
1081 {
1083 
1084  return ( (~lhs) * rhs.leftOperand() ) * rhs.rightOperand();
1085 }
1087 //*************************************************************************************************
1088 
1089 
1090 //*************************************************************************************************
1104 template< typename VT1 // Type of the dense vector of the left-hand side expression
1105  , typename ST1 // Type of the scalar of the left-hand side expression
1106  , bool TF // Transpose flag of the dense vectors
1107  , typename VT2 // Type of the dense vector of the right-hand side expression
1108  , typename ST2 > // Type of the scalar of the right-hand side expression
1109 inline const typename MultExprTrait< DVecScalarMultExpr<VT1,ST1,TF>, DVecScalarMultExpr<VT2,ST2,TF> >::Type
1110  operator*( const DVecScalarMultExpr<VT1,ST1,TF>& lhs, const DVecScalarMultExpr<VT2,ST2,TF>& rhs )
1111 {
1113 
1114  return ( lhs.leftOperand() * rhs.leftOperand() ) * ( lhs.rightOperand() * rhs.rightOperand() );
1115 }
1117 //*************************************************************************************************
1118 
1119 
1120 //*************************************************************************************************
1134 template< typename VT1 // Type of the dense vector of the left-hand side expression
1135  , typename ST // Type of the scalar of the left-hand side expression
1136  , typename VT2 > // Type of the right-hand side dense vector
1137 inline const typename MultExprTrait< DVecScalarMultExpr<VT1,ST,false>, VT2 >::Type
1138  operator*( const DVecScalarMultExpr<VT1,ST,false>& lhs, const DenseVector<VT2,true>& rhs )
1139 {
1141 
1142  return ( lhs.leftOperand() * (~rhs) ) * lhs.rightOperand();
1143 }
1145 //*************************************************************************************************
1146 
1147 
1148 //*************************************************************************************************
1162 template< typename VT1 // Type of the left-hand side dense vector
1163  , typename VT2 // Type of the dense vector of the right-hand side expression
1164  , typename ST > // Type of the scalar of the right-hand side expression
1165 inline const typename MultExprTrait< VT1, DVecScalarMultExpr<VT2,ST,true> >::Type
1166  operator*( const DenseVector<VT1,false>& lhs, const DVecScalarMultExpr<VT2,ST,true>& rhs )
1167 {
1169 
1170  return ( (~lhs) * rhs.leftOperand() ) * rhs.rightOperand();
1171 }
1173 //*************************************************************************************************
1174 
1175 
1176 //*************************************************************************************************
1190 template< typename VT1 // Type of the dense vector of the left-hand side expression
1191  , typename ST1 // Type of the scalar of the left-hand side expression
1192  , typename VT2 // Type of the dense vector of the right-hand side expression
1193  , typename ST2 > // Type of the scalar of the right-hand side expression
1194 inline const typename MultExprTrait< DVecScalarMultExpr<VT1,ST1,false>, DVecScalarMultExpr<VT2,ST2,true> >::Type
1195  operator*( const DVecScalarMultExpr<VT1,ST1,false>& lhs, const DVecScalarMultExpr<VT2,ST2,true>& rhs )
1196 {
1198 
1199  return ( lhs.leftOperand() * rhs.leftOperand() ) * ( lhs.rightOperand() * rhs.rightOperand() );
1200 }
1202 //*************************************************************************************************
1203 
1204 
1205 //*************************************************************************************************
1219 template< typename VT1 // Type of the dense vector of the left-hand side expression
1220  , typename ST // Type of the scalar of the left-hand side expression
1221  , bool TF // Transpose flag of the vectors
1222  , typename VT2 > // Type of the right-hand side sparse vector
1223 inline const typename MultExprTrait< DVecScalarMultExpr<VT1,ST,TF>, VT2 >::Type
1224  operator*( const DVecScalarMultExpr<VT1,ST,TF>& lhs, const SparseVector<VT2,TF>& rhs )
1225 {
1227 
1228  return ( lhs.leftOperand() * (~rhs) ) * lhs.rightOperand();
1229 }
1231 //*************************************************************************************************
1232 
1233 
1234 //*************************************************************************************************
1248 template< typename VT1 // Type of the left-hand side sparse vector
1249  , bool TF // Transpose flag of the vectors
1250  , typename VT2 // Type of the dense vector of the right-hand side expression
1251  , typename ST > // Type of the scalar of the right-hand side expression
1252 inline const typename MultExprTrait< VT1, DVecScalarMultExpr<VT2,ST,TF> >::Type
1253  operator*( const SparseVector<VT1,TF>& lhs, const DVecScalarMultExpr<VT2,ST,TF>& rhs )
1254 {
1256 
1257  return ( (~lhs) * rhs.leftOperand() ) * rhs.rightOperand();
1258 }
1260 //*************************************************************************************************
1261 
1262 
1263 //*************************************************************************************************
1278 template< typename VT1 // Type of the dense vector of the left-hand side expression
1279  , typename ST1 // Type of the scalar of the left-hand side expression
1280  , bool TF // Transpose flag of the vectors
1281  , typename VT2 // Type of the sparse vector of the right-hand side expression
1282  , typename ST2 > // Type of the scalar o the right-hand side expression
1283 inline const typename MultExprTrait< DVecScalarMultExpr<VT1,ST1,TF>, SVecScalarMultExpr<VT2,ST2,TF> >::Type
1284  operator*( const DVecScalarMultExpr<VT1,ST1,TF>& lhs, const SVecScalarMultExpr<VT2,ST2,TF>& rhs )
1285 {
1287 
1288  return ( lhs.leftOperand() * rhs.leftOperand() ) * ( lhs.rightOperand() * rhs.rightOperand() );
1289 }
1291 //*************************************************************************************************
1292 
1293 
1294 //*************************************************************************************************
1309 template< typename VT1 // Type of the sparse vector of the left-hand side expression
1310  , typename ST1 // Type of the scalar of the left-hand side expression
1311  , bool TF // Transpose flag of the vectors
1312  , typename VT2 // Type of the dense vector of the right-hand side expression
1313  , typename ST2 > // Type of the scalar o the right-hand side expression
1314 inline const typename MultExprTrait< SVecScalarMultExpr<VT1,ST1,TF>, DVecScalarMultExpr<VT2,ST2,TF> >::Type
1315  operator*( const SVecScalarMultExpr<VT1,ST1,TF>& lhs, const DVecScalarMultExpr<VT2,ST2,TF>& rhs )
1316 {
1318 
1319  return ( lhs.leftOperand() * rhs.leftOperand() ) * ( lhs.rightOperand() * rhs.rightOperand() );
1320 }
1322 //*************************************************************************************************
1323 
1324 
1325 //*************************************************************************************************
1339 template< typename VT1 // Type of the dense vector of the left-hand side expression
1340  , typename ST // Type of the scalar of the left-hand side expression
1341  , typename VT2 > // Type of the right-hand side sparse vector
1342 inline const typename MultExprTrait< DVecScalarMultExpr<VT1,ST,false>, VT2 >::Type
1343  operator*( const DVecScalarMultExpr<VT1,ST,false>& lhs, const SparseVector<VT2,true>& rhs )
1344 {
1346 
1347  return ( lhs.leftOperand() * (~rhs) ) * lhs.rightOperand();
1348 }
1350 //*************************************************************************************************
1351 
1352 
1353 //*************************************************************************************************
1367 template< typename VT1 // Type of the left-hand side sparse vector
1368  , typename VT2 // Type of the dense vector of the right-hand side expression
1369  , typename ST > // Type of the scalar of the right-hand side expression
1370 inline const typename MultExprTrait< VT1, DVecScalarMultExpr<VT2,ST,true> >::Type
1371  operator*( const SparseVector<VT1,false>& lhs, const DVecScalarMultExpr<VT2,ST,true>& rhs )
1372 {
1374 
1375  return ( (~lhs) * rhs.leftOperand() ) * rhs.rightOperand();
1376 }
1378 //*************************************************************************************************
1379 
1380 
1381 //*************************************************************************************************
1396 template< typename VT1 // Type of the dense vector of the left-hand side expression
1397  , typename ST1 // Type of the scalar of the left-hand side expression
1398  , typename VT2 // Type of the sparse vector of the right-hand side expression
1399  , typename ST2 > // Type of the scalar o the right-hand side expression
1400 inline const typename MultExprTrait< DVecScalarMultExpr<VT1,ST1,false>, SVecScalarMultExpr<VT2,ST2,true> >::Type
1401  operator*( const DVecScalarMultExpr<VT1,ST1,false>& lhs, const SVecScalarMultExpr<VT2,ST2,true>& rhs )
1402 {
1404 
1405  return ( lhs.leftOperand() * rhs.leftOperand() ) * ( lhs.rightOperand() * rhs.rightOperand() );
1406 }
1408 //*************************************************************************************************
1409 
1410 
1411 //*************************************************************************************************
1426 template< typename VT1 // Type of the sparse vector of the left-hand side expression
1427  , typename ST1 // Type of the scalar of the left-hand side expression
1428  , typename VT2 // Type of the dense vector of the right-hand side expression
1429  , typename ST2 > // Type of the scalar o the right-hand side expression
1430 inline const typename MultExprTrait< SVecScalarMultExpr<VT1,ST1,false>, DVecScalarMultExpr<VT2,ST2,true> >::Type
1431  operator*( const SVecScalarMultExpr<VT1,ST1,false>& lhs, const DVecScalarMultExpr<VT2,ST2,true>& rhs )
1432 {
1434 
1435  return ( lhs.leftOperand() * rhs.leftOperand() ) * ( lhs.rightOperand() * rhs.rightOperand() );
1436 }
1438 //*************************************************************************************************
1439 
1440 
1441 //*************************************************************************************************
1455 template< typename MT // Type of the left-hand side dense matrix
1456  , bool SO // Storage order of the left-hand side dense matrix
1457  , typename VT // Type of the dense vector of the right-hand side expression
1458  , typename ST > // Type of the scalar of the right-hand side expression
1459 inline const typename MultExprTrait< MT, DVecScalarMultExpr<VT,ST,false> >::Type
1460  operator*( const DenseMatrix<MT,SO>& mat, const DVecScalarMultExpr<VT,ST,false>& vec )
1461 {
1463 
1464  return ( (~mat) * vec.leftOperand() ) * vec.rightOperand();
1465 }
1467 //*************************************************************************************************
1468 
1469 
1470 //*************************************************************************************************
1484 template< typename VT // Type of the dense vector of the left-hand side expression
1485  , typename ST // Type of the scalar of the left-hand side expression
1486  , typename MT // Type of the right-hand side dense matrix
1487  , bool SO > // Storage order of the right-hand side dense matrix
1488 inline const typename MultExprTrait< DVecScalarMultExpr<VT,ST,true>, MT >::Type
1489  operator*( const DVecScalarMultExpr<VT,ST,true>& vec, const DenseMatrix<MT,SO>& mat )
1490 {
1492 
1493  return ( vec.leftOperand() * (~mat) ) * vec.rightOperand();
1494 }
1496 //*************************************************************************************************
1497 
1498 
1499 //*************************************************************************************************
1513 template< typename MT // Type of the left-hand side sparse matrix
1514  , bool SO // Storage order of the left-hand side sparse matrix
1515  , typename VT // Type of the dense vector of the right-hand side expression
1516  , typename ST > // Type of the scalar of the right-hand side expression
1517 inline const typename MultExprTrait< MT, DVecScalarMultExpr<VT,ST,false> >::Type
1518  operator*( const SparseMatrix<MT,SO>& mat, const DVecScalarMultExpr<VT,ST,false>& vec )
1519 {
1521 
1522  return ( (~mat) * vec.leftOperand() ) * vec.rightOperand();
1523 }
1525 //*************************************************************************************************
1526 
1527 
1528 //*************************************************************************************************
1542 template< typename VT // Type of the dense vector of the left-hand side expression
1543  , typename ST // Type of the scalar of the left-hand side expression
1544  , typename MT // Type of the right-hand side sparse matrix
1545  , bool SO > // Storage order of the right-hand side sparse matrix
1546 inline const typename MultExprTrait< DVecScalarMultExpr<VT,ST,true>, MT >::Type
1547  operator*( const DVecScalarMultExpr<VT,ST,true>& vec, const SparseMatrix<MT,SO>& mat )
1548 {
1550 
1551  return ( vec.leftOperand() * (~mat) ) * vec.rightOperand();
1552 }
1554 //*************************************************************************************************
1555 
1556 
1557 
1558 
1559 //=================================================================================================
1560 //
1561 // DVECSCALARMULTEXPRTRAIT SPECIALIZATIONS
1562 //
1563 //=================================================================================================
1564 
1565 //*************************************************************************************************
1567 template< typename VT, typename ST1, typename ST2 >
1568 struct DVecScalarMultExprTrait< DVecScalarMultExpr<VT,ST1,false>, ST2 >
1569 {
1570  public:
1571  //**********************************************************************************************
1572  typedef typename SelectType< IsDenseVector<VT>::value && IsColumnVector<VT>::value &&
1573  IsNumeric<ST1>::value && IsNumeric<ST2>::value
1574  , typename DVecScalarMultExprTrait<VT,typename MultTrait<ST1,ST2>::Type>::Type
1575  , INVALID_TYPE >::Type Type;
1576  //**********************************************************************************************
1577 };
1579 //*************************************************************************************************
1580 
1581 
1582 
1583 
1584 //=================================================================================================
1585 //
1586 // TDVECSCALARMULTEXPRTRAIT SPECIALIZATIONS
1587 //
1588 //=================================================================================================
1589 
1590 //*************************************************************************************************
1592 template< typename VT, typename ST1, typename ST2 >
1593 struct TDVecScalarMultExprTrait< DVecScalarMultExpr<VT,ST1,true>, ST2 >
1594 {
1595  public:
1596  //**********************************************************************************************
1597  typedef typename SelectType< IsDenseVector<VT>::value && IsRowVector<VT>::value &&
1598  IsNumeric<ST1>::value && IsNumeric<ST2>::value
1599  , typename TDVecScalarMultExprTrait<VT,typename MultTrait<ST1,ST2>::Type>::Type
1600  , INVALID_TYPE >::Type Type;
1601  //**********************************************************************************************
1602 };
1604 //*************************************************************************************************
1605 
1606 
1607 
1608 
1609 //=================================================================================================
1610 //
1611 // DVECSCALARDIVEXPRTRAIT SPECIALIZATIONS
1612 //
1613 //=================================================================================================
1614 
1615 //*************************************************************************************************
1617 template< typename VT, typename ST1, typename ST2 >
1618 struct DVecScalarDivExprTrait< DVecScalarMultExpr<VT,ST1,false>, ST2 >
1619 {
1620  private:
1621  //**********************************************************************************************
1622  enum { condition = IsFloatingPoint<typename DivTrait<ST1,ST2>::Type>::value };
1623  //**********************************************************************************************
1624 
1625  //**********************************************************************************************
1626  typedef typename DVecScalarMultExprTrait<VT,typename DivTrait<ST1,ST2>::Type>::Type T1;
1627  typedef typename DVecScalarDivExprTrait<VT,typename DivTrait<ST1,ST2>::Type>::Type T2;
1628  //**********************************************************************************************
1629 
1630  public:
1631  //**********************************************************************************************
1632  typedef typename SelectType< IsDenseVector<VT>::value && IsColumnVector<VT>::value &&
1633  IsNumeric<ST1>::value && IsNumeric<ST2>::value
1634  , typename SelectType<condition,T1,T2>::Type
1635  , INVALID_TYPE >::Type Type;
1636  //**********************************************************************************************
1637 };
1639 //*************************************************************************************************
1640 
1641 
1642 
1643 
1644 //=================================================================================================
1645 //
1646 // TDVECSCALARDIVEXPRTRAIT SPECIALIZATIONS
1647 //
1648 //=================================================================================================
1649 
1650 //*************************************************************************************************
1652 template< typename VT, typename ST1, typename ST2 >
1653 struct TDVecScalarDivExprTrait< DVecScalarMultExpr<VT,ST1,true>, ST2 >
1654 {
1655  private:
1656  //**********************************************************************************************
1657  enum { condition = IsFloatingPoint<typename DivTrait<ST1,ST2>::Type>::value };
1658  //**********************************************************************************************
1659 
1660  //**********************************************************************************************
1661  typedef typename TDVecScalarMultExprTrait<VT,typename DivTrait<ST1,ST2>::Type>::Type T1;
1662  typedef typename TDVecScalarDivExprTrait<VT,typename DivTrait<ST1,ST2>::Type>::Type T2;
1663  //**********************************************************************************************
1664 
1665  public:
1666  //**********************************************************************************************
1667  typedef typename SelectType< IsDenseVector<VT>::value && IsRowVector<VT>::value &&
1668  IsNumeric<ST1>::value && IsNumeric<ST2>::value
1669  , typename SelectType<condition,T1,T2>::Type
1670  , INVALID_TYPE >::Type Type;
1671  //**********************************************************************************************
1672 };
1674 //*************************************************************************************************
1675 
1676 
1677 
1678 
1679 //=================================================================================================
1680 //
1681 // DVECDVECMULTEXPRTRAIT SPECIALIZATIONS
1682 //
1683 //=================================================================================================
1684 
1685 //*************************************************************************************************
1687 template< typename VT1, typename ST, typename VT2 >
1688 struct DVecDVecMultExprTrait< DVecScalarMultExpr<VT1,ST,false>, VT2 >
1689 {
1690  public:
1691  //**********************************************************************************************
1692  typedef typename SelectType< IsDenseVector<VT1>::value && IsColumnVector<VT1>::value &&
1693  IsDenseVector<VT2>::value && IsColumnVector<VT2>::value &&
1694  IsNumeric<ST>::value
1695  , typename DVecScalarMultExprTrait<typename DVecDVecMultExprTrait<VT1,VT2>::Type,ST>::Type
1696  , INVALID_TYPE >::Type Type;
1697  //**********************************************************************************************
1698 };
1700 //*************************************************************************************************
1701 
1702 
1703 //*************************************************************************************************
1705 template< typename VT1, typename VT2, typename ST >
1706 struct DVecDVecMultExprTrait< VT1, DVecScalarMultExpr<VT2,ST,false> >
1707 {
1708  public:
1709  //**********************************************************************************************
1710  typedef typename SelectType< IsDenseVector<VT1>::value && IsColumnVector<VT1>::value &&
1711  IsDenseVector<VT2>::value && IsColumnVector<VT2>::value &&
1712  IsNumeric<ST>::value
1713  , typename DVecScalarMultExprTrait<typename DVecDVecMultExprTrait<VT1,VT2>::Type,ST>::Type
1714  , INVALID_TYPE >::Type Type;
1715  //**********************************************************************************************
1716 };
1718 //*************************************************************************************************
1719 
1720 
1721 //*************************************************************************************************
1723 template< typename VT1, typename ST1, typename VT2, typename ST2 >
1724 struct DVecDVecMultExprTrait< DVecScalarMultExpr<VT1,ST1,false>, DVecScalarMultExpr<VT2,ST2,false> >
1725 {
1726  public:
1727  //**********************************************************************************************
1728  typedef typename SelectType< IsDenseVector<VT1>::value && IsColumnVector<VT1>::value &&
1729  IsDenseVector<VT2>::value && IsColumnVector<VT2>::value &&
1730  IsNumeric<ST1>::value && IsNumeric<ST2>::value
1731  , typename DVecScalarMultExprTrait<typename DVecDVecMultExprTrait<VT1,VT2>::Type,typename MultTrait<ST1,ST2>::Type>::Type
1732  , INVALID_TYPE >::Type Type;
1733  //**********************************************************************************************
1734 };
1736 //*************************************************************************************************
1737 
1738 
1739 
1740 
1741 //=================================================================================================
1742 //
1743 // DVECTDVECMULTEXPRTRAIT SPECIALIZATIONS
1744 //
1745 //=================================================================================================
1746 
1747 //*************************************************************************************************
1749 template< typename VT1, typename ST, typename VT2 >
1750 struct DVecTDVecMultExprTrait< DVecScalarMultExpr<VT1,ST,false>, VT2 >
1751 {
1752  public:
1753  //**********************************************************************************************
1754  typedef typename SelectType< IsDenseVector<VT1>::value && IsColumnVector<VT1>::value &&
1755  IsDenseVector<VT2>::value && IsRowVector<VT2>::value &&
1756  IsNumeric<ST>::value
1757  , typename DMatScalarMultExprTrait<typename DVecTDVecMultExprTrait<VT1,VT2>::Type,ST>::Type
1758  , INVALID_TYPE >::Type Type;
1759  //**********************************************************************************************
1760 };
1762 //*************************************************************************************************
1763 
1764 
1765 //*************************************************************************************************
1767 template< typename VT1, typename VT2, typename ST >
1768 struct DVecTDVecMultExprTrait< VT1, DVecScalarMultExpr<VT2,ST,true> >
1769 {
1770  public:
1771  //**********************************************************************************************
1772  typedef typename SelectType< IsDenseVector<VT1>::value && IsColumnVector<VT1>::value &&
1773  IsDenseVector<VT2>::value && IsRowVector<VT2>::value &&
1774  IsNumeric<ST>::value
1775  , typename DMatScalarMultExprTrait<typename DVecTDVecMultExprTrait<VT1,VT2>::Type,ST>::Type
1776  , INVALID_TYPE >::Type Type;
1777  //**********************************************************************************************
1778 };
1780 //*************************************************************************************************
1781 
1782 
1783 //*************************************************************************************************
1785 template< typename VT1, typename ST1, typename VT2, typename ST2 >
1786 struct DVecTDVecMultExprTrait< DVecScalarMultExpr<VT1,ST1,false>, DVecScalarMultExpr<VT2,ST2,true> >
1787 {
1788  public:
1789  //**********************************************************************************************
1790  typedef typename SelectType< IsDenseVector<VT1>::value && IsColumnVector<VT1>::value &&
1791  IsDenseVector<VT2>::value && IsRowVector<VT2>::value &&
1792  IsNumeric<ST1>::value && IsNumeric<ST2>::value
1793  , typename DMatScalarMultExprTrait<typename DVecTDVecMultExprTrait<VT1,VT2>::Type,typename MultTrait<ST1,ST2>::Type>::Type
1794  , INVALID_TYPE >::Type Type;
1795  //**********************************************************************************************
1796 };
1798 //*************************************************************************************************
1799 
1800 
1801 
1802 
1803 //=================================================================================================
1804 //
1805 // TDVECTDVECMULTEXPRTRAIT SPECIALIZATIONS
1806 //
1807 //=================================================================================================
1808 
1809 //*************************************************************************************************
1811 template< typename VT1, typename ST, typename VT2 >
1812 struct TDVecTDVecMultExprTrait< DVecScalarMultExpr<VT1,ST,true>, VT2 >
1813 {
1814  public:
1815  //**********************************************************************************************
1816  typedef typename SelectType< IsDenseVector<VT1>::value && IsRowVector<VT1>::value &&
1817  IsDenseVector<VT2>::value && IsRowVector<VT2>::value &&
1818  IsNumeric<ST>::value
1819  , typename TDVecScalarMultExprTrait<typename TDVecTDVecMultExprTrait<VT1,VT2>::Type,ST>::Type
1820  , INVALID_TYPE >::Type Type;
1821  //**********************************************************************************************
1822 };
1824 //*************************************************************************************************
1825 
1826 
1827 //*************************************************************************************************
1829 template< typename VT1, typename VT2, typename ST >
1830 struct TDVecTDVecMultExprTrait< VT1, DVecScalarMultExpr<VT2,ST,true> >
1831 {
1832  public:
1833  //**********************************************************************************************
1834  typedef typename SelectType< IsDenseVector<VT1>::value && IsRowVector<VT1>::value &&
1835  IsDenseVector<VT2>::value && IsRowVector<VT2>::value &&
1836  IsNumeric<ST>::value
1837  , typename TDVecScalarMultExprTrait<typename TDVecTDVecMultExprTrait<VT1,VT2>::Type,ST>::Type
1838  , INVALID_TYPE >::Type Type;
1839  //**********************************************************************************************
1840 };
1842 //*************************************************************************************************
1843 
1844 
1845 //*************************************************************************************************
1847 template< typename VT1, typename ST1, typename VT2, typename ST2 >
1848 struct TDVecTDVecMultExprTrait< DVecScalarMultExpr<VT1,ST1,true>, DVecScalarMultExpr<VT2,ST2,true> >
1849 {
1850  public:
1851  //**********************************************************************************************
1852  typedef typename SelectType< IsDenseVector<VT1>::value && IsRowVector<VT1>::value &&
1853  IsDenseVector<VT2>::value && IsRowVector<VT2>::value &&
1854  IsNumeric<ST1>::value && IsNumeric<ST2>::value
1855  , typename TDVecScalarMultExprTrait<typename TDVecTDVecMultExprTrait<VT1,VT2>::Type,typename MultTrait<ST1,ST2>::Type>::Type
1856  , INVALID_TYPE >::Type Type;
1857  //**********************************************************************************************
1858 };
1860 //*************************************************************************************************
1861 
1862 
1863 
1864 
1865 //=================================================================================================
1866 //
1867 // DVECSVECMULTEXPRTRAIT SPECIALIZATIONS
1868 //
1869 //=================================================================================================
1870 
1871 //*************************************************************************************************
1873 template< typename VT1, typename VT2, typename ST >
1874 struct DVecSVecMultExprTrait< DVecScalarMultExpr<VT1,ST,false>, VT2 >
1875 {
1876  public:
1877  //**********************************************************************************************
1878  typedef typename SelectType< IsDenseVector<VT1>::value && IsColumnVector<VT1>::value &&
1879  IsSparseVector<VT2>::value && IsColumnVector<VT2>::value &&
1880  IsNumeric<ST>::value
1881  , typename SVecScalarMultExprTrait<typename DVecSVecMultExprTrait<VT1,VT2>::Type,ST>::Type
1882  , INVALID_TYPE >::Type Type;
1883  //**********************************************************************************************
1884 };
1886 //*************************************************************************************************
1887 
1888 
1889 //*************************************************************************************************
1891 template< typename VT1, typename ST1, typename VT2, typename ST2 >
1892 struct DVecSVecMultExprTrait< DVecScalarMultExpr<VT1,ST1,false>, SVecScalarMultExpr<VT2,ST2,false> >
1893 {
1894  public:
1895  //**********************************************************************************************
1896  typedef typename SelectType< IsDenseVector<VT1>::value && IsColumnVector<VT1>::value &&
1897  IsSparseVector<VT2>::value && IsColumnVector<VT2>::value &&
1898  IsNumeric<ST1>::value && IsNumeric<ST2>::value
1899  , typename SVecScalarMultExprTrait<typename DVecSVecMultExprTrait<VT1,VT2>::Type,typename MultTrait<ST1,ST2>::Type>::Type
1900  , INVALID_TYPE >::Type Type;
1901  //**********************************************************************************************
1902 };
1904 //*************************************************************************************************
1905 
1906 
1907 
1908 
1909 //=================================================================================================
1910 //
1911 // DVECTSVECMULTEXPRTRAIT SPECIALIZATIONS
1912 //
1913 //=================================================================================================
1914 
1915 //*************************************************************************************************
1917 template< typename VT1, typename ST, typename VT2 >
1918 struct DVecTSVecMultExprTrait< DVecScalarMultExpr<VT1,ST,false>, VT2 >
1919 {
1920  public:
1921  //**********************************************************************************************
1922  typedef typename SelectType< IsDenseVector<VT1>::value && IsColumnVector<VT1>::value &&
1923  IsSparseVector<VT2>::value && IsRowVector<VT2>::value &&
1924  IsNumeric<ST>::value
1925  , typename SMatScalarMultExprTrait<typename DVecTSVecMultExprTrait<VT1,VT2>::Type,ST>::Type
1926  , INVALID_TYPE >::Type Type;
1927  //**********************************************************************************************
1928 };
1930 //*************************************************************************************************
1931 
1932 
1933 //*************************************************************************************************
1935 template< typename VT1, typename ST1, typename VT2, typename ST2 >
1936 struct DVecTSVecMultExprTrait< DVecScalarMultExpr<VT1,ST1,false>, SVecScalarMultExpr<VT2,ST2,true> >
1937 {
1938  public:
1939  //**********************************************************************************************
1940  typedef typename SelectType< IsDenseVector<VT1>::value && IsColumnVector<VT1>::value &&
1941  IsSparseVector<VT2>::value && IsRowVector<VT2>::value &&
1942  IsNumeric<ST1>::value && IsNumeric<ST2>::value
1943  , typename SMatScalarMultExprTrait<typename DVecTSVecMultExprTrait<VT1,VT2>::Type,typename MultTrait<ST1,ST2>::Type>::Type
1944  , INVALID_TYPE >::Type Type;
1945  //**********************************************************************************************
1946 };
1948 //*************************************************************************************************
1949 
1950 
1951 
1952 
1953 //=================================================================================================
1954 //
1955 // TDVECTSVECMULTEXPRTRAIT SPECIALIZATIONS
1956 //
1957 //=================================================================================================
1958 
1959 //*************************************************************************************************
1961 template< typename VT1, typename ST, typename VT2 >
1962 struct TDVecTSVecMultExprTrait< DVecScalarMultExpr<VT1,ST,true>, VT2 >
1963 {
1964  public:
1965  //**********************************************************************************************
1966  typedef typename SelectType< IsDenseVector<VT1>::value && IsRowVector<VT1>::value &&
1967  IsSparseVector<VT2>::value && IsRowVector<VT2>::value &&
1968  IsNumeric<ST>::value
1969  , typename TSVecScalarMultExprTrait<typename TDVecTSVecMultExprTrait<VT1,VT2>::Type,ST>::Type
1970  , INVALID_TYPE >::Type Type;
1971  //**********************************************************************************************
1972 };
1974 //*************************************************************************************************
1975 
1976 
1977 //*************************************************************************************************
1979 template< typename VT1, typename ST1, typename VT2, typename ST2 >
1980 struct TDVecTSVecMultExprTrait< DVecScalarMultExpr<VT1,ST1,true>, SVecScalarMultExpr<VT2,ST2,true> >
1981 {
1982  public:
1983  //**********************************************************************************************
1984  typedef typename SelectType< IsDenseVector<VT1>::value && IsRowVector<VT1>::value &&
1985  IsSparseVector<VT2>::value && IsRowVector<VT2>::value &&
1986  IsNumeric<ST1>::value && IsNumeric<ST2>::value
1987  , typename TSVecScalarMultExprTrait<typename TDVecTSVecMultExprTrait<VT1,VT2>::Type,typename MultTrait<ST1,ST2>::Type>::Type
1988  , INVALID_TYPE >::Type Type;
1989  //**********************************************************************************************
1990 };
1992 //*************************************************************************************************
1993 
1994 
1995 
1996 
1997 //=================================================================================================
1998 //
1999 // SVECDVECMULTEXPRTRAIT SPECIALIZATIONS
2000 //
2001 //=================================================================================================
2002 
2003 //*************************************************************************************************
2005 template< typename VT1, typename VT2, typename ST >
2006 struct SVecDVecMultExprTrait< VT1, DVecScalarMultExpr<VT2,ST,false> >
2007 {
2008  public:
2009  //**********************************************************************************************
2010  typedef typename SelectType< IsSparseVector<VT1>::value && IsColumnVector<VT1>::value &&
2011  IsDenseVector<VT2>::value && IsColumnVector<VT2>::value &&
2012  IsNumeric<ST>::value
2013  , typename SVecScalarMultExprTrait<typename SVecDVecMultExprTrait<VT1,VT2>::Type,ST>::Type
2014  , INVALID_TYPE >::Type Type;
2015  //**********************************************************************************************
2016 };
2018 //*************************************************************************************************
2019 
2020 
2021 //*************************************************************************************************
2023 template< typename VT1, typename ST1, typename VT2, typename ST2 >
2024 struct SVecDVecMultExprTrait< SVecScalarMultExpr<VT1,ST1,false>, DVecScalarMultExpr<VT2,ST2,false> >
2025 {
2026  public:
2027  //**********************************************************************************************
2028  typedef typename SelectType< IsSparseVector<VT1>::value && IsColumnVector<VT1>::value &&
2029  IsDenseVector<VT2>::value && IsColumnVector<VT2>::value &&
2030  IsNumeric<ST1>::value && IsNumeric<ST2>::value
2031  , typename SVecScalarMultExprTrait<typename SVecDVecMultExprTrait<VT1,VT2>::Type,typename MultTrait<ST1,ST2>::Type>::Type
2032  , INVALID_TYPE >::Type Type;
2033  //**********************************************************************************************
2034 };
2036 //*************************************************************************************************
2037 
2038 
2039 
2040 
2041 //=================================================================================================
2042 //
2043 // SVECTDVECMULTEXPRTRAIT SPECIALIZATIONS
2044 //
2045 //=================================================================================================
2046 
2047 //*************************************************************************************************
2049 template< typename VT1, typename VT2, typename ST >
2050 struct SVecTDVecMultExprTrait< VT1, DVecScalarMultExpr<VT2,ST,true> >
2051 {
2052  public:
2053  //**********************************************************************************************
2054  typedef typename SelectType< IsSparseVector<VT1>::value && IsColumnVector<VT1>::value &&
2055  IsDenseVector<VT2>::value && IsRowVector<VT2>::value &&
2056  IsNumeric<ST>::value
2057  , typename TSMatScalarMultExprTrait<typename SVecTDVecMultExprTrait<VT1,VT2>::Type,ST>::Type
2058  , INVALID_TYPE >::Type Type;
2059  //**********************************************************************************************
2060 };
2062 //*************************************************************************************************
2063 
2064 
2065 //*************************************************************************************************
2067 template< typename VT1, typename ST1, typename VT2, typename ST2 >
2068 struct SVecTDVecMultExprTrait< SVecScalarMultExpr<VT1,ST1,false>, DVecScalarMultExpr<VT2,ST2,true> >
2069 {
2070  public:
2071  //**********************************************************************************************
2072  typedef typename SelectType< IsSparseVector<VT1>::value && IsColumnVector<VT1>::value &&
2073  IsDenseVector<VT2>::value && IsRowVector<VT2>::value &&
2074  IsNumeric<ST1>::value && IsNumeric<ST2>::value
2075  , typename TSMatScalarMultExprTrait<typename SVecTDVecMultExprTrait<VT1,VT2>::Type,typename MultTrait<ST1,ST2>::Type>::Type
2076  , INVALID_TYPE >::Type Type;
2077  //**********************************************************************************************
2078 };
2080 //*************************************************************************************************
2081 
2082 
2083 
2084 
2085 //=================================================================================================
2086 //
2087 // TSVECTDVECMULTEXPRTRAIT SPECIALIZATIONS
2088 //
2089 //=================================================================================================
2090 
2091 //*************************************************************************************************
2093 template< typename VT1, typename VT2, typename ST >
2094 struct TSVecTDVecMultExprTrait< VT1, DVecScalarMultExpr<VT2,ST,true> >
2095 {
2096  public:
2097  //**********************************************************************************************
2098  typedef typename SelectType< IsSparseVector<VT1>::value && IsRowVector<VT1>::value &&
2099  IsDenseVector<VT2>::value && IsRowVector<VT2>::value &&
2100  IsNumeric<ST>::value
2101  , typename TSVecScalarMultExprTrait<typename TSVecTDVecMultExprTrait<VT1,VT2>::Type,ST>::Type
2102  , INVALID_TYPE >::Type Type;
2103  //**********************************************************************************************
2104 };
2106 //*************************************************************************************************
2107 
2108 
2109 //*************************************************************************************************
2111 template< typename VT1, typename ST1, typename VT2, typename ST2 >
2112 struct TSVecTDVecMultExprTrait< SVecScalarMultExpr<VT1,ST1,true>, DVecScalarMultExpr<VT2,ST2,true> >
2113 {
2114  public:
2115  //**********************************************************************************************
2116  typedef typename SelectType< IsSparseVector<VT1>::value && IsRowVector<VT1>::value &&
2117  IsDenseVector<VT2>::value && IsRowVector<VT2>::value &&
2118  IsNumeric<ST1>::value && IsNumeric<ST2>::value
2119  , typename TSVecScalarMultExprTrait<typename TSVecTDVecMultExprTrait<VT1,VT2>::Type,typename MultTrait<ST1,ST2>::Type>::Type
2120  , INVALID_TYPE >::Type Type;
2121  //**********************************************************************************************
2122 };
2124 //*************************************************************************************************
2125 
2126 
2127 
2128 
2129 //=================================================================================================
2130 //
2131 // DMATDVECMULTEXPRTRAIT SPECIALIZATIONS
2132 //
2133 //=================================================================================================
2134 
2135 //*************************************************************************************************
2137 template< typename MT, typename VT, typename ST >
2138 struct DMatDVecMultExprTrait< MT, DVecScalarMultExpr<VT,ST,false> >
2139 {
2140  public:
2141  //**********************************************************************************************
2142  typedef typename SelectType< IsDenseMatrix<MT>::value && IsRowMajorMatrix<MT>::value &&
2143  IsDenseVector<VT>::value && IsColumnVector<VT>::value &&
2144  IsNumeric<ST>::value
2145  , typename DVecScalarMultExprTrait<typename DMatDVecMultExprTrait<MT,VT>::Type,ST>::Type
2146  , INVALID_TYPE >::Type Type;
2147  //**********************************************************************************************
2148 };
2150 //*************************************************************************************************
2151 
2152 
2153 
2154 
2155 //=================================================================================================
2156 //
2157 // TDMATDVECMULTEXPRTRAIT SPECIALIZATIONS
2158 //
2159 //=================================================================================================
2160 
2161 //*************************************************************************************************
2163 template< typename MT, typename VT, typename ST >
2164 struct TDMatDVecMultExprTrait< MT, DVecScalarMultExpr<VT,ST,false> >
2165 {
2166  public:
2167  //**********************************************************************************************
2168  typedef typename SelectType< IsDenseMatrix<MT>::value && IsColumnMajorMatrix<MT>::value &&
2169  IsDenseVector<VT>::value && IsColumnVector<VT>::value &&
2170  IsNumeric<ST>::value
2171  , typename DVecScalarMultExprTrait<typename TDMatDVecMultExprTrait<MT,VT>::Type,ST>::Type
2172  , INVALID_TYPE >::Type Type;
2173  //**********************************************************************************************
2174 };
2176 //*************************************************************************************************
2177 
2178 
2179 
2180 
2181 //=================================================================================================
2182 //
2183 // TDVECDMATMULTEXPRTRAIT SPECIALIZATIONS
2184 //
2185 //=================================================================================================
2186 
2187 //*************************************************************************************************
2189 template< typename VT, typename MT, typename ST >
2190 struct TDVecDMatMultExprTrait< DVecScalarMultExpr<VT,ST,true>, MT >
2191 {
2192  public:
2193  //**********************************************************************************************
2194  typedef typename SelectType< IsDenseVector<VT>::value && IsRowVector<VT>::value &&
2195  IsDenseMatrix<MT>::value && IsRowMajorMatrix<MT>::value &&
2196  IsNumeric<ST>::value
2197  , typename TDVecScalarMultExprTrait<typename TDVecDMatMultExprTrait<VT,MT>::Type,ST>::Type
2198  , INVALID_TYPE >::Type Type;
2199  //**********************************************************************************************
2200 };
2202 //*************************************************************************************************
2203 
2204 
2205 
2206 
2207 //=================================================================================================
2208 //
2209 // TDVECTDMATMULTEXPRTRAIT SPECIALIZATIONS
2210 //
2211 //=================================================================================================
2212 
2213 //*************************************************************************************************
2215 template< typename VT, typename MT, typename ST >
2216 struct TDVecTDMatMultExprTrait< DVecScalarMultExpr<VT,ST,true>, MT >
2217 {
2218  public:
2219  //**********************************************************************************************
2220  typedef typename SelectType< IsDenseVector<VT>::value && IsRowVector<VT>::value &&
2221  IsDenseMatrix<MT>::value && IsColumnMajorMatrix<MT>::value &&
2222  IsNumeric<ST>::value
2223  , typename TDVecScalarMultExprTrait<typename TDVecTDMatMultExprTrait<VT,MT>::Type,ST>::Type
2224  , INVALID_TYPE >::Type Type;
2225  //**********************************************************************************************
2226 };
2228 //*************************************************************************************************
2229 
2230 
2231 
2232 
2233 //=================================================================================================
2234 //
2235 // SMATDVECMULTEXPRTRAIT SPECIALIZATIONS
2236 //
2237 //=================================================================================================
2238 
2239 //*************************************************************************************************
2241 template< typename MT, typename VT, typename ST >
2242 struct SMatDVecMultExprTrait< MT, DVecScalarMultExpr<VT,ST,false> >
2243 {
2244  public:
2245  //**********************************************************************************************
2246  typedef typename SelectType< IsSparseMatrix<MT>::value && IsRowMajorMatrix<MT>::value &&
2247  IsDenseVector<VT>::value && IsColumnVector<VT>::value &&
2248  IsNumeric<ST>::value
2249  , typename DVecScalarMultExprTrait<typename SMatDVecMultExprTrait<MT,VT>::Type,ST>::Type
2250  , INVALID_TYPE >::Type Type;
2251  //**********************************************************************************************
2252 };
2254 //*************************************************************************************************
2255 
2256 
2257 
2258 
2259 //=================================================================================================
2260 //
2261 // TSMATDVECMULTEXPRTRAIT SPECIALIZATIONS
2262 //
2263 //=================================================================================================
2264 
2265 //*************************************************************************************************
2267 template< typename MT, typename VT, typename ST >
2268 struct TSMatDVecMultExprTrait< MT, DVecScalarMultExpr<VT,ST,false> >
2269 {
2270  public:
2271  //**********************************************************************************************
2272  typedef typename SelectType< IsSparseMatrix<MT>::value && IsColumnMajorMatrix<MT>::value &&
2273  IsDenseVector<VT>::value && IsColumnVector<VT>::value &&
2274  IsNumeric<ST>::value
2275  , typename DVecScalarMultExprTrait<typename TSMatDVecMultExprTrait<MT,VT>::Type,ST>::Type
2276  , INVALID_TYPE >::Type Type;
2277  //**********************************************************************************************
2278 };
2280 //*************************************************************************************************
2281 
2282 
2283 
2284 
2285 //=================================================================================================
2286 //
2287 // TDVECSMATMULTEXPRTRAIT SPECIALIZATIONS
2288 //
2289 //=================================================================================================
2290 
2291 //*************************************************************************************************
2293 template< typename VT, typename MT, typename ST >
2294 struct TDVecSMatMultExprTrait< DVecScalarMultExpr<VT,ST,true>, MT >
2295 {
2296  public:
2297  //**********************************************************************************************
2298  typedef typename SelectType< IsDenseVector<VT>::value && IsRowVector<VT>::value &&
2299  IsSparseMatrix<MT>::value && IsRowMajorMatrix<MT>::value &&
2300  IsNumeric<ST>::value
2301  , typename TDVecScalarMultExprTrait<typename TDVecSMatMultExprTrait<VT,MT>::Type,ST>::Type
2302  , INVALID_TYPE >::Type Type;
2303  //**********************************************************************************************
2304 };
2306 //*************************************************************************************************
2307 
2308 
2309 
2310 
2311 //=================================================================================================
2312 //
2313 // TDVECTSMATMULTEXPRTRAIT SPECIALIZATIONS
2314 //
2315 //=================================================================================================
2316 
2317 //*************************************************************************************************
2319 template< typename VT, typename MT, typename ST >
2320 struct TDVecTSMatMultExprTrait< DVecScalarMultExpr<VT,ST,true>, MT >
2321 {
2322  public:
2323  //**********************************************************************************************
2324  typedef typename SelectType< IsDenseVector<VT>::value && IsRowVector<VT>::value &&
2325  IsSparseMatrix<MT>::value && IsColumnMajorMatrix<MT>::value &&
2326  IsNumeric<ST>::value
2327  , typename TDVecScalarMultExprTrait<typename TDVecTSMatMultExprTrait<VT,MT>::Type,ST>::Type
2328  , INVALID_TYPE >::Type Type;
2329  //**********************************************************************************************
2330 };
2332 //*************************************************************************************************
2333 
2334 
2335 
2336 
2337 //=================================================================================================
2338 //
2339 // SUBVECTOREXPRTRAIT SPECIALIZATIONS
2340 //
2341 //=================================================================================================
2342 
2343 //*************************************************************************************************
2345 template< typename VT, typename ST, bool TF, bool AF >
2346 struct SubvectorExprTrait< DVecScalarMultExpr<VT,ST,TF>, AF >
2347 {
2348  public:
2349  //**********************************************************************************************
2350  typedef typename MultExprTrait< typename SubvectorExprTrait<const VT,AF>::Type, ST >::Type Type;
2351  //**********************************************************************************************
2352 };
2354 //*************************************************************************************************
2355 
2356 } // namespace blaze
2357 
2358 #endif
Pointer difference type of the Blaze library.
Data type constraint.
Compile time check whether the given type is a computational expression template.This type trait clas...
Definition: IsComputation.h:89
Constraint on the data type.
Compile time check whether the given type is a temporary vector or matrix type.This type trait class ...
Definition: IsTemporary.h:87
const DMatDMatMultExpr< T1, T2 > operator*(const DenseMatrix< T1, false > &lhs, const DenseMatrix< T2, false > &rhs)
Multiplication operator for the multiplication of two row-major dense matrices ( ).
Definition: DMatDMatMultExpr.h:4075
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:772
Header file for the SparseVector base class.
IntrinsicTrait< ElementType >::Type IntrinsicType
Resulting intrinsic element type.
Definition: DVecScalarMultExpr.h:158
ReturnType operator*() const
Direct access to the element at the current iterator position.
Definition: DVecScalarMultExpr.h:280
void smpSubAssign(DenseMatrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs)
Default implementation of the SMP subtraction assignment of a matrix to dense matrix.
Definition: DenseMatrix.h:151
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:481
Efficient implementation of a compressed matrix.The CompressedMatrix class template is the represent...
Definition: CompressedMatrix.h:197
const ConstIterator operator++(int)
Post-increment operator.
Definition: DVecScalarMultExpr.h:249
void smpMultAssign(DenseVector< VT1, TF1 > &lhs, const Vector< VT2, TF2 > &rhs)
Default implementation of the SMP multiplication assignment of a vector to a dense vector...
Definition: DenseVector.h:178
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:2384
Header file for the IsRowVector type trait.
Type ElementType
Type of the sparse matrix elements.
Definition: CompressedMatrix.h:249
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:444
Header file for the Computation base class.
Type relationship analysis.This class tests if the two data types A and B are equal. For this type comparison, the cv-qualifiers of both data types are ignored. If A and B are the same data type (ignoring the cv-qualifiers), then the value member enumeration is set to 1, the nested type definition Type is TrueType, and the class derives from TrueType. Otherwise value is set to 0, Type is FalseType, and the class derives from FalseType.
Definition: IsSame.h:158
Header file for the RequiresEvaluation type trait.
MultExprTrait< RN, ST >::Type ExprReturnType
Expression return type for the subscript operator.
Definition: DVecScalarMultExpr.h:130
bool operator!=(const ConstIterator &rhs) const
Inequality comparison between two ConstIterator objects.
Definition: DVecScalarMultExpr.h:312
ConstIterator(IteratorType iterator, RightOperand scalar)
Constructor for the ConstIterator class.
Definition: DVecScalarMultExpr.h:203
Header file for the VecScalarMultExpr base class.
LeftOperand leftOperand() const
Returns the left-hand side dense vector operand.
Definition: DVecScalarMultExpr.h:501
ResultType::ElementType ElementType
Resulting element type.
Definition: DVecScalarMultExpr.h:157
Constraint on the data type.
ValueType value_type
Type of the underlying elements.
Definition: DVecScalarMultExpr.h:188
bool operator<=(const ConstIterator &rhs) const
Less-than comparison between two ConstIterator objects.
Definition: DVecScalarMultExpr.h:345
Header file for the SparseMatrix base class.
Header file for the DivExprTrait class template.
bool isAligned() const
Returns whether the operands of the expression are properly aligned in memory.
Definition: DVecScalarMultExpr.h:545
PointerType pointer
Pointer return type.
Definition: DVecScalarMultExpr.h:189
VT::ConstIterator IteratorType
ConstIterator type of the dense vector expression.
Definition: DVecScalarMultExpr.h:194
IntrinsicType load(size_t index) const
Access to the intrinsic elements of the vector.
Definition: DVecScalarMultExpr.h:456
SelectType< IsExpression< VT >::value, const VT, const VT & >::Type LeftOperand
Composite type of the left-hand side dense vector expression.
Definition: DVecScalarMultExpr.h:167
Header file for the MultExprTrait class template.
void smpAddAssign(DenseMatrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs)
Default implementation of the SMP addition assignment of a matrix to a dense matrix.
Definition: DenseMatrix.h:121
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:251
DVecScalarMultExpr(const VT &vector, ST scalar)
Constructor for the DVecScalarMultExpr class.
Definition: DVecScalarMultExpr.h:432
ptrdiff_t DifferenceType
Difference between two iterators.
Definition: DVecScalarMultExpr.h:184
Compile time type selection.The SelectType class template selects one of the two given types T1 and T...
Definition: SelectType.h:59
Header file for the IsTemporary type trait class.
Header file for the multiplication trait.
Header file for the dense vector SMP implementation.
Header file for the IsFloatingPoint type trait.
const Element * ConstIterator
Iterator over constant elements.
Definition: CompressedMatrix.h:2388
bool canAlias(const T *alias) const
Returns whether the expression can alias with the given address alias.
Definition: DVecScalarMultExpr.h:523
Iterator over the elements of the dense vector.
Definition: DVecScalarMultExpr.h:176
Header file for the DenseMatrix base class.
const SelectType< returnExpr, ExprReturnType, ElementType >::Type ReturnType
Return type for expression template evaluations.
Definition: DVecScalarMultExpr.h:161
bool operator>(const ConstIterator &rhs) const
Greater-than comparison between two ConstIterator objects.
Definition: DVecScalarMultExpr.h:334
ResultType::TransposeType TransposeType
Transpose type for expression template evaluations.
Definition: DVecScalarMultExpr.h:156
void assign(Matrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs)
Default implementation of the assignment of a matrix to a matrix.
Definition: Matrix.h:179
bool operator>=(const ConstIterator &rhs) const
Greater-than comparison between two ConstIterator objects.
Definition: DVecScalarMultExpr.h:356
ST RightOperand
Composite type of the right-hand side scalar value.
Definition: DVecScalarMultExpr.h:170
VT::ResultType RT
Result type of the dense vector expression.
Definition: DVecScalarMultExpr.h:114
Base class for N-dimensional dense vectors.The DenseVector class is a base class for all arbitrarily ...
Definition: DenseVector.h:70
#define BLAZE_CONSTRAINT_MUST_BE_SAME_TYPE(A, B)
Data type constraint.In case the two types A and B are not the same (ignoring all cv-qualifiers of bo...
Definition: SameType.h:89
Constraint on the data type.
#define BLAZE_CONSTRAINT_MUST_BE_REFERENCE_TYPE(T)
Constraint on the data type.In case the given data type T is not a reference type, a compilation error is created.
Definition: Reference.h:78
std::random_access_iterator_tag IteratorCategory
The iterator category.
Definition: DVecScalarMultExpr.h:180
Constraint on the data type.
DVecScalarMultExpr< VT, ST, TF > This
Type of this DVecScalarMultExpr instance.
Definition: DVecScalarMultExpr.h:154
Type ElementType
Type of the sparse matrix elements.
Definition: CompressedMatrix.h:2382
void multAssign(Matrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs)
Default implementation of the multiplication assignment of a matrix to a matrix.
Definition: Matrix.h:269
bool operator<(const ConstIterator &rhs) const
Less-than comparison between two ConstIterator objects.
Definition: DVecScalarMultExpr.h:323
Header file for the SelectType class template.
LeftOperand vector_
Left-hand side dense vector of the multiplication expression.
Definition: DVecScalarMultExpr.h:562
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:480
Header file for the IsDenseMatrix type trait.
size_t size() const
Returns the current size/dimension of the vector.
Definition: DVecScalarMultExpr.h:491
Header file for the EnableIf class template.
ReferenceType reference
Reference return type.
Definition: DVecScalarMultExpr.h:190
ConstIterator & operator++()
Pre-increment operator.
Definition: DVecScalarMultExpr.h:238
Header file for the BaseElementType type trait.
bool canSMPAssign() const
Returns whether the expression can be used in SMP assignments.
Definition: DVecScalarMultExpr.h:555
friend const ConstIterator operator+(const ConstIterator &it, size_t inc)
Addition between a ConstIterator and an integral value.
Definition: DVecScalarMultExpr.h:379
Header file for the IsNumeric type trait.
RightOperand scalar_
Right-hand side scalar of the multiplication expression.
Definition: DVecScalarMultExpr.h:563
ElementType ValueType
Type of the underlying elements.
Definition: DVecScalarMultExpr.h:181
bool operator==(const ConstIterator &rhs) const
Equality comparison between two ConstIterator objects.
Definition: DVecScalarMultExpr.h:301
Base class for all vector/scalar multiplication expression templates.The VecScalarMultExpr class serv...
Definition: VecScalarMultExpr.h:66
Header file for the IsSparseVector type trait.
const Type & ReturnType
Return type for expression template evaluations.
Definition: CompressedMatrix.h:2383
Intrinsic characteristics of data types.The IntrinsicTrait class template provides the intrinsic char...
Definition: IntrinsicTrait.h:748
Header file for run time assertion macros.
Utility type for generic codes.
Base template for the MultTrait class.
Definition: MultTrait.h:141
Header file for the division trait.
IteratorType iterator_
Iterator to the current element.
Definition: DVecScalarMultExpr.h:410
void addAssign(Matrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs)
Default implementation of the addition assignment of a matrix to a matrix.
Definition: Matrix.h:209
bool isAliased(const T *alias) const
Returns whether the expression is aliased with the given address alias.
Definition: DVecScalarMultExpr.h:535
const DenseIterator< Type > operator-(const DenseIterator< Type > &it, ptrdiff_t inc)
Subtraction between a DenseIterator and an integral value.
Definition: DenseIterator.h:585
Substitution Failure Is Not An Error (SFINAE) class.The EnableIf class template is an auxiliary tool ...
Definition: EnableIf.h:184
Constraint on the data type.
#define BLAZE_CONSTRAINT_MUST_BE_NUMERIC_TYPE(T)
Constraint on the data type.In case the given data type T is not a numeric (integral or floating poin...
Definition: Numeric.h:79
RightOperand rightOperand() const
Returns the right-hand side scalar operand.
Definition: DVecScalarMultExpr.h:511
void subAssign(Matrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs)
Default implementation of the subtraction assignment of a matrix to matrix.
Definition: Matrix.h:239
VT::ElementType ET
Element type of the dense vector expression.
Definition: DVecScalarMultExpr.h:116
friend const ConstIterator operator+(size_t inc, const ConstIterator &it)
Addition between an integral value and a ConstIterator.
Definition: DVecScalarMultExpr.h:391
ElementType * PointerType
Pointer return type.
Definition: DVecScalarMultExpr.h:182
Evaluation of the base element type of a given data type.Via this type trait it is possible to evalua...
Definition: BaseElementType.h:75
VT::ReturnType RN
Return type of the dense vector expression.
Definition: DVecScalarMultExpr.h:115
Header file for the IsDenseVector type trait.
friend const ConstIterator operator-(const ConstIterator &it, size_t dec)
Subtraction between a ConstIterator and an integral value.
Definition: DVecScalarMultExpr.h:403
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:183
ConstIterator begin() const
Returns an iterator to the first non-zero element of the dense vector.
Definition: DVecScalarMultExpr.h:471
IntrinsicType load() const
Access to the intrinsic elements of the vector.
Definition: DVecScalarMultExpr.h:290
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:270
Expression object for dense vector-scalar multiplications.The DVecScalarMultExpr class represents the...
Definition: DVecScalarMultExpr.h:108
const size_t SMP_DVECSCALARMULT_THRESHOLD
SMP dense vector/scalar multiplication/division threshold.This threshold represents the system-specif...
Definition: Thresholds.h:126
ConstIterator & operator+=(size_t inc)
Addition assignment operator.
Definition: DVecScalarMultExpr.h:215
Base class for all compute expression templates.The Computation class serves as a tag for all computa...
Definition: Computation.h:59
Header file for the sparse vector SMP implementation.
Base class for sparse vectors.The SparseVector class is a base class for all arbitrarily sized (N-dim...
Definition: Forward.h:105
#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:227
This ResultType
Result type for expression template evaluations.
Definition: CompressedMatrix.h:2379
Header file for basic type definitions.
Header file for the SubvectorExprTrait class template.
SelectType< useAssign, const ResultType, const DVecScalarMultExpr & >::Type CompositeType
Data type for composite expression templates.
Definition: DVecScalarMultExpr.h:164
const DVecScalarMultExpr< VT, typename VT::ElementType, TF > normalize(const DenseVector< VT, TF > &vec)
Normalization of the dense vector ( ).
Definition: DVecScalarMultExpr.h:889
MultTrait< RT, ST >::Type ResultType
Result type for expression template evaluations.
Definition: DVecScalarMultExpr.h:155
Header file for the IsColumnVector type trait.
IteratorCategory iterator_category
The iterator category.
Definition: DVecScalarMultExpr.h:187
VT::CompositeType CT
Composite type of the dense vector expression.
Definition: DVecScalarMultExpr.h:117
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:411
#define BLAZE_CONSTRAINT_MUST_BE_VECTOR_WITH_TRANSPOSE_FLAG(T, TF)
Constraint on the data type.In case the given data type T is not a dense or sparse vector type and in...
Definition: TransposeFlag.h:238
Header file for the thresholds for matrix/vector and matrix/matrix multiplications.
#define BLAZE_INTERNAL_ASSERT(expr, msg)
Run time assertion macro for internal checks.In case of an invalid run time expression, the program execution is terminated. The BLAZE_INTERNAL_ASSERT macro can be disabled by setting the BLAZE_USER_ASSERTION flag to zero or by defining NDEBUG during the compilation.
Definition: Assert.h:101
EnableIf< IsIntegral< T >, Set< T, sizeof(T)> >::Type::Type set(T value)
Sets all values in the vector to the given integral value.
Definition: Set.h:209
#define BLAZE_CONSTRAINT_MUST_BE_FLOATING_POINT_TYPE(T)
Constraint on the data type.In case the given data type T is not a floating point data type...
Definition: FloatingPoint.h:79
Header file for the IsExpression type trait class.
Header file for the FunctionTrace class.
DifferenceType difference_type
Difference between two iterators.
Definition: DVecScalarMultExpr.h:191
DifferenceType operator-(const ConstIterator &rhs) const
Calculating the number of elements between two iterators.
Definition: DVecScalarMultExpr.h:367
ConstIterator & operator--()
Pre-decrement operator.
Definition: DVecScalarMultExpr.h:259