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>
56 #include <blaze/util/Assert.h>
60 #include <blaze/util/EnableIf.h>
61 #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 
159  enum { canAlias = CanAlias<VT>::value };
160  //**********************************************************************************************
161 
162  //**Constructor*********************************************************************************
168  explicit inline DVecScalarMultExpr( const VT& vector, ST scalar )
169  : vector_( vector ) // Left-hand side dense vector of the multiplication expression
170  , scalar_( scalar ) // Right-hand side scalar of the multiplication expression
171  {}
172  //**********************************************************************************************
173 
174  //**Subscript operator**************************************************************************
180  inline ReturnType operator[]( size_t index ) const {
181  BLAZE_INTERNAL_ASSERT( index < vector_.size(), "Invalid vector access index" );
182  return vector_[index] * scalar_;
183  }
184  //**********************************************************************************************
185 
186  //**Get function********************************************************************************
192  inline IntrinsicType get( size_t index ) const {
193  typedef IntrinsicTrait<ElementType> IT;
194  BLAZE_INTERNAL_ASSERT( index < vector_.size() , "Invalid vector access index" );
195  BLAZE_INTERNAL_ASSERT( index % IT::size == 0UL, "Invalid vector access index" );
196  const IntrinsicType xmm1( vector_.get( index ) );
197  const IntrinsicType xmm2( set( scalar_ ) );
198  return xmm1 * xmm2;
199  }
200  //**********************************************************************************************
201 
202  //**Size function*******************************************************************************
207  inline size_t size() const {
208  return vector_.size();
209  }
210  //**********************************************************************************************
211 
212  //**Left operand access*************************************************************************
217  inline LeftOperand leftOperand() const {
218  return vector_;
219  }
220  //**********************************************************************************************
221 
222  //**Right operand access************************************************************************
227  inline RightOperand rightOperand() const {
228  return scalar_;
229  }
230  //**********************************************************************************************
231 
232  //**********************************************************************************************
238  template< typename T >
239  inline bool isAliased( const T* alias ) const {
240  return CanAlias<VT>::value && vector_.isAliased( alias );
241  }
242  //**********************************************************************************************
243 
244  private:
245  //**Member variables****************************************************************************
248  //**********************************************************************************************
249 
250  //**Assignment to dense vectors*****************************************************************
264  template< typename VT2 > // Type of the target dense vector
265  friend inline typename EnableIf< UseAssign<VT2> >::Type
266  assign( DenseVector<VT2,TF>& lhs, const DVecScalarMultExpr& rhs )
267  {
268  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
269 
270  assign( ~lhs, rhs.vector_ );
271 
272  const size_t size( rhs.size() );
273  for( size_t i=0UL; i<size; ++i )
274  (~lhs)[i] *= rhs.scalar_;
275  }
277  //**********************************************************************************************
278 
279  //**Assignment to sparse vectors****************************************************************
293  template< typename VT2 > // Type of the target sparse vector
294  friend inline typename EnableIf< UseAssign<VT2> >::Type
296  {
297  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
298 
299  assign( ~lhs, rhs.vector_ );
300 
301  typename VT2::Iterator begin( (~lhs).begin() );
302  const typename VT2::Iterator end( (~lhs).end() );
303 
304  for( ; begin!=end; ++begin )
305  begin->value() *= rhs.scalar_;
306  }
308  //**********************************************************************************************
309 
310  //**Addition assignment to dense vectors********************************************************
324  template< typename VT2 > // Type of the target dense vector
325  friend inline typename EnableIf< UseAssign<VT2> >::Type
326  addAssign( DenseVector<VT2,TF>& lhs, const DVecScalarMultExpr& rhs )
327  {
330  BLAZE_CONSTRAINT_MUST_BE_REFERENCE_TYPE( typename ResultType::CompositeType );
331 
332  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
333 
334  const ResultType tmp( rhs );
335  addAssign( ~lhs, tmp );
336  }
338  //**********************************************************************************************
339 
340  //**Addition assignment to sparse vectors*******************************************************
341  // No special implementation for the addition assignment to sparse vectors.
342  //**********************************************************************************************
343 
344  //**Subtraction assignment to dense vectors*****************************************************
358  template< typename VT2 > // Type of the target dense vector
359  friend inline typename EnableIf< UseAssign<VT2> >::Type
360  subAssign( DenseVector<VT2,TF>& lhs, const DVecScalarMultExpr& rhs )
361  {
364  BLAZE_CONSTRAINT_MUST_BE_REFERENCE_TYPE( typename ResultType::CompositeType );
365 
366  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
367 
368  const ResultType tmp( rhs );
369  subAssign( ~lhs, tmp );
370  }
372  //**********************************************************************************************
373 
374  //**Subtraction assignment to sparse vectors****************************************************
375  // No special implementation for the subtraction assignment to sparse vectors.
376  //**********************************************************************************************
377 
378  //**Multiplication assignment to dense vectors**************************************************
392  template< typename VT2 > // Type of the target dense vector
393  friend inline typename EnableIf< UseAssign<VT2> >::Type
394  multAssign( DenseVector<VT2,TF>& lhs, const DVecScalarMultExpr& rhs )
395  {
398  BLAZE_CONSTRAINT_MUST_BE_REFERENCE_TYPE( typename ResultType::CompositeType );
399 
400  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
401 
402  const ResultType tmp( rhs );
403  multAssign( ~lhs, tmp );
404  }
406  //**********************************************************************************************
407 
408  //**Multiplication assignment to sparse vectors*************************************************
409  // No special implementation for the multiplication assignment to sparse vectors.
410  //**********************************************************************************************
411 
412  //**Compile time checks*************************************************************************
419  //**********************************************************************************************
420 };
421 //*************************************************************************************************
422 
423 
424 
425 
426 //=================================================================================================
427 //
428 // GLOBAL UNARY ARITHMETIC OPERATORS
429 //
430 //=================================================================================================
431 
432 //*************************************************************************************************
449 template< typename VT // Type of the dense vector
450  , bool TF > // Transpose flag
451 inline const DVecScalarMultExpr<VT,typename BaseElementType<VT>::Type,TF>
453 {
454  typedef typename BaseElementType<VT>::Type ElementType;
455  return DVecScalarMultExpr<VT,ElementType,TF>( ~dv, ElementType(-1) );
456 }
457 //*************************************************************************************************
458 
459 
460 
461 
462 //=================================================================================================
463 //
464 // GLOBAL BINARY ARITHMETIC OPERATORS
465 //
466 //=================================================================================================
467 
468 //*************************************************************************************************
490 template< typename T1 // Type of the left-hand side dense vector
491  , typename T2 // Type of the right-hand side scalar
492  , bool TF > // Transpose flag
493 inline const typename EnableIf< IsNumeric<T2>, typename MultExprTrait<T1,T2>::Type >::Type
494  operator*( const DenseVector<T1,TF>& vec, T2 scalar )
495 {
496  typedef typename MultExprTrait<T1,T2>::Type Type;
497  return Type( ~vec, scalar );
498 }
499 //*************************************************************************************************
500 
501 
502 //*************************************************************************************************
524 template< typename T1 // Type of the left-hand side scalar
525  , typename T2 // Type of the right-hand side dense vector
526  , bool TF > // Transpose flag
527 inline const typename EnableIf< IsNumeric<T1>, typename MultExprTrait<T1,T2>::Type >::Type
528  operator*( T1 scalar, const DenseVector<T2,TF>& vec )
529 {
530  typedef typename MultExprTrait<T1,T2>::Type Type;
531  return Type( ~vec, scalar );
532 }
533 //*************************************************************************************************
534 
535 
536 
537 
538 //=================================================================================================
539 //
540 // GLOBAL RESTRUCTURING UNARY ARITHMETIC OPERATORS
541 //
542 //=================================================================================================
543 
544 //*************************************************************************************************
556 template< typename VT // Type of the dense vector
557  , typename ST // Type of the scalar
558  , bool TF > // Transpose flag
559 inline const DVecScalarMultExpr<VT,ST,TF>
560  operator-( const DVecScalarMultExpr<VT,ST,TF>& dv )
561 {
562  return DVecScalarMultExpr<VT,ST,TF>( dv.leftOperand(), -dv.rightOperand() );
563 }
565 //*************************************************************************************************
566 
567 
568 
569 
570 //=================================================================================================
571 //
572 // GLOBAL RESTRUCTURING BINARY ARITHMETIC OPERATORS
573 //
574 //=================================================================================================
575 
576 //*************************************************************************************************
589 template< typename VT // Type of the dense vector of the left-hand side expression
590  , typename ST1 // Type of the scalar of the left-hand side expression
591  , bool TF // Transpose flag of the dense vector
592  , typename ST2 > // Type of the right-hand side scalar
593 inline const typename EnableIf< IsNumeric<ST2>
594  , typename MultExprTrait< DVecScalarMultExpr<VT,ST1,TF>, ST2 >::Type >::Type
595  operator*( const DVecScalarMultExpr<VT,ST1,TF>& vec, ST2 scalar )
596 {
597  return vec.leftOperand() * ( vec.rightOperand() * scalar );
598 }
600 //*************************************************************************************************
601 
602 
603 //*************************************************************************************************
616 template< typename ST1 // Type of the left-hand side scalar
617  , typename VT // Type of the dense vector of the right-hand side expression
618  , typename ST2 // Type of the scalar of the right-hand side expression
619  , bool TF > // Transpose flag of the dense vector
620 inline const typename EnableIf< IsNumeric<ST1>
621  , typename MultExprTrait< ST1, DVecScalarMultExpr<VT,ST2,TF> >::Type >::Type
622  operator*( ST1 scalar, const DVecScalarMultExpr<VT,ST2,TF>& vec )
623 {
624  return vec.leftOperand() * ( scalar * vec.rightOperand() );
625 }
627 //*************************************************************************************************
628 
629 
630 //*************************************************************************************************
643 template< typename VT // Type of the dense vector of the left-hand side expression
644  , typename ST1 // Type of the scalar of the left-hand side expression
645  , bool TF // Transpose flag of the dense vector
646  , typename ST2 > // Type of the right-hand side scalar
647 inline const typename EnableIf< IsFloatingPoint<typename DivTrait<ST1,ST2>::Type>
648  , typename DivExprTrait< DVecScalarMultExpr<VT,ST1,TF>, ST2 >::Type >::Type
649  operator/( const DVecScalarMultExpr<VT,ST1,TF>& vec, ST2 scalar )
650 {
651  return vec.leftOperand() * ( vec.rightOperand() / scalar );
652 }
654 //*************************************************************************************************
655 
656 
657 //*************************************************************************************************
671 template< typename VT1 // Type of the dense vector of the left-hand side expression
672  , typename ST // Type of the scalar of the left-hand side expression
673  , bool TF // Transpose flag of the dense vectors
674  , typename VT2 > // Type of the right-hand side dense vector
675 inline const typename MultExprTrait< DVecScalarMultExpr<VT1,ST,TF>, VT2 >::Type
676  operator*( const DVecScalarMultExpr<VT1,ST,TF>& lhs, const DenseVector<VT2,TF>& rhs )
677 {
678  return ( lhs.leftOperand() * (~rhs) ) * lhs.rightOperand();
679 }
681 //*************************************************************************************************
682 
683 
684 //*************************************************************************************************
698 template< typename VT1 // Type of the left-hand side dense vector
699  , bool TF // Transpose flag of the dense vectors
700  , typename VT2 // Type of the dense vector of the right-hand side expression
701  , typename ST > // Type of the scalar of the right-hand side expression
702 inline const typename MultExprTrait< VT1, DVecScalarMultExpr<VT2,ST,TF> >::Type
703  operator*( const DenseVector<VT1,TF>& lhs, const DVecScalarMultExpr<VT2,ST,TF>& rhs )
704 {
705  return ( (~lhs) * rhs.leftOperand() ) * rhs.rightOperand();
706 }
708 //*************************************************************************************************
709 
710 
711 //*************************************************************************************************
725 template< typename VT1 // Type of the dense vector of the left-hand side expression
726  , typename ST1 // Type of the scalar of the left-hand side expression
727  , bool TF // Transpose flag of the dense vectors
728  , typename VT2 // Type of the dense vector of the right-hand side expression
729  , typename ST2 > // Type of the scalar of the right-hand side expression
730 inline const typename MultExprTrait< DVecScalarMultExpr<VT1,ST1,TF>, DVecScalarMultExpr<VT2,ST2,TF> >::Type
731  operator*( const DVecScalarMultExpr<VT1,ST1,TF>& lhs, const DVecScalarMultExpr<VT2,ST2,TF>& rhs )
732 {
733  return ( lhs.leftOperand() * rhs.leftOperand() ) * ( lhs.rightOperand() * rhs.rightOperand() );
734 }
736 //*************************************************************************************************
737 
738 
739 //*************************************************************************************************
753 template< typename VT1 // Type of the dense vector of the left-hand side expression
754  , typename ST // Type of the scalar of the left-hand side expression
755  , typename VT2 > // Type of the right-hand side dense vector
756 inline const typename MultExprTrait< DVecScalarMultExpr<VT1,ST,false>, VT2 >::Type
757  operator*( const DVecScalarMultExpr<VT1,ST,false>& lhs, const DenseVector<VT2,true>& rhs )
758 {
759  return ( lhs.leftOperand() * (~rhs) ) * lhs.rightOperand();
760 }
762 //*************************************************************************************************
763 
764 
765 //*************************************************************************************************
779 template< typename VT1 // Type of the left-hand side dense vector
780  , typename VT2 // Type of the dense vector of the right-hand side expression
781  , typename ST > // Type of the scalar of the right-hand side expression
782 inline const typename MultExprTrait< VT1, DVecScalarMultExpr<VT2,ST,true> >::Type
783  operator*( const DenseVector<VT1,false>& lhs, const DVecScalarMultExpr<VT2,ST,true>& rhs )
784 {
785  return ( (~lhs) * rhs.leftOperand() ) * rhs.rightOperand();
786 }
788 //*************************************************************************************************
789 
790 
791 //*************************************************************************************************
805 template< typename VT1 // Type of the dense vector of the left-hand side expression
806  , typename ST1 // Type of the scalar of the left-hand side expression
807  , typename VT2 // Type of the dense vector of the right-hand side expression
808  , typename ST2 > // Type of the scalar of the right-hand side expression
809 inline const typename MultExprTrait< DVecScalarMultExpr<VT1,ST1,false>, DVecScalarMultExpr<VT2,ST2,true> >::Type
810  operator*( const DVecScalarMultExpr<VT1,ST1,false>& lhs, const DVecScalarMultExpr<VT2,ST2,true>& rhs )
811 {
812  return ( lhs.leftOperand() * rhs.leftOperand() ) * ( lhs.rightOperand() * rhs.rightOperand() );
813 }
815 //*************************************************************************************************
816 
817 
818 //*************************************************************************************************
832 template< typename VT1 // Type of the dense vector of the left-hand side expression
833  , typename ST // Type of the scalar of the left-hand side expression
834  , bool TF // Transpose flag of the vectors
835  , typename VT2 > // Type of the right-hand side sparse vector
836 inline const typename MultExprTrait< DVecScalarMultExpr<VT1,ST,TF>, VT2 >::Type
837  operator*( const DVecScalarMultExpr<VT1,ST,TF>& lhs, const SparseVector<VT2,TF>& rhs )
838 {
839  return ( lhs.leftOperand() * (~rhs) ) * lhs.rightOperand();
840 }
842 //*************************************************************************************************
843 
844 
845 //*************************************************************************************************
859 template< typename VT1 // Type of the left-hand side sparse vector
860  , bool TF // Transpose flag of the vectors
861  , typename VT2 // Type of the dense vector of the right-hand side expression
862  , typename ST > // Type of the scalar of the right-hand side expression
863 inline const typename MultExprTrait< VT1, DVecScalarMultExpr<VT2,ST,TF> >::Type
864  operator*( const SparseVector<VT1,TF>& lhs, const DVecScalarMultExpr<VT2,ST,TF>& rhs )
865 {
866  return ( (~lhs) * rhs.leftOperand() ) * rhs.rightOperand();
867 }
869 //*************************************************************************************************
870 
871 
872 //*************************************************************************************************
887 template< typename VT1 // Type of the dense vector of the left-hand side expression
888  , typename ST1 // Type of the scalar of the left-hand side expression
889  , bool TF // Transpose flag of the vectors
890  , typename VT2 // Type of the sparse vector of the right-hand side expression
891  , typename ST2 > // Type of the scalar o the right-hand side expression
892 inline const typename MultExprTrait< DVecScalarMultExpr<VT1,ST1,TF>, SVecScalarMultExpr<VT2,ST2,TF> >::Type
893  operator*( const DVecScalarMultExpr<VT1,ST1,TF>& lhs, const SVecScalarMultExpr<VT2,ST2,TF>& rhs )
894 {
895  return ( lhs.leftOperand() * rhs.leftOperand() ) * ( lhs.rightOperand() * rhs.rightOperand() );
896 }
898 //*************************************************************************************************
899 
900 
901 //*************************************************************************************************
916 template< typename VT1 // Type of the sparse vector of the left-hand side expression
917  , typename ST1 // Type of the scalar of the left-hand side expression
918  , bool TF // Transpose flag of the vectors
919  , typename VT2 // Type of the dense vector of the right-hand side expression
920  , typename ST2 > // Type of the scalar o the right-hand side expression
921 inline const typename MultExprTrait< SVecScalarMultExpr<VT1,ST1,TF>, DVecScalarMultExpr<VT2,ST2,TF> >::Type
922  operator*( const SVecScalarMultExpr<VT1,ST1,TF>& lhs, const DVecScalarMultExpr<VT2,ST2,TF>& rhs )
923 {
924  return ( lhs.leftOperand() * rhs.leftOperand() ) * ( lhs.rightOperand() * rhs.rightOperand() );
925 }
927 //*************************************************************************************************
928 
929 
930 //*************************************************************************************************
944 template< typename VT1 // Type of the dense vector of the left-hand side expression
945  , typename ST // Type of the scalar of the left-hand side expression
946  , typename VT2 > // Type of the right-hand side sparse vector
947 inline const typename MultExprTrait< DVecScalarMultExpr<VT1,ST,false>, VT2 >::Type
948  operator*( const DVecScalarMultExpr<VT1,ST,false>& lhs, const SparseVector<VT2,true>& rhs )
949 {
950  return ( lhs.leftOperand() * (~rhs) ) * lhs.rightOperand();
951 }
953 //*************************************************************************************************
954 
955 
956 //*************************************************************************************************
970 template< typename VT1 // Type of the left-hand side sparse vector
971  , typename VT2 // Type of the dense vector of the right-hand side expression
972  , typename ST > // Type of the scalar of the right-hand side expression
973 inline const typename MultExprTrait< VT1, DVecScalarMultExpr<VT2,ST,true> >::Type
974  operator*( const SparseVector<VT1,false>& lhs, const DVecScalarMultExpr<VT2,ST,true>& rhs )
975 {
976  return ( (~lhs) * rhs.leftOperand() ) * rhs.rightOperand();
977 }
979 //*************************************************************************************************
980 
981 
982 //*************************************************************************************************
997 template< typename VT1 // Type of the dense vector of the left-hand side expression
998  , typename ST1 // Type of the scalar of the left-hand side expression
999  , typename VT2 // Type of the sparse vector of the right-hand side expression
1000  , typename ST2 > // Type of the scalar o the right-hand side expression
1001 inline const typename MultExprTrait< DVecScalarMultExpr<VT1,ST1,false>, SVecScalarMultExpr<VT2,ST2,true> >::Type
1002  operator*( const DVecScalarMultExpr<VT1,ST1,false>& lhs, const SVecScalarMultExpr<VT2,ST2,true>& rhs )
1003 {
1004  return ( lhs.leftOperand() * rhs.leftOperand() ) * ( lhs.rightOperand() * rhs.rightOperand() );
1005 }
1007 //*************************************************************************************************
1008 
1009 
1010 //*************************************************************************************************
1025 template< typename VT1 // Type of the sparse vector of the left-hand side expression
1026  , typename ST1 // Type of the scalar of the left-hand side expression
1027  , typename VT2 // Type of the dense vector of the right-hand side expression
1028  , typename ST2 > // Type of the scalar o the right-hand side expression
1029 inline const typename MultExprTrait< SVecScalarMultExpr<VT1,ST1,false>, DVecScalarMultExpr<VT2,ST2,true> >::Type
1030  operator*( const SVecScalarMultExpr<VT1,ST1,false>& lhs, const DVecScalarMultExpr<VT2,ST2,true>& rhs )
1031 {
1032  return ( lhs.leftOperand() * rhs.leftOperand() ) * ( lhs.rightOperand() * rhs.rightOperand() );
1033 }
1035 //*************************************************************************************************
1036 
1037 
1038 //*************************************************************************************************
1052 template< typename MT // Type of the left-hand side dense matrix
1053  , bool SO // Storage order of the left-hand side dense matrix
1054  , typename VT // Type of the dense vector of the right-hand side expression
1055  , typename ST > // Type of the scalar of the right-hand side expression
1056 inline const typename MultExprTrait< MT, DVecScalarMultExpr<VT,ST,false> >::Type
1057  operator*( const DenseMatrix<MT,SO>& mat, const DVecScalarMultExpr<VT,ST,false>& vec )
1058 {
1059  return ( (~mat) * vec.leftOperand() ) * vec.rightOperand();
1060 }
1062 //*************************************************************************************************
1063 
1064 
1065 //*************************************************************************************************
1079 template< typename VT // Type of the dense vector of the left-hand side expression
1080  , typename ST // Type of the scalar of the left-hand side expression
1081  , typename MT // Type of the right-hand side dense matrix
1082  , bool SO > // Storage order of the right-hand side dense matrix
1083 inline const typename MultExprTrait< DVecScalarMultExpr<VT,ST,true>, MT >::Type
1084  operator*( const DVecScalarMultExpr<VT,ST,true>& vec, const DenseMatrix<MT,SO>& mat )
1085 {
1086  return ( vec.leftOperand() * (~mat) ) * vec.rightOperand();
1087 }
1089 //*************************************************************************************************
1090 
1091 
1092 //*************************************************************************************************
1106 template< typename MT // Type of the left-hand side sparse matrix
1107  , bool SO // Storage order of the left-hand side sparse matrix
1108  , typename VT // Type of the dense vector of the right-hand side expression
1109  , typename ST > // Type of the scalar of the right-hand side expression
1110 inline const typename MultExprTrait< MT, DVecScalarMultExpr<VT,ST,false> >::Type
1111  operator*( const SparseMatrix<MT,SO>& mat, const DVecScalarMultExpr<VT,ST,false>& vec )
1112 {
1113  return ( (~mat) * vec.leftOperand() ) * vec.rightOperand();
1114 }
1116 //*************************************************************************************************
1117 
1118 
1119 //*************************************************************************************************
1133 template< typename VT // Type of the dense vector of the left-hand side expression
1134  , typename ST // Type of the scalar of the left-hand side expression
1135  , typename MT // Type of the right-hand side sparse matrix
1136  , bool SO > // Storage order of the right-hand side sparse matrix
1137 inline const typename MultExprTrait< DVecScalarMultExpr<VT,ST,true>, MT >::Type
1138  operator*( const DVecScalarMultExpr<VT,ST,true>& vec, const SparseMatrix<MT,SO>& mat )
1139 {
1140  return ( vec.leftOperand() * (~mat) ) * vec.rightOperand();
1141 }
1143 //*************************************************************************************************
1144 
1145 
1146 
1147 
1148 //=================================================================================================
1149 //
1150 // DVECSCALARMULTEXPRTRAIT SPECIALIZATIONS
1151 //
1152 //=================================================================================================
1153 
1154 //*************************************************************************************************
1156 template< typename VT, typename ST1, typename ST2 >
1157 struct DVecScalarMultExprTrait< DVecScalarMultExpr<VT,ST1,false>, ST2 >
1158 {
1159  public:
1160  //**********************************************************************************************
1161  typedef typename SelectType< IsDenseVector<VT>::value && !IsTransposeVector<VT>::value &&
1162  IsNumeric<ST1>::value && IsNumeric<ST2>::value
1163  , typename DVecScalarMultExprTrait<VT,typename MultTrait<ST1,ST2>::Type>::Type
1164  , INVALID_TYPE >::Type Type;
1165  //**********************************************************************************************
1166 };
1168 //*************************************************************************************************
1169 
1170 
1171 
1172 
1173 //=================================================================================================
1174 //
1175 // TDVECSCALARMULTEXPRTRAIT SPECIALIZATIONS
1176 //
1177 //=================================================================================================
1178 
1179 //*************************************************************************************************
1181 template< typename VT, typename ST1, typename ST2 >
1182 struct TDVecScalarMultExprTrait< DVecScalarMultExpr<VT,ST1,true>, ST2 >
1183 {
1184  public:
1185  //**********************************************************************************************
1186  typedef typename SelectType< IsDenseVector<VT>::value && IsTransposeVector<VT>::value &&
1187  IsNumeric<ST1>::value && IsNumeric<ST2>::value
1188  , typename TDVecScalarMultExprTrait<VT,typename MultTrait<ST1,ST2>::Type>::Type
1189  , INVALID_TYPE >::Type Type;
1190  //**********************************************************************************************
1191 };
1193 //*************************************************************************************************
1194 
1195 
1196 
1197 
1198 //=================================================================================================
1199 //
1200 // DVECSCALARDIVEXPRTRAIT SPECIALIZATIONS
1201 //
1202 //=================================================================================================
1203 
1204 //*************************************************************************************************
1206 template< typename VT, typename ST1, typename ST2 >
1207 struct DVecScalarDivExprTrait< DVecScalarMultExpr<VT,ST1,false>, ST2 >
1208 {
1209  private:
1210  //**********************************************************************************************
1211  enum { condition = IsFloatingPoint<typename DivTrait<ST1,ST2>::Type>::value };
1212  //**********************************************************************************************
1213 
1214  //**********************************************************************************************
1215  typedef typename DVecScalarMultExprTrait<VT,typename DivTrait<ST1,ST2>::Type>::Type T1;
1216  typedef typename DVecScalarDivExprTrait<VT,typename DivTrait<ST1,ST2>::Type>::Type T2;
1217  //**********************************************************************************************
1218 
1219  public:
1220  //**********************************************************************************************
1221  typedef typename SelectType< IsDenseVector<VT>::value && !IsTransposeVector<VT>::value &&
1222  IsNumeric<ST1>::value && IsNumeric<ST2>::value
1223  , typename SelectType<condition,T1,T2>::Type
1224  , INVALID_TYPE >::Type Type;
1225  //**********************************************************************************************
1226 };
1228 //*************************************************************************************************
1229 
1230 
1231 
1232 
1233 //=================================================================================================
1234 //
1235 // TDVECSCALARDIVEXPRTRAIT SPECIALIZATIONS
1236 //
1237 //=================================================================================================
1238 
1239 //*************************************************************************************************
1241 template< typename VT, typename ST1, typename ST2 >
1242 struct TDVecScalarDivExprTrait< DVecScalarMultExpr<VT,ST1,true>, ST2 >
1243 {
1244  private:
1245  //**********************************************************************************************
1246  enum { condition = IsFloatingPoint<typename DivTrait<ST1,ST2>::Type>::value };
1247  //**********************************************************************************************
1248 
1249  //**********************************************************************************************
1250  typedef typename TDVecScalarMultExprTrait<VT,typename DivTrait<ST1,ST2>::Type>::Type T1;
1251  typedef typename TDVecScalarDivExprTrait<VT,typename DivTrait<ST1,ST2>::Type>::Type T2;
1252  //**********************************************************************************************
1253 
1254  public:
1255  //**********************************************************************************************
1256  typedef typename SelectType< IsDenseVector<VT>::value && IsTransposeVector<VT>::value &&
1257  IsNumeric<ST1>::value && IsNumeric<ST2>::value
1258  , typename SelectType<condition,T1,T2>::Type
1259  , INVALID_TYPE >::Type Type;
1260  //**********************************************************************************************
1261 };
1263 //*************************************************************************************************
1264 
1265 
1266 
1267 
1268 //=================================================================================================
1269 //
1270 // DVECDVECMULTEXPRTRAIT SPECIALIZATIONS
1271 //
1272 //=================================================================================================
1273 
1274 //*************************************************************************************************
1276 template< typename VT1, typename ST, typename VT2 >
1277 struct DVecDVecMultExprTrait< DVecScalarMultExpr<VT1,ST,false>, VT2 >
1278 {
1279  public:
1280  //**********************************************************************************************
1281  typedef typename SelectType< IsDenseVector<VT1>::value && !IsTransposeVector<VT1>::value &&
1282  IsDenseVector<VT2>::value && !IsTransposeVector<VT2>::value &&
1283  IsNumeric<ST>::value
1284  , typename DVecScalarMultExprTrait<typename DVecDVecMultExprTrait<VT1,VT2>::Type,ST>::Type
1285  , INVALID_TYPE >::Type Type;
1286  //**********************************************************************************************
1287 };
1289 //*************************************************************************************************
1290 
1291 
1292 //*************************************************************************************************
1294 template< typename VT1, typename VT2, typename ST >
1295 struct DVecDVecMultExprTrait< VT1, DVecScalarMultExpr<VT2,ST,false> >
1296 {
1297  public:
1298  //**********************************************************************************************
1299  typedef typename SelectType< IsDenseVector<VT1>::value && !IsTransposeVector<VT1>::value &&
1300  IsDenseVector<VT2>::value && !IsTransposeVector<VT2>::value &&
1301  IsNumeric<ST>::value
1302  , typename DVecScalarMultExprTrait<typename DVecDVecMultExprTrait<VT1,VT2>::Type,ST>::Type
1303  , INVALID_TYPE >::Type Type;
1304  //**********************************************************************************************
1305 };
1307 //*************************************************************************************************
1308 
1309 
1310 //*************************************************************************************************
1312 template< typename VT1, typename ST1, typename VT2, typename ST2 >
1313 struct DVecDVecMultExprTrait< DVecScalarMultExpr<VT1,ST1,false>, DVecScalarMultExpr<VT2,ST2,false> >
1314 {
1315  public:
1316  //**********************************************************************************************
1317  typedef typename SelectType< IsDenseVector<VT1>::value && !IsTransposeVector<VT1>::value &&
1318  IsDenseVector<VT2>::value && !IsTransposeVector<VT2>::value &&
1319  IsNumeric<ST1>::value && IsNumeric<ST2>::value
1320  , typename DVecScalarMultExprTrait<typename DVecDVecMultExprTrait<VT1,VT2>::Type,typename MultTrait<ST1,ST2>::Type>::Type
1321  , INVALID_TYPE >::Type Type;
1322  //**********************************************************************************************
1323 };
1325 //*************************************************************************************************
1326 
1327 
1328 
1329 
1330 //=================================================================================================
1331 //
1332 // DVECTDVECMULTEXPRTRAIT SPECIALIZATIONS
1333 //
1334 //=================================================================================================
1335 
1336 //*************************************************************************************************
1338 template< typename VT1, typename ST, typename VT2 >
1339 struct DVecTDVecMultExprTrait< DVecScalarMultExpr<VT1,ST,false>, VT2 >
1340 {
1341  public:
1342  //**********************************************************************************************
1343  typedef typename SelectType< IsDenseVector<VT1>::value && !IsTransposeVector<VT1>::value &&
1344  IsDenseVector<VT2>::value && IsTransposeVector<VT2>::value &&
1345  IsNumeric<ST>::value
1346  , typename DMatScalarMultExprTrait<typename DVecTDVecMultExprTrait<VT1,VT2>::Type,ST>::Type
1347  , INVALID_TYPE >::Type Type;
1348  //**********************************************************************************************
1349 };
1351 //*************************************************************************************************
1352 
1353 
1354 //*************************************************************************************************
1356 template< typename VT1, typename VT2, typename ST >
1357 struct DVecTDVecMultExprTrait< VT1, DVecScalarMultExpr<VT2,ST,true> >
1358 {
1359  public:
1360  //**********************************************************************************************
1361  typedef typename SelectType< IsDenseVector<VT1>::value && !IsTransposeVector<VT1>::value &&
1362  IsDenseVector<VT2>::value && IsTransposeVector<VT2>::value &&
1363  IsNumeric<ST>::value
1364  , typename DMatScalarMultExprTrait<typename DVecTDVecMultExprTrait<VT1,VT2>::Type,ST>::Type
1365  , INVALID_TYPE >::Type Type;
1366  //**********************************************************************************************
1367 };
1369 //*************************************************************************************************
1370 
1371 
1372 //*************************************************************************************************
1374 template< typename VT1, typename ST1, typename VT2, typename ST2 >
1375 struct DVecTDVecMultExprTrait< DVecScalarMultExpr<VT1,ST1,false>, DVecScalarMultExpr<VT2,ST2,true> >
1376 {
1377  public:
1378  //**********************************************************************************************
1379  typedef typename SelectType< IsDenseVector<VT1>::value && !IsTransposeVector<VT1>::value &&
1380  IsDenseVector<VT2>::value && IsTransposeVector<VT2>::value &&
1381  IsNumeric<ST1>::value && IsNumeric<ST2>::value
1382  , typename DMatScalarMultExprTrait<typename DVecTDVecMultExprTrait<VT1,VT2>::Type,typename MultTrait<ST1,ST2>::Type>::Type
1383  , INVALID_TYPE >::Type Type;
1384  //**********************************************************************************************
1385 };
1387 //*************************************************************************************************
1388 
1389 
1390 
1391 
1392 //=================================================================================================
1393 //
1394 // TDVECTDVECMULTEXPRTRAIT SPECIALIZATIONS
1395 //
1396 //=================================================================================================
1397 
1398 //*************************************************************************************************
1400 template< typename VT1, typename ST, typename VT2 >
1401 struct TDVecTDVecMultExprTrait< DVecScalarMultExpr<VT1,ST,true>, VT2 >
1402 {
1403  public:
1404  //**********************************************************************************************
1405  typedef typename SelectType< IsDenseVector<VT1>::value && IsTransposeVector<VT1>::value &&
1406  IsDenseVector<VT2>::value && IsTransposeVector<VT2>::value &&
1407  IsNumeric<ST>::value
1408  , typename TDVecScalarMultExprTrait<typename TDVecTDVecMultExprTrait<VT1,VT2>::Type,ST>::Type
1409  , INVALID_TYPE >::Type Type;
1410  //**********************************************************************************************
1411 };
1413 //*************************************************************************************************
1414 
1415 
1416 //*************************************************************************************************
1418 template< typename VT1, typename VT2, typename ST >
1419 struct TDVecTDVecMultExprTrait< VT1, DVecScalarMultExpr<VT2,ST,true> >
1420 {
1421  public:
1422  //**********************************************************************************************
1423  typedef typename SelectType< IsDenseVector<VT1>::value && IsTransposeVector<VT1>::value &&
1424  IsDenseVector<VT2>::value && IsTransposeVector<VT2>::value &&
1425  IsNumeric<ST>::value
1426  , typename TDVecScalarMultExprTrait<typename TDVecTDVecMultExprTrait<VT1,VT2>::Type,ST>::Type
1427  , INVALID_TYPE >::Type Type;
1428  //**********************************************************************************************
1429 };
1431 //*************************************************************************************************
1432 
1433 
1434 //*************************************************************************************************
1436 template< typename VT1, typename ST1, typename VT2, typename ST2 >
1437 struct TDVecTDVecMultExprTrait< DVecScalarMultExpr<VT1,ST1,true>, DVecScalarMultExpr<VT2,ST2,true> >
1438 {
1439  public:
1440  //**********************************************************************************************
1441  typedef typename SelectType< IsDenseVector<VT1>::value && IsTransposeVector<VT1>::value &&
1442  IsDenseVector<VT2>::value && IsTransposeVector<VT2>::value &&
1443  IsNumeric<ST1>::value && IsNumeric<ST2>::value
1444  , typename TDVecScalarMultExprTrait<typename TDVecTDVecMultExprTrait<VT1,VT2>::Type,typename MultTrait<ST1,ST2>::Type>::Type
1445  , INVALID_TYPE >::Type Type;
1446  //**********************************************************************************************
1447 };
1449 //*************************************************************************************************
1450 
1451 
1452 
1453 
1454 //=================================================================================================
1455 //
1456 // DVECSVECMULTEXPRTRAIT SPECIALIZATIONS
1457 //
1458 //=================================================================================================
1459 
1460 //*************************************************************************************************
1462 template< typename VT1, typename VT2, typename ST >
1463 struct DVecSVecMultExprTrait< DVecScalarMultExpr<VT1,ST,false>, VT2 >
1464 {
1465  public:
1466  //**********************************************************************************************
1467  typedef typename SelectType< IsDenseVector<VT1>::value && !IsTransposeVector<VT1>::value &&
1468  IsSparseVector<VT2>::value && !IsTransposeVector<VT2>::value &&
1469  IsNumeric<ST>::value
1470  , typename SVecScalarMultExprTrait<typename DVecSVecMultExprTrait<VT1,VT2>::Type,ST>::Type
1471  , INVALID_TYPE >::Type Type;
1472  //**********************************************************************************************
1473 };
1475 //*************************************************************************************************
1476 
1477 
1478 //*************************************************************************************************
1480 template< typename VT1, typename ST1, typename VT2, typename ST2 >
1481 struct DVecSVecMultExprTrait< DVecScalarMultExpr<VT1,ST1,false>, SVecScalarMultExpr<VT2,ST2,false> >
1482 {
1483  public:
1484  //**********************************************************************************************
1485  typedef typename SelectType< IsDenseVector<VT1>::value && !IsTransposeVector<VT1>::value &&
1486  IsSparseVector<VT2>::value && !IsTransposeVector<VT2>::value &&
1487  IsNumeric<ST1>::value && IsNumeric<ST2>::value
1488  , typename SVecScalarMultExprTrait<typename DVecSVecMultExprTrait<VT1,VT2>::Type,typename MultTrait<ST1,ST2>::Type>::Type
1489  , INVALID_TYPE >::Type Type;
1490  //**********************************************************************************************
1491 };
1493 //*************************************************************************************************
1494 
1495 
1496 
1497 
1498 //=================================================================================================
1499 //
1500 // DVECTSVECMULTEXPRTRAIT SPECIALIZATIONS
1501 //
1502 //=================================================================================================
1503 
1504 //*************************************************************************************************
1506 template< typename VT1, typename ST, typename VT2 >
1507 struct DVecTSVecMultExprTrait< DVecScalarMultExpr<VT1,ST,false>, VT2 >
1508 {
1509  public:
1510  //**********************************************************************************************
1511  typedef typename SelectType< IsDenseVector<VT1>::value && !IsTransposeVector<VT1>::value &&
1512  IsSparseVector<VT2>::value && IsTransposeVector<VT2>::value &&
1513  IsNumeric<ST>::value
1514  , typename SMatScalarMultExprTrait<typename DVecTSVecMultExprTrait<VT1,VT2>::Type,ST>::Type
1515  , INVALID_TYPE >::Type Type;
1516  //**********************************************************************************************
1517 };
1519 //*************************************************************************************************
1520 
1521 
1522 //*************************************************************************************************
1524 template< typename VT1, typename ST1, typename VT2, typename ST2 >
1525 struct DVecTSVecMultExprTrait< DVecScalarMultExpr<VT1,ST1,false>, SVecScalarMultExpr<VT2,ST2,true> >
1526 {
1527  public:
1528  //**********************************************************************************************
1529  typedef typename SelectType< IsDenseVector<VT1>::value && !IsTransposeVector<VT1>::value &&
1530  IsSparseVector<VT2>::value && IsTransposeVector<VT2>::value &&
1531  IsNumeric<ST1>::value && IsNumeric<ST2>::value
1532  , typename SMatScalarMultExprTrait<typename DVecTSVecMultExprTrait<VT1,VT2>::Type,typename MultTrait<ST1,ST2>::Type>::Type
1533  , INVALID_TYPE >::Type Type;
1534  //**********************************************************************************************
1535 };
1537 //*************************************************************************************************
1538 
1539 
1540 
1541 
1542 //=================================================================================================
1543 //
1544 // TDVECTSVECMULTEXPRTRAIT SPECIALIZATIONS
1545 //
1546 //=================================================================================================
1547 
1548 //*************************************************************************************************
1550 template< typename VT1, typename ST, typename VT2 >
1551 struct TDVecTSVecMultExprTrait< DVecScalarMultExpr<VT1,ST,true>, VT2 >
1552 {
1553  public:
1554  //**********************************************************************************************
1555  typedef typename SelectType< IsDenseVector<VT1>::value && IsTransposeVector<VT1>::value &&
1556  IsSparseVector<VT2>::value && IsTransposeVector<VT2>::value &&
1557  IsNumeric<ST>::value
1558  , typename TSVecScalarMultExprTrait<typename TDVecTSVecMultExprTrait<VT1,VT2>::Type,ST>::Type
1559  , INVALID_TYPE >::Type Type;
1560  //**********************************************************************************************
1561 };
1563 //*************************************************************************************************
1564 
1565 
1566 //*************************************************************************************************
1568 template< typename VT1, typename ST1, typename VT2, typename ST2 >
1569 struct TDVecTSVecMultExprTrait< DVecScalarMultExpr<VT1,ST1,true>, SVecScalarMultExpr<VT2,ST2,true> >
1570 {
1571  public:
1572  //**********************************************************************************************
1573  typedef typename SelectType< IsDenseVector<VT1>::value && IsTransposeVector<VT1>::value &&
1574  IsSparseVector<VT2>::value && IsTransposeVector<VT2>::value &&
1575  IsNumeric<ST1>::value && IsNumeric<ST2>::value
1576  , typename TSVecScalarMultExprTrait<typename TDVecTSVecMultExprTrait<VT1,VT2>::Type,typename MultTrait<ST1,ST2>::Type>::Type
1577  , INVALID_TYPE >::Type Type;
1578  //**********************************************************************************************
1579 };
1581 //*************************************************************************************************
1582 
1583 
1584 
1585 
1586 //=================================================================================================
1587 //
1588 // SVECDVECMULTEXPRTRAIT SPECIALIZATIONS
1589 //
1590 //=================================================================================================
1591 
1592 //*************************************************************************************************
1594 template< typename VT1, typename VT2, typename ST >
1595 struct SVecDVecMultExprTrait< VT1, DVecScalarMultExpr<VT2,ST,false> >
1596 {
1597  public:
1598  //**********************************************************************************************
1599  typedef typename SelectType< IsSparseVector<VT1>::value && !IsTransposeVector<VT1>::value &&
1600  IsDenseVector<VT2>::value && !IsTransposeVector<VT2>::value &&
1601  IsNumeric<ST>::value
1602  , typename SVecScalarMultExprTrait<typename SVecDVecMultExprTrait<VT1,VT2>::Type,ST>::Type
1603  , INVALID_TYPE >::Type Type;
1604  //**********************************************************************************************
1605 };
1607 //*************************************************************************************************
1608 
1609 
1610 //*************************************************************************************************
1612 template< typename VT1, typename ST1, typename VT2, typename ST2 >
1613 struct SVecDVecMultExprTrait< SVecScalarMultExpr<VT1,ST1,false>, DVecScalarMultExpr<VT2,ST2,false> >
1614 {
1615  public:
1616  //**********************************************************************************************
1617  typedef typename SelectType< IsSparseVector<VT1>::value && !IsTransposeVector<VT1>::value &&
1618  IsDenseVector<VT2>::value && !IsTransposeVector<VT2>::value &&
1619  IsNumeric<ST1>::value && IsNumeric<ST2>::value
1620  , typename SVecScalarMultExprTrait<typename SVecDVecMultExprTrait<VT1,VT2>::Type,typename MultTrait<ST1,ST2>::Type>::Type
1621  , INVALID_TYPE >::Type Type;
1622  //**********************************************************************************************
1623 };
1625 //*************************************************************************************************
1626 
1627 
1628 
1629 
1630 //=================================================================================================
1631 //
1632 // SVECTDVECMULTEXPRTRAIT SPECIALIZATIONS
1633 //
1634 //=================================================================================================
1635 
1636 //*************************************************************************************************
1638 template< typename VT1, typename VT2, typename ST >
1639 struct SVecTDVecMultExprTrait< VT1, DVecScalarMultExpr<VT2,ST,true> >
1640 {
1641  public:
1642  //**********************************************************************************************
1643  typedef typename SelectType< IsSparseVector<VT1>::value && !IsTransposeVector<VT1>::value &&
1644  IsDenseVector<VT2>::value && IsTransposeVector<VT2>::value &&
1645  IsNumeric<ST>::value
1646  , typename TSMatScalarMultExprTrait<typename SVecTDVecMultExprTrait<VT1,VT2>::Type,ST>::Type
1647  , INVALID_TYPE >::Type Type;
1648  //**********************************************************************************************
1649 };
1651 //*************************************************************************************************
1652 
1653 
1654 //*************************************************************************************************
1656 template< typename VT1, typename ST1, typename VT2, typename ST2 >
1657 struct SVecTDVecMultExprTrait< SVecScalarMultExpr<VT1,ST1,false>, DVecScalarMultExpr<VT2,ST2,true> >
1658 {
1659  public:
1660  //**********************************************************************************************
1661  typedef typename SelectType< IsSparseVector<VT1>::value && !IsTransposeVector<VT1>::value &&
1662  IsDenseVector<VT2>::value && IsTransposeVector<VT2>::value &&
1663  IsNumeric<ST1>::value && IsNumeric<ST2>::value
1664  , typename TSMatScalarMultExprTrait<typename SVecTDVecMultExprTrait<VT1,VT2>::Type,typename MultTrait<ST1,ST2>::Type>::Type
1665  , INVALID_TYPE >::Type Type;
1666  //**********************************************************************************************
1667 };
1669 //*************************************************************************************************
1670 
1671 
1672 
1673 
1674 //=================================================================================================
1675 //
1676 // TSVECTDVECMULTEXPRTRAIT SPECIALIZATIONS
1677 //
1678 //=================================================================================================
1679 
1680 //*************************************************************************************************
1682 template< typename VT1, typename VT2, typename ST >
1683 struct TSVecTDVecMultExprTrait< VT1, DVecScalarMultExpr<VT2,ST,true> >
1684 {
1685  public:
1686  //**********************************************************************************************
1687  typedef typename SelectType< IsSparseVector<VT1>::value && IsTransposeVector<VT1>::value &&
1688  IsDenseVector<VT2>::value && IsTransposeVector<VT2>::value &&
1689  IsNumeric<ST>::value
1690  , typename TSVecScalarMultExprTrait<typename TSVecTDVecMultExprTrait<VT1,VT2>::Type,ST>::Type
1691  , INVALID_TYPE >::Type Type;
1692  //**********************************************************************************************
1693 };
1695 //*************************************************************************************************
1696 
1697 
1698 //*************************************************************************************************
1700 template< typename VT1, typename ST1, typename VT2, typename ST2 >
1701 struct TSVecTDVecMultExprTrait< SVecScalarMultExpr<VT1,ST1,true>, DVecScalarMultExpr<VT2,ST2,true> >
1702 {
1703  public:
1704  //**********************************************************************************************
1705  typedef typename SelectType< IsSparseVector<VT1>::value && IsTransposeVector<VT1>::value &&
1706  IsDenseVector<VT2>::value && IsTransposeVector<VT2>::value &&
1707  IsNumeric<ST1>::value && IsNumeric<ST2>::value
1708  , typename TSVecScalarMultExprTrait<typename TSVecTDVecMultExprTrait<VT1,VT2>::Type,typename MultTrait<ST1,ST2>::Type>::Type
1709  , INVALID_TYPE >::Type Type;
1710  //**********************************************************************************************
1711 };
1713 //*************************************************************************************************
1714 
1715 
1716 
1717 
1718 //=================================================================================================
1719 //
1720 // DMATDVECMULTEXPRTRAIT SPECIALIZATIONS
1721 //
1722 //=================================================================================================
1723 
1724 //*************************************************************************************************
1726 template< typename MT, typename VT, typename ST >
1727 struct DMatDVecMultExprTrait< MT, DVecScalarMultExpr<VT,ST,false> >
1728 {
1729  public:
1730  //**********************************************************************************************
1731  typedef typename SelectType< IsDenseMatrix<MT>::value && IsRowMajorMatrix<MT>::value &&
1732  IsDenseVector<VT>::value && !IsTransposeVector<VT>::value &&
1733  IsNumeric<ST>::value
1734  , typename DVecScalarMultExprTrait<typename DMatDVecMultExprTrait<MT,VT>::Type,ST>::Type
1735  , INVALID_TYPE >::Type Type;
1736  //**********************************************************************************************
1737 };
1739 //*************************************************************************************************
1740 
1741 
1742 
1743 
1744 //=================================================================================================
1745 //
1746 // TDMATDVECMULTEXPRTRAIT SPECIALIZATIONS
1747 //
1748 //=================================================================================================
1749 
1750 //*************************************************************************************************
1752 template< typename MT, typename VT, typename ST >
1753 struct TDMatDVecMultExprTrait< MT, DVecScalarMultExpr<VT,ST,false> >
1754 {
1755  public:
1756  //**********************************************************************************************
1757  typedef typename SelectType< IsDenseMatrix<MT>::value && IsColumnMajorMatrix<MT>::value &&
1758  IsDenseVector<VT>::value && !IsTransposeVector<VT>::value &&
1759  IsNumeric<ST>::value
1760  , typename DVecScalarMultExprTrait<typename TDMatDVecMultExprTrait<MT,VT>::Type,ST>::Type
1761  , INVALID_TYPE >::Type Type;
1762  //**********************************************************************************************
1763 };
1765 //*************************************************************************************************
1766 
1767 
1768 
1769 
1770 //=================================================================================================
1771 //
1772 // TDVECDMATMULTEXPRTRAIT SPECIALIZATIONS
1773 //
1774 //=================================================================================================
1775 
1776 //*************************************************************************************************
1778 template< typename VT, typename MT, typename ST >
1779 struct TDVecDMatMultExprTrait< DVecScalarMultExpr<VT,ST,true>, MT >
1780 {
1781  public:
1782  //**********************************************************************************************
1783  typedef typename SelectType< IsDenseVector<VT>::value && IsTransposeVector<VT>::value &&
1784  IsDenseMatrix<MT>::value && IsRowMajorMatrix<MT>::value &&
1785  IsNumeric<ST>::value
1786  , typename TDVecScalarMultExprTrait<typename TDVecDMatMultExprTrait<VT,MT>::Type,ST>::Type
1787  , INVALID_TYPE >::Type Type;
1788  //**********************************************************************************************
1789 };
1791 //*************************************************************************************************
1792 
1793 
1794 
1795 
1796 //=================================================================================================
1797 //
1798 // TDVECTDMATMULTEXPRTRAIT SPECIALIZATIONS
1799 //
1800 //=================================================================================================
1801 
1802 //*************************************************************************************************
1804 template< typename VT, typename MT, typename ST >
1805 struct TDVecTDMatMultExprTrait< DVecScalarMultExpr<VT,ST,true>, MT >
1806 {
1807  public:
1808  //**********************************************************************************************
1809  typedef typename SelectType< IsDenseVector<VT>::value && IsTransposeVector<VT>::value &&
1810  IsDenseMatrix<MT>::value && IsColumnMajorMatrix<MT>::value &&
1811  IsNumeric<ST>::value
1812  , typename TDVecScalarMultExprTrait<typename TDVecTDMatMultExprTrait<VT,MT>::Type,ST>::Type
1813  , INVALID_TYPE >::Type Type;
1814  //**********************************************************************************************
1815 };
1817 //*************************************************************************************************
1818 
1819 
1820 
1821 
1822 //=================================================================================================
1823 //
1824 // SMATDVECMULTEXPRTRAIT SPECIALIZATIONS
1825 //
1826 //=================================================================================================
1827 
1828 //*************************************************************************************************
1830 template< typename MT, typename VT, typename ST >
1831 struct SMatDVecMultExprTrait< MT, DVecScalarMultExpr<VT,ST,false> >
1832 {
1833  public:
1834  //**********************************************************************************************
1835  typedef typename SelectType< IsSparseMatrix<MT>::value && IsRowMajorMatrix<MT>::value &&
1836  IsDenseVector<VT>::value && !IsTransposeVector<VT>::value &&
1837  IsNumeric<ST>::value
1838  , typename DVecScalarMultExprTrait<typename SMatDVecMultExprTrait<MT,VT>::Type,ST>::Type
1839  , INVALID_TYPE >::Type Type;
1840  //**********************************************************************************************
1841 };
1843 //*************************************************************************************************
1844 
1845 
1846 
1847 
1848 //=================================================================================================
1849 //
1850 // TSMATDVECMULTEXPRTRAIT SPECIALIZATIONS
1851 //
1852 //=================================================================================================
1853 
1854 //*************************************************************************************************
1856 template< typename MT, typename VT, typename ST >
1857 struct TSMatDVecMultExprTrait< MT, DVecScalarMultExpr<VT,ST,false> >
1858 {
1859  public:
1860  //**********************************************************************************************
1861  typedef typename SelectType< IsSparseMatrix<MT>::value && IsColumnMajorMatrix<MT>::value &&
1862  IsDenseVector<VT>::value && !IsTransposeVector<VT>::value &&
1863  IsNumeric<ST>::value
1864  , typename DVecScalarMultExprTrait<typename TSMatDVecMultExprTrait<MT,VT>::Type,ST>::Type
1865  , INVALID_TYPE >::Type Type;
1866  //**********************************************************************************************
1867 };
1869 //*************************************************************************************************
1870 
1871 
1872 
1873 
1874 //=================================================================================================
1875 //
1876 // TDVECSMATMULTEXPRTRAIT SPECIALIZATIONS
1877 //
1878 //=================================================================================================
1879 
1880 //*************************************************************************************************
1882 template< typename VT, typename MT, typename ST >
1883 struct TDVecSMatMultExprTrait< DVecScalarMultExpr<VT,ST,true>, MT >
1884 {
1885  public:
1886  //**********************************************************************************************
1887  typedef typename SelectType< IsDenseVector<VT>::value && IsTransposeVector<VT>::value &&
1888  IsSparseMatrix<MT>::value && IsRowMajorMatrix<MT>::value &&
1889  IsNumeric<ST>::value
1890  , typename TDVecScalarMultExprTrait<typename TDVecSMatMultExprTrait<VT,MT>::Type,ST>::Type
1891  , INVALID_TYPE >::Type Type;
1892  //**********************************************************************************************
1893 };
1895 //*************************************************************************************************
1896 
1897 
1898 
1899 
1900 //=================================================================================================
1901 //
1902 // TDVECTSMATMULTEXPRTRAIT SPECIALIZATIONS
1903 //
1904 //=================================================================================================
1905 
1906 //*************************************************************************************************
1908 template< typename VT, typename MT, typename ST >
1909 struct TDVecTSMatMultExprTrait< DVecScalarMultExpr<VT,ST,true>, MT >
1910 {
1911  public:
1912  //**********************************************************************************************
1913  typedef typename SelectType< IsDenseVector<VT>::value && IsTransposeVector<VT>::value &&
1914  IsSparseMatrix<MT>::value && IsColumnMajorMatrix<MT>::value &&
1915  IsNumeric<ST>::value
1916  , typename TDVecScalarMultExprTrait<typename TDVecTSMatMultExprTrait<VT,MT>::Type,ST>::Type
1917  , INVALID_TYPE >::Type Type;
1918  //**********************************************************************************************
1919 };
1921 //*************************************************************************************************
1922 
1923 } // namespace blaze
1924 
1925 #endif