All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
DVecScalarMultExpr.h
Go to the documentation of this file.
1 //=================================================================================================
20 //=================================================================================================
21 
22 #ifndef _BLAZE_MATH_EXPRESSIONS_DVECSCALARMULTEXPR_H_
23 #define _BLAZE_MATH_EXPRESSIONS_DVECSCALARMULTEXPR_H_
24 
25 
26 //*************************************************************************************************
27 // Includes
28 //*************************************************************************************************
29 
39 #include <blaze/math/Intrinsics.h>
55 #include <blaze/util/Assert.h>
59 #include <blaze/util/EnableIf.h>
60 #include <blaze/util/InvalidType.h>
62 #include <blaze/util/SelectType.h>
63 #include <blaze/util/Types.h>
67 
68 
69 namespace blaze {
70 
71 //=================================================================================================
72 //
73 // CLASS DVECSCALARMULTEXPR
74 //
75 //=================================================================================================
76 
77 //*************************************************************************************************
84 template< typename VT // Type of the left-hand side dense vector
85  , typename ST // Type of the right-hand side scalar value
86  , bool TF > // Transpose flag
87 class DVecScalarMultExpr : public DenseVector< DVecScalarMultExpr<VT,ST,TF>, TF >
88  , private Expression
89  , private Computation
90 {
91  private:
92  //**Type definitions****************************************************************************
93  typedef typename VT::ResultType RT;
94  typedef typename VT::ReturnType RN;
95  typedef typename VT::ElementType ET;
96  typedef typename VT::CompositeType CT;
97  //**********************************************************************************************
98 
99  //**Return type evaluation**********************************************************************
101 
106  enum { returnExpr = !IsTemporary<RN>::value };
107 
110  //**********************************************************************************************
111 
112  //**Evaluation strategy*************************************************************************
114 
120  enum { useAssign = RequiresEvaluation<VT>::value };
121 
123 
124  template< typename VT2 >
125  struct UseAssign {
126  enum { value = useAssign };
127  };
129  //**********************************************************************************************
130 
131  public:
132  //**Type definitions****************************************************************************
135  typedef typename ResultType::TransposeType TransposeType;
136  typedef typename ResultType::ElementType ElementType;
138 
141 
144 
146  typedef typename SelectType< IsExpression<VT>::value, const VT, const VT& >::Type LeftOperand;
147 
150  //**********************************************************************************************
151 
152  //**Compilation flags***************************************************************************
154  enum { vectorizable = VT::vectorizable &&
157  //**********************************************************************************************
158 
159  //**Constructor*********************************************************************************
165  explicit inline DVecScalarMultExpr( const VT& vector, ST scalar )
166  : vector_( vector ) // Left-hand side dense vector of the multiplication expression
167  , scalar_( scalar ) // Right-hand side scalar of the multiplication expression
168  {}
169  //**********************************************************************************************
170 
171  //**Subscript operator**************************************************************************
177  inline ReturnType operator[]( size_t index ) const {
178  BLAZE_INTERNAL_ASSERT( index < vector_.size(), "Invalid vector access index" );
179  return vector_[index] * scalar_;
180  }
181  //**********************************************************************************************
182 
183  //**Get function********************************************************************************
189  inline IntrinsicType get( size_t index ) const {
190  typedef IntrinsicTrait<ElementType> IT;
191  BLAZE_INTERNAL_ASSERT( index < vector_.size() , "Invalid vector access index" );
192  BLAZE_INTERNAL_ASSERT( index % IT::size == 0UL, "Invalid vector access index" );
193  const IntrinsicType xmm1( vector_.get( index ) );
194  const IntrinsicType xmm2( set( scalar_ ) );
195  return xmm1 * xmm2;
196  }
197  //**********************************************************************************************
198 
199  //**Size function*******************************************************************************
204  inline size_t size() const {
205  return vector_.size();
206  }
207  //**********************************************************************************************
208 
209  //**Left operand access*************************************************************************
214  inline LeftOperand leftOperand() const {
215  return vector_;
216  }
217  //**********************************************************************************************
218 
219  //**Right operand access************************************************************************
224  inline RightOperand rightOperand() const {
225  return scalar_;
226  }
227  //**********************************************************************************************
228 
229  //**********************************************************************************************
235  template< typename T >
236  inline bool canAlias( const T* alias ) const {
237  return vector_.canAlias( alias );
238  }
239  //**********************************************************************************************
240 
241  //**********************************************************************************************
247  template< typename T >
248  inline bool isAliased( const T* alias ) const {
249  return vector_.isAliased( alias );
250  }
251  //**********************************************************************************************
252 
253  private:
254  //**Member variables****************************************************************************
257  //**********************************************************************************************
258 
259  //**Assignment to dense vectors*****************************************************************
273  template< typename VT2 > // Type of the target dense vector
274  friend inline typename EnableIf< UseAssign<VT2> >::Type
275  assign( DenseVector<VT2,TF>& lhs, const DVecScalarMultExpr& rhs )
276  {
278 
279  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
280 
281  assign( ~lhs, rhs.vector_ );
282 
283  const size_t size( rhs.size() );
284  for( size_t i=0UL; i<size; ++i )
285  (~lhs)[i] *= rhs.scalar_;
286  }
288  //**********************************************************************************************
289 
290  //**Assignment to sparse vectors****************************************************************
304  template< typename VT2 > // Type of the target sparse vector
305  friend inline typename EnableIf< UseAssign<VT2> >::Type
307  {
309 
310  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
311 
312  assign( ~lhs, rhs.vector_ );
313 
314  typename VT2::Iterator begin( (~lhs).begin() );
315  const typename VT2::Iterator end( (~lhs).end() );
316 
317  for( ; begin!=end; ++begin )
318  begin->value() *= rhs.scalar_;
319  }
321  //**********************************************************************************************
322 
323  //**Addition assignment to dense vectors********************************************************
337  template< typename VT2 > // Type of the target dense vector
338  friend inline typename EnableIf< UseAssign<VT2> >::Type
339  addAssign( DenseVector<VT2,TF>& lhs, const DVecScalarMultExpr& rhs )
340  {
342 
345  BLAZE_CONSTRAINT_MUST_BE_REFERENCE_TYPE( typename ResultType::CompositeType );
346 
347  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
348 
349  const ResultType tmp( rhs );
350  addAssign( ~lhs, tmp );
351  }
353  //**********************************************************************************************
354 
355  //**Addition assignment to sparse vectors*******************************************************
356  // No special implementation for the addition assignment to sparse vectors.
357  //**********************************************************************************************
358 
359  //**Subtraction assignment to dense vectors*****************************************************
373  template< typename VT2 > // Type of the target dense vector
374  friend inline typename EnableIf< UseAssign<VT2> >::Type
375  subAssign( DenseVector<VT2,TF>& lhs, const DVecScalarMultExpr& rhs )
376  {
378 
381  BLAZE_CONSTRAINT_MUST_BE_REFERENCE_TYPE( typename ResultType::CompositeType );
382 
383  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
384 
385  const ResultType tmp( rhs );
386  subAssign( ~lhs, tmp );
387  }
389  //**********************************************************************************************
390 
391  //**Subtraction assignment to sparse vectors****************************************************
392  // No special implementation for the subtraction assignment to sparse vectors.
393  //**********************************************************************************************
394 
395  //**Multiplication assignment to dense vectors**************************************************
409  template< typename VT2 > // Type of the target dense vector
410  friend inline typename EnableIf< UseAssign<VT2> >::Type
411  multAssign( DenseVector<VT2,TF>& lhs, const DVecScalarMultExpr& rhs )
412  {
414 
417  BLAZE_CONSTRAINT_MUST_BE_REFERENCE_TYPE( typename ResultType::CompositeType );
418 
419  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
420 
421  const ResultType tmp( rhs );
422  multAssign( ~lhs, tmp );
423  }
425  //**********************************************************************************************
426 
427  //**Multiplication assignment to sparse vectors*************************************************
428  // No special implementation for the multiplication assignment to sparse vectors.
429  //**********************************************************************************************
430 
431  //**Compile time checks*************************************************************************
438  //**********************************************************************************************
439 };
440 //*************************************************************************************************
441 
442 
443 
444 
445 //=================================================================================================
446 //
447 // GLOBAL UNARY ARITHMETIC OPERATORS
448 //
449 //=================================================================================================
450 
451 //*************************************************************************************************
468 template< typename VT // Type of the dense vector
469  , bool TF > // Transpose flag
470 inline const DVecScalarMultExpr<VT,typename BaseElementType<VT>::Type,TF>
472 {
474 
475  typedef typename BaseElementType<VT>::Type ElementType;
476  return DVecScalarMultExpr<VT,ElementType,TF>( ~dv, ElementType(-1) );
477 }
478 //*************************************************************************************************
479 
480 
481 
482 
483 //=================================================================================================
484 //
485 // GLOBAL BINARY ARITHMETIC OPERATORS
486 //
487 //=================================================================================================
488 
489 //*************************************************************************************************
511 template< typename T1 // Type of the left-hand side dense vector
512  , typename T2 // Type of the right-hand side scalar
513  , bool TF > // Transpose flag
514 inline const typename EnableIf< IsNumeric<T2>, typename MultExprTrait<T1,T2>::Type >::Type
515  operator*( const DenseVector<T1,TF>& vec, T2 scalar )
516 {
518 
519  typedef typename MultExprTrait<T1,T2>::Type Type;
520  return Type( ~vec, scalar );
521 }
522 //*************************************************************************************************
523 
524 
525 //*************************************************************************************************
547 template< typename T1 // Type of the left-hand side scalar
548  , typename T2 // Type of the right-hand side dense vector
549  , bool TF > // Transpose flag
550 inline const typename EnableIf< IsNumeric<T1>, typename MultExprTrait<T1,T2>::Type >::Type
551  operator*( T1 scalar, const DenseVector<T2,TF>& vec )
552 {
554 
555  typedef typename MultExprTrait<T1,T2>::Type Type;
556  return Type( ~vec, scalar );
557 }
558 //*************************************************************************************************
559 
560 
561 
562 
563 //=================================================================================================
564 //
565 // GLOBAL RESTRUCTURING UNARY ARITHMETIC OPERATORS
566 //
567 //=================================================================================================
568 
569 //*************************************************************************************************
581 template< typename VT // Type of the dense vector
582  , typename ST // Type of the scalar
583  , bool TF > // Transpose flag
584 inline const DVecScalarMultExpr<VT,ST,TF>
585  operator-( const DVecScalarMultExpr<VT,ST,TF>& dv )
586 {
588 
589  return DVecScalarMultExpr<VT,ST,TF>( dv.leftOperand(), -dv.rightOperand() );
590 }
592 //*************************************************************************************************
593 
594 
595 
596 
597 //=================================================================================================
598 //
599 // GLOBAL RESTRUCTURING BINARY ARITHMETIC OPERATORS
600 //
601 //=================================================================================================
602 
603 //*************************************************************************************************
616 template< typename VT // Type of the dense vector of the left-hand side expression
617  , typename ST1 // Type of the scalar of the left-hand side expression
618  , bool TF // Transpose flag of the dense vector
619  , typename ST2 > // Type of the right-hand side scalar
620 inline const typename EnableIf< IsNumeric<ST2>
621  , typename MultExprTrait< DVecScalarMultExpr<VT,ST1,TF>, ST2 >::Type >::Type
622  operator*( const DVecScalarMultExpr<VT,ST1,TF>& vec, ST2 scalar )
623 {
625 
626  return vec.leftOperand() * ( vec.rightOperand() * scalar );
627 }
629 //*************************************************************************************************
630 
631 
632 //*************************************************************************************************
645 template< typename ST1 // Type of the left-hand side scalar
646  , typename VT // Type of the dense vector of the right-hand side expression
647  , typename ST2 // Type of the scalar of the right-hand side expression
648  , bool TF > // Transpose flag of the dense vector
649 inline const typename EnableIf< IsNumeric<ST1>
650  , typename MultExprTrait< ST1, DVecScalarMultExpr<VT,ST2,TF> >::Type >::Type
651  operator*( ST1 scalar, const DVecScalarMultExpr<VT,ST2,TF>& vec )
652 {
654 
655  return vec.leftOperand() * ( scalar * vec.rightOperand() );
656 }
658 //*************************************************************************************************
659 
660 
661 //*************************************************************************************************
674 template< typename VT // Type of the dense vector of the left-hand side expression
675  , typename ST1 // Type of the scalar of the left-hand side expression
676  , bool TF // Transpose flag of the dense vector
677  , typename ST2 > // Type of the right-hand side scalar
678 inline const typename EnableIf< IsFloatingPoint<typename DivTrait<ST1,ST2>::Type>
679  , typename DivExprTrait< DVecScalarMultExpr<VT,ST1,TF>, ST2 >::Type >::Type
680  operator/( const DVecScalarMultExpr<VT,ST1,TF>& vec, ST2 scalar )
681 {
683 
684  return vec.leftOperand() * ( vec.rightOperand() / scalar );
685 }
687 //*************************************************************************************************
688 
689 
690 //*************************************************************************************************
704 template< typename VT1 // Type of the dense vector of the left-hand side expression
705  , typename ST // Type of the scalar of the left-hand side expression
706  , bool TF // Transpose flag of the dense vectors
707  , typename VT2 > // Type of the right-hand side dense vector
708 inline const typename MultExprTrait< DVecScalarMultExpr<VT1,ST,TF>, VT2 >::Type
709  operator*( const DVecScalarMultExpr<VT1,ST,TF>& lhs, const DenseVector<VT2,TF>& rhs )
710 {
712 
713  return ( lhs.leftOperand() * (~rhs) ) * lhs.rightOperand();
714 }
716 //*************************************************************************************************
717 
718 
719 //*************************************************************************************************
733 template< typename VT1 // Type of the left-hand side dense vector
734  , bool TF // Transpose flag of the dense vectors
735  , typename VT2 // Type of the dense vector of the right-hand side expression
736  , typename ST > // Type of the scalar of the right-hand side expression
737 inline const typename MultExprTrait< VT1, DVecScalarMultExpr<VT2,ST,TF> >::Type
738  operator*( const DenseVector<VT1,TF>& lhs, const DVecScalarMultExpr<VT2,ST,TF>& rhs )
739 {
741 
742  return ( (~lhs) * rhs.leftOperand() ) * rhs.rightOperand();
743 }
745 //*************************************************************************************************
746 
747 
748 //*************************************************************************************************
762 template< typename VT1 // Type of the dense vector of the left-hand side expression
763  , typename ST1 // Type of the scalar of the left-hand side expression
764  , bool TF // Transpose flag of the dense vectors
765  , typename VT2 // Type of the dense vector of the right-hand side expression
766  , typename ST2 > // Type of the scalar of the right-hand side expression
767 inline const typename MultExprTrait< DVecScalarMultExpr<VT1,ST1,TF>, DVecScalarMultExpr<VT2,ST2,TF> >::Type
768  operator*( const DVecScalarMultExpr<VT1,ST1,TF>& lhs, const DVecScalarMultExpr<VT2,ST2,TF>& rhs )
769 {
771 
772  return ( lhs.leftOperand() * rhs.leftOperand() ) * ( lhs.rightOperand() * rhs.rightOperand() );
773 }
775 //*************************************************************************************************
776 
777 
778 //*************************************************************************************************
792 template< typename VT1 // Type of the dense vector of the left-hand side expression
793  , typename ST // Type of the scalar of the left-hand side expression
794  , typename VT2 > // Type of the right-hand side dense vector
795 inline const typename MultExprTrait< DVecScalarMultExpr<VT1,ST,false>, VT2 >::Type
796  operator*( const DVecScalarMultExpr<VT1,ST,false>& lhs, const DenseVector<VT2,true>& rhs )
797 {
799 
800  return ( lhs.leftOperand() * (~rhs) ) * lhs.rightOperand();
801 }
803 //*************************************************************************************************
804 
805 
806 //*************************************************************************************************
820 template< typename VT1 // Type of the left-hand side dense vector
821  , typename VT2 // Type of the dense vector of the right-hand side expression
822  , typename ST > // Type of the scalar of the right-hand side expression
823 inline const typename MultExprTrait< VT1, DVecScalarMultExpr<VT2,ST,true> >::Type
824  operator*( const DenseVector<VT1,false>& lhs, const DVecScalarMultExpr<VT2,ST,true>& rhs )
825 {
827 
828  return ( (~lhs) * rhs.leftOperand() ) * rhs.rightOperand();
829 }
831 //*************************************************************************************************
832 
833 
834 //*************************************************************************************************
848 template< typename VT1 // Type of the dense vector of the left-hand side expression
849  , typename ST1 // Type of the scalar of the left-hand side expression
850  , typename VT2 // Type of the dense vector of the right-hand side expression
851  , typename ST2 > // Type of the scalar of the right-hand side expression
852 inline const typename MultExprTrait< DVecScalarMultExpr<VT1,ST1,false>, DVecScalarMultExpr<VT2,ST2,true> >::Type
853  operator*( const DVecScalarMultExpr<VT1,ST1,false>& lhs, const DVecScalarMultExpr<VT2,ST2,true>& rhs )
854 {
856 
857  return ( lhs.leftOperand() * rhs.leftOperand() ) * ( lhs.rightOperand() * rhs.rightOperand() );
858 }
860 //*************************************************************************************************
861 
862 
863 //*************************************************************************************************
877 template< typename VT1 // Type of the dense vector of the left-hand side expression
878  , typename ST // Type of the scalar of the left-hand side expression
879  , bool TF // Transpose flag of the vectors
880  , typename VT2 > // Type of the right-hand side sparse vector
881 inline const typename MultExprTrait< DVecScalarMultExpr<VT1,ST,TF>, VT2 >::Type
882  operator*( const DVecScalarMultExpr<VT1,ST,TF>& lhs, const SparseVector<VT2,TF>& rhs )
883 {
885 
886  return ( lhs.leftOperand() * (~rhs) ) * lhs.rightOperand();
887 }
889 //*************************************************************************************************
890 
891 
892 //*************************************************************************************************
906 template< typename VT1 // Type of the left-hand side sparse vector
907  , bool TF // Transpose flag of the vectors
908  , typename VT2 // Type of the dense vector of the right-hand side expression
909  , typename ST > // Type of the scalar of the right-hand side expression
910 inline const typename MultExprTrait< VT1, DVecScalarMultExpr<VT2,ST,TF> >::Type
911  operator*( const SparseVector<VT1,TF>& lhs, const DVecScalarMultExpr<VT2,ST,TF>& rhs )
912 {
914 
915  return ( (~lhs) * rhs.leftOperand() ) * rhs.rightOperand();
916 }
918 //*************************************************************************************************
919 
920 
921 //*************************************************************************************************
936 template< typename VT1 // Type of the dense vector of the left-hand side expression
937  , typename ST1 // Type of the scalar of the left-hand side expression
938  , bool TF // Transpose flag of the vectors
939  , typename VT2 // Type of the sparse vector of the right-hand side expression
940  , typename ST2 > // Type of the scalar o the right-hand side expression
941 inline const typename MultExprTrait< DVecScalarMultExpr<VT1,ST1,TF>, SVecScalarMultExpr<VT2,ST2,TF> >::Type
942  operator*( const DVecScalarMultExpr<VT1,ST1,TF>& lhs, const SVecScalarMultExpr<VT2,ST2,TF>& rhs )
943 {
945 
946  return ( lhs.leftOperand() * rhs.leftOperand() ) * ( lhs.rightOperand() * rhs.rightOperand() );
947 }
949 //*************************************************************************************************
950 
951 
952 //*************************************************************************************************
967 template< typename VT1 // Type of the sparse vector of the left-hand side expression
968  , typename ST1 // Type of the scalar of the left-hand side expression
969  , bool TF // Transpose flag of the vectors
970  , typename VT2 // Type of the dense vector of the right-hand side expression
971  , typename ST2 > // Type of the scalar o the right-hand side expression
972 inline const typename MultExprTrait< SVecScalarMultExpr<VT1,ST1,TF>, DVecScalarMultExpr<VT2,ST2,TF> >::Type
973  operator*( const SVecScalarMultExpr<VT1,ST1,TF>& lhs, const DVecScalarMultExpr<VT2,ST2,TF>& rhs )
974 {
976 
977  return ( lhs.leftOperand() * rhs.leftOperand() ) * ( lhs.rightOperand() * rhs.rightOperand() );
978 }
980 //*************************************************************************************************
981 
982 
983 //*************************************************************************************************
997 template< typename VT1 // Type of the dense vector of the left-hand side expression
998  , typename ST // Type of the scalar of the left-hand side expression
999  , typename VT2 > // Type of the right-hand side sparse vector
1000 inline const typename MultExprTrait< DVecScalarMultExpr<VT1,ST,false>, VT2 >::Type
1001  operator*( const DVecScalarMultExpr<VT1,ST,false>& lhs, const SparseVector<VT2,true>& rhs )
1002 {
1004 
1005  return ( lhs.leftOperand() * (~rhs) ) * lhs.rightOperand();
1006 }
1008 //*************************************************************************************************
1009 
1010 
1011 //*************************************************************************************************
1025 template< typename VT1 // Type of the left-hand side sparse vector
1026  , typename VT2 // Type of the dense vector of the right-hand side expression
1027  , typename ST > // Type of the scalar of the right-hand side expression
1028 inline const typename MultExprTrait< VT1, DVecScalarMultExpr<VT2,ST,true> >::Type
1029  operator*( const SparseVector<VT1,false>& lhs, const DVecScalarMultExpr<VT2,ST,true>& rhs )
1030 {
1032 
1033  return ( (~lhs) * rhs.leftOperand() ) * rhs.rightOperand();
1034 }
1036 //*************************************************************************************************
1037 
1038 
1039 //*************************************************************************************************
1054 template< typename VT1 // Type of the dense vector of the left-hand side expression
1055  , typename ST1 // Type of the scalar of the left-hand side expression
1056  , typename VT2 // Type of the sparse vector of the right-hand side expression
1057  , typename ST2 > // Type of the scalar o the right-hand side expression
1058 inline const typename MultExprTrait< DVecScalarMultExpr<VT1,ST1,false>, SVecScalarMultExpr<VT2,ST2,true> >::Type
1059  operator*( const DVecScalarMultExpr<VT1,ST1,false>& lhs, const SVecScalarMultExpr<VT2,ST2,true>& rhs )
1060 {
1062 
1063  return ( lhs.leftOperand() * rhs.leftOperand() ) * ( lhs.rightOperand() * rhs.rightOperand() );
1064 }
1066 //*************************************************************************************************
1067 
1068 
1069 //*************************************************************************************************
1084 template< typename VT1 // Type of the sparse vector of the left-hand side expression
1085  , typename ST1 // Type of the scalar of the left-hand side expression
1086  , typename VT2 // Type of the dense vector of the right-hand side expression
1087  , typename ST2 > // Type of the scalar o the right-hand side expression
1088 inline const typename MultExprTrait< SVecScalarMultExpr<VT1,ST1,false>, DVecScalarMultExpr<VT2,ST2,true> >::Type
1089  operator*( const SVecScalarMultExpr<VT1,ST1,false>& lhs, const DVecScalarMultExpr<VT2,ST2,true>& rhs )
1090 {
1092 
1093  return ( lhs.leftOperand() * rhs.leftOperand() ) * ( lhs.rightOperand() * rhs.rightOperand() );
1094 }
1096 //*************************************************************************************************
1097 
1098 
1099 //*************************************************************************************************
1113 template< typename MT // Type of the left-hand side dense matrix
1114  , bool SO // Storage order of the left-hand side dense matrix
1115  , typename VT // Type of the dense vector of the right-hand side expression
1116  , typename ST > // Type of the scalar of the right-hand side expression
1117 inline const typename MultExprTrait< MT, DVecScalarMultExpr<VT,ST,false> >::Type
1118  operator*( const DenseMatrix<MT,SO>& mat, const DVecScalarMultExpr<VT,ST,false>& vec )
1119 {
1121 
1122  return ( (~mat) * vec.leftOperand() ) * vec.rightOperand();
1123 }
1125 //*************************************************************************************************
1126 
1127 
1128 //*************************************************************************************************
1142 template< typename VT // Type of the dense vector of the left-hand side expression
1143  , typename ST // Type of the scalar of the left-hand side expression
1144  , typename MT // Type of the right-hand side dense matrix
1145  , bool SO > // Storage order of the right-hand side dense matrix
1146 inline const typename MultExprTrait< DVecScalarMultExpr<VT,ST,true>, MT >::Type
1147  operator*( const DVecScalarMultExpr<VT,ST,true>& vec, const DenseMatrix<MT,SO>& mat )
1148 {
1150 
1151  return ( vec.leftOperand() * (~mat) ) * vec.rightOperand();
1152 }
1154 //*************************************************************************************************
1155 
1156 
1157 //*************************************************************************************************
1171 template< typename MT // Type of the left-hand side sparse matrix
1172  , bool SO // Storage order of the left-hand side sparse matrix
1173  , typename VT // Type of the dense vector of the right-hand side expression
1174  , typename ST > // Type of the scalar of the right-hand side expression
1175 inline const typename MultExprTrait< MT, DVecScalarMultExpr<VT,ST,false> >::Type
1176  operator*( const SparseMatrix<MT,SO>& mat, const DVecScalarMultExpr<VT,ST,false>& vec )
1177 {
1179 
1180  return ( (~mat) * vec.leftOperand() ) * vec.rightOperand();
1181 }
1183 //*************************************************************************************************
1184 
1185 
1186 //*************************************************************************************************
1200 template< typename VT // Type of the dense vector of the left-hand side expression
1201  , typename ST // Type of the scalar of the left-hand side expression
1202  , typename MT // Type of the right-hand side sparse matrix
1203  , bool SO > // Storage order of the right-hand side sparse matrix
1204 inline const typename MultExprTrait< DVecScalarMultExpr<VT,ST,true>, MT >::Type
1205  operator*( const DVecScalarMultExpr<VT,ST,true>& vec, const SparseMatrix<MT,SO>& mat )
1206 {
1208 
1209  return ( vec.leftOperand() * (~mat) ) * vec.rightOperand();
1210 }
1212 //*************************************************************************************************
1213 
1214 
1215 
1216 
1217 //=================================================================================================
1218 //
1219 // DVECSCALARMULTEXPRTRAIT SPECIALIZATIONS
1220 //
1221 //=================================================================================================
1222 
1223 //*************************************************************************************************
1225 template< typename VT, typename ST1, typename ST2 >
1226 struct DVecScalarMultExprTrait< DVecScalarMultExpr<VT,ST1,false>, ST2 >
1227 {
1228  public:
1229  //**********************************************************************************************
1230  typedef typename SelectType< IsDenseVector<VT>::value && !IsTransposeVector<VT>::value &&
1231  IsNumeric<ST1>::value && IsNumeric<ST2>::value
1232  , typename DVecScalarMultExprTrait<VT,typename MultTrait<ST1,ST2>::Type>::Type
1233  , INVALID_TYPE >::Type Type;
1234  //**********************************************************************************************
1235 };
1237 //*************************************************************************************************
1238 
1239 
1240 
1241 
1242 //=================================================================================================
1243 //
1244 // TDVECSCALARMULTEXPRTRAIT SPECIALIZATIONS
1245 //
1246 //=================================================================================================
1247 
1248 //*************************************************************************************************
1250 template< typename VT, typename ST1, typename ST2 >
1251 struct TDVecScalarMultExprTrait< DVecScalarMultExpr<VT,ST1,true>, ST2 >
1252 {
1253  public:
1254  //**********************************************************************************************
1255  typedef typename SelectType< IsDenseVector<VT>::value && IsTransposeVector<VT>::value &&
1256  IsNumeric<ST1>::value && IsNumeric<ST2>::value
1257  , typename TDVecScalarMultExprTrait<VT,typename MultTrait<ST1,ST2>::Type>::Type
1258  , INVALID_TYPE >::Type Type;
1259  //**********************************************************************************************
1260 };
1262 //*************************************************************************************************
1263 
1264 
1265 
1266 
1267 //=================================================================================================
1268 //
1269 // DVECSCALARDIVEXPRTRAIT SPECIALIZATIONS
1270 //
1271 //=================================================================================================
1272 
1273 //*************************************************************************************************
1275 template< typename VT, typename ST1, typename ST2 >
1276 struct DVecScalarDivExprTrait< DVecScalarMultExpr<VT,ST1,false>, ST2 >
1277 {
1278  private:
1279  //**********************************************************************************************
1280  enum { condition = IsFloatingPoint<typename DivTrait<ST1,ST2>::Type>::value };
1281  //**********************************************************************************************
1282 
1283  //**********************************************************************************************
1284  typedef typename DVecScalarMultExprTrait<VT,typename DivTrait<ST1,ST2>::Type>::Type T1;
1285  typedef typename DVecScalarDivExprTrait<VT,typename DivTrait<ST1,ST2>::Type>::Type T2;
1286  //**********************************************************************************************
1287 
1288  public:
1289  //**********************************************************************************************
1290  typedef typename SelectType< IsDenseVector<VT>::value && !IsTransposeVector<VT>::value &&
1291  IsNumeric<ST1>::value && IsNumeric<ST2>::value
1292  , typename SelectType<condition,T1,T2>::Type
1293  , INVALID_TYPE >::Type Type;
1294  //**********************************************************************************************
1295 };
1297 //*************************************************************************************************
1298 
1299 
1300 
1301 
1302 //=================================================================================================
1303 //
1304 // TDVECSCALARDIVEXPRTRAIT SPECIALIZATIONS
1305 //
1306 //=================================================================================================
1307 
1308 //*************************************************************************************************
1310 template< typename VT, typename ST1, typename ST2 >
1311 struct TDVecScalarDivExprTrait< DVecScalarMultExpr<VT,ST1,true>, ST2 >
1312 {
1313  private:
1314  //**********************************************************************************************
1315  enum { condition = IsFloatingPoint<typename DivTrait<ST1,ST2>::Type>::value };
1316  //**********************************************************************************************
1317 
1318  //**********************************************************************************************
1319  typedef typename TDVecScalarMultExprTrait<VT,typename DivTrait<ST1,ST2>::Type>::Type T1;
1320  typedef typename TDVecScalarDivExprTrait<VT,typename DivTrait<ST1,ST2>::Type>::Type T2;
1321  //**********************************************************************************************
1322 
1323  public:
1324  //**********************************************************************************************
1325  typedef typename SelectType< IsDenseVector<VT>::value && IsTransposeVector<VT>::value &&
1326  IsNumeric<ST1>::value && IsNumeric<ST2>::value
1327  , typename SelectType<condition,T1,T2>::Type
1328  , INVALID_TYPE >::Type Type;
1329  //**********************************************************************************************
1330 };
1332 //*************************************************************************************************
1333 
1334 
1335 
1336 
1337 //=================================================================================================
1338 //
1339 // DVECDVECMULTEXPRTRAIT SPECIALIZATIONS
1340 //
1341 //=================================================================================================
1342 
1343 //*************************************************************************************************
1345 template< typename VT1, typename ST, typename VT2 >
1346 struct DVecDVecMultExprTrait< DVecScalarMultExpr<VT1,ST,false>, VT2 >
1347 {
1348  public:
1349  //**********************************************************************************************
1350  typedef typename SelectType< IsDenseVector<VT1>::value && !IsTransposeVector<VT1>::value &&
1351  IsDenseVector<VT2>::value && !IsTransposeVector<VT2>::value &&
1352  IsNumeric<ST>::value
1353  , typename DVecScalarMultExprTrait<typename DVecDVecMultExprTrait<VT1,VT2>::Type,ST>::Type
1354  , INVALID_TYPE >::Type Type;
1355  //**********************************************************************************************
1356 };
1358 //*************************************************************************************************
1359 
1360 
1361 //*************************************************************************************************
1363 template< typename VT1, typename VT2, typename ST >
1364 struct DVecDVecMultExprTrait< VT1, DVecScalarMultExpr<VT2,ST,false> >
1365 {
1366  public:
1367  //**********************************************************************************************
1368  typedef typename SelectType< IsDenseVector<VT1>::value && !IsTransposeVector<VT1>::value &&
1369  IsDenseVector<VT2>::value && !IsTransposeVector<VT2>::value &&
1370  IsNumeric<ST>::value
1371  , typename DVecScalarMultExprTrait<typename DVecDVecMultExprTrait<VT1,VT2>::Type,ST>::Type
1372  , INVALID_TYPE >::Type Type;
1373  //**********************************************************************************************
1374 };
1376 //*************************************************************************************************
1377 
1378 
1379 //*************************************************************************************************
1381 template< typename VT1, typename ST1, typename VT2, typename ST2 >
1382 struct DVecDVecMultExprTrait< DVecScalarMultExpr<VT1,ST1,false>, DVecScalarMultExpr<VT2,ST2,false> >
1383 {
1384  public:
1385  //**********************************************************************************************
1386  typedef typename SelectType< IsDenseVector<VT1>::value && !IsTransposeVector<VT1>::value &&
1387  IsDenseVector<VT2>::value && !IsTransposeVector<VT2>::value &&
1388  IsNumeric<ST1>::value && IsNumeric<ST2>::value
1389  , typename DVecScalarMultExprTrait<typename DVecDVecMultExprTrait<VT1,VT2>::Type,typename MultTrait<ST1,ST2>::Type>::Type
1390  , INVALID_TYPE >::Type Type;
1391  //**********************************************************************************************
1392 };
1394 //*************************************************************************************************
1395 
1396 
1397 
1398 
1399 //=================================================================================================
1400 //
1401 // DVECTDVECMULTEXPRTRAIT SPECIALIZATIONS
1402 //
1403 //=================================================================================================
1404 
1405 //*************************************************************************************************
1407 template< typename VT1, typename ST, typename VT2 >
1408 struct DVecTDVecMultExprTrait< DVecScalarMultExpr<VT1,ST,false>, VT2 >
1409 {
1410  public:
1411  //**********************************************************************************************
1412  typedef typename SelectType< IsDenseVector<VT1>::value && !IsTransposeVector<VT1>::value &&
1413  IsDenseVector<VT2>::value && IsTransposeVector<VT2>::value &&
1414  IsNumeric<ST>::value
1415  , typename DMatScalarMultExprTrait<typename DVecTDVecMultExprTrait<VT1,VT2>::Type,ST>::Type
1416  , INVALID_TYPE >::Type Type;
1417  //**********************************************************************************************
1418 };
1420 //*************************************************************************************************
1421 
1422 
1423 //*************************************************************************************************
1425 template< typename VT1, typename VT2, typename ST >
1426 struct DVecTDVecMultExprTrait< VT1, DVecScalarMultExpr<VT2,ST,true> >
1427 {
1428  public:
1429  //**********************************************************************************************
1430  typedef typename SelectType< IsDenseVector<VT1>::value && !IsTransposeVector<VT1>::value &&
1431  IsDenseVector<VT2>::value && IsTransposeVector<VT2>::value &&
1432  IsNumeric<ST>::value
1433  , typename DMatScalarMultExprTrait<typename DVecTDVecMultExprTrait<VT1,VT2>::Type,ST>::Type
1434  , INVALID_TYPE >::Type Type;
1435  //**********************************************************************************************
1436 };
1438 //*************************************************************************************************
1439 
1440 
1441 //*************************************************************************************************
1443 template< typename VT1, typename ST1, typename VT2, typename ST2 >
1444 struct DVecTDVecMultExprTrait< DVecScalarMultExpr<VT1,ST1,false>, DVecScalarMultExpr<VT2,ST2,true> >
1445 {
1446  public:
1447  //**********************************************************************************************
1448  typedef typename SelectType< IsDenseVector<VT1>::value && !IsTransposeVector<VT1>::value &&
1449  IsDenseVector<VT2>::value && IsTransposeVector<VT2>::value &&
1450  IsNumeric<ST1>::value && IsNumeric<ST2>::value
1451  , typename DMatScalarMultExprTrait<typename DVecTDVecMultExprTrait<VT1,VT2>::Type,typename MultTrait<ST1,ST2>::Type>::Type
1452  , INVALID_TYPE >::Type Type;
1453  //**********************************************************************************************
1454 };
1456 //*************************************************************************************************
1457 
1458 
1459 
1460 
1461 //=================================================================================================
1462 //
1463 // TDVECTDVECMULTEXPRTRAIT SPECIALIZATIONS
1464 //
1465 //=================================================================================================
1466 
1467 //*************************************************************************************************
1469 template< typename VT1, typename ST, typename VT2 >
1470 struct TDVecTDVecMultExprTrait< DVecScalarMultExpr<VT1,ST,true>, VT2 >
1471 {
1472  public:
1473  //**********************************************************************************************
1474  typedef typename SelectType< IsDenseVector<VT1>::value && IsTransposeVector<VT1>::value &&
1475  IsDenseVector<VT2>::value && IsTransposeVector<VT2>::value &&
1476  IsNumeric<ST>::value
1477  , typename TDVecScalarMultExprTrait<typename TDVecTDVecMultExprTrait<VT1,VT2>::Type,ST>::Type
1478  , INVALID_TYPE >::Type Type;
1479  //**********************************************************************************************
1480 };
1482 //*************************************************************************************************
1483 
1484 
1485 //*************************************************************************************************
1487 template< typename VT1, typename VT2, typename ST >
1488 struct TDVecTDVecMultExprTrait< VT1, DVecScalarMultExpr<VT2,ST,true> >
1489 {
1490  public:
1491  //**********************************************************************************************
1492  typedef typename SelectType< IsDenseVector<VT1>::value && IsTransposeVector<VT1>::value &&
1493  IsDenseVector<VT2>::value && IsTransposeVector<VT2>::value &&
1494  IsNumeric<ST>::value
1495  , typename TDVecScalarMultExprTrait<typename TDVecTDVecMultExprTrait<VT1,VT2>::Type,ST>::Type
1496  , INVALID_TYPE >::Type Type;
1497  //**********************************************************************************************
1498 };
1500 //*************************************************************************************************
1501 
1502 
1503 //*************************************************************************************************
1505 template< typename VT1, typename ST1, typename VT2, typename ST2 >
1506 struct TDVecTDVecMultExprTrait< DVecScalarMultExpr<VT1,ST1,true>, DVecScalarMultExpr<VT2,ST2,true> >
1507 {
1508  public:
1509  //**********************************************************************************************
1510  typedef typename SelectType< IsDenseVector<VT1>::value && IsTransposeVector<VT1>::value &&
1511  IsDenseVector<VT2>::value && IsTransposeVector<VT2>::value &&
1512  IsNumeric<ST1>::value && IsNumeric<ST2>::value
1513  , typename TDVecScalarMultExprTrait<typename TDVecTDVecMultExprTrait<VT1,VT2>::Type,typename MultTrait<ST1,ST2>::Type>::Type
1514  , INVALID_TYPE >::Type Type;
1515  //**********************************************************************************************
1516 };
1518 //*************************************************************************************************
1519 
1520 
1521 
1522 
1523 //=================================================================================================
1524 //
1525 // DVECSVECMULTEXPRTRAIT SPECIALIZATIONS
1526 //
1527 //=================================================================================================
1528 
1529 //*************************************************************************************************
1531 template< typename VT1, typename VT2, typename ST >
1532 struct DVecSVecMultExprTrait< DVecScalarMultExpr<VT1,ST,false>, VT2 >
1533 {
1534  public:
1535  //**********************************************************************************************
1536  typedef typename SelectType< IsDenseVector<VT1>::value && !IsTransposeVector<VT1>::value &&
1537  IsSparseVector<VT2>::value && !IsTransposeVector<VT2>::value &&
1538  IsNumeric<ST>::value
1539  , typename SVecScalarMultExprTrait<typename DVecSVecMultExprTrait<VT1,VT2>::Type,ST>::Type
1540  , INVALID_TYPE >::Type Type;
1541  //**********************************************************************************************
1542 };
1544 //*************************************************************************************************
1545 
1546 
1547 //*************************************************************************************************
1549 template< typename VT1, typename ST1, typename VT2, typename ST2 >
1550 struct DVecSVecMultExprTrait< DVecScalarMultExpr<VT1,ST1,false>, SVecScalarMultExpr<VT2,ST2,false> >
1551 {
1552  public:
1553  //**********************************************************************************************
1554  typedef typename SelectType< IsDenseVector<VT1>::value && !IsTransposeVector<VT1>::value &&
1555  IsSparseVector<VT2>::value && !IsTransposeVector<VT2>::value &&
1556  IsNumeric<ST1>::value && IsNumeric<ST2>::value
1557  , typename SVecScalarMultExprTrait<typename DVecSVecMultExprTrait<VT1,VT2>::Type,typename MultTrait<ST1,ST2>::Type>::Type
1558  , INVALID_TYPE >::Type Type;
1559  //**********************************************************************************************
1560 };
1562 //*************************************************************************************************
1563 
1564 
1565 
1566 
1567 //=================================================================================================
1568 //
1569 // DVECTSVECMULTEXPRTRAIT SPECIALIZATIONS
1570 //
1571 //=================================================================================================
1572 
1573 //*************************************************************************************************
1575 template< typename VT1, typename ST, typename VT2 >
1576 struct DVecTSVecMultExprTrait< DVecScalarMultExpr<VT1,ST,false>, VT2 >
1577 {
1578  public:
1579  //**********************************************************************************************
1580  typedef typename SelectType< IsDenseVector<VT1>::value && !IsTransposeVector<VT1>::value &&
1581  IsSparseVector<VT2>::value && IsTransposeVector<VT2>::value &&
1582  IsNumeric<ST>::value
1583  , typename SMatScalarMultExprTrait<typename DVecTSVecMultExprTrait<VT1,VT2>::Type,ST>::Type
1584  , INVALID_TYPE >::Type Type;
1585  //**********************************************************************************************
1586 };
1588 //*************************************************************************************************
1589 
1590 
1591 //*************************************************************************************************
1593 template< typename VT1, typename ST1, typename VT2, typename ST2 >
1594 struct DVecTSVecMultExprTrait< DVecScalarMultExpr<VT1,ST1,false>, SVecScalarMultExpr<VT2,ST2,true> >
1595 {
1596  public:
1597  //**********************************************************************************************
1598  typedef typename SelectType< IsDenseVector<VT1>::value && !IsTransposeVector<VT1>::value &&
1599  IsSparseVector<VT2>::value && IsTransposeVector<VT2>::value &&
1600  IsNumeric<ST1>::value && IsNumeric<ST2>::value
1601  , typename SMatScalarMultExprTrait<typename DVecTSVecMultExprTrait<VT1,VT2>::Type,typename MultTrait<ST1,ST2>::Type>::Type
1602  , INVALID_TYPE >::Type Type;
1603  //**********************************************************************************************
1604 };
1606 //*************************************************************************************************
1607 
1608 
1609 
1610 
1611 //=================================================================================================
1612 //
1613 // TDVECTSVECMULTEXPRTRAIT SPECIALIZATIONS
1614 //
1615 //=================================================================================================
1616 
1617 //*************************************************************************************************
1619 template< typename VT1, typename ST, typename VT2 >
1620 struct TDVecTSVecMultExprTrait< DVecScalarMultExpr<VT1,ST,true>, VT2 >
1621 {
1622  public:
1623  //**********************************************************************************************
1624  typedef typename SelectType< IsDenseVector<VT1>::value && IsTransposeVector<VT1>::value &&
1625  IsSparseVector<VT2>::value && IsTransposeVector<VT2>::value &&
1626  IsNumeric<ST>::value
1627  , typename TSVecScalarMultExprTrait<typename TDVecTSVecMultExprTrait<VT1,VT2>::Type,ST>::Type
1628  , INVALID_TYPE >::Type Type;
1629  //**********************************************************************************************
1630 };
1632 //*************************************************************************************************
1633 
1634 
1635 //*************************************************************************************************
1637 template< typename VT1, typename ST1, typename VT2, typename ST2 >
1638 struct TDVecTSVecMultExprTrait< DVecScalarMultExpr<VT1,ST1,true>, SVecScalarMultExpr<VT2,ST2,true> >
1639 {
1640  public:
1641  //**********************************************************************************************
1642  typedef typename SelectType< IsDenseVector<VT1>::value && IsTransposeVector<VT1>::value &&
1643  IsSparseVector<VT2>::value && IsTransposeVector<VT2>::value &&
1644  IsNumeric<ST1>::value && IsNumeric<ST2>::value
1645  , typename TSVecScalarMultExprTrait<typename TDVecTSVecMultExprTrait<VT1,VT2>::Type,typename MultTrait<ST1,ST2>::Type>::Type
1646  , INVALID_TYPE >::Type Type;
1647  //**********************************************************************************************
1648 };
1650 //*************************************************************************************************
1651 
1652 
1653 
1654 
1655 //=================================================================================================
1656 //
1657 // SVECDVECMULTEXPRTRAIT SPECIALIZATIONS
1658 //
1659 //=================================================================================================
1660 
1661 //*************************************************************************************************
1663 template< typename VT1, typename VT2, typename ST >
1664 struct SVecDVecMultExprTrait< VT1, DVecScalarMultExpr<VT2,ST,false> >
1665 {
1666  public:
1667  //**********************************************************************************************
1668  typedef typename SelectType< IsSparseVector<VT1>::value && !IsTransposeVector<VT1>::value &&
1669  IsDenseVector<VT2>::value && !IsTransposeVector<VT2>::value &&
1670  IsNumeric<ST>::value
1671  , typename SVecScalarMultExprTrait<typename SVecDVecMultExprTrait<VT1,VT2>::Type,ST>::Type
1672  , INVALID_TYPE >::Type Type;
1673  //**********************************************************************************************
1674 };
1676 //*************************************************************************************************
1677 
1678 
1679 //*************************************************************************************************
1681 template< typename VT1, typename ST1, typename VT2, typename ST2 >
1682 struct SVecDVecMultExprTrait< SVecScalarMultExpr<VT1,ST1,false>, DVecScalarMultExpr<VT2,ST2,false> >
1683 {
1684  public:
1685  //**********************************************************************************************
1686  typedef typename SelectType< IsSparseVector<VT1>::value && !IsTransposeVector<VT1>::value &&
1687  IsDenseVector<VT2>::value && !IsTransposeVector<VT2>::value &&
1688  IsNumeric<ST1>::value && IsNumeric<ST2>::value
1689  , typename SVecScalarMultExprTrait<typename SVecDVecMultExprTrait<VT1,VT2>::Type,typename MultTrait<ST1,ST2>::Type>::Type
1690  , INVALID_TYPE >::Type Type;
1691  //**********************************************************************************************
1692 };
1694 //*************************************************************************************************
1695 
1696 
1697 
1698 
1699 //=================================================================================================
1700 //
1701 // SVECTDVECMULTEXPRTRAIT SPECIALIZATIONS
1702 //
1703 //=================================================================================================
1704 
1705 //*************************************************************************************************
1707 template< typename VT1, typename VT2, typename ST >
1708 struct SVecTDVecMultExprTrait< VT1, DVecScalarMultExpr<VT2,ST,true> >
1709 {
1710  public:
1711  //**********************************************************************************************
1712  typedef typename SelectType< IsSparseVector<VT1>::value && !IsTransposeVector<VT1>::value &&
1713  IsDenseVector<VT2>::value && IsTransposeVector<VT2>::value &&
1714  IsNumeric<ST>::value
1715  , typename TSMatScalarMultExprTrait<typename SVecTDVecMultExprTrait<VT1,VT2>::Type,ST>::Type
1716  , INVALID_TYPE >::Type Type;
1717  //**********************************************************************************************
1718 };
1720 //*************************************************************************************************
1721 
1722 
1723 //*************************************************************************************************
1725 template< typename VT1, typename ST1, typename VT2, typename ST2 >
1726 struct SVecTDVecMultExprTrait< SVecScalarMultExpr<VT1,ST1,false>, DVecScalarMultExpr<VT2,ST2,true> >
1727 {
1728  public:
1729  //**********************************************************************************************
1730  typedef typename SelectType< IsSparseVector<VT1>::value && !IsTransposeVector<VT1>::value &&
1731  IsDenseVector<VT2>::value && IsTransposeVector<VT2>::value &&
1732  IsNumeric<ST1>::value && IsNumeric<ST2>::value
1733  , typename TSMatScalarMultExprTrait<typename SVecTDVecMultExprTrait<VT1,VT2>::Type,typename MultTrait<ST1,ST2>::Type>::Type
1734  , INVALID_TYPE >::Type Type;
1735  //**********************************************************************************************
1736 };
1738 //*************************************************************************************************
1739 
1740 
1741 
1742 
1743 //=================================================================================================
1744 //
1745 // TSVECTDVECMULTEXPRTRAIT SPECIALIZATIONS
1746 //
1747 //=================================================================================================
1748 
1749 //*************************************************************************************************
1751 template< typename VT1, typename VT2, typename ST >
1752 struct TSVecTDVecMultExprTrait< VT1, DVecScalarMultExpr<VT2,ST,true> >
1753 {
1754  public:
1755  //**********************************************************************************************
1756  typedef typename SelectType< IsSparseVector<VT1>::value && IsTransposeVector<VT1>::value &&
1757  IsDenseVector<VT2>::value && IsTransposeVector<VT2>::value &&
1758  IsNumeric<ST>::value
1759  , typename TSVecScalarMultExprTrait<typename TSVecTDVecMultExprTrait<VT1,VT2>::Type,ST>::Type
1760  , INVALID_TYPE >::Type Type;
1761  //**********************************************************************************************
1762 };
1764 //*************************************************************************************************
1765 
1766 
1767 //*************************************************************************************************
1769 template< typename VT1, typename ST1, typename VT2, typename ST2 >
1770 struct TSVecTDVecMultExprTrait< SVecScalarMultExpr<VT1,ST1,true>, DVecScalarMultExpr<VT2,ST2,true> >
1771 {
1772  public:
1773  //**********************************************************************************************
1774  typedef typename SelectType< IsSparseVector<VT1>::value && IsTransposeVector<VT1>::value &&
1775  IsDenseVector<VT2>::value && IsTransposeVector<VT2>::value &&
1776  IsNumeric<ST1>::value && IsNumeric<ST2>::value
1777  , typename TSVecScalarMultExprTrait<typename TSVecTDVecMultExprTrait<VT1,VT2>::Type,typename MultTrait<ST1,ST2>::Type>::Type
1778  , INVALID_TYPE >::Type Type;
1779  //**********************************************************************************************
1780 };
1782 //*************************************************************************************************
1783 
1784 
1785 
1786 
1787 //=================================================================================================
1788 //
1789 // DMATDVECMULTEXPRTRAIT SPECIALIZATIONS
1790 //
1791 //=================================================================================================
1792 
1793 //*************************************************************************************************
1795 template< typename MT, typename VT, typename ST >
1796 struct DMatDVecMultExprTrait< MT, DVecScalarMultExpr<VT,ST,false> >
1797 {
1798  public:
1799  //**********************************************************************************************
1800  typedef typename SelectType< IsDenseMatrix<MT>::value && IsRowMajorMatrix<MT>::value &&
1801  IsDenseVector<VT>::value && !IsTransposeVector<VT>::value &&
1802  IsNumeric<ST>::value
1803  , typename DVecScalarMultExprTrait<typename DMatDVecMultExprTrait<MT,VT>::Type,ST>::Type
1804  , INVALID_TYPE >::Type Type;
1805  //**********************************************************************************************
1806 };
1808 //*************************************************************************************************
1809 
1810 
1811 
1812 
1813 //=================================================================================================
1814 //
1815 // TDMATDVECMULTEXPRTRAIT SPECIALIZATIONS
1816 //
1817 //=================================================================================================
1818 
1819 //*************************************************************************************************
1821 template< typename MT, typename VT, typename ST >
1822 struct TDMatDVecMultExprTrait< MT, DVecScalarMultExpr<VT,ST,false> >
1823 {
1824  public:
1825  //**********************************************************************************************
1826  typedef typename SelectType< IsDenseMatrix<MT>::value && IsColumnMajorMatrix<MT>::value &&
1827  IsDenseVector<VT>::value && !IsTransposeVector<VT>::value &&
1828  IsNumeric<ST>::value
1829  , typename DVecScalarMultExprTrait<typename TDMatDVecMultExprTrait<MT,VT>::Type,ST>::Type
1830  , INVALID_TYPE >::Type Type;
1831  //**********************************************************************************************
1832 };
1834 //*************************************************************************************************
1835 
1836 
1837 
1838 
1839 //=================================================================================================
1840 //
1841 // TDVECDMATMULTEXPRTRAIT SPECIALIZATIONS
1842 //
1843 //=================================================================================================
1844 
1845 //*************************************************************************************************
1847 template< typename VT, typename MT, typename ST >
1848 struct TDVecDMatMultExprTrait< DVecScalarMultExpr<VT,ST,true>, MT >
1849 {
1850  public:
1851  //**********************************************************************************************
1852  typedef typename SelectType< IsDenseVector<VT>::value && IsTransposeVector<VT>::value &&
1853  IsDenseMatrix<MT>::value && IsRowMajorMatrix<MT>::value &&
1854  IsNumeric<ST>::value
1855  , typename TDVecScalarMultExprTrait<typename TDVecDMatMultExprTrait<VT,MT>::Type,ST>::Type
1856  , INVALID_TYPE >::Type Type;
1857  //**********************************************************************************************
1858 };
1860 //*************************************************************************************************
1861 
1862 
1863 
1864 
1865 //=================================================================================================
1866 //
1867 // TDVECTDMATMULTEXPRTRAIT SPECIALIZATIONS
1868 //
1869 //=================================================================================================
1870 
1871 //*************************************************************************************************
1873 template< typename VT, typename MT, typename ST >
1874 struct TDVecTDMatMultExprTrait< DVecScalarMultExpr<VT,ST,true>, MT >
1875 {
1876  public:
1877  //**********************************************************************************************
1878  typedef typename SelectType< IsDenseVector<VT>::value && IsTransposeVector<VT>::value &&
1879  IsDenseMatrix<MT>::value && IsColumnMajorMatrix<MT>::value &&
1880  IsNumeric<ST>::value
1881  , typename TDVecScalarMultExprTrait<typename TDVecTDMatMultExprTrait<VT,MT>::Type,ST>::Type
1882  , INVALID_TYPE >::Type Type;
1883  //**********************************************************************************************
1884 };
1886 //*************************************************************************************************
1887 
1888 
1889 
1890 
1891 //=================================================================================================
1892 //
1893 // SMATDVECMULTEXPRTRAIT SPECIALIZATIONS
1894 //
1895 //=================================================================================================
1896 
1897 //*************************************************************************************************
1899 template< typename MT, typename VT, typename ST >
1900 struct SMatDVecMultExprTrait< MT, DVecScalarMultExpr<VT,ST,false> >
1901 {
1902  public:
1903  //**********************************************************************************************
1904  typedef typename SelectType< IsSparseMatrix<MT>::value && IsRowMajorMatrix<MT>::value &&
1905  IsDenseVector<VT>::value && !IsTransposeVector<VT>::value &&
1906  IsNumeric<ST>::value
1907  , typename DVecScalarMultExprTrait<typename SMatDVecMultExprTrait<MT,VT>::Type,ST>::Type
1908  , INVALID_TYPE >::Type Type;
1909  //**********************************************************************************************
1910 };
1912 //*************************************************************************************************
1913 
1914 
1915 
1916 
1917 //=================================================================================================
1918 //
1919 // TSMATDVECMULTEXPRTRAIT SPECIALIZATIONS
1920 //
1921 //=================================================================================================
1922 
1923 //*************************************************************************************************
1925 template< typename MT, typename VT, typename ST >
1926 struct TSMatDVecMultExprTrait< MT, DVecScalarMultExpr<VT,ST,false> >
1927 {
1928  public:
1929  //**********************************************************************************************
1930  typedef typename SelectType< IsSparseMatrix<MT>::value && IsColumnMajorMatrix<MT>::value &&
1931  IsDenseVector<VT>::value && !IsTransposeVector<VT>::value &&
1932  IsNumeric<ST>::value
1933  , typename DVecScalarMultExprTrait<typename TSMatDVecMultExprTrait<MT,VT>::Type,ST>::Type
1934  , INVALID_TYPE >::Type Type;
1935  //**********************************************************************************************
1936 };
1938 //*************************************************************************************************
1939 
1940 
1941 
1942 
1943 //=================================================================================================
1944 //
1945 // TDVECSMATMULTEXPRTRAIT SPECIALIZATIONS
1946 //
1947 //=================================================================================================
1948 
1949 //*************************************************************************************************
1951 template< typename VT, typename MT, typename ST >
1952 struct TDVecSMatMultExprTrait< DVecScalarMultExpr<VT,ST,true>, MT >
1953 {
1954  public:
1955  //**********************************************************************************************
1956  typedef typename SelectType< IsDenseVector<VT>::value && IsTransposeVector<VT>::value &&
1957  IsSparseMatrix<MT>::value && IsRowMajorMatrix<MT>::value &&
1958  IsNumeric<ST>::value
1959  , typename TDVecScalarMultExprTrait<typename TDVecSMatMultExprTrait<VT,MT>::Type,ST>::Type
1960  , INVALID_TYPE >::Type Type;
1961  //**********************************************************************************************
1962 };
1964 //*************************************************************************************************
1965 
1966 
1967 
1968 
1969 //=================================================================================================
1970 //
1971 // TDVECTSMATMULTEXPRTRAIT SPECIALIZATIONS
1972 //
1973 //=================================================================================================
1974 
1975 //*************************************************************************************************
1977 template< typename VT, typename MT, typename ST >
1978 struct TDVecTSMatMultExprTrait< DVecScalarMultExpr<VT,ST,true>, MT >
1979 {
1980  public:
1981  //**********************************************************************************************
1982  typedef typename SelectType< IsDenseVector<VT>::value && IsTransposeVector<VT>::value &&
1983  IsSparseMatrix<MT>::value && IsColumnMajorMatrix<MT>::value &&
1984  IsNumeric<ST>::value
1985  , typename TDVecScalarMultExprTrait<typename TDVecTSMatMultExprTrait<VT,MT>::Type,ST>::Type
1986  , INVALID_TYPE >::Type Type;
1987  //**********************************************************************************************
1988 };
1990 //*************************************************************************************************
1991 
1992 } // namespace blaze
1993 
1994 #endif