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>
60 #include <blaze/util/EnableIf.h>
61 #include <blaze/util/InvalidType.h>
63 #include <blaze/util/SelectType.h>
64 #include <blaze/util/Types.h>
68 
69 
70 namespace blaze {
71 
72 //=================================================================================================
73 //
74 // CLASS DVECSCALARMULTEXPR
75 //
76 //=================================================================================================
77 
78 //*************************************************************************************************
85 template< typename VT // Type of the left-hand side dense vector
86  , typename ST // Type of the right-hand side scalar value
87  , bool TF > // Transpose flag
88 class DVecScalarMultExpr : public DenseVector< DVecScalarMultExpr<VT,ST,TF>, TF >
89  , private VecScalarMultExpr
90  , private Computation
91 {
92  private:
93  //**Type definitions****************************************************************************
94  typedef typename VT::ResultType RT;
95  typedef typename VT::ReturnType RN;
96  typedef typename VT::ElementType ET;
97  typedef typename VT::CompositeType CT;
98  //**********************************************************************************************
99 
100  //**Return type evaluation**********************************************************************
102 
107  enum { returnExpr = !IsTemporary<RN>::value };
108 
111  //**********************************************************************************************
112 
113  //**Evaluation strategy*************************************************************************
115 
121  enum { useAssign = RequiresEvaluation<VT>::value };
122 
124 
125  template< typename VT2 >
126  struct UseAssign {
127  enum { value = useAssign };
128  };
130  //**********************************************************************************************
131 
132  public:
133  //**Type definitions****************************************************************************
136  typedef typename ResultType::TransposeType TransposeType;
137  typedef typename ResultType::ElementType ElementType;
139 
142 
145 
147  typedef typename SelectType< IsExpression<VT>::value, const VT, const VT& >::Type LeftOperand;
148 
150  typedef ST RightOperand;
151  //**********************************************************************************************
152 
153  //**Compilation flags***************************************************************************
155  enum { vectorizable = VT::vectorizable &&
158  //**********************************************************************************************
159 
160  //**Constructor*********************************************************************************
166  explicit inline DVecScalarMultExpr( const VT& vector, ST scalar )
167  : vector_( vector ) // Left-hand side dense vector of the multiplication expression
168  , scalar_( scalar ) // Right-hand side scalar of the multiplication expression
169  {}
170  //**********************************************************************************************
171 
172  //**Subscript operator**************************************************************************
178  inline ReturnType operator[]( size_t index ) const {
179  BLAZE_INTERNAL_ASSERT( index < vector_.size(), "Invalid vector access index" );
180  return vector_[index] * scalar_;
181  }
182  //**********************************************************************************************
183 
184  //**Get function********************************************************************************
190  inline IntrinsicType get( size_t index ) const {
191  typedef IntrinsicTrait<ElementType> IT;
192  BLAZE_INTERNAL_ASSERT( index < vector_.size() , "Invalid vector access index" );
193  BLAZE_INTERNAL_ASSERT( index % IT::size == 0UL, "Invalid vector access index" );
194  const IntrinsicType xmm1( vector_.get( index ) );
195  const IntrinsicType xmm2( set( scalar_ ) );
196  return xmm1 * xmm2;
197  }
198  //**********************************************************************************************
199 
200  //**Size function*******************************************************************************
205  inline size_t size() const {
206  return vector_.size();
207  }
208  //**********************************************************************************************
209 
210  //**Left operand access*************************************************************************
215  inline LeftOperand leftOperand() const {
216  return vector_;
217  }
218  //**********************************************************************************************
219 
220  //**Right operand access************************************************************************
225  inline RightOperand rightOperand() const {
226  return scalar_;
227  }
228  //**********************************************************************************************
229 
230  //**********************************************************************************************
236  template< typename T >
237  inline bool canAlias( const T* alias ) const {
238  return vector_.canAlias( alias );
239  }
240  //**********************************************************************************************
241 
242  //**********************************************************************************************
248  template< typename T >
249  inline bool isAliased( const T* alias ) const {
250  return vector_.isAliased( alias );
251  }
252  //**********************************************************************************************
253 
254  private:
255  //**Member variables****************************************************************************
258  //**********************************************************************************************
259 
260  //**Assignment to dense vectors*****************************************************************
274  template< typename VT2 > // Type of the target dense vector
275  friend inline typename EnableIf< UseAssign<VT2> >::Type
276  assign( DenseVector<VT2,TF>& lhs, const DVecScalarMultExpr& rhs )
277  {
279 
280  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
281 
282  assign( ~lhs, rhs.vector_ );
283 
284  const size_t size( rhs.size() );
285  for( size_t i=0UL; i<size; ++i )
286  (~lhs)[i] *= rhs.scalar_;
287  }
289  //**********************************************************************************************
290 
291  //**Assignment to sparse vectors****************************************************************
305  template< typename VT2 > // Type of the target sparse vector
306  friend inline typename EnableIf< UseAssign<VT2> >::Type
308  {
310 
311  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
312 
313  assign( ~lhs, rhs.vector_ );
314 
315  typename VT2::Iterator begin( (~lhs).begin() );
316  const typename VT2::Iterator end( (~lhs).end() );
317 
318  for( ; begin!=end; ++begin )
319  begin->value() *= rhs.scalar_;
320  }
322  //**********************************************************************************************
323 
324  //**Addition assignment to dense vectors********************************************************
338  template< typename VT2 > // Type of the target dense vector
339  friend inline typename EnableIf< UseAssign<VT2> >::Type
340  addAssign( DenseVector<VT2,TF>& lhs, const DVecScalarMultExpr& rhs )
341  {
343 
346  BLAZE_CONSTRAINT_MUST_BE_REFERENCE_TYPE( typename ResultType::CompositeType );
347 
348  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
349 
350  const ResultType tmp( rhs );
351  addAssign( ~lhs, tmp );
352  }
354  //**********************************************************************************************
355 
356  //**Addition assignment to sparse vectors*******************************************************
357  // No special implementation for the addition assignment to sparse vectors.
358  //**********************************************************************************************
359 
360  //**Subtraction assignment to dense vectors*****************************************************
374  template< typename VT2 > // Type of the target dense vector
375  friend inline typename EnableIf< UseAssign<VT2> >::Type
376  subAssign( DenseVector<VT2,TF>& lhs, const DVecScalarMultExpr& rhs )
377  {
379 
382  BLAZE_CONSTRAINT_MUST_BE_REFERENCE_TYPE( typename ResultType::CompositeType );
383 
384  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
385 
386  const ResultType tmp( rhs );
387  subAssign( ~lhs, tmp );
388  }
390  //**********************************************************************************************
391 
392  //**Subtraction assignment to sparse vectors****************************************************
393  // No special implementation for the subtraction assignment to sparse vectors.
394  //**********************************************************************************************
395 
396  //**Multiplication assignment to dense vectors**************************************************
410  template< typename VT2 > // Type of the target dense vector
411  friend inline typename EnableIf< UseAssign<VT2> >::Type
412  multAssign( DenseVector<VT2,TF>& lhs, const DVecScalarMultExpr& rhs )
413  {
415 
418  BLAZE_CONSTRAINT_MUST_BE_REFERENCE_TYPE( typename ResultType::CompositeType );
419 
420  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
421 
422  const ResultType tmp( rhs );
423  multAssign( ~lhs, tmp );
424  }
426  //**********************************************************************************************
427 
428  //**Multiplication assignment to sparse vectors*************************************************
429  // No special implementation for the multiplication assignment to sparse vectors.
430  //**********************************************************************************************
431 
432  //**Compile time checks*************************************************************************
439  //**********************************************************************************************
440 };
441 //*************************************************************************************************
442 
443 
444 
445 
446 //=================================================================================================
447 //
448 // GLOBAL UNARY ARITHMETIC OPERATORS
449 //
450 //=================================================================================================
451 
452 //*************************************************************************************************
469 template< typename VT // Type of the dense vector
470  , bool TF > // Transpose flag
471 inline const DVecScalarMultExpr<VT,typename BaseElementType<VT>::Type,TF>
473 {
475 
476  typedef typename BaseElementType<VT>::Type ElementType;
477  return DVecScalarMultExpr<VT,ElementType,TF>( ~dv, ElementType(-1) );
478 }
479 //*************************************************************************************************
480 
481 
482 
483 
484 //=================================================================================================
485 //
486 // GLOBAL BINARY ARITHMETIC OPERATORS
487 //
488 //=================================================================================================
489 
490 //*************************************************************************************************
512 template< typename T1 // Type of the left-hand side dense vector
513  , typename T2 // Type of the right-hand side scalar
514  , bool TF > // Transpose flag
515 inline const typename EnableIf< IsNumeric<T2>, typename MultExprTrait<T1,T2>::Type >::Type
516  operator*( const DenseVector<T1,TF>& vec, T2 scalar )
517 {
519 
520  typedef typename MultExprTrait<T1,T2>::Type Type;
521  return Type( ~vec, scalar );
522 }
523 //*************************************************************************************************
524 
525 
526 //*************************************************************************************************
548 template< typename T1 // Type of the left-hand side scalar
549  , typename T2 // Type of the right-hand side dense vector
550  , bool TF > // Transpose flag
551 inline const typename EnableIf< IsNumeric<T1>, typename MultExprTrait<T1,T2>::Type >::Type
552  operator*( T1 scalar, const DenseVector<T2,TF>& vec )
553 {
555 
556  typedef typename MultExprTrait<T1,T2>::Type Type;
557  return Type( ~vec, scalar );
558 }
559 //*************************************************************************************************
560 
561 
562 
563 
564 //=================================================================================================
565 //
566 // GLOBAL FUNCTIONS
567 //
568 //=================================================================================================
569 
570 //*************************************************************************************************
588 template< typename VT // Type of the dense vector
589  , bool TF > // Transpose flag
590 inline const DVecScalarMultExpr<VT,typename VT::ElementType,TF>
592 {
593  typedef typename VT::ElementType ElementType;
594 
596 
597  const ElementType len ( length( ~vec ) );
598  const ElementType ilen( ( len != ElementType(0) )?( ElementType(1) / len ):( 0 ) );
599 
600  return DVecScalarMultExpr<VT,ElementType,TF>( ~vec, ilen );
601 }
602 //*************************************************************************************************
603 
604 
605 
606 
607 //=================================================================================================
608 //
609 // GLOBAL RESTRUCTURING UNARY ARITHMETIC OPERATORS
610 //
611 //=================================================================================================
612 
613 //*************************************************************************************************
625 template< typename VT // Type of the dense vector
626  , typename ST // Type of the scalar
627  , bool TF > // Transpose flag
628 inline const DVecScalarMultExpr<VT,ST,TF>
629  operator-( const DVecScalarMultExpr<VT,ST,TF>& dv )
630 {
632 
633  return DVecScalarMultExpr<VT,ST,TF>( dv.leftOperand(), -dv.rightOperand() );
634 }
636 //*************************************************************************************************
637 
638 
639 
640 
641 //=================================================================================================
642 //
643 // GLOBAL RESTRUCTURING BINARY ARITHMETIC OPERATORS
644 //
645 //=================================================================================================
646 
647 //*************************************************************************************************
660 template< typename VT // Type of the dense vector of the left-hand side expression
661  , typename ST1 // Type of the scalar of the left-hand side expression
662  , bool TF // Transpose flag of the dense vector
663  , typename ST2 > // Type of the right-hand side scalar
664 inline const typename EnableIf< IsNumeric<ST2>
665  , typename MultExprTrait< DVecScalarMultExpr<VT,ST1,TF>, ST2 >::Type >::Type
666  operator*( const DVecScalarMultExpr<VT,ST1,TF>& vec, ST2 scalar )
667 {
669 
670  return vec.leftOperand() * ( vec.rightOperand() * scalar );
671 }
673 //*************************************************************************************************
674 
675 
676 //*************************************************************************************************
689 template< typename ST1 // Type of the left-hand side scalar
690  , typename VT // Type of the dense vector of the right-hand side expression
691  , typename ST2 // Type of the scalar of the right-hand side expression
692  , bool TF > // Transpose flag of the dense vector
693 inline const typename EnableIf< IsNumeric<ST1>
694  , typename MultExprTrait< ST1, DVecScalarMultExpr<VT,ST2,TF> >::Type >::Type
695  operator*( ST1 scalar, const DVecScalarMultExpr<VT,ST2,TF>& vec )
696 {
698 
699  return vec.leftOperand() * ( scalar * vec.rightOperand() );
700 }
702 //*************************************************************************************************
703 
704 
705 //*************************************************************************************************
718 template< typename VT // Type of the dense vector of the left-hand side expression
719  , typename ST1 // Type of the scalar of the left-hand side expression
720  , bool TF // Transpose flag of the dense vector
721  , typename ST2 > // Type of the right-hand side scalar
722 inline const typename EnableIf< IsFloatingPoint<typename DivTrait<ST1,ST2>::Type>
723  , typename DivExprTrait< DVecScalarMultExpr<VT,ST1,TF>, ST2 >::Type >::Type
724  operator/( const DVecScalarMultExpr<VT,ST1,TF>& vec, ST2 scalar )
725 {
727 
728  return vec.leftOperand() * ( vec.rightOperand() / scalar );
729 }
731 //*************************************************************************************************
732 
733 
734 //*************************************************************************************************
748 template< typename VT1 // Type of the dense vector of the left-hand side expression
749  , typename ST // Type of the scalar of the left-hand side expression
750  , bool TF // Transpose flag of the dense vectors
751  , typename VT2 > // Type of the right-hand side dense vector
752 inline const typename MultExprTrait< DVecScalarMultExpr<VT1,ST,TF>, VT2 >::Type
753  operator*( const DVecScalarMultExpr<VT1,ST,TF>& lhs, const DenseVector<VT2,TF>& rhs )
754 {
756 
757  return ( lhs.leftOperand() * (~rhs) ) * lhs.rightOperand();
758 }
760 //*************************************************************************************************
761 
762 
763 //*************************************************************************************************
777 template< typename VT1 // Type of the left-hand side dense vector
778  , bool TF // Transpose flag of the dense vectors
779  , typename VT2 // Type of the dense vector of the right-hand side expression
780  , typename ST > // Type of the scalar of the right-hand side expression
781 inline const typename MultExprTrait< VT1, DVecScalarMultExpr<VT2,ST,TF> >::Type
782  operator*( const DenseVector<VT1,TF>& lhs, const DVecScalarMultExpr<VT2,ST,TF>& rhs )
783 {
785 
786  return ( (~lhs) * rhs.leftOperand() ) * rhs.rightOperand();
787 }
789 //*************************************************************************************************
790 
791 
792 //*************************************************************************************************
806 template< typename VT1 // Type of the dense vector of the left-hand side expression
807  , typename ST1 // Type of the scalar of the left-hand side expression
808  , bool TF // Transpose flag of the dense vectors
809  , typename VT2 // Type of the dense vector of the right-hand side expression
810  , typename ST2 > // Type of the scalar of the right-hand side expression
811 inline const typename MultExprTrait< DVecScalarMultExpr<VT1,ST1,TF>, DVecScalarMultExpr<VT2,ST2,TF> >::Type
812  operator*( const DVecScalarMultExpr<VT1,ST1,TF>& lhs, const DVecScalarMultExpr<VT2,ST2,TF>& rhs )
813 {
815 
816  return ( lhs.leftOperand() * rhs.leftOperand() ) * ( lhs.rightOperand() * rhs.rightOperand() );
817 }
819 //*************************************************************************************************
820 
821 
822 //*************************************************************************************************
836 template< typename VT1 // Type of the dense vector of the left-hand side expression
837  , typename ST // Type of the scalar of the left-hand side expression
838  , typename VT2 > // Type of the right-hand side dense vector
839 inline const typename MultExprTrait< DVecScalarMultExpr<VT1,ST,false>, VT2 >::Type
840  operator*( const DVecScalarMultExpr<VT1,ST,false>& lhs, const DenseVector<VT2,true>& rhs )
841 {
843 
844  return ( lhs.leftOperand() * (~rhs) ) * lhs.rightOperand();
845 }
847 //*************************************************************************************************
848 
849 
850 //*************************************************************************************************
864 template< typename VT1 // Type of the left-hand side dense vector
865  , typename VT2 // Type of the dense vector of the right-hand side expression
866  , typename ST > // Type of the scalar of the right-hand side expression
867 inline const typename MultExprTrait< VT1, DVecScalarMultExpr<VT2,ST,true> >::Type
868  operator*( const DenseVector<VT1,false>& lhs, const DVecScalarMultExpr<VT2,ST,true>& rhs )
869 {
871 
872  return ( (~lhs) * rhs.leftOperand() ) * rhs.rightOperand();
873 }
875 //*************************************************************************************************
876 
877 
878 //*************************************************************************************************
892 template< typename VT1 // Type of the dense vector of the left-hand side expression
893  , typename ST1 // Type of the scalar of the left-hand side expression
894  , typename VT2 // Type of the dense vector of the right-hand side expression
895  , typename ST2 > // Type of the scalar of the right-hand side expression
896 inline const typename MultExprTrait< DVecScalarMultExpr<VT1,ST1,false>, DVecScalarMultExpr<VT2,ST2,true> >::Type
897  operator*( const DVecScalarMultExpr<VT1,ST1,false>& lhs, const DVecScalarMultExpr<VT2,ST2,true>& rhs )
898 {
900 
901  return ( lhs.leftOperand() * rhs.leftOperand() ) * ( lhs.rightOperand() * rhs.rightOperand() );
902 }
904 //*************************************************************************************************
905 
906 
907 //*************************************************************************************************
921 template< typename VT1 // Type of the dense vector of the left-hand side expression
922  , typename ST // Type of the scalar of the left-hand side expression
923  , bool TF // Transpose flag of the vectors
924  , typename VT2 > // Type of the right-hand side sparse vector
925 inline const typename MultExprTrait< DVecScalarMultExpr<VT1,ST,TF>, VT2 >::Type
926  operator*( const DVecScalarMultExpr<VT1,ST,TF>& lhs, const SparseVector<VT2,TF>& rhs )
927 {
929 
930  return ( lhs.leftOperand() * (~rhs) ) * lhs.rightOperand();
931 }
933 //*************************************************************************************************
934 
935 
936 //*************************************************************************************************
950 template< typename VT1 // Type of the left-hand side sparse vector
951  , bool TF // Transpose flag of the vectors
952  , typename VT2 // Type of the dense vector of the right-hand side expression
953  , typename ST > // Type of the scalar of the right-hand side expression
954 inline const typename MultExprTrait< VT1, DVecScalarMultExpr<VT2,ST,TF> >::Type
955  operator*( const SparseVector<VT1,TF>& lhs, const DVecScalarMultExpr<VT2,ST,TF>& rhs )
956 {
958 
959  return ( (~lhs) * rhs.leftOperand() ) * rhs.rightOperand();
960 }
962 //*************************************************************************************************
963 
964 
965 //*************************************************************************************************
980 template< typename VT1 // Type of the dense vector of the left-hand side expression
981  , typename ST1 // Type of the scalar of the left-hand side expression
982  , bool TF // Transpose flag of the vectors
983  , typename VT2 // Type of the sparse vector of the right-hand side expression
984  , typename ST2 > // Type of the scalar o the right-hand side expression
985 inline const typename MultExprTrait< DVecScalarMultExpr<VT1,ST1,TF>, SVecScalarMultExpr<VT2,ST2,TF> >::Type
986  operator*( const DVecScalarMultExpr<VT1,ST1,TF>& lhs, const SVecScalarMultExpr<VT2,ST2,TF>& rhs )
987 {
989 
990  return ( lhs.leftOperand() * rhs.leftOperand() ) * ( lhs.rightOperand() * rhs.rightOperand() );
991 }
993 //*************************************************************************************************
994 
995 
996 //*************************************************************************************************
1011 template< typename VT1 // Type of the sparse vector of the left-hand side expression
1012  , typename ST1 // Type of the scalar of the left-hand side expression
1013  , bool TF // Transpose flag of the vectors
1014  , typename VT2 // Type of the dense vector of the right-hand side expression
1015  , typename ST2 > // Type of the scalar o the right-hand side expression
1016 inline const typename MultExprTrait< SVecScalarMultExpr<VT1,ST1,TF>, DVecScalarMultExpr<VT2,ST2,TF> >::Type
1017  operator*( const SVecScalarMultExpr<VT1,ST1,TF>& lhs, const DVecScalarMultExpr<VT2,ST2,TF>& rhs )
1018 {
1020 
1021  return ( lhs.leftOperand() * rhs.leftOperand() ) * ( lhs.rightOperand() * rhs.rightOperand() );
1022 }
1024 //*************************************************************************************************
1025 
1026 
1027 //*************************************************************************************************
1041 template< typename VT1 // Type of the dense vector of the left-hand side expression
1042  , typename ST // Type of the scalar of the left-hand side expression
1043  , typename VT2 > // Type of the right-hand side sparse vector
1044 inline const typename MultExprTrait< DVecScalarMultExpr<VT1,ST,false>, VT2 >::Type
1045  operator*( const DVecScalarMultExpr<VT1,ST,false>& lhs, const SparseVector<VT2,true>& rhs )
1046 {
1048 
1049  return ( lhs.leftOperand() * (~rhs) ) * lhs.rightOperand();
1050 }
1052 //*************************************************************************************************
1053 
1054 
1055 //*************************************************************************************************
1069 template< typename VT1 // Type of the left-hand side sparse vector
1070  , typename VT2 // Type of the dense vector of the right-hand side expression
1071  , typename ST > // Type of the scalar of the right-hand side expression
1072 inline const typename MultExprTrait< VT1, DVecScalarMultExpr<VT2,ST,true> >::Type
1073  operator*( const SparseVector<VT1,false>& lhs, const DVecScalarMultExpr<VT2,ST,true>& rhs )
1074 {
1076 
1077  return ( (~lhs) * rhs.leftOperand() ) * rhs.rightOperand();
1078 }
1080 //*************************************************************************************************
1081 
1082 
1083 //*************************************************************************************************
1098 template< typename VT1 // Type of the dense vector of the left-hand side expression
1099  , typename ST1 // Type of the scalar of the left-hand side expression
1100  , typename VT2 // Type of the sparse vector of the right-hand side expression
1101  , typename ST2 > // Type of the scalar o the right-hand side expression
1102 inline const typename MultExprTrait< DVecScalarMultExpr<VT1,ST1,false>, SVecScalarMultExpr<VT2,ST2,true> >::Type
1103  operator*( const DVecScalarMultExpr<VT1,ST1,false>& lhs, const SVecScalarMultExpr<VT2,ST2,true>& rhs )
1104 {
1106 
1107  return ( lhs.leftOperand() * rhs.leftOperand() ) * ( lhs.rightOperand() * rhs.rightOperand() );
1108 }
1110 //*************************************************************************************************
1111 
1112 
1113 //*************************************************************************************************
1128 template< typename VT1 // Type of the sparse vector of the left-hand side expression
1129  , typename ST1 // Type of the scalar of the left-hand side expression
1130  , typename VT2 // Type of the dense vector of the right-hand side expression
1131  , typename ST2 > // Type of the scalar o the right-hand side expression
1132 inline const typename MultExprTrait< SVecScalarMultExpr<VT1,ST1,false>, DVecScalarMultExpr<VT2,ST2,true> >::Type
1133  operator*( const SVecScalarMultExpr<VT1,ST1,false>& lhs, const DVecScalarMultExpr<VT2,ST2,true>& rhs )
1134 {
1136 
1137  return ( lhs.leftOperand() * rhs.leftOperand() ) * ( lhs.rightOperand() * rhs.rightOperand() );
1138 }
1140 //*************************************************************************************************
1141 
1142 
1143 //*************************************************************************************************
1157 template< typename MT // Type of the left-hand side dense matrix
1158  , bool SO // Storage order of the left-hand side dense matrix
1159  , typename VT // Type of the dense vector of the right-hand side expression
1160  , typename ST > // Type of the scalar of the right-hand side expression
1161 inline const typename MultExprTrait< MT, DVecScalarMultExpr<VT,ST,false> >::Type
1162  operator*( const DenseMatrix<MT,SO>& mat, const DVecScalarMultExpr<VT,ST,false>& vec )
1163 {
1165 
1166  return ( (~mat) * vec.leftOperand() ) * vec.rightOperand();
1167 }
1169 //*************************************************************************************************
1170 
1171 
1172 //*************************************************************************************************
1186 template< typename VT // Type of the dense vector of the left-hand side expression
1187  , typename ST // Type of the scalar of the left-hand side expression
1188  , typename MT // Type of the right-hand side dense matrix
1189  , bool SO > // Storage order of the right-hand side dense matrix
1190 inline const typename MultExprTrait< DVecScalarMultExpr<VT,ST,true>, MT >::Type
1191  operator*( const DVecScalarMultExpr<VT,ST,true>& vec, const DenseMatrix<MT,SO>& mat )
1192 {
1194 
1195  return ( vec.leftOperand() * (~mat) ) * vec.rightOperand();
1196 }
1198 //*************************************************************************************************
1199 
1200 
1201 //*************************************************************************************************
1215 template< typename MT // Type of the left-hand side sparse matrix
1216  , bool SO // Storage order of the left-hand side sparse matrix
1217  , typename VT // Type of the dense vector of the right-hand side expression
1218  , typename ST > // Type of the scalar of the right-hand side expression
1219 inline const typename MultExprTrait< MT, DVecScalarMultExpr<VT,ST,false> >::Type
1220  operator*( const SparseMatrix<MT,SO>& mat, const DVecScalarMultExpr<VT,ST,false>& vec )
1221 {
1223 
1224  return ( (~mat) * vec.leftOperand() ) * vec.rightOperand();
1225 }
1227 //*************************************************************************************************
1228 
1229 
1230 //*************************************************************************************************
1244 template< typename VT // Type of the dense vector of the left-hand side expression
1245  , typename ST // Type of the scalar of the left-hand side expression
1246  , typename MT // Type of the right-hand side sparse matrix
1247  , bool SO > // Storage order of the right-hand side sparse matrix
1248 inline const typename MultExprTrait< DVecScalarMultExpr<VT,ST,true>, MT >::Type
1249  operator*( const DVecScalarMultExpr<VT,ST,true>& vec, const SparseMatrix<MT,SO>& mat )
1250 {
1252 
1253  return ( vec.leftOperand() * (~mat) ) * vec.rightOperand();
1254 }
1256 //*************************************************************************************************
1257 
1258 
1259 
1260 
1261 //=================================================================================================
1262 //
1263 // DVECSCALARMULTEXPRTRAIT SPECIALIZATIONS
1264 //
1265 //=================================================================================================
1266 
1267 //*************************************************************************************************
1269 template< typename VT, typename ST1, typename ST2 >
1270 struct DVecScalarMultExprTrait< DVecScalarMultExpr<VT,ST1,false>, ST2 >
1271 {
1272  public:
1273  //**********************************************************************************************
1274  typedef typename SelectType< IsDenseVector<VT>::value && !IsTransposeVector<VT>::value &&
1275  IsNumeric<ST1>::value && IsNumeric<ST2>::value
1276  , typename DVecScalarMultExprTrait<VT,typename MultTrait<ST1,ST2>::Type>::Type
1277  , INVALID_TYPE >::Type Type;
1278  //**********************************************************************************************
1279 };
1281 //*************************************************************************************************
1282 
1283 
1284 
1285 
1286 //=================================================================================================
1287 //
1288 // TDVECSCALARMULTEXPRTRAIT SPECIALIZATIONS
1289 //
1290 //=================================================================================================
1291 
1292 //*************************************************************************************************
1294 template< typename VT, typename ST1, typename ST2 >
1295 struct TDVecScalarMultExprTrait< DVecScalarMultExpr<VT,ST1,true>, ST2 >
1296 {
1297  public:
1298  //**********************************************************************************************
1299  typedef typename SelectType< IsDenseVector<VT>::value && IsTransposeVector<VT>::value &&
1300  IsNumeric<ST1>::value && IsNumeric<ST2>::value
1301  , typename TDVecScalarMultExprTrait<VT,typename MultTrait<ST1,ST2>::Type>::Type
1302  , INVALID_TYPE >::Type Type;
1303  //**********************************************************************************************
1304 };
1306 //*************************************************************************************************
1307 
1308 
1309 
1310 
1311 //=================================================================================================
1312 //
1313 // DVECSCALARDIVEXPRTRAIT SPECIALIZATIONS
1314 //
1315 //=================================================================================================
1316 
1317 //*************************************************************************************************
1319 template< typename VT, typename ST1, typename ST2 >
1320 struct DVecScalarDivExprTrait< DVecScalarMultExpr<VT,ST1,false>, ST2 >
1321 {
1322  private:
1323  //**********************************************************************************************
1324  enum { condition = IsFloatingPoint<typename DivTrait<ST1,ST2>::Type>::value };
1325  //**********************************************************************************************
1326 
1327  //**********************************************************************************************
1328  typedef typename DVecScalarMultExprTrait<VT,typename DivTrait<ST1,ST2>::Type>::Type T1;
1329  typedef typename DVecScalarDivExprTrait<VT,typename DivTrait<ST1,ST2>::Type>::Type T2;
1330  //**********************************************************************************************
1331 
1332  public:
1333  //**********************************************************************************************
1334  typedef typename SelectType< IsDenseVector<VT>::value && !IsTransposeVector<VT>::value &&
1335  IsNumeric<ST1>::value && IsNumeric<ST2>::value
1336  , typename SelectType<condition,T1,T2>::Type
1337  , INVALID_TYPE >::Type Type;
1338  //**********************************************************************************************
1339 };
1341 //*************************************************************************************************
1342 
1343 
1344 
1345 
1346 //=================================================================================================
1347 //
1348 // TDVECSCALARDIVEXPRTRAIT SPECIALIZATIONS
1349 //
1350 //=================================================================================================
1351 
1352 //*************************************************************************************************
1354 template< typename VT, typename ST1, typename ST2 >
1355 struct TDVecScalarDivExprTrait< DVecScalarMultExpr<VT,ST1,true>, ST2 >
1356 {
1357  private:
1358  //**********************************************************************************************
1359  enum { condition = IsFloatingPoint<typename DivTrait<ST1,ST2>::Type>::value };
1360  //**********************************************************************************************
1361 
1362  //**********************************************************************************************
1363  typedef typename TDVecScalarMultExprTrait<VT,typename DivTrait<ST1,ST2>::Type>::Type T1;
1364  typedef typename TDVecScalarDivExprTrait<VT,typename DivTrait<ST1,ST2>::Type>::Type T2;
1365  //**********************************************************************************************
1366 
1367  public:
1368  //**********************************************************************************************
1369  typedef typename SelectType< IsDenseVector<VT>::value && IsTransposeVector<VT>::value &&
1370  IsNumeric<ST1>::value && IsNumeric<ST2>::value
1371  , typename SelectType<condition,T1,T2>::Type
1372  , INVALID_TYPE >::Type Type;
1373  //**********************************************************************************************
1374 };
1376 //*************************************************************************************************
1377 
1378 
1379 
1380 
1381 //=================================================================================================
1382 //
1383 // DVECDVECMULTEXPRTRAIT SPECIALIZATIONS
1384 //
1385 //=================================================================================================
1386 
1387 //*************************************************************************************************
1389 template< typename VT1, typename ST, typename VT2 >
1390 struct DVecDVecMultExprTrait< DVecScalarMultExpr<VT1,ST,false>, VT2 >
1391 {
1392  public:
1393  //**********************************************************************************************
1394  typedef typename SelectType< IsDenseVector<VT1>::value && !IsTransposeVector<VT1>::value &&
1395  IsDenseVector<VT2>::value && !IsTransposeVector<VT2>::value &&
1396  IsNumeric<ST>::value
1397  , typename DVecScalarMultExprTrait<typename DVecDVecMultExprTrait<VT1,VT2>::Type,ST>::Type
1398  , INVALID_TYPE >::Type Type;
1399  //**********************************************************************************************
1400 };
1402 //*************************************************************************************************
1403 
1404 
1405 //*************************************************************************************************
1407 template< typename VT1, typename VT2, typename ST >
1408 struct DVecDVecMultExprTrait< VT1, DVecScalarMultExpr<VT2,ST,false> >
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 DVecScalarMultExprTrait<typename DVecDVecMultExprTrait<VT1,VT2>::Type,ST>::Type
1416  , INVALID_TYPE >::Type Type;
1417  //**********************************************************************************************
1418 };
1420 //*************************************************************************************************
1421 
1422 
1423 //*************************************************************************************************
1425 template< typename VT1, typename ST1, typename VT2, typename ST2 >
1426 struct DVecDVecMultExprTrait< DVecScalarMultExpr<VT1,ST1,false>, DVecScalarMultExpr<VT2,ST2,false> >
1427 {
1428  public:
1429  //**********************************************************************************************
1430  typedef typename SelectType< IsDenseVector<VT1>::value && !IsTransposeVector<VT1>::value &&
1431  IsDenseVector<VT2>::value && !IsTransposeVector<VT2>::value &&
1432  IsNumeric<ST1>::value && IsNumeric<ST2>::value
1433  , typename DVecScalarMultExprTrait<typename DVecDVecMultExprTrait<VT1,VT2>::Type,typename MultTrait<ST1,ST2>::Type>::Type
1434  , INVALID_TYPE >::Type Type;
1435  //**********************************************************************************************
1436 };
1438 //*************************************************************************************************
1439 
1440 
1441 
1442 
1443 //=================================================================================================
1444 //
1445 // DVECTDVECMULTEXPRTRAIT SPECIALIZATIONS
1446 //
1447 //=================================================================================================
1448 
1449 //*************************************************************************************************
1451 template< typename VT1, typename ST, typename VT2 >
1452 struct DVecTDVecMultExprTrait< DVecScalarMultExpr<VT1,ST,false>, VT2 >
1453 {
1454  public:
1455  //**********************************************************************************************
1456  typedef typename SelectType< IsDenseVector<VT1>::value && !IsTransposeVector<VT1>::value &&
1457  IsDenseVector<VT2>::value && IsTransposeVector<VT2>::value &&
1458  IsNumeric<ST>::value
1459  , typename DMatScalarMultExprTrait<typename DVecTDVecMultExprTrait<VT1,VT2>::Type,ST>::Type
1460  , INVALID_TYPE >::Type Type;
1461  //**********************************************************************************************
1462 };
1464 //*************************************************************************************************
1465 
1466 
1467 //*************************************************************************************************
1469 template< typename VT1, typename VT2, typename ST >
1470 struct DVecTDVecMultExprTrait< VT1, DVecScalarMultExpr<VT2,ST,true> >
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 DMatScalarMultExprTrait<typename DVecTDVecMultExprTrait<VT1,VT2>::Type,ST>::Type
1478  , INVALID_TYPE >::Type Type;
1479  //**********************************************************************************************
1480 };
1482 //*************************************************************************************************
1483 
1484 
1485 //*************************************************************************************************
1487 template< typename VT1, typename ST1, typename VT2, typename ST2 >
1488 struct DVecTDVecMultExprTrait< DVecScalarMultExpr<VT1,ST1,false>, DVecScalarMultExpr<VT2,ST2,true> >
1489 {
1490  public:
1491  //**********************************************************************************************
1492  typedef typename SelectType< IsDenseVector<VT1>::value && !IsTransposeVector<VT1>::value &&
1493  IsDenseVector<VT2>::value && IsTransposeVector<VT2>::value &&
1494  IsNumeric<ST1>::value && IsNumeric<ST2>::value
1495  , typename DMatScalarMultExprTrait<typename DVecTDVecMultExprTrait<VT1,VT2>::Type,typename MultTrait<ST1,ST2>::Type>::Type
1496  , INVALID_TYPE >::Type Type;
1497  //**********************************************************************************************
1498 };
1500 //*************************************************************************************************
1501 
1502 
1503 
1504 
1505 //=================================================================================================
1506 //
1507 // TDVECTDVECMULTEXPRTRAIT SPECIALIZATIONS
1508 //
1509 //=================================================================================================
1510 
1511 //*************************************************************************************************
1513 template< typename VT1, typename ST, typename VT2 >
1514 struct TDVecTDVecMultExprTrait< DVecScalarMultExpr<VT1,ST,true>, VT2 >
1515 {
1516  public:
1517  //**********************************************************************************************
1518  typedef typename SelectType< IsDenseVector<VT1>::value && IsTransposeVector<VT1>::value &&
1519  IsDenseVector<VT2>::value && IsTransposeVector<VT2>::value &&
1520  IsNumeric<ST>::value
1521  , typename TDVecScalarMultExprTrait<typename TDVecTDVecMultExprTrait<VT1,VT2>::Type,ST>::Type
1522  , INVALID_TYPE >::Type Type;
1523  //**********************************************************************************************
1524 };
1526 //*************************************************************************************************
1527 
1528 
1529 //*************************************************************************************************
1531 template< typename VT1, typename VT2, typename ST >
1532 struct TDVecTDVecMultExprTrait< VT1, DVecScalarMultExpr<VT2,ST,true> >
1533 {
1534  public:
1535  //**********************************************************************************************
1536  typedef typename SelectType< IsDenseVector<VT1>::value && IsTransposeVector<VT1>::value &&
1537  IsDenseVector<VT2>::value && IsTransposeVector<VT2>::value &&
1538  IsNumeric<ST>::value
1539  , typename TDVecScalarMultExprTrait<typename TDVecTDVecMultExprTrait<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 TDVecTDVecMultExprTrait< DVecScalarMultExpr<VT1,ST1,true>, DVecScalarMultExpr<VT2,ST2,true> >
1551 {
1552  public:
1553  //**********************************************************************************************
1554  typedef typename SelectType< IsDenseVector<VT1>::value && IsTransposeVector<VT1>::value &&
1555  IsDenseVector<VT2>::value && IsTransposeVector<VT2>::value &&
1556  IsNumeric<ST1>::value && IsNumeric<ST2>::value
1557  , typename TDVecScalarMultExprTrait<typename TDVecTDVecMultExprTrait<VT1,VT2>::Type,typename MultTrait<ST1,ST2>::Type>::Type
1558  , INVALID_TYPE >::Type Type;
1559  //**********************************************************************************************
1560 };
1562 //*************************************************************************************************
1563 
1564 
1565 
1566 
1567 //=================================================================================================
1568 //
1569 // DVECSVECMULTEXPRTRAIT SPECIALIZATIONS
1570 //
1571 //=================================================================================================
1572 
1573 //*************************************************************************************************
1575 template< typename VT1, typename VT2, typename ST >
1576 struct DVecSVecMultExprTrait< 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 SVecScalarMultExprTrait<typename DVecSVecMultExprTrait<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 DVecSVecMultExprTrait< DVecScalarMultExpr<VT1,ST1,false>, SVecScalarMultExpr<VT2,ST2,false> >
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 SVecScalarMultExprTrait<typename DVecSVecMultExprTrait<VT1,VT2>::Type,typename MultTrait<ST1,ST2>::Type>::Type
1602  , INVALID_TYPE >::Type Type;
1603  //**********************************************************************************************
1604 };
1606 //*************************************************************************************************
1607 
1608 
1609 
1610 
1611 //=================================================================================================
1612 //
1613 // DVECTSVECMULTEXPRTRAIT SPECIALIZATIONS
1614 //
1615 //=================================================================================================
1616 
1617 //*************************************************************************************************
1619 template< typename VT1, typename ST, typename VT2 >
1620 struct DVecTSVecMultExprTrait< DVecScalarMultExpr<VT1,ST,false>, 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 SMatScalarMultExprTrait<typename DVecTSVecMultExprTrait<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 DVecTSVecMultExprTrait< DVecScalarMultExpr<VT1,ST1,false>, 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 SMatScalarMultExprTrait<typename DVecTSVecMultExprTrait<VT1,VT2>::Type,typename MultTrait<ST1,ST2>::Type>::Type
1646  , INVALID_TYPE >::Type Type;
1647  //**********************************************************************************************
1648 };
1650 //*************************************************************************************************
1651 
1652 
1653 
1654 
1655 //=================================================================================================
1656 //
1657 // TDVECTSVECMULTEXPRTRAIT SPECIALIZATIONS
1658 //
1659 //=================================================================================================
1660 
1661 //*************************************************************************************************
1663 template< typename VT1, typename ST, typename VT2 >
1664 struct TDVecTSVecMultExprTrait< DVecScalarMultExpr<VT1,ST,true>, VT2 >
1665 {
1666  public:
1667  //**********************************************************************************************
1668  typedef typename SelectType< IsDenseVector<VT1>::value && IsTransposeVector<VT1>::value &&
1669  IsSparseVector<VT2>::value && IsTransposeVector<VT2>::value &&
1670  IsNumeric<ST>::value
1671  , typename TSVecScalarMultExprTrait<typename TDVecTSVecMultExprTrait<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 TDVecTSVecMultExprTrait< DVecScalarMultExpr<VT1,ST1,true>, SVecScalarMultExpr<VT2,ST2,true> >
1683 {
1684  public:
1685  //**********************************************************************************************
1686  typedef typename SelectType< IsDenseVector<VT1>::value && IsTransposeVector<VT1>::value &&
1687  IsSparseVector<VT2>::value && IsTransposeVector<VT2>::value &&
1688  IsNumeric<ST1>::value && IsNumeric<ST2>::value
1689  , typename TSVecScalarMultExprTrait<typename TDVecTSVecMultExprTrait<VT1,VT2>::Type,typename MultTrait<ST1,ST2>::Type>::Type
1690  , INVALID_TYPE >::Type Type;
1691  //**********************************************************************************************
1692 };
1694 //*************************************************************************************************
1695 
1696 
1697 
1698 
1699 //=================================================================================================
1700 //
1701 // SVECDVECMULTEXPRTRAIT SPECIALIZATIONS
1702 //
1703 //=================================================================================================
1704 
1705 //*************************************************************************************************
1707 template< typename VT1, typename VT2, typename ST >
1708 struct SVecDVecMultExprTrait< VT1, DVecScalarMultExpr<VT2,ST,false> >
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 SVecScalarMultExprTrait<typename SVecDVecMultExprTrait<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 SVecDVecMultExprTrait< SVecScalarMultExpr<VT1,ST1,false>, DVecScalarMultExpr<VT2,ST2,false> >
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 SVecScalarMultExprTrait<typename SVecDVecMultExprTrait<VT1,VT2>::Type,typename MultTrait<ST1,ST2>::Type>::Type
1734  , INVALID_TYPE >::Type Type;
1735  //**********************************************************************************************
1736 };
1738 //*************************************************************************************************
1739 
1740 
1741 
1742 
1743 //=================================================================================================
1744 //
1745 // SVECTDVECMULTEXPRTRAIT SPECIALIZATIONS
1746 //
1747 //=================================================================================================
1748 
1749 //*************************************************************************************************
1751 template< typename VT1, typename VT2, typename ST >
1752 struct SVecTDVecMultExprTrait< 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 TSMatScalarMultExprTrait<typename SVecTDVecMultExprTrait<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 SVecTDVecMultExprTrait< SVecScalarMultExpr<VT1,ST1,false>, 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 TSMatScalarMultExprTrait<typename SVecTDVecMultExprTrait<VT1,VT2>::Type,typename MultTrait<ST1,ST2>::Type>::Type
1778  , INVALID_TYPE >::Type Type;
1779  //**********************************************************************************************
1780 };
1782 //*************************************************************************************************
1783 
1784 
1785 
1786 
1787 //=================================================================================================
1788 //
1789 // TSVECTDVECMULTEXPRTRAIT SPECIALIZATIONS
1790 //
1791 //=================================================================================================
1792 
1793 //*************************************************************************************************
1795 template< typename VT1, typename VT2, typename ST >
1796 struct TSVecTDVecMultExprTrait< VT1, DVecScalarMultExpr<VT2,ST,true> >
1797 {
1798  public:
1799  //**********************************************************************************************
1800  typedef typename SelectType< IsSparseVector<VT1>::value && IsTransposeVector<VT1>::value &&
1801  IsDenseVector<VT2>::value && IsTransposeVector<VT2>::value &&
1802  IsNumeric<ST>::value
1803  , typename TSVecScalarMultExprTrait<typename TSVecTDVecMultExprTrait<VT1,VT2>::Type,ST>::Type
1804  , INVALID_TYPE >::Type Type;
1805  //**********************************************************************************************
1806 };
1808 //*************************************************************************************************
1809 
1810 
1811 //*************************************************************************************************
1813 template< typename VT1, typename ST1, typename VT2, typename ST2 >
1814 struct TSVecTDVecMultExprTrait< SVecScalarMultExpr<VT1,ST1,true>, DVecScalarMultExpr<VT2,ST2,true> >
1815 {
1816  public:
1817  //**********************************************************************************************
1818  typedef typename SelectType< IsSparseVector<VT1>::value && IsTransposeVector<VT1>::value &&
1819  IsDenseVector<VT2>::value && IsTransposeVector<VT2>::value &&
1820  IsNumeric<ST1>::value && IsNumeric<ST2>::value
1821  , typename TSVecScalarMultExprTrait<typename TSVecTDVecMultExprTrait<VT1,VT2>::Type,typename MultTrait<ST1,ST2>::Type>::Type
1822  , INVALID_TYPE >::Type Type;
1823  //**********************************************************************************************
1824 };
1826 //*************************************************************************************************
1827 
1828 
1829 
1830 
1831 //=================================================================================================
1832 //
1833 // DMATDVECMULTEXPRTRAIT SPECIALIZATIONS
1834 //
1835 //=================================================================================================
1836 
1837 //*************************************************************************************************
1839 template< typename MT, typename VT, typename ST >
1840 struct DMatDVecMultExprTrait< MT, DVecScalarMultExpr<VT,ST,false> >
1841 {
1842  public:
1843  //**********************************************************************************************
1844  typedef typename SelectType< IsDenseMatrix<MT>::value && IsRowMajorMatrix<MT>::value &&
1845  IsDenseVector<VT>::value && !IsTransposeVector<VT>::value &&
1846  IsNumeric<ST>::value
1847  , typename DVecScalarMultExprTrait<typename DMatDVecMultExprTrait<MT,VT>::Type,ST>::Type
1848  , INVALID_TYPE >::Type Type;
1849  //**********************************************************************************************
1850 };
1852 //*************************************************************************************************
1853 
1854 
1855 
1856 
1857 //=================================================================================================
1858 //
1859 // TDMATDVECMULTEXPRTRAIT SPECIALIZATIONS
1860 //
1861 //=================================================================================================
1862 
1863 //*************************************************************************************************
1865 template< typename MT, typename VT, typename ST >
1866 struct TDMatDVecMultExprTrait< MT, DVecScalarMultExpr<VT,ST,false> >
1867 {
1868  public:
1869  //**********************************************************************************************
1870  typedef typename SelectType< IsDenseMatrix<MT>::value && IsColumnMajorMatrix<MT>::value &&
1871  IsDenseVector<VT>::value && !IsTransposeVector<VT>::value &&
1872  IsNumeric<ST>::value
1873  , typename DVecScalarMultExprTrait<typename TDMatDVecMultExprTrait<MT,VT>::Type,ST>::Type
1874  , INVALID_TYPE >::Type Type;
1875  //**********************************************************************************************
1876 };
1878 //*************************************************************************************************
1879 
1880 
1881 
1882 
1883 //=================================================================================================
1884 //
1885 // TDVECDMATMULTEXPRTRAIT SPECIALIZATIONS
1886 //
1887 //=================================================================================================
1888 
1889 //*************************************************************************************************
1891 template< typename VT, typename MT, typename ST >
1892 struct TDVecDMatMultExprTrait< DVecScalarMultExpr<VT,ST,true>, MT >
1893 {
1894  public:
1895  //**********************************************************************************************
1896  typedef typename SelectType< IsDenseVector<VT>::value && IsTransposeVector<VT>::value &&
1897  IsDenseMatrix<MT>::value && IsRowMajorMatrix<MT>::value &&
1898  IsNumeric<ST>::value
1899  , typename TDVecScalarMultExprTrait<typename TDVecDMatMultExprTrait<VT,MT>::Type,ST>::Type
1900  , INVALID_TYPE >::Type Type;
1901  //**********************************************************************************************
1902 };
1904 //*************************************************************************************************
1905 
1906 
1907 
1908 
1909 //=================================================================================================
1910 //
1911 // TDVECTDMATMULTEXPRTRAIT SPECIALIZATIONS
1912 //
1913 //=================================================================================================
1914 
1915 //*************************************************************************************************
1917 template< typename VT, typename MT, typename ST >
1918 struct TDVecTDMatMultExprTrait< DVecScalarMultExpr<VT,ST,true>, MT >
1919 {
1920  public:
1921  //**********************************************************************************************
1922  typedef typename SelectType< IsDenseVector<VT>::value && IsTransposeVector<VT>::value &&
1923  IsDenseMatrix<MT>::value && IsColumnMajorMatrix<MT>::value &&
1924  IsNumeric<ST>::value
1925  , typename TDVecScalarMultExprTrait<typename TDVecTDMatMultExprTrait<VT,MT>::Type,ST>::Type
1926  , INVALID_TYPE >::Type Type;
1927  //**********************************************************************************************
1928 };
1930 //*************************************************************************************************
1931 
1932 
1933 
1934 
1935 //=================================================================================================
1936 //
1937 // SMATDVECMULTEXPRTRAIT SPECIALIZATIONS
1938 //
1939 //=================================================================================================
1940 
1941 //*************************************************************************************************
1943 template< typename MT, typename VT, typename ST >
1944 struct SMatDVecMultExprTrait< MT, DVecScalarMultExpr<VT,ST,false> >
1945 {
1946  public:
1947  //**********************************************************************************************
1948  typedef typename SelectType< IsSparseMatrix<MT>::value && IsRowMajorMatrix<MT>::value &&
1949  IsDenseVector<VT>::value && !IsTransposeVector<VT>::value &&
1950  IsNumeric<ST>::value
1951  , typename DVecScalarMultExprTrait<typename SMatDVecMultExprTrait<MT,VT>::Type,ST>::Type
1952  , INVALID_TYPE >::Type Type;
1953  //**********************************************************************************************
1954 };
1956 //*************************************************************************************************
1957 
1958 
1959 
1960 
1961 //=================================================================================================
1962 //
1963 // TSMATDVECMULTEXPRTRAIT SPECIALIZATIONS
1964 //
1965 //=================================================================================================
1966 
1967 //*************************************************************************************************
1969 template< typename MT, typename VT, typename ST >
1970 struct TSMatDVecMultExprTrait< MT, DVecScalarMultExpr<VT,ST,false> >
1971 {
1972  public:
1973  //**********************************************************************************************
1974  typedef typename SelectType< IsSparseMatrix<MT>::value && IsColumnMajorMatrix<MT>::value &&
1975  IsDenseVector<VT>::value && !IsTransposeVector<VT>::value &&
1976  IsNumeric<ST>::value
1977  , typename DVecScalarMultExprTrait<typename TSMatDVecMultExprTrait<MT,VT>::Type,ST>::Type
1978  , INVALID_TYPE >::Type Type;
1979  //**********************************************************************************************
1980 };
1982 //*************************************************************************************************
1983 
1984 
1985 
1986 
1987 //=================================================================================================
1988 //
1989 // TDVECSMATMULTEXPRTRAIT SPECIALIZATIONS
1990 //
1991 //=================================================================================================
1992 
1993 //*************************************************************************************************
1995 template< typename VT, typename MT, typename ST >
1996 struct TDVecSMatMultExprTrait< DVecScalarMultExpr<VT,ST,true>, MT >
1997 {
1998  public:
1999  //**********************************************************************************************
2000  typedef typename SelectType< IsDenseVector<VT>::value && IsTransposeVector<VT>::value &&
2001  IsSparseMatrix<MT>::value && IsRowMajorMatrix<MT>::value &&
2002  IsNumeric<ST>::value
2003  , typename TDVecScalarMultExprTrait<typename TDVecSMatMultExprTrait<VT,MT>::Type,ST>::Type
2004  , INVALID_TYPE >::Type Type;
2005  //**********************************************************************************************
2006 };
2008 //*************************************************************************************************
2009 
2010 
2011 
2012 
2013 //=================================================================================================
2014 //
2015 // TDVECTSMATMULTEXPRTRAIT SPECIALIZATIONS
2016 //
2017 //=================================================================================================
2018 
2019 //*************************************************************************************************
2021 template< typename VT, typename MT, typename ST >
2022 struct TDVecTSMatMultExprTrait< DVecScalarMultExpr<VT,ST,true>, MT >
2023 {
2024  public:
2025  //**********************************************************************************************
2026  typedef typename SelectType< IsDenseVector<VT>::value && IsTransposeVector<VT>::value &&
2027  IsSparseMatrix<MT>::value && IsColumnMajorMatrix<MT>::value &&
2028  IsNumeric<ST>::value
2029  , typename TDVecScalarMultExprTrait<typename TDVecTSMatMultExprTrait<VT,MT>::Type,ST>::Type
2030  , INVALID_TYPE >::Type Type;
2031  //**********************************************************************************************
2032 };
2034 //*************************************************************************************************
2035 
2036 } // namespace blaze
2037 
2038 #endif