All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
DMatScalarMultExpr.h
Go to the documentation of this file.
1 //=================================================================================================
20 //=================================================================================================
21 
22 #ifndef _BLAZE_MATH_EXPRESSIONS_DMATSCALARMULTEXPR_H_
23 #define _BLAZE_MATH_EXPRESSIONS_DMATSCALARMULTEXPR_H_
24 
25 
26 //*************************************************************************************************
27 // Includes
28 //*************************************************************************************************
29 
37 #include <blaze/math/Intrinsics.h>
54 #include <blaze/util/Assert.h>
58 #include <blaze/util/EnableIf.h>
59 #include <blaze/util/InvalidType.h>
61 #include <blaze/util/SelectType.h>
62 #include <blaze/util/Types.h>
65 
66 
67 namespace blaze {
68 
69 //=================================================================================================
70 //
71 // CLASS DMATSCALARMULTEXPR
72 //
73 //=================================================================================================
74 
75 //*************************************************************************************************
82 template< typename MT // Type of the left-hand side dense matrix
83  , typename ST // Type of the right-hand side scalar value
84  , bool SO > // Storage order
85 class DMatScalarMultExpr : public DenseMatrix< DMatScalarMultExpr<MT,ST,SO>, SO >
86  , private Expression
87  , private Computation
88 {
89  private:
90  //**Type definitions****************************************************************************
91  typedef typename MT::ResultType RT;
92  typedef typename MT::ReturnType RN;
93  typedef typename MT::ElementType ET;
94  typedef typename MT::CompositeType CT;
95  //**********************************************************************************************
96 
97  //**Return type evaluation**********************************************************************
99 
104  enum { returnExpr = !IsTemporary<RN>::value };
105 
108  //**********************************************************************************************
109 
110  //**Evaluation strategy*************************************************************************
112 
118  enum { useAssign = RequiresEvaluation<MT>::value };
119 
121 
122  template< typename MT2 >
123  struct UseAssign {
124  enum { value = useAssign };
125  };
127  //**********************************************************************************************
128 
129  public:
130  //**Type definitions****************************************************************************
133  typedef typename ResultType::OppositeType OppositeType;
134  typedef typename ResultType::TransposeType TransposeType;
135  typedef typename ResultType::ElementType ElementType;
137 
140 
143 
145  typedef typename SelectType< IsExpression<MT>::value, const MT, const MT& >::Type LeftOperand;
146 
149  //**********************************************************************************************
150 
151  //**Compilation flags***************************************************************************
153  enum { vectorizable = MT::vectorizable &&
156  //**********************************************************************************************
157 
158  //**Constructor*********************************************************************************
164  explicit inline DMatScalarMultExpr( const MT& matrix, ST scalar )
165  : matrix_( matrix ) // Left-hand side dense matrix of the multiplication expression
166  , scalar_( scalar ) // Right-hand side scalar of the multiplication expression
167  {}
168  //**********************************************************************************************
169 
170  //**Access operator*****************************************************************************
177  inline ReturnType operator()( size_t i, size_t j ) const {
178  BLAZE_INTERNAL_ASSERT( i < matrix_.rows() , "Invalid row access index" );
179  BLAZE_INTERNAL_ASSERT( j < matrix_.columns(), "Invalid column access index" );
180  return matrix_(i,j) * scalar_;
181  }
182  //**********************************************************************************************
183 
184  //**Get function********************************************************************************
191  inline IntrinsicType get( size_t i, size_t j ) const {
192  typedef IntrinsicTrait<ElementType> IT;
193  BLAZE_INTERNAL_ASSERT( i < matrix_.rows() , "Invalid row access index" );
194  BLAZE_INTERNAL_ASSERT( j < matrix_.columns(), "Invalid column access index" );
195  BLAZE_INTERNAL_ASSERT( SO || ( j % IT::size == 0UL ), "Invalid column access index" );
196  BLAZE_INTERNAL_ASSERT( !SO || ( i % IT::size == 0UL ), "Invalid column access index" );
197  const IntrinsicType xmm1( matrix_.get(i,j) );
198  const IntrinsicType xmm2( set( scalar_ ) );
199  return xmm1 * xmm2;
200  }
201  //**********************************************************************************************
202 
203  //**Rows function*******************************************************************************
208  inline size_t rows() const {
209  return matrix_.rows();
210  }
211  //**********************************************************************************************
212 
213  //**Columns function****************************************************************************
218  inline size_t columns() const {
219  return matrix_.columns();
220  }
221  //**********************************************************************************************
222 
223  //**Left operand access*************************************************************************
228  inline LeftOperand leftOperand() const {
229  return matrix_;
230  }
231  //**********************************************************************************************
232 
233  //**Right operand access************************************************************************
238  inline RightOperand rightOperand() const {
239  return scalar_;
240  }
241  //**********************************************************************************************
242 
243  //**********************************************************************************************
249  template< typename T >
250  inline bool canAlias( const T* alias ) const {
251  return matrix_.canAlias( alias );
252  }
253  //**********************************************************************************************
254 
255  //**********************************************************************************************
261  template< typename T >
262  inline bool isAliased( const T* alias ) const {
263  return matrix_.isAliased( alias );
264  }
265  //**********************************************************************************************
266 
267  private:
268  //**Member variables****************************************************************************
271  //**********************************************************************************************
272 
273  //**Assignment to row-major dense matrices******************************************************
287  template< typename MT2 > // Type of the target dense matrix
288  friend inline typename EnableIf< UseAssign<MT2> >::Type
290  {
292 
293  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
294  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
295 
296  assign( ~lhs, rhs.matrix_ );
297 
298  const size_t m( (~lhs).rows() );
299  const size_t n( (~lhs).columns() );
300  for( size_t i=0UL; i<m; ++i ) {
301  for( size_t j=0UL; j<n; ++j ) {
302  (~lhs)(i,j) *= rhs.scalar_;
303  }
304  }
305  }
307  //**********************************************************************************************
308 
309  //**Assignment to column-major dense matrices***************************************************
323  template< typename MT2 > // Type of the target dense matrix
324  friend inline typename EnableIf< UseAssign<MT2> >::Type
326  {
328 
329  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
330  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
331 
332  assign( ~lhs, rhs.matrix_ );
333 
334  const size_t m( (~lhs).rows() );
335  const size_t n( (~lhs).columns() );
336  for( size_t j=0UL; j<n; ++j ) {
337  for( size_t i=0UL; i<m; ++i ) {
338  (~lhs)(i,j) *= rhs.scalar_;
339  }
340  }
341  }
343  //**********************************************************************************************
344 
345  //**Assignment to row-major sparse matrices*****************************************************
359  template< typename MT2 > // Type of the target sparse matrix
360  friend inline typename EnableIf< UseAssign<MT2> >::Type
361  assign( SparseMatrix<MT2,false>& lhs, const DMatScalarMultExpr& rhs )
362  {
364 
365  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
366  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
367 
368  assign( ~lhs, rhs.matrix_ );
369 
370  for( size_t i=0UL; i<(~lhs).rows(); ++i )
371  {
372  typename MT2::Iterator element( (~lhs).begin(i) );
373  const typename MT2::Iterator end( (~lhs).end(i) );
374 
375  for( ; element!=end; ++element )
376  element->value() *= rhs.scalar_;
377  }
378  }
380  //**********************************************************************************************
381 
382  //**Assignment to column-major sparse matrices**************************************************
396  template< typename MT2 > // Type of the target sparse matrix
397  friend inline typename EnableIf< UseAssign<MT2> >::Type
398  assign( SparseMatrix<MT2,true>& lhs, const DMatScalarMultExpr& rhs )
399  {
401 
402  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
403  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
404 
405  assign( ~lhs, rhs.matrix_ );
406 
407  for( size_t j=0UL; j<(~lhs).columns(); ++j )
408  {
409  typename MT2::Iterator element( (~lhs).begin(j) );
410  const typename MT2::Iterator end( (~lhs).end(j) );
411 
412  for( ; element!=end; ++element )
413  element->value() *= rhs.scalar_;
414  }
415  }
417  //**********************************************************************************************
418 
419  //**Addition assignment to dense matrices*******************************************************
433  template< typename MT2 // Type of the target dense matrix
434  , bool SO2 > // Storage order of the target dense matrix
435  friend inline typename EnableIf< UseAssign<MT2> >::Type
436  addAssign( DenseMatrix<MT2,SO2>& lhs, const DMatScalarMultExpr& rhs )
437  {
439 
442  BLAZE_CONSTRAINT_MUST_BE_REFERENCE_TYPE( typename ResultType::CompositeType );
443 
444  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
445  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
446 
447  const ResultType tmp( rhs );
448  addAssign( ~lhs, tmp );
449  }
451  //**********************************************************************************************
452 
453  //**Addition assignment to sparse matrices******************************************************
454  // No special implementation for the addition assignment to sparse matrices.
455  //**********************************************************************************************
456 
457  //**Subtraction assignment to dense matrices****************************************************
471  template< typename MT2 // Type of the target dense matrix
472  , bool SO2 > // Storage order of the target dense matrix
473  friend inline typename EnableIf< UseAssign<MT2> >::Type
474  subAssign( DenseMatrix<MT2,SO2>& lhs, const DMatScalarMultExpr& rhs )
475  {
477 
480  BLAZE_CONSTRAINT_MUST_BE_REFERENCE_TYPE( typename ResultType::CompositeType );
481 
482  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
483  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
484 
485  const ResultType tmp( rhs );
486  subAssign( ~lhs, tmp );
487  }
489  //**********************************************************************************************
490 
491  //**Subtraction assignment to sparse matrices***************************************************
492  // No special implementation for the subtraction assignment to sparse matrices.
493  //**********************************************************************************************
494 
495  //**Multiplication assignment to dense matrices*************************************************
496  // No special implementation for the multiplication assignment to dense matrices.
497  //**********************************************************************************************
498 
499  //**Multiplication assignment to sparse matrices************************************************
500  // No special implementation for the multiplication assignment to sparse matrices.
501  //**********************************************************************************************
502 
503  //**Compile time checks*************************************************************************
510  //**********************************************************************************************
511 };
512 //*************************************************************************************************
513 
514 
515 
516 
517 //=================================================================================================
518 //
519 // GLOBAL UNARY ARITHMETIC OPERATORS
520 //
521 //=================================================================================================
522 
523 //*************************************************************************************************
540 template< typename MT // Type of the dense matrix
541  , bool SO > // Storage order
542 inline const DMatScalarMultExpr<MT,typename BaseElementType<MT>::Type,SO>
544 {
546 
547  typedef typename BaseElementType<MT>::Type ElementType;
548  return DMatScalarMultExpr<MT,ElementType,SO>( ~dm, ElementType(-1) );
549 }
550 //*************************************************************************************************
551 
552 
553 
554 
555 //=================================================================================================
556 //
557 // GLOBAL BINARY ARITHMETIC OPERATORS
558 //
559 //=================================================================================================
560 
561 //*************************************************************************************************
582 template< typename T1 // Type of the left-hand side dense matrix
583  , bool SO // Storage order of the left-hand side dense matrix
584  , typename T2 > // Type of the right-hand side scalar
585 inline const typename EnableIf< IsNumeric<T2>, typename MultExprTrait<T1,T2>::Type >::Type
586  operator*( const DenseMatrix<T1,SO>& mat, T2 scalar )
587 {
589 
590  typedef typename MultExprTrait<T1,T2>::Type Type;
591  return Type( ~mat, scalar );
592 }
593 //*************************************************************************************************
594 
595 
596 //*************************************************************************************************
617 template< typename T1 // Type of the left-hand side scalar
618  , typename T2 // Type of the right-hand side dense matrix
619  , bool SO > // Storage order of the right-hand side dense matrix
620 inline const typename EnableIf< IsNumeric<T1>, typename MultExprTrait<T1,T2>::Type >::Type
621  operator*( T1 scalar, const DenseMatrix<T2,SO>& mat )
622 {
624 
625  typedef typename MultExprTrait<T1,T2>::Type Type;
626  return Type( ~mat, scalar );
627 }
628 //*************************************************************************************************
629 
630 
631 
632 
633 //=================================================================================================
634 //
635 // GLOBAL RESTRUCTURING UNARY ARITHMETIC OPERATORS
636 //
637 //=================================================================================================
638 
639 //*************************************************************************************************
651 template< typename VT // Type of the dense matrix
652  , typename ST // Type of the scalar
653  , bool TF > // Transpose flag
654 inline const DMatScalarMultExpr<VT,ST,TF>
655  operator-( const DMatScalarMultExpr<VT,ST,TF>& dm )
656 {
658 
659  return DMatScalarMultExpr<VT,ST,TF>( dm.leftOperand(), -dm.rightOperand() );
660 }
662 //*************************************************************************************************
663 
664 
665 
666 
667 //=================================================================================================
668 //
669 // GLOBAL RESTRUCTURING BINARY ARITHMETIC OPERATORS
670 //
671 //=================================================================================================
672 
673 //*************************************************************************************************
686 template< typename MT // Type of the dense matrix of the left-hand side expression
687  , typename ST1 // Type of the scalar of the left-hand side expression
688  , bool SO // Storage order of the dense matrix
689  , typename ST2 > // Type of the right-hand side scalar
690 inline const typename EnableIf< IsNumeric<ST2>
691  , typename MultExprTrait< DMatScalarMultExpr<MT,ST1,SO>, ST2 >::Type >::Type
692  operator*( const DMatScalarMultExpr<MT,ST1,SO>& mat, ST2 scalar )
693 {
695 
696  return mat.leftOperand() * ( mat.rightOperand() * scalar );
697 }
699 //*************************************************************************************************
700 
701 
702 //*************************************************************************************************
715 template< typename ST1 // Type of the left-hand side scalar
716  , typename MT // Type of the dense matrix of the right-hand side expression
717  , typename ST2 // Type of the scalar of the right-hand side expression
718  , bool SO > // Storage order of the dense matrix
719 inline const typename EnableIf< IsNumeric<ST1>
720  , typename MultExprTrait< ST1, DMatScalarMultExpr<MT,ST2,SO> >::Type >::Type
721  operator*( ST1 scalar, const DMatScalarMultExpr<MT,ST2,SO>& mat )
722 {
724 
725  return mat.leftOperand() * ( scalar * mat.rightOperand() );
726 }
728 //*************************************************************************************************
729 
730 
731 //*************************************************************************************************
744 template< typename MT // Type of the dense matrix of the left-hand side expression
745  , typename ST1 // Type of the scalar of the left-hand side expression
746  , bool SO // Storage order of the dense matrix
747  , typename ST2 > // Type of the right-hand side scalar
748 inline const typename EnableIf< IsFloatingPoint<typename DivTrait<ST1,ST2>::Type>
749  , typename DivExprTrait< DMatScalarMultExpr<MT,ST1,SO>, ST2 >::Type >::Type
750  operator/( const DMatScalarMultExpr<MT,ST1,SO>& mat, ST2 scalar )
751 {
753 
754  return mat.leftOperand() * ( mat.rightOperand() / scalar );
755 }
757 //*************************************************************************************************
758 
759 
760 //*************************************************************************************************
774 template< typename MT // Type of the dense matrix of the left-hand side expression
775  , typename ST // Type of the scalar of the left-hand side expression
776  , bool SO // Storage order of the left-hand side expression
777  , typename VT > // Type of the right-hand side dense vector
778 inline const typename MultExprTrait< DMatScalarMultExpr<MT,ST,SO>, VT >::Type
779  operator*( const DMatScalarMultExpr<MT,ST,SO>& mat, const DenseVector<VT,false>& vec )
780 {
782 
783  return ( mat.leftOperand() * (~vec) ) * mat.rightOperand();
784 }
786 //*************************************************************************************************
787 
788 
789 //*************************************************************************************************
803 template< typename VT // Type of the left-hand side dense vector
804  , typename MT // Type of the dense matrix of the right-hand side expression
805  , typename ST // Type of the scalar of the right-hand side expression
806  , bool SO > // Storage order of the right-hand side expression
807 inline const typename MultExprTrait< VT, DMatScalarMultExpr<MT,ST,SO> >::Type
808  operator*( const DenseVector<VT,true>& vec, const DMatScalarMultExpr<MT,ST,SO>& mat )
809 {
811 
812  return ( (~vec) * mat.leftOperand() ) * mat.rightOperand();
813 }
815 //*************************************************************************************************
816 
817 
818 //*************************************************************************************************
834 template< typename MT // Type of the dense matrix of the left-hand side expression
835  , typename ST1 // Type of the scalar of the left-hand side expression
836  , bool SO // Storage order of the left-hand side expression
837  , typename VT // Type of the dense vector of the right-hand side expression
838  , typename ST2 > // Type of the scalar of the right-hand side expression
839 inline const DVecScalarMultExpr<typename MultExprTrait<MT,VT>::Type,typename MultTrait<ST1,ST2>::Type,false>
840  operator*( const DMatScalarMultExpr<MT,ST1,SO>& mat, const DVecScalarMultExpr<VT,ST2,false>& vec )
841 {
843 
844  return ( mat.leftOperand() * vec.leftOperand() ) * ( mat.rightOperand() * vec.rightOperand() );
845 }
847 //*************************************************************************************************
848 
849 
850 //*************************************************************************************************
866 template< typename VT // Type of the dense vector of the left-hand side expression
867  , typename ST1 // Type of the scalar of the left-hand side expression
868  , typename MT // Type of the dense matrix of the right-hand side expression
869  , typename ST2 // Type of the scalar of the right-hand side expression
870  , bool SO > // Storage order of the right-hand side expression
871 inline const typename MultExprTrait< DVecScalarMultExpr<VT,ST1,true>, DMatScalarMultExpr<MT,ST2,SO> >::Type
872  operator*( const DVecScalarMultExpr<VT,ST1,true>& vec, const DMatScalarMultExpr<MT,ST2,SO>& mat )
873 {
875 
876  return ( vec.leftOperand() * mat.leftOperand() ) * ( vec.rightOperand() * mat.rightOperand() );
877 }
879 //*************************************************************************************************
880 
881 
882 //*************************************************************************************************
896 template< typename MT // Type of the dense matrix of the left-hand side expression
897  , typename ST // Type of the scalar of the left-hand side expression
898  , bool SO // Storage order of the left-hand side expression
899  , typename VT > // Type of the right-hand side sparse vector
900 inline const typename MultExprTrait< DMatScalarMultExpr<MT,ST,SO>, VT >::Type
901  operator*( const DMatScalarMultExpr<MT,ST,SO>& mat, const SparseVector<VT,false>& vec )
902 {
904 
905  return ( mat.leftOperand() * (~vec) ) * mat.rightOperand();
906 }
908 //*************************************************************************************************
909 
910 
911 //*************************************************************************************************
925 template< typename VT // Type of the left-hand side sparse vector
926  , typename MT // Type of the dense matrix of the right-hand side expression
927  , typename ST // Type of the scalar of the right-hand side expression
928  , bool SO > // Storage order of the right-hand side expression
929 inline const typename MultExprTrait< VT, DMatScalarMultExpr<MT,ST,SO> >::Type
930  operator*( const SparseVector<VT,true>& vec, const DMatScalarMultExpr<MT,ST,SO>& mat )
931 {
933 
934  return ( (~vec) * mat.leftOperand() ) * mat.rightOperand();
935 }
937 //*************************************************************************************************
938 
939 
940 //*************************************************************************************************
956 template< typename MT // Type of the dense matrix of the left-hand side expression
957  , typename ST1 // Type of the scalar of the left-hand side expression
958  , bool SO // Storage order of the left-hand side expression
959  , typename VT // Type of the sparse vector of the right-hand side expression
960  , typename ST2 > // Type of the scalar of the right-hand side expression
961 inline const typename MultExprTrait< DMatScalarMultExpr<MT,ST1,SO>, SVecScalarMultExpr<VT,ST2,false> >::Type
962  operator*( const DMatScalarMultExpr<MT,ST1,SO>& mat, const SVecScalarMultExpr<VT,ST2,false>& vec )
963 {
965 
966  return ( mat.leftOperand() * vec.leftOperand() ) * ( mat.rightOperand() * vec.rightOperand() );
967 }
969 //*************************************************************************************************
970 
971 
972 //*************************************************************************************************
988 template< typename VT // Type of the sparse vector of the left-hand side expression
989  , typename ST1 // Type of the scalar of the left-hand side expression
990  , typename MT // Type of the dense matrix of the right-hand side expression
991  , typename ST2 // Type of the scalar of the right-hand side expression
992  , bool SO > // Storage order of the right-hand side expression
993 inline const typename MultExprTrait< SVecScalarMultExpr<VT,ST1,true>, DMatScalarMultExpr<MT,ST2,SO> >::Type
994  operator*( const SVecScalarMultExpr<VT,ST1,true>& vec, const DMatScalarMultExpr<MT,ST2,SO>& mat )
995 {
997 
998  return ( vec.leftOperand() * mat.leftOperand() ) * ( vec.rightOperand() * mat.rightOperand() );
999 }
1001 //*************************************************************************************************
1002 
1003 
1004 //*************************************************************************************************
1018 template< typename MT1 // Type of the dense matrix of the left-hand side expression
1019  , typename ST // Type of the scalar of the left-hand side expression
1020  , bool SO1 // Storage order of the left-hand side expression
1021  , typename MT2 // Type of the right-hand side dense matrix
1022  , bool SO2 > // Storage order of the right-hand side dense matrix
1023 inline const typename MultExprTrait< DMatScalarMultExpr<MT1,ST,SO1>, MT2 >::Type
1024  operator*( const DMatScalarMultExpr<MT1,ST,SO1>& lhs, const DenseMatrix<MT2,SO2>& rhs )
1025 {
1027 
1028  return ( lhs.leftOperand() * (~rhs) ) * lhs.rightOperand();
1029 }
1031 //*************************************************************************************************
1032 
1033 
1034 //*************************************************************************************************
1048 template< typename MT1 // Type of the left-hand side dense matrix
1049  , bool SO1 // Storage order of the left-hand side dense matrix
1050  , typename MT2 // Type of the dense matrix of the right-hand side expression
1051  , typename ST // Type of the scalar of the right-hand side expression
1052  , bool SO2 > // Storage order of the right-hand side expression
1053 inline const typename MultExprTrait< MT1, DMatScalarMultExpr<MT2,ST,SO2> >::Type
1054  operator*( const DenseMatrix<MT1,SO1>& lhs, const DMatScalarMultExpr<MT2,ST,SO2>& rhs )
1055 {
1057 
1058  return ( (~lhs) * rhs.leftOperand() ) * rhs.rightOperand();
1059 }
1061 //*************************************************************************************************
1062 
1063 
1064 //*************************************************************************************************
1078 template< typename MT1 // Type of the dense matrix of the left-hand side expression
1079  , typename ST1 // Type of the scalar of the left-hand side expression
1080  , bool SO1 // Storage order of the left-hand side expression
1081  , typename MT2 // Type of the right-hand side dense matrix
1082  , typename ST2 // Type of the scalar of the right-hand side expression
1083  , bool SO2 > // Storage order of the right-hand side expression
1084 inline const typename MultExprTrait< DMatScalarMultExpr<MT1,ST1,SO1>, DMatScalarMultExpr<MT2,ST2,SO2> >::Type
1085  operator*( const DMatScalarMultExpr<MT1,ST1,SO1>& lhs, const DMatScalarMultExpr<MT2,ST2,SO2>& rhs )
1086 {
1088 
1089  return ( lhs.leftOperand() * rhs.leftOperand() ) * ( lhs.rightOperand() * rhs.rightOperand() );
1090 }
1092 //*************************************************************************************************
1093 
1094 
1095 //*************************************************************************************************
1109 template< typename MT1 // Type of the dense matrix of the left-hand side expression
1110  , typename ST // Type of the scalar of the left-hand side expression
1111  , bool SO1 // Storage order of the left-hand side expression
1112  , typename MT2 // Type of the right-hand side sparse matrix
1113  , bool SO2 > // Storage order of the right-hand side sparse matrix
1114 inline const typename MultExprTrait< DMatScalarMultExpr<MT1,ST,SO1>, MT2 >::Type
1115  operator*( const DMatScalarMultExpr<MT1,ST,SO1>& lhs, const SparseMatrix<MT2,SO2>& rhs )
1116 {
1118 
1119  return ( lhs.leftOperand() * (~rhs) ) * lhs.rightOperand();
1120 }
1122 //*************************************************************************************************
1123 
1124 
1125 //*************************************************************************************************
1139 template< typename MT1 // Type of the left-hand side sparse matrix
1140  , bool SO1 // Storage order of the left-hand side sparse matrix
1141  , typename MT2 // Type of the dense matrix of the right-hand side expression
1142  , typename ST // Type of the scalar of the right-hand side expression
1143  , bool SO2 > // Storage order of the right-hand side expression
1144 inline const typename MultExprTrait< MT1, DMatScalarMultExpr<MT2,ST,SO2> >::Type
1145  operator*( const SparseMatrix<MT1,SO1>& lhs, const DMatScalarMultExpr<MT2,ST,SO2>& rhs )
1146 {
1148 
1149  return ( (~lhs) * rhs.leftOperand() ) * rhs.rightOperand();
1150 }
1152 //*************************************************************************************************
1153 
1154 
1155 //*************************************************************************************************
1170 template< typename MT1 // Type of the dense matrix of the left-hand side expression
1171  , typename ST1 // Type of the scalar of the left-hand side expression
1172  , bool SO1 // Storage order of the left-hand side expression
1173  , typename MT2 // Type of the sparse matrix of the right-hand side expression
1174  , typename ST2 // Type of the scalar of the right-hand side expression
1175  , bool SO2 > // Storage order of the right-hand side expression
1176 inline const typename MultExprTrait< DMatScalarMultExpr<MT1,ST1,SO1>, SMatScalarMultExpr<MT2,ST2,SO2> >::Type
1177  operator*( const DMatScalarMultExpr<MT1,ST1,SO1>& mat, const SMatScalarMultExpr<MT2,ST2,SO2>& vec )
1178 {
1180 
1181  return ( mat.leftOperand() * vec.leftOperand() ) * ( mat.rightOperand() * vec.rightOperand() );
1182 }
1184 //*************************************************************************************************
1185 
1186 
1187 //*************************************************************************************************
1202 template< typename MT1 // Type of the sparse matrix of the left-hand side expression
1203  , typename ST1 // Type of the scalar of the left-hand side expression
1204  , bool SO1 // Storage order of the left-hand side expression
1205  , typename MT2 // Type of the dense matrix of the right-hand side expression
1206  , typename ST2 // Type of the scalar of the right-hand side expression
1207  , bool SO2 > // Storage order of the right-hand side expression
1208 inline const typename MultExprTrait< SMatScalarMultExpr<MT1,ST1,SO1>, DMatScalarMultExpr<MT2,ST2,SO2> >::Type
1209  operator*( const SMatScalarMultExpr<MT1,ST1,SO1>& mat, const DMatScalarMultExpr<MT2,ST2,SO2>& vec )
1210 {
1212 
1213  return ( mat.leftOperand() * vec.leftOperand() ) * ( mat.rightOperand() * vec.rightOperand() );
1214 }
1216 //*************************************************************************************************
1217 
1218 
1219 
1220 
1221 //=================================================================================================
1222 //
1223 // GLOBAL OPERATORS
1224 //
1225 //=================================================================================================
1226 
1227 //*************************************************************************************************
1239 template< typename MT // Type of the left-hand side dense matrix
1240  , typename ST // Type of the right-hand side scalar value
1241  , bool SO > // Storage order
1242 inline typename RowExprTrait< DMatScalarMultExpr<MT,ST,SO> >::Type
1243  row( const DMatScalarMultExpr<MT,ST,SO>& dm, size_t index )
1244 {
1246 
1247  return row( dm.leftOperand(), index ) * dm.rightOperand();
1248 }
1250 //*************************************************************************************************
1251 
1252 
1253 //*************************************************************************************************
1265 template< typename MT // Type of the left-hand side dense matrix
1266  , typename ST // Type of the right-hand side scalar value
1267  , bool SO > // Storage order
1268 inline typename ColumnExprTrait< DMatScalarMultExpr<MT,ST,SO> >::Type
1269  column( const DMatScalarMultExpr<MT,ST,SO>& dm, size_t index )
1270 {
1272 
1273  return column( dm.leftOperand(), index ) * dm.rightOperand();
1274 }
1276 //*************************************************************************************************
1277 
1278 
1279 
1280 
1281 //=================================================================================================
1282 //
1283 // DMATSCALARMULTEXPRTRAIT SPECIALIZATIONS
1284 //
1285 //=================================================================================================
1286 
1287 //*************************************************************************************************
1289 template< typename MT, typename ST1, typename ST2 >
1290 struct DMatScalarMultExprTrait< DMatScalarMultExpr<MT,ST1,false>, ST2 >
1291 {
1292  public:
1293  //**********************************************************************************************
1294  typedef typename SelectType< IsDenseMatrix<MT>::value && IsRowMajorMatrix<MT>::value &&
1295  IsNumeric<ST1>::value && IsNumeric<ST2>::value
1296  , typename DMatScalarMultExprTrait<MT,typename MultTrait<ST1,ST2>::Type>::Type
1297  , INVALID_TYPE >::Type Type;
1298  //**********************************************************************************************
1299 };
1301 //*************************************************************************************************
1302 
1303 
1304 
1305 
1306 //=================================================================================================
1307 //
1308 // TDMATSCALARMULTEXPRTRAIT SPECIALIZATIONS
1309 //
1310 //=================================================================================================
1311 
1312 //*************************************************************************************************
1314 template< typename MT, typename ST1, typename ST2 >
1315 struct TDMatScalarMultExprTrait< DMatScalarMultExpr<MT,ST1,true>, ST2 >
1316 {
1317  public:
1318  //**********************************************************************************************
1319  typedef typename SelectType< IsDenseMatrix<MT>::value && IsColumnMajorMatrix<MT>::value &&
1320  IsNumeric<ST1>::value && IsNumeric<ST2>::value
1321  , typename TDMatScalarMultExprTrait<MT,typename MultTrait<ST1,ST2>::Type>::Type
1322  , INVALID_TYPE >::Type Type;
1323  //**********************************************************************************************
1324 };
1326 //*************************************************************************************************
1327 
1328 
1329 
1330 
1331 //=================================================================================================
1332 //
1333 // DMATSCALARDIVEXPRTRAIT SPECIALIZATIONS
1334 //
1335 //=================================================================================================
1336 
1337 //*************************************************************************************************
1339 template< typename MT, typename ST1, typename ST2 >
1340 struct DMatScalarDivExprTrait< DMatScalarMultExpr<MT,ST1,false>, ST2 >
1341 {
1342  private:
1343  //**********************************************************************************************
1344  enum { condition = IsFloatingPoint<typename DivTrait<ST1,ST2>::Type>::value };
1345  //**********************************************************************************************
1346 
1347  //**********************************************************************************************
1348  typedef typename DMatScalarMultExprTrait<MT,typename DivTrait<ST1,ST2>::Type>::Type T1;
1349  typedef typename DMatScalarDivExprTrait<MT,typename DivTrait<ST1,ST2>::Type>::Type T2;
1350  //**********************************************************************************************
1351 
1352  public:
1353  //**********************************************************************************************
1354  typedef typename SelectType< IsDenseMatrix<MT>::value && IsRowMajorMatrix<MT>::value &&
1355  IsNumeric<ST1>::value && IsNumeric<ST2>::value
1356  , typename SelectType<condition,T1,T2>::Type
1357  , INVALID_TYPE >::Type Type;
1358  //**********************************************************************************************
1359 };
1361 //*************************************************************************************************
1362 
1363 
1364 
1365 
1366 //=================================================================================================
1367 //
1368 // TDMATSCALARDIVEXPRTRAIT SPECIALIZATIONS
1369 //
1370 //=================================================================================================
1371 
1372 //*************************************************************************************************
1374 template< typename MT, typename ST1, typename ST2 >
1375 struct TDMatScalarDivExprTrait< DMatScalarMultExpr<MT,ST1,true>, ST2 >
1376 {
1377  private:
1378  //**********************************************************************************************
1379  enum { condition = IsFloatingPoint<typename DivTrait<ST1,ST2>::Type>::value };
1380  //**********************************************************************************************
1381 
1382  //**********************************************************************************************
1383  typedef typename TDMatScalarMultExprTrait<MT,typename DivTrait<ST1,ST2>::Type>::Type T1;
1384  typedef typename TDMatScalarDivExprTrait<MT,typename DivTrait<ST1,ST2>::Type>::Type T2;
1385  //**********************************************************************************************
1386 
1387  public:
1388  //**********************************************************************************************
1389  typedef typename SelectType< IsDenseMatrix<MT>::value && IsColumnMajorMatrix<MT>::value &&
1390  IsNumeric<ST1>::value && IsNumeric<ST2>::value
1391  , typename SelectType<condition,T1,T2>::Type
1392  , INVALID_TYPE >::Type Type;
1393  //**********************************************************************************************
1394 };
1396 //*************************************************************************************************
1397 
1398 
1399 
1400 
1401 //=================================================================================================
1402 //
1403 // DMATDVECMULTEXPRTRAIT SPECIALIZATIONS
1404 //
1405 //=================================================================================================
1406 
1407 //*************************************************************************************************
1409 template< typename MT, typename ST, typename VT >
1410 struct DMatDVecMultExprTrait< DMatScalarMultExpr<MT,ST,false>, VT >
1411 {
1412  public:
1413  //**********************************************************************************************
1414  typedef typename SelectType< IsDenseMatrix<MT>::value && IsRowMajorMatrix<MT>::value &&
1415  IsDenseVector<VT>::value && !IsTransposeVector<VT>::value &&
1416  IsNumeric<ST>::value
1417  , typename DVecScalarMultExprTrait<typename DMatDVecMultExprTrait<MT,VT>::Type,ST>::Type
1418  , INVALID_TYPE >::Type Type;
1419  //**********************************************************************************************
1420 };
1422 //*************************************************************************************************
1423 
1424 
1425 //*************************************************************************************************
1427 template< typename MT, typename ST1, typename VT, typename ST2 >
1428 struct DMatDVecMultExprTrait< DMatScalarMultExpr<MT,ST1,false>, DVecScalarMultExpr<VT,ST2,false> >
1429 {
1430  public:
1431  //**********************************************************************************************
1432  typedef typename SelectType< IsDenseMatrix<MT>::value && IsRowMajorMatrix<MT>::value &&
1433  IsDenseVector<VT>::value && !IsTransposeVector<VT>::value &&
1434  IsNumeric<ST1>::value && IsNumeric<ST2>::value
1435  , typename DVecScalarMultExprTrait<typename DMatDVecMultExprTrait<MT,VT>::Type,typename MultTrait<ST1,ST2>::Type>::Type
1436  , INVALID_TYPE >::Type Type;
1437  //**********************************************************************************************
1438 };
1440 //*************************************************************************************************
1441 
1442 
1443 
1444 
1445 //=================================================================================================
1446 //
1447 // TDMATDVECMULTEXPRTRAIT SPECIALIZATIONS
1448 //
1449 //=================================================================================================
1450 
1451 //*************************************************************************************************
1453 template< typename MT, typename ST, typename VT >
1454 struct TDMatDVecMultExprTrait< DMatScalarMultExpr<MT,ST,true>, VT >
1455 {
1456  public:
1457  //**********************************************************************************************
1458  typedef typename SelectType< IsDenseMatrix<MT>::value && IsColumnMajorMatrix<MT>::value &&
1459  IsDenseVector<VT>::value && !IsTransposeVector<VT>::value &&
1460  IsNumeric<ST>::value
1461  , typename DVecScalarMultExprTrait<typename TDMatDVecMultExprTrait<MT,VT>::Type,ST>::Type
1462  , INVALID_TYPE >::Type Type;
1463  //**********************************************************************************************
1464 };
1466 //*************************************************************************************************
1467 
1468 
1469 //*************************************************************************************************
1471 template< typename MT, typename ST1, typename VT, typename ST2 >
1472 struct TDMatDVecMultExprTrait< DMatScalarMultExpr<MT,ST1,true>, DVecScalarMultExpr<VT,ST2,false> >
1473 {
1474  public:
1475  //**********************************************************************************************
1476  typedef typename SelectType< IsDenseMatrix<MT>::value && IsColumnMajorMatrix<MT>::value &&
1477  IsDenseVector<VT>::value && !IsTransposeVector<VT>::value &&
1478  IsNumeric<ST1>::value && IsNumeric<ST2>::value
1479  , typename DVecScalarMultExprTrait<typename TDMatDVecMultExprTrait<MT,VT>::Type,typename MultTrait<ST1,ST2>::Type>::Type
1480  , INVALID_TYPE >::Type Type;
1481  //**********************************************************************************************
1482 };
1484 //*************************************************************************************************
1485 
1486 
1487 
1488 
1489 //=================================================================================================
1490 //
1491 // TDVECDMATMULTEXPRTRAIT SPECIALIZATIONS
1492 //
1493 //=================================================================================================
1494 
1495 //*************************************************************************************************
1497 template< typename VT, typename MT, typename ST >
1498 struct TDVecDMatMultExprTrait< VT, DMatScalarMultExpr<MT,ST,false> >
1499 {
1500  public:
1501  //**********************************************************************************************
1502  typedef typename SelectType< IsDenseVector<VT>::value && IsTransposeVector<VT>::value &&
1503  IsDenseMatrix<MT>::value && IsRowMajorMatrix<MT>::value &&
1504  IsNumeric<ST>::value
1505  , typename TDVecScalarMultExprTrait<typename TDVecDMatMultExprTrait<VT,MT>::Type,ST>::Type
1506  , INVALID_TYPE >::Type Type;
1507  //**********************************************************************************************
1508 };
1510 //*************************************************************************************************
1511 
1512 
1513 //*************************************************************************************************
1515 template< typename VT, typename ST1, typename MT, typename ST2 >
1516 struct TDVecDMatMultExprTrait< DVecScalarMultExpr<VT,ST1,true>, DMatScalarMultExpr<MT,ST2,false> >
1517 {
1518  public:
1519  //**********************************************************************************************
1520  typedef typename SelectType< IsDenseVector<VT>::value && IsTransposeVector<VT>::value &&
1521  IsDenseMatrix<MT>::value && IsRowMajorMatrix<MT>::value &&
1522  IsNumeric<ST1>::value && IsNumeric<ST2>::value
1523  , typename TDVecScalarMultExprTrait<typename TDVecDMatMultExprTrait<VT,MT>::Type,typename MultTrait<ST1,ST2>::Type>::Type
1524  , INVALID_TYPE >::Type Type;
1525  //**********************************************************************************************
1526 };
1528 //*************************************************************************************************
1529 
1530 
1531 
1532 
1533 //=================================================================================================
1534 //
1535 // TDVECTDMATMULTEXPRTRAIT SPECIALIZATIONS
1536 //
1537 //=================================================================================================
1538 
1539 //*************************************************************************************************
1541 template< typename VT, typename MT, typename ST >
1542 struct TDVecTDMatMultExprTrait< VT, DMatScalarMultExpr<MT,ST,true> >
1543 {
1544  public:
1545  //**********************************************************************************************
1546  typedef typename SelectType< IsDenseVector<VT>::value && IsTransposeVector<VT>::value &&
1547  IsDenseMatrix<MT>::value && IsColumnMajorMatrix<MT>::value &&
1548  IsNumeric<ST>::value
1549  , typename TDVecScalarMultExprTrait<typename TDVecTDMatMultExprTrait<VT,MT>::Type,ST>::Type
1550  , INVALID_TYPE >::Type Type;
1551  //**********************************************************************************************
1552 };
1554 //*************************************************************************************************
1555 
1556 
1557 //*************************************************************************************************
1559 template< typename VT, typename ST1, typename MT, typename ST2 >
1560 struct TDVecTDMatMultExprTrait< DVecScalarMultExpr<VT,ST1,true>, DMatScalarMultExpr<MT,ST2,true> >
1561 {
1562  public:
1563  //**********************************************************************************************
1564  typedef typename SelectType< IsDenseVector<VT>::value && IsTransposeVector<VT>::value &&
1565  IsDenseMatrix<MT>::value && IsColumnMajorMatrix<MT>::value &&
1566  IsNumeric<ST1>::value && IsNumeric<ST2>::value
1567  , typename TDVecScalarMultExprTrait<typename TDVecTDMatMultExprTrait<VT,MT>::Type,typename MultTrait<ST1,ST2>::Type>::Type
1568  , INVALID_TYPE >::Type Type;
1569  //**********************************************************************************************
1570 };
1572 //*************************************************************************************************
1573 
1574 
1575 
1576 
1577 //=================================================================================================
1578 //
1579 // DMATSVECMULTEXPRTRAIT SPECIALIZATIONS
1580 //
1581 //=================================================================================================
1582 
1583 //*************************************************************************************************
1585 template< typename MT, typename ST, typename VT >
1586 struct DMatSVecMultExprTrait< DMatScalarMultExpr<MT,ST,false>, VT >
1587 {
1588  public:
1589  //**********************************************************************************************
1590  typedef typename SelectType< IsDenseMatrix<MT>::value && IsRowMajorMatrix<MT>::value &&
1591  IsSparseVector<VT>::value && !IsTransposeVector<VT>::value &&
1592  IsNumeric<ST>::value
1593  , typename DVecScalarMultExprTrait<typename DMatSVecMultExprTrait<MT,VT>::Type,ST>::Type
1594  , INVALID_TYPE >::Type Type;
1595  //**********************************************************************************************
1596 };
1598 //*************************************************************************************************
1599 
1600 
1601 //*************************************************************************************************
1603 template< typename MT, typename ST1, typename VT, typename ST2 >
1604 struct DMatSVecMultExprTrait< DMatScalarMultExpr<MT,ST1,false>, SVecScalarMultExpr<VT,ST2,false> >
1605 {
1606  public:
1607  //**********************************************************************************************
1608  typedef typename SelectType< IsDenseMatrix<MT>::value && IsRowMajorMatrix<MT>::value &&
1609  IsSparseVector<VT>::value && !IsTransposeVector<VT>::value &&
1610  IsNumeric<ST1>::value && IsNumeric<ST2>::value
1611  , typename DVecScalarMultExprTrait<typename DMatSVecMultExprTrait<MT,VT>::Type,typename MultTrait<ST1,ST2>::Type>::Type
1612  , INVALID_TYPE >::Type Type;
1613  //**********************************************************************************************
1614 };
1616 //*************************************************************************************************
1617 
1618 
1619 
1620 
1621 //=================================================================================================
1622 //
1623 // TDMATSVECMULTEXPRTRAIT SPECIALIZATIONS
1624 //
1625 //=================================================================================================
1626 
1627 //*************************************************************************************************
1629 template< typename MT, typename ST, typename VT >
1630 struct TDMatSVecMultExprTrait< DMatScalarMultExpr<MT,ST,true>, VT >
1631 {
1632  public:
1633  //**********************************************************************************************
1634  typedef typename SelectType< IsDenseMatrix<MT>::value && IsColumnMajorMatrix<MT>::value &&
1635  IsSparseVector<VT>::value && !IsTransposeVector<VT>::value &&
1636  IsNumeric<ST>::value
1637  , typename DVecScalarMultExprTrait<typename TDMatSVecMultExprTrait<MT,VT>::Type,ST>::Type
1638  , INVALID_TYPE >::Type Type;
1639  //**********************************************************************************************
1640 };
1642 //*************************************************************************************************
1643 
1644 
1645 //*************************************************************************************************
1647 template< typename MT, typename ST1, typename VT, typename ST2 >
1648 struct TDMatSVecMultExprTrait< DMatScalarMultExpr<MT,ST1,true>, SVecScalarMultExpr<VT,ST2,false> >
1649 {
1650  public:
1651  //**********************************************************************************************
1652  typedef typename SelectType< IsDenseMatrix<MT>::value && IsColumnMajorMatrix<MT>::value &&
1653  IsSparseVector<VT>::value && !IsTransposeVector<VT>::value &&
1654  IsNumeric<ST1>::value && IsNumeric<ST2>::value
1655  , typename DVecScalarMultExprTrait<typename TDMatSVecMultExprTrait<MT,VT>::Type,typename MultTrait<ST1,ST2>::Type>::Type
1656  , INVALID_TYPE >::Type Type;
1657  //**********************************************************************************************
1658 };
1660 //*************************************************************************************************
1661 
1662 
1663 
1664 
1665 //=================================================================================================
1666 //
1667 // TSVECDMATMULTEXPRTRAIT SPECIALIZATIONS
1668 //
1669 //=================================================================================================
1670 
1671 //*************************************************************************************************
1673 template< typename VT, typename MT, typename ST >
1674 struct TSVecDMatMultExprTrait< VT, DMatScalarMultExpr<MT,ST,false> >
1675 {
1676  public:
1677  //**********************************************************************************************
1678  typedef typename SelectType< IsSparseVector<VT>::value && IsTransposeVector<VT>::value &&
1679  IsDenseMatrix<MT>::value && IsRowMajorMatrix<MT>::value &&
1680  IsNumeric<ST>::value
1681  , typename TDVecScalarMultExprTrait<typename TSVecDMatMultExprTrait<VT,MT>::Type,ST>::Type
1682  , INVALID_TYPE >::Type Type;
1683  //**********************************************************************************************
1684 };
1686 //*************************************************************************************************
1687 
1688 
1689 //*************************************************************************************************
1691 template< typename VT, typename ST1, typename MT, typename ST2 >
1692 struct TSVecDMatMultExprTrait< SVecScalarMultExpr<VT,ST1,true>, DMatScalarMultExpr<MT,ST2,false> >
1693 {
1694  public:
1695  //**********************************************************************************************
1696  typedef typename SelectType< IsSparseVector<VT>::value && IsTransposeVector<VT>::value &&
1697  IsDenseMatrix<MT>::value && IsRowMajorMatrix<MT>::value &&
1698  IsNumeric<ST1>::value && IsNumeric<ST2>::value
1699  , typename TDVecScalarMultExprTrait<typename TSVecDMatMultExprTrait<VT,MT>::Type,typename MultTrait<ST1,ST2>::Type>::Type
1700  , INVALID_TYPE >::Type Type;
1701  //**********************************************************************************************
1702 };
1704 //*************************************************************************************************
1705 
1706 
1707 
1708 
1709 //=================================================================================================
1710 //
1711 // TSVECTDMATMULTEXPRTRAIT SPECIALIZATIONS
1712 //
1713 //=================================================================================================
1714 
1715 //*************************************************************************************************
1717 template< typename VT, typename MT, typename ST >
1718 struct TSVecTDMatMultExprTrait< VT, DMatScalarMultExpr<MT,ST,true> >
1719 {
1720  public:
1721  //**********************************************************************************************
1722  typedef typename SelectType< IsSparseVector<VT>::value && IsTransposeVector<VT>::value &&
1723  IsDenseMatrix<MT>::value && IsColumnMajorMatrix<MT>::value &&
1724  IsNumeric<ST>::value
1725  , typename TDVecScalarMultExprTrait<typename TSVecTDMatMultExprTrait<VT,MT>::Type,ST>::Type
1726  , INVALID_TYPE >::Type Type;
1727  //**********************************************************************************************
1728 };
1730 //*************************************************************************************************
1731 
1732 
1733 //*************************************************************************************************
1735 template< typename VT, typename ST1, typename MT, typename ST2 >
1736 struct TSVecTDMatMultExprTrait< SVecScalarMultExpr<VT,ST1,true>, DMatScalarMultExpr<MT,ST2,true> >
1737 {
1738  public:
1739  //**********************************************************************************************
1740  typedef typename SelectType< IsSparseVector<VT>::value && IsTransposeVector<VT>::value &&
1741  IsDenseMatrix<MT>::value && IsColumnMajorMatrix<MT>::value &&
1742  IsNumeric<ST1>::value && IsNumeric<ST2>::value
1743  , typename TDVecScalarMultExprTrait<typename TSVecTDMatMultExprTrait<VT,MT>::Type,typename MultTrait<ST1,ST2>::Type>::Type
1744  , INVALID_TYPE >::Type Type;
1745  //**********************************************************************************************
1746 };
1748 //*************************************************************************************************
1749 
1750 
1751 
1752 
1753 //=================================================================================================
1754 //
1755 // DMATDMATMULTEXPRTRAIT SPECIALIZATIONS
1756 //
1757 //=================================================================================================
1758 
1759 //*************************************************************************************************
1761 template< typename MT1, typename ST, typename MT2 >
1762 struct DMatDMatMultExprTrait< DMatScalarMultExpr<MT1,ST,false>, MT2 >
1763 {
1764  public:
1765  //**********************************************************************************************
1766  typedef typename SelectType< IsDenseMatrix<MT1>::value && IsRowMajorMatrix<MT1>::value &&
1767  IsDenseMatrix<MT2>::value && IsRowMajorMatrix<MT2>::value &&
1768  IsNumeric<ST>::value
1769  , typename DMatScalarMultExprTrait<typename DMatDMatMultExprTrait<MT1,MT2>::Type,ST>::Type
1770  , INVALID_TYPE >::Type Type;
1771  //**********************************************************************************************
1772 };
1774 //*************************************************************************************************
1775 
1776 
1777 //*************************************************************************************************
1779 template< typename MT1, typename MT2, typename ST >
1780 struct DMatDMatMultExprTrait< MT1, DMatScalarMultExpr<MT2,ST,false> >
1781 {
1782  public:
1783  //**********************************************************************************************
1784  typedef typename SelectType< IsDenseMatrix<MT1>::value && IsRowMajorMatrix<MT1>::value &&
1785  IsDenseMatrix<MT2>::value && IsRowMajorMatrix<MT2>::value &&
1786  IsNumeric<ST>::value
1787  , typename DMatScalarMultExprTrait<typename DMatDMatMultExprTrait<MT1,MT2>::Type,ST>::Type
1788  , INVALID_TYPE >::Type Type;
1789  //**********************************************************************************************
1790 };
1792 //*************************************************************************************************
1793 
1794 
1795 //*************************************************************************************************
1797 template< typename MT1, typename ST1, typename MT2, typename ST2 >
1798 struct DMatDMatMultExprTrait< DMatScalarMultExpr<MT1,ST1,false>, DMatScalarMultExpr<MT2,ST2,false> >
1799 {
1800  public:
1801  //**********************************************************************************************
1802  typedef typename SelectType< IsDenseMatrix<MT1>::value && IsRowMajorMatrix<MT1>::value &&
1803  IsDenseMatrix<MT2>::value && IsRowMajorMatrix<MT2>::value &&
1804  IsNumeric<ST1>::value && IsNumeric<ST2>::value
1805  , typename DMatScalarMultExprTrait<typename DMatDMatMultExprTrait<MT1,MT2>::Type,typename MultTrait<ST1,ST2>::Type>::Type
1806  , INVALID_TYPE >::Type Type;
1807  //**********************************************************************************************
1808 };
1810 //*************************************************************************************************
1811 
1812 
1813 
1814 
1815 //=================================================================================================
1816 //
1817 // DMATTDMATMULTEXPRTRAIT SPECIALIZATIONS
1818 //
1819 //=================================================================================================
1820 
1821 //*************************************************************************************************
1823 template< typename MT1, typename ST, typename MT2 >
1824 struct DMatTDMatMultExprTrait< DMatScalarMultExpr<MT1,ST,false>, MT2 >
1825 {
1826  public:
1827  //**********************************************************************************************
1828  typedef typename SelectType< IsDenseMatrix<MT1>::value && IsRowMajorMatrix<MT1>::value &&
1829  IsDenseMatrix<MT2>::value && IsColumnMajorMatrix<MT2>::value &&
1830  IsNumeric<ST>::value
1831  , typename DMatScalarMultExprTrait<typename DMatTDMatMultExprTrait<MT1,MT2>::Type,ST>::Type
1832  , INVALID_TYPE >::Type Type;
1833  //**********************************************************************************************
1834 };
1836 //*************************************************************************************************
1837 
1838 
1839 //*************************************************************************************************
1841 template< typename MT1, typename MT2, typename ST >
1842 struct DMatTDMatMultExprTrait< MT1, DMatScalarMultExpr<MT2,ST,true> >
1843 {
1844  public:
1845  //**********************************************************************************************
1846  typedef typename SelectType< IsDenseMatrix<MT1>::value && IsRowMajorMatrix<MT1>::value &&
1847  IsDenseMatrix<MT2>::value && IsColumnMajorMatrix<MT2>::value &&
1848  IsNumeric<ST>::value
1849  , typename DMatScalarMultExprTrait<typename DMatTDMatMultExprTrait<MT1,MT2>::Type,ST>::Type
1850  , INVALID_TYPE >::Type Type;
1851  //**********************************************************************************************
1852 };
1854 //*************************************************************************************************
1855 
1856 
1857 //*************************************************************************************************
1859 template< typename MT1, typename ST1, typename MT2, typename ST2 >
1860 struct DMatTDMatMultExprTrait< DMatScalarMultExpr<MT1,ST1,false>, DMatScalarMultExpr<MT2,ST2,true> >
1861 {
1862  public:
1863  //**********************************************************************************************
1864  typedef typename SelectType< IsDenseMatrix<MT1>::value && IsRowMajorMatrix<MT1>::value &&
1865  IsDenseMatrix<MT2>::value && IsColumnMajorMatrix<MT2>::value &&
1866  IsNumeric<ST1>::value && IsNumeric<ST2>::value
1867  , typename DMatScalarMultExprTrait<typename DMatTDMatMultExprTrait<MT1,MT2>::Type,typename MultTrait<ST1,ST2>::Type>::Type
1868  , INVALID_TYPE >::Type Type;
1869  //**********************************************************************************************
1870 };
1872 //*************************************************************************************************
1873 
1874 
1875 
1876 
1877 //=================================================================================================
1878 //
1879 // TDMATDMATMULTEXPRTRAIT SPECIALIZATIONS
1880 //
1881 //=================================================================================================
1882 
1883 //*************************************************************************************************
1885 template< typename MT1, typename ST, typename MT2 >
1886 struct TDMatDMatMultExprTrait< DMatScalarMultExpr<MT1,ST,true>, MT2 >
1887 {
1888  public:
1889  //**********************************************************************************************
1890  typedef typename SelectType< IsDenseMatrix<MT1>::value && IsColumnMajorMatrix<MT1>::value &&
1891  IsDenseMatrix<MT2>::value && IsRowMajorMatrix<MT2>::value &&
1892  IsNumeric<ST>::value
1893  , typename TDMatScalarMultExprTrait<typename TDMatDMatMultExprTrait<MT1,MT2>::Type,ST>::Type
1894  , INVALID_TYPE >::Type Type;
1895  //**********************************************************************************************
1896 };
1898 //*************************************************************************************************
1899 
1900 
1901 //*************************************************************************************************
1903 template< typename MT1, typename MT2, typename ST >
1904 struct TDMatDMatMultExprTrait< MT1, DMatScalarMultExpr<MT2,ST,false> >
1905 {
1906  public:
1907  //**********************************************************************************************
1908  typedef typename SelectType< IsDenseMatrix<MT1>::value && IsColumnMajorMatrix<MT1>::value &&
1909  IsDenseMatrix<MT2>::value && IsRowMajorMatrix<MT2>::value &&
1910  IsNumeric<ST>::value
1911  , typename TDMatScalarMultExprTrait<typename TDMatDMatMultExprTrait<MT1,MT2>::Type,ST>::Type
1912  , INVALID_TYPE >::Type Type;
1913  //**********************************************************************************************
1914 };
1916 //*************************************************************************************************
1917 
1918 
1919 //*************************************************************************************************
1921 template< typename MT1, typename ST1, typename MT2, typename ST2 >
1922 struct TDMatDMatMultExprTrait< DMatScalarMultExpr<MT1,ST1,true>, DMatScalarMultExpr<MT2,ST2,false> >
1923 {
1924  public:
1925  //**********************************************************************************************
1926  typedef typename SelectType< IsDenseMatrix<MT1>::value && IsColumnMajorMatrix<MT1>::value &&
1927  IsDenseMatrix<MT2>::value && IsRowMajorMatrix<MT2>::value &&
1928  IsNumeric<ST1>::value && IsNumeric<ST2>::value
1929  , typename TDMatScalarMultExprTrait<typename TDMatDMatMultExprTrait<MT1,MT2>::Type,typename MultTrait<ST1,ST2>::Type>::Type
1930  , INVALID_TYPE >::Type Type;
1931  //**********************************************************************************************
1932 };
1934 //*************************************************************************************************
1935 
1936 
1937 
1938 
1939 //=================================================================================================
1940 //
1941 // TDMATTDMATMULTEXPRTRAIT SPECIALIZATIONS
1942 //
1943 //=================================================================================================
1944 
1945 //*************************************************************************************************
1947 template< typename MT1, typename ST, typename MT2 >
1948 struct TDMatTDMatMultExprTrait< DMatScalarMultExpr<MT1,ST,true>, MT2 >
1949 {
1950  public:
1951  //**********************************************************************************************
1952  typedef typename SelectType< IsDenseMatrix<MT1>::value && IsColumnMajorMatrix<MT1>::value &&
1953  IsDenseMatrix<MT2>::value && IsColumnMajorMatrix<MT2>::value &&
1954  IsNumeric<ST>::value
1955  , typename TDMatScalarMultExprTrait<typename TDMatTDMatMultExprTrait<MT1,MT2>::Type,ST>::Type
1956  , INVALID_TYPE >::Type Type;
1957  //**********************************************************************************************
1958 };
1960 //*************************************************************************************************
1961 
1962 
1963 //*************************************************************************************************
1965 template< typename MT1, typename MT2, typename ST >
1966 struct TDMatTDMatMultExprTrait< MT1, DMatScalarMultExpr<MT2,ST,true> >
1967 {
1968  public:
1969  //**********************************************************************************************
1970  typedef typename SelectType< IsDenseMatrix<MT1>::value && IsColumnMajorMatrix<MT1>::value &&
1971  IsDenseMatrix<MT2>::value && IsColumnMajorMatrix<MT2>::value &&
1972  IsNumeric<ST>::value
1973  , typename TDMatScalarMultExprTrait<typename TDMatTDMatMultExprTrait<MT1,MT2>::Type,ST>::Type
1974  , INVALID_TYPE >::Type Type;
1975  //**********************************************************************************************
1976 };
1978 //*************************************************************************************************
1979 
1980 
1981 //*************************************************************************************************
1983 template< typename MT1, typename ST1, typename MT2, typename ST2 >
1984 struct TDMatTDMatMultExprTrait< DMatScalarMultExpr<MT1,ST1,true>, DMatScalarMultExpr<MT2,ST2,true> >
1985 {
1986  public:
1987  //**********************************************************************************************
1988  typedef typename SelectType< IsDenseMatrix<MT1>::value && IsColumnMajorMatrix<MT1>::value &&
1989  IsDenseMatrix<MT2>::value && IsColumnMajorMatrix<MT2>::value &&
1990  IsNumeric<ST1>::value && IsNumeric<ST2>::value
1991  , typename TDMatScalarMultExprTrait<typename TDMatTDMatMultExprTrait<MT1,MT2>::Type,typename MultTrait<ST1,ST2>::Type>::Type
1992  , INVALID_TYPE >::Type Type;
1993  //**********************************************************************************************
1994 };
1996 //*************************************************************************************************
1997 
1998 
1999 
2000 
2001 //=================================================================================================
2002 //
2003 // DMATSMATMULTEXPRTRAIT SPECIALIZATIONS
2004 //
2005 //=================================================================================================
2006 
2007 //*************************************************************************************************
2009 template< typename MT1, typename ST, typename MT2 >
2010 struct DMatSMatMultExprTrait< DMatScalarMultExpr<MT1,ST,false>, MT2 >
2011 {
2012  public:
2013  //**********************************************************************************************
2014  typedef typename SelectType< IsDenseMatrix<MT1>::value && IsRowMajorMatrix<MT1>::value &&
2015  IsSparseMatrix<MT2>::value && IsRowMajorMatrix<MT2>::value &&
2016  IsNumeric<ST>::value
2017  , typename DMatScalarMultExprTrait<typename DMatSMatMultExprTrait<MT1,MT2>::Type,ST>::Type
2018  , INVALID_TYPE >::Type Type;
2019  //**********************************************************************************************
2020 };
2022 //*************************************************************************************************
2023 
2024 
2025 //*************************************************************************************************
2027 template< typename MT1, typename ST1, typename MT2, typename ST2 >
2028 struct DMatSMatMultExprTrait< DMatScalarMultExpr<MT1,ST1,false>, SMatScalarMultExpr<MT2,ST2,false> >
2029 {
2030  public:
2031  //**********************************************************************************************
2032  typedef typename SelectType< IsDenseMatrix<MT1>::value && IsRowMajorMatrix<MT1>::value &&
2033  IsSparseMatrix<MT2>::value && IsRowMajorMatrix<MT2>::value &&
2034  IsNumeric<ST1>::value && IsNumeric<ST2>::value
2035  , typename DMatScalarMultExprTrait<typename DMatSMatMultExprTrait<MT1,MT2>::Type,typename MultTrait<ST1,ST2>::Type>::Type
2036  , INVALID_TYPE >::Type Type;
2037  //**********************************************************************************************
2038 };
2040 //*************************************************************************************************
2041 
2042 
2043 
2044 
2045 //=================================================================================================
2046 //
2047 // DMATTSMATMULTEXPRTRAIT SPECIALIZATIONS
2048 //
2049 //=================================================================================================
2050 
2051 //*************************************************************************************************
2053 template< typename MT1, typename ST, typename MT2 >
2054 struct DMatTSMatMultExprTrait< DMatScalarMultExpr<MT1,ST,false>, MT2 >
2055 {
2056  public:
2057  //**********************************************************************************************
2058  typedef typename SelectType< IsDenseMatrix<MT1>::value && IsRowMajorMatrix<MT1>::value &&
2059  IsSparseMatrix<MT2>::value && IsColumnMajorMatrix<MT2>::value &&
2060  IsNumeric<ST>::value
2061  , typename DMatScalarMultExprTrait<typename DMatTSMatMultExprTrait<MT1,MT2>::Type,ST>::Type
2062  , INVALID_TYPE >::Type Type;
2063  //**********************************************************************************************
2064 };
2066 //*************************************************************************************************
2067 
2068 
2069 //*************************************************************************************************
2071 template< typename MT1, typename ST1, typename MT2, typename ST2 >
2072 struct DMatTSMatMultExprTrait< DMatScalarMultExpr<MT1,ST1,false>, SMatScalarMultExpr<MT2,ST2,true> >
2073 {
2074  public:
2075  //**********************************************************************************************
2076  typedef typename SelectType< IsDenseMatrix<MT1>::value && IsRowMajorMatrix<MT1>::value &&
2077  IsSparseMatrix<MT2>::value && IsColumnMajorMatrix<MT2>::value &&
2078  IsNumeric<ST1>::value && IsNumeric<ST2>::value
2079  , typename DMatScalarMultExprTrait<typename DMatTSMatMultExprTrait<MT1,MT2>::Type,typename MultTrait<ST1,ST2>::Type>::Type
2080  , INVALID_TYPE >::Type Type;
2081  //**********************************************************************************************
2082 };
2084 //*************************************************************************************************
2085 
2086 
2087 
2088 
2089 //=================================================================================================
2090 //
2091 // TDMATSMATMULTEXPRTRAIT SPECIALIZATIONS
2092 //
2093 //=================================================================================================
2094 
2095 //*************************************************************************************************
2097 template< typename MT1, typename ST, typename MT2 >
2098 struct TDMatSMatMultExprTrait< DMatScalarMultExpr<MT1,ST,true>, MT2 >
2099 {
2100  public:
2101  //**********************************************************************************************
2102  typedef typename SelectType< IsDenseMatrix<MT1>::value && IsColumnMajorMatrix<MT1>::value &&
2103  IsSparseMatrix<MT2>::value && IsRowMajorMatrix<MT2>::value &&
2104  IsNumeric<ST>::value
2105  , typename TDMatScalarMultExprTrait<typename TDMatSMatMultExprTrait<MT1,MT2>::Type,ST>::Type
2106  , INVALID_TYPE >::Type Type;
2107  //**********************************************************************************************
2108 };
2110 //*************************************************************************************************
2111 
2112 
2113 //*************************************************************************************************
2115 template< typename MT1, typename ST1, typename MT2, typename ST2 >
2116 struct TDMatSMatMultExprTrait< DMatScalarMultExpr<MT1,ST1,true>, SMatScalarMultExpr<MT2,ST2,false> >
2117 {
2118  public:
2119  //**********************************************************************************************
2120  typedef typename SelectType< IsDenseMatrix<MT1>::value && IsColumnMajorMatrix<MT1>::value &&
2121  IsSparseMatrix<MT2>::value && IsRowMajorMatrix<MT2>::value &&
2122  IsNumeric<ST1>::value && IsNumeric<ST2>::value
2123  , typename TDMatScalarMultExprTrait<typename TDMatSMatMultExprTrait<MT1,MT2>::Type,typename MultTrait<ST1,ST2>::Type>::Type
2124  , INVALID_TYPE >::Type Type;
2125  //**********************************************************************************************
2126 };
2128 //*************************************************************************************************
2129 
2130 
2131 
2132 
2133 //=================================================================================================
2134 //
2135 // TDMATTSMATMULTEXPRTRAIT SPECIALIZATIONS
2136 //
2137 //=================================================================================================
2138 
2139 //*************************************************************************************************
2141 template< typename MT1, typename ST, typename MT2 >
2142 struct TDMatTSMatMultExprTrait< DMatScalarMultExpr<MT1,ST,true>, MT2 >
2143 {
2144  public:
2145  //**********************************************************************************************
2146  typedef typename SelectType< IsDenseMatrix<MT1>::value && IsColumnMajorMatrix<MT1>::value &&
2147  IsSparseMatrix<MT2>::value && IsColumnMajorMatrix<MT2>::value &&
2148  IsNumeric<ST>::value
2149  , typename TDMatScalarMultExprTrait<typename TDMatTSMatMultExprTrait<MT1,MT2>::Type,ST>::Type
2150  , INVALID_TYPE >::Type Type;
2151  //**********************************************************************************************
2152 };
2154 //*************************************************************************************************
2155 
2156 
2157 //*************************************************************************************************
2159 template< typename MT1, typename ST1, typename MT2, typename ST2 >
2160 struct TDMatTSMatMultExprTrait< DMatScalarMultExpr<MT1,ST1,true>, SMatScalarMultExpr<MT2,ST2,true> >
2161 {
2162  public:
2163  //**********************************************************************************************
2164  typedef typename SelectType< IsDenseMatrix<MT1>::value && IsColumnMajorMatrix<MT1>::value &&
2165  IsSparseMatrix<MT2>::value && IsColumnMajorMatrix<MT2>::value &&
2166  IsNumeric<ST1>::value && IsNumeric<ST2>::value
2167  , typename TDMatScalarMultExprTrait<typename TDMatTSMatMultExprTrait<MT1,MT2>::Type,typename MultTrait<ST1,ST2>::Type>::Type
2168  , INVALID_TYPE >::Type Type;
2169  //**********************************************************************************************
2170 };
2172 //*************************************************************************************************
2173 
2174 
2175 
2176 
2177 //=================================================================================================
2178 //
2179 // SMATDMATMULTEXPRTRAIT SPECIALIZATIONS
2180 //
2181 //=================================================================================================
2182 
2183 //*************************************************************************************************
2185 template< typename MT1, typename ST, typename MT2 >
2186 struct SMatDMatMultExprTrait< MT1, DMatScalarMultExpr<MT2,ST,false> >
2187 {
2188  public:
2189  //**********************************************************************************************
2190  typedef typename SelectType< IsSparseMatrix<MT1>::value && IsRowMajorMatrix<MT1>::value &&
2191  IsDenseMatrix<MT2>::value && IsRowMajorMatrix<MT2>::value &&
2192  IsNumeric<ST>::value
2193  , typename DMatScalarMultExprTrait<typename SMatDMatMultExprTrait<MT1,MT2>::Type,ST>::Type
2194  , INVALID_TYPE >::Type Type;
2195  //**********************************************************************************************
2196 };
2198 //*************************************************************************************************
2199 
2200 
2201 //*************************************************************************************************
2203 template< typename MT1, typename ST1, typename MT2, typename ST2 >
2204 struct SMatDMatMultExprTrait< SMatScalarMultExpr<MT1,ST1,false>, DMatScalarMultExpr<MT2,ST2,false> >
2205 {
2206  public:
2207  //**********************************************************************************************
2208  typedef typename SelectType< IsSparseMatrix<MT1>::value && IsRowMajorMatrix<MT1>::value &&
2209  IsDenseMatrix<MT2>::value && IsRowMajorMatrix<MT2>::value &&
2210  IsNumeric<ST1>::value && IsNumeric<ST2>::value
2211  , typename DMatScalarMultExprTrait<typename SMatDMatMultExprTrait<MT1,MT2>::Type,typename MultTrait<ST1,ST2>::Type>::Type
2212  , INVALID_TYPE >::Type Type;
2213  //**********************************************************************************************
2214 };
2216 //*************************************************************************************************
2217 
2218 
2219 
2220 
2221 //=================================================================================================
2222 //
2223 // SMATTDMATMULTEXPRTRAIT SPECIALIZATIONS
2224 //
2225 //=================================================================================================
2226 
2227 //*************************************************************************************************
2229 template< typename MT1, typename ST, typename MT2 >
2230 struct SMatTDMatMultExprTrait< MT1, DMatScalarMultExpr<MT2,ST,true> >
2231 {
2232  public:
2233  //**********************************************************************************************
2234  typedef typename SelectType< IsSparseMatrix<MT1>::value && IsRowMajorMatrix<MT1>::value &&
2235  IsDenseMatrix<MT2>::value && IsColumnMajorMatrix<MT2>::value &&
2236  IsNumeric<ST>::value
2237  , typename DMatScalarMultExprTrait<typename SMatTDMatMultExprTrait<MT1,MT2>::Type,ST>::Type
2238  , INVALID_TYPE >::Type Type;
2239  //**********************************************************************************************
2240 };
2242 //*************************************************************************************************
2243 
2244 
2245 //*************************************************************************************************
2247 template< typename MT1, typename ST1, typename MT2, typename ST2 >
2248 struct SMatTDMatMultExprTrait< SMatScalarMultExpr<MT1,ST1,false>, DMatScalarMultExpr<MT2,ST2,true> >
2249 {
2250  public:
2251  //**********************************************************************************************
2252  typedef typename SelectType< IsSparseMatrix<MT1>::value && IsRowMajorMatrix<MT1>::value &&
2253  IsDenseMatrix<MT2>::value && IsColumnMajorMatrix<MT2>::value &&
2254  IsNumeric<ST1>::value && IsNumeric<ST2>::value
2255  , typename DMatScalarMultExprTrait<typename SMatTDMatMultExprTrait<MT1,MT2>::Type,typename MultTrait<ST1,ST2>::Type>::Type
2256  , INVALID_TYPE >::Type Type;
2257  //**********************************************************************************************
2258 };
2260 //*************************************************************************************************
2261 
2262 
2263 
2264 
2265 //=================================================================================================
2266 //
2267 // TSMATDMATMULTEXPRTRAIT SPECIALIZATIONS
2268 //
2269 //=================================================================================================
2270 
2271 //*************************************************************************************************
2273 template< typename MT1, typename ST, typename MT2 >
2274 struct TSMatDMatMultExprTrait< MT1, DMatScalarMultExpr<MT2,ST,false> >
2275 {
2276  public:
2277  //**********************************************************************************************
2278  typedef typename SelectType< IsSparseMatrix<MT1>::value && IsColumnMajorMatrix<MT1>::value &&
2279  IsDenseMatrix<MT2>::value && IsRowMajorMatrix<MT2>::value &&
2280  IsNumeric<ST>::value
2281  , typename TDMatScalarMultExprTrait<typename TSMatDMatMultExprTrait<MT1,MT2>::Type,ST>::Type
2282  , INVALID_TYPE >::Type Type;
2283  //**********************************************************************************************
2284 };
2286 //*************************************************************************************************
2287 
2288 
2289 //*************************************************************************************************
2291 template< typename MT1, typename ST1, typename MT2, typename ST2 >
2292 struct TSMatDMatMultExprTrait< SMatScalarMultExpr<MT1,ST1,true>, DMatScalarMultExpr<MT2,ST2,false> >
2293 {
2294  public:
2295  //**********************************************************************************************
2296  typedef typename SelectType< IsSparseMatrix<MT1>::value && IsColumnMajorMatrix<MT1>::value &&
2297  IsDenseMatrix<MT2>::value && IsRowMajorMatrix<MT2>::value &&
2298  IsNumeric<ST1>::value && IsNumeric<ST2>::value
2299  , typename TDMatScalarMultExprTrait<typename TSMatDMatMultExprTrait<MT1,MT2>::Type,typename MultTrait<ST1,ST2>::Type>::Type
2300  , INVALID_TYPE >::Type Type;
2301  //**********************************************************************************************
2302 };
2304 //*************************************************************************************************
2305 
2306 
2307 
2308 
2309 //=================================================================================================
2310 //
2311 // TSMATTDMATMULTEXPRTRAIT SPECIALIZATIONS
2312 //
2313 //=================================================================================================
2314 
2315 //*************************************************************************************************
2317 template< typename MT1, typename ST, typename MT2 >
2318 struct TSMatTDMatMultExprTrait< MT1, DMatScalarMultExpr<MT2,ST,true> >
2319 {
2320  public:
2321  //**********************************************************************************************
2322  typedef typename SelectType< IsSparseMatrix<MT1>::value && IsColumnMajorMatrix<MT1>::value &&
2323  IsDenseMatrix<MT2>::value && IsColumnMajorMatrix<MT2>::value &&
2324  IsNumeric<ST>::value
2325  , typename TDMatScalarMultExprTrait<typename TSMatTDMatMultExprTrait<MT1,MT2>::Type,ST>::Type
2326  , INVALID_TYPE >::Type Type;
2327  //**********************************************************************************************
2328 };
2330 //*************************************************************************************************
2331 
2332 
2333 //*************************************************************************************************
2335 template< typename MT1, typename ST1, typename MT2, typename ST2 >
2336 struct TSMatTDMatMultExprTrait< SMatScalarMultExpr<MT1,ST1,true>, DMatScalarMultExpr<MT2,ST2,true> >
2337 {
2338  public:
2339  //**********************************************************************************************
2340  typedef typename SelectType< IsSparseMatrix<MT1>::value && IsColumnMajorMatrix<MT1>::value &&
2341  IsDenseMatrix<MT2>::value && IsColumnMajorMatrix<MT2>::value &&
2342  IsNumeric<ST1>::value && IsNumeric<ST2>::value
2343  , typename TDMatScalarMultExprTrait<typename TSMatTDMatMultExprTrait<MT1,MT2>::Type,typename MultTrait<ST1,ST2>::Type>::Type
2344  , INVALID_TYPE >::Type Type;
2345  //**********************************************************************************************
2346 };
2348 //*************************************************************************************************
2349 
2350 
2351 
2352 
2353 //=================================================================================================
2354 //
2355 // ROWEXPRTRAIT SPECIALIZATIONS
2356 //
2357 //=================================================================================================
2358 
2359 //*************************************************************************************************
2361 template< typename MT, typename ST, bool SO >
2362 struct RowExprTrait< DMatScalarMultExpr<MT,ST,SO> >
2363 {
2364  public:
2365  //**********************************************************************************************
2366  typedef typename MultExprTrait< typename RowExprTrait<const MT>::Type, ST >::Type Type;
2367  //**********************************************************************************************
2368 };
2370 //*************************************************************************************************
2371 
2372 
2373 
2374 
2375 //=================================================================================================
2376 //
2377 // COLUMNEXPRTRAIT SPECIALIZATIONS
2378 //
2379 //=================================================================================================
2380 
2381 //*************************************************************************************************
2383 template< typename MT, typename ST, bool SO >
2384 struct ColumnExprTrait< DMatScalarMultExpr<MT,ST,SO> >
2385 {
2386  public:
2387  //**********************************************************************************************
2388  typedef typename MultExprTrait< typename ColumnExprTrait<const MT>::Type, ST >::Type Type;
2389  //**********************************************************************************************
2390 };
2392 //*************************************************************************************************
2393 
2394 } // namespace blaze
2395 
2396 #endif