All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
DMatScalarMultExpr.h
Go to the documentation of this file.
1 //=================================================================================================
33 //=================================================================================================
34 
35 #ifndef _BLAZE_MATH_EXPRESSIONS_DMATSCALARMULTEXPR_H_
36 #define _BLAZE_MATH_EXPRESSIONS_DMATSCALARMULTEXPR_H_
37 
38 
39 //*************************************************************************************************
40 // Includes
41 //*************************************************************************************************
42 
43 #include <iterator>
51 #include <blaze/math/Intrinsics.h>
70 #include <blaze/util/Assert.h>
74 #include <blaze/util/EnableIf.h>
75 #include <blaze/util/InvalidType.h>
77 #include <blaze/util/SelectType.h>
78 #include <blaze/util/Types.h>
82 
83 
84 namespace blaze {
85 
86 //=================================================================================================
87 //
88 // CLASS DMATSCALARMULTEXPR
89 //
90 //=================================================================================================
91 
92 //*************************************************************************************************
99 template< typename MT // Type of the left-hand side dense matrix
100  , typename ST // Type of the right-hand side scalar value
101  , bool SO > // Storage order
102 class DMatScalarMultExpr : public DenseMatrix< DMatScalarMultExpr<MT,ST,SO>, SO >
103  , private MatScalarMultExpr
104  , private Computation
105 {
106  private:
107  //**Type definitions****************************************************************************
108  typedef typename MT::ResultType RT;
109  typedef typename MT::ReturnType RN;
110  typedef typename MT::ElementType ET;
111  typedef typename MT::CompositeType CT;
112  //**********************************************************************************************
113 
114  //**Return type evaluation**********************************************************************
116 
121  enum { returnExpr = !IsTemporary<RN>::value };
122 
125  //**********************************************************************************************
126 
127  //**Evaluation strategy*************************************************************************
129 
135  enum { useAssign = RequiresEvaluation<MT>::value };
136 
138  template< typename MT2 >
140  struct UseAssign {
141  enum { value = useAssign };
142  };
144  //**********************************************************************************************
145 
146  public:
147  //**Type definitions****************************************************************************
154 
157 
160 
162  typedef typename SelectType< IsExpression<MT>::value, const MT, const MT& >::Type LeftOperand;
163 
165  typedef ST RightOperand;
166  //**********************************************************************************************
167 
168  //**ConstIterator class definition**************************************************************
172  {
173  public:
174  //**Type definitions*************************************************************************
175  typedef std::random_access_iterator_tag IteratorCategory;
180 
181  // STL iterator requirements
187 
189  typedef typename MT::ConstIterator IteratorType;
190  //*******************************************************************************************
191 
192  //**Constructor******************************************************************************
198  explicit inline ConstIterator( IteratorType iterator, RightOperand scalar )
199  : iterator_( iterator ) // Iterator to the current element
200  , scalar_ ( scalar ) // Scalar of the multiplication expression
201  {}
202  //*******************************************************************************************
203 
204  //**Addition assignment operator*************************************************************
210  inline ConstIterator& operator+=( size_t inc ) {
211  iterator_ += inc;
212  return *this;
213  }
214  //*******************************************************************************************
215 
216  //**Subtraction assignment operator**********************************************************
222  inline ConstIterator& operator-=( size_t dec ) {
223  iterator_ -= dec;
224  return *this;
225  }
226  //*******************************************************************************************
227 
228  //**Prefix increment operator****************************************************************
234  ++iterator_;
235  return *this;
236  }
237  //*******************************************************************************************
238 
239  //**Postfix increment operator***************************************************************
244  inline const ConstIterator operator++( int ) {
245  return ConstIterator( iterator_++ );
246  }
247  //*******************************************************************************************
248 
249  //**Prefix decrement operator****************************************************************
255  --iterator_;
256  return *this;
257  }
258  //*******************************************************************************************
259 
260  //**Postfix decrement operator***************************************************************
265  inline const ConstIterator operator--( int ) {
266  return ConstIterator( iterator_-- );
267  }
268  //*******************************************************************************************
269 
270  //**Element access operator******************************************************************
275  inline ReturnType operator*() const {
276  return *iterator_ * scalar_;
277  }
278  //*******************************************************************************************
279 
280  //**Load function****************************************************************************
285  inline IntrinsicType load() const {
286  return iterator_.load() * set( scalar_ );
287  }
288  //*******************************************************************************************
289 
290  //**Equality operator************************************************************************
296  inline bool operator==( const ConstIterator& rhs ) const {
297  return iterator_ == rhs.iterator_;
298  }
299  //*******************************************************************************************
300 
301  //**Inequality operator**********************************************************************
307  inline bool operator!=( const ConstIterator& rhs ) const {
308  return iterator_ != rhs.iterator_;
309  }
310  //*******************************************************************************************
311 
312  //**Less-than operator***********************************************************************
318  inline bool operator<( const ConstIterator& rhs ) const {
319  return iterator_ < rhs.iterator_;
320  }
321  //*******************************************************************************************
322 
323  //**Greater-than operator********************************************************************
329  inline bool operator>( const ConstIterator& rhs ) const {
330  return iterator_ > rhs.iterator_;
331  }
332  //*******************************************************************************************
333 
334  //**Less-or-equal-than operator**************************************************************
340  inline bool operator<=( const ConstIterator& rhs ) const {
341  return iterator_ <= rhs.iterator_;
342  }
343  //*******************************************************************************************
344 
345  //**Greater-or-equal-than operator***********************************************************
351  inline bool operator>=( const ConstIterator& rhs ) const {
352  return iterator_ >= rhs.iterator_;
353  }
354  //*******************************************************************************************
355 
356  //**Subtraction operator*********************************************************************
362  inline DifferenceType operator-( const ConstIterator& rhs ) const {
363  return iterator_ - rhs.iterator_;
364  }
365  //*******************************************************************************************
366 
367  //**Addition operator************************************************************************
374  friend inline const ConstIterator operator+( const ConstIterator& it, size_t inc ) {
375  return ConstIterator( it.iterator_ + inc );
376  }
377  //*******************************************************************************************
378 
379  //**Addition operator************************************************************************
386  friend inline const ConstIterator operator+( size_t inc, const ConstIterator& it ) {
387  return ConstIterator( it.iterator_ + inc );
388  }
389  //*******************************************************************************************
390 
391  //**Subtraction operator*********************************************************************
398  friend inline const ConstIterator operator-( const ConstIterator& it, size_t dec ) {
399  return ConstIterator( it.iterator_ - dec );
400  }
401  //*******************************************************************************************
402 
403  private:
404  //**Member variables*************************************************************************
407  //*******************************************************************************************
408  };
409  //**********************************************************************************************
410 
411  //**Compilation flags***************************************************************************
413  enum { vectorizable = MT::vectorizable &&
416  //**********************************************************************************************
417 
418  //**Constructor*********************************************************************************
424  explicit inline DMatScalarMultExpr( const MT& matrix, ST scalar )
425  : matrix_( matrix ) // Left-hand side dense matrix of the multiplication expression
426  , scalar_( scalar ) // Right-hand side scalar of the multiplication expression
427  {}
428  //**********************************************************************************************
429 
430  //**Access operator*****************************************************************************
437  inline ReturnType operator()( size_t i, size_t j ) const {
438  BLAZE_INTERNAL_ASSERT( i < matrix_.rows() , "Invalid row access index" );
439  BLAZE_INTERNAL_ASSERT( j < matrix_.columns(), "Invalid column access index" );
440  return matrix_(i,j) * scalar_;
441  }
442  //**********************************************************************************************
443 
444  //**Load function*******************************************************************************
451  inline IntrinsicType load( size_t i, size_t j ) const {
452  typedef IntrinsicTrait<ElementType> IT;
453  BLAZE_INTERNAL_ASSERT( i < matrix_.rows() , "Invalid row access index" );
454  BLAZE_INTERNAL_ASSERT( j < matrix_.columns(), "Invalid column access index" );
455  BLAZE_INTERNAL_ASSERT( !SO || ( i % IT::size == 0UL ), "Invalid row access index" );
456  BLAZE_INTERNAL_ASSERT( SO || ( j % IT::size == 0UL ), "Invalid column access index" );
457  const IntrinsicType xmm1( matrix_.load(i,j) );
458  const IntrinsicType xmm2( set( scalar_ ) );
459  return xmm1 * xmm2;
460  }
461  //**********************************************************************************************
462 
463  //**Begin function******************************************************************************
469  inline ConstIterator begin( size_t i ) const {
470  return ConstIterator( matrix_.begin(i), scalar_ );
471  }
472  //**********************************************************************************************
473 
474  //**End function********************************************************************************
480  inline ConstIterator end( size_t i ) const {
481  return ConstIterator( matrix_.end(i), scalar_ );
482  }
483  //**********************************************************************************************
484 
485  //**Rows function*******************************************************************************
490  inline size_t rows() const {
491  return matrix_.rows();
492  }
493  //**********************************************************************************************
494 
495  //**Columns function****************************************************************************
500  inline size_t columns() const {
501  return matrix_.columns();
502  }
503  //**********************************************************************************************
504 
505  //**Left operand access*************************************************************************
510  inline LeftOperand leftOperand() const {
511  return matrix_;
512  }
513  //**********************************************************************************************
514 
515  //**Right operand access************************************************************************
520  inline RightOperand rightOperand() const {
521  return scalar_;
522  }
523  //**********************************************************************************************
524 
525  //**********************************************************************************************
531  template< typename T >
532  inline bool canAlias( const T* alias ) const {
533  return IsComputation<MT>::value && matrix_.canAlias( alias );
534  }
535  //**********************************************************************************************
536 
537  //**********************************************************************************************
543  template< typename T >
544  inline bool isAliased( const T* alias ) const {
545  return matrix_.isAliased( alias );
546  }
547  //**********************************************************************************************
548 
549  private:
550  //**Member variables****************************************************************************
553  //**********************************************************************************************
554 
555  //**Assignment to dense matrices****************************************************************
569  template< typename MT2 // Type of the target dense matrix
570  , bool SO2 > // Storage order of the target dense matrix
571  friend inline typename EnableIf< UseAssign<MT2> >::Type
573  {
575 
576  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
577  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
578 
579  assign( ~lhs, rhs.matrix_ );
580  (~lhs) *= rhs.scalar_;
581  }
583  //**********************************************************************************************
584 
585  //**Assignment to sparse matrices***************************************************************
599  template< typename MT2 // Type of the target sparse matrix
600  , bool SO2 > // Storage order of the target sparse matrix
601  friend inline typename EnableIf< UseAssign<MT2> >::Type
603  {
605 
606  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
607  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
608 
609  assign( ~lhs, rhs.matrix_ );
610  (~lhs) *= rhs.scalar_;
611  }
613  //**********************************************************************************************
614 
615  //**Addition assignment to dense matrices*******************************************************
629  template< typename MT2 // Type of the target dense matrix
630  , bool SO2 > // Storage order of the target dense matrix
631  friend inline typename EnableIf< UseAssign<MT2> >::Type
632  addAssign( DenseMatrix<MT2,SO2>& lhs, const DMatScalarMultExpr& rhs )
633  {
635 
639 
640  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
641  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
642 
643  const ResultType tmp( rhs );
644  addAssign( ~lhs, tmp );
645  }
647  //**********************************************************************************************
648 
649  //**Addition assignment to sparse matrices******************************************************
650  // No special implementation for the addition assignment to sparse matrices.
651  //**********************************************************************************************
652 
653  //**Subtraction assignment to dense matrices****************************************************
667  template< typename MT2 // Type of the target dense matrix
668  , bool SO2 > // Storage order of the target dense matrix
669  friend inline typename EnableIf< UseAssign<MT2> >::Type
670  subAssign( DenseMatrix<MT2,SO2>& lhs, const DMatScalarMultExpr& rhs )
671  {
673 
677 
678  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
679  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
680 
681  const ResultType tmp( rhs );
682  subAssign( ~lhs, tmp );
683  }
685  //**********************************************************************************************
686 
687  //**Subtraction assignment to sparse matrices***************************************************
688  // No special implementation for the subtraction assignment to sparse matrices.
689  //**********************************************************************************************
690 
691  //**Multiplication assignment to dense matrices*************************************************
692  // No special implementation for the multiplication assignment to dense matrices.
693  //**********************************************************************************************
694 
695  //**Multiplication assignment to sparse matrices************************************************
696  // No special implementation for the multiplication assignment to sparse matrices.
697  //**********************************************************************************************
698 
699  //**Compile time checks*************************************************************************
706  //**********************************************************************************************
707 };
708 //*************************************************************************************************
709 
710 
711 
712 
713 //=================================================================================================
714 //
715 // GLOBAL UNARY ARITHMETIC OPERATORS
716 //
717 //=================================================================================================
718 
719 //*************************************************************************************************
736 template< typename MT // Type of the dense matrix
737  , bool SO > // Storage order
738 inline const DMatScalarMultExpr<MT,typename BaseElementType<MT>::Type,SO>
740 {
742 
743  typedef typename BaseElementType<MT>::Type ElementType;
745 }
746 //*************************************************************************************************
747 
748 
749 
750 
751 //=================================================================================================
752 //
753 // GLOBAL BINARY ARITHMETIC OPERATORS
754 //
755 //=================================================================================================
756 
757 //*************************************************************************************************
778 template< typename T1 // Type of the left-hand side dense matrix
779  , bool SO // Storage order of the left-hand side dense matrix
780  , typename T2 > // Type of the right-hand side scalar
781 inline const typename EnableIf< IsNumeric<T2>, typename MultExprTrait<T1,T2>::Type >::Type
782  operator*( const DenseMatrix<T1,SO>& mat, T2 scalar )
783 {
785 
786  typedef typename MultExprTrait<T1,T2>::Type Type;
787  return Type( ~mat, scalar );
788 }
789 //*************************************************************************************************
790 
791 
792 //*************************************************************************************************
813 template< typename T1 // Type of the left-hand side scalar
814  , typename T2 // Type of the right-hand side dense matrix
815  , bool SO > // Storage order of the right-hand side dense matrix
816 inline const typename EnableIf< IsNumeric<T1>, typename MultExprTrait<T1,T2>::Type >::Type
817  operator*( T1 scalar, const DenseMatrix<T2,SO>& mat )
818 {
820 
821  typedef typename MultExprTrait<T1,T2>::Type Type;
822  return Type( ~mat, scalar );
823 }
824 //*************************************************************************************************
825 
826 
827 
828 
829 //=================================================================================================
830 //
831 // GLOBAL RESTRUCTURING UNARY ARITHMETIC OPERATORS
832 //
833 //=================================================================================================
834 
835 //*************************************************************************************************
847 template< typename VT // Type of the dense matrix
848  , typename ST // Type of the scalar
849  , bool TF > // Transpose flag
850 inline const DMatScalarMultExpr<VT,ST,TF>
851  operator-( const DMatScalarMultExpr<VT,ST,TF>& dm )
852 {
854 
855  return DMatScalarMultExpr<VT,ST,TF>( dm.leftOperand(), -dm.rightOperand() );
856 }
858 //*************************************************************************************************
859 
860 
861 
862 
863 //=================================================================================================
864 //
865 // GLOBAL RESTRUCTURING BINARY ARITHMETIC OPERATORS
866 //
867 //=================================================================================================
868 
869 //*************************************************************************************************
882 template< typename MT // Type of the dense matrix of the left-hand side expression
883  , typename ST1 // Type of the scalar of the left-hand side expression
884  , bool SO // Storage order of the dense matrix
885  , typename ST2 > // Type of the right-hand side scalar
886 inline const typename EnableIf< IsNumeric<ST2>
887  , typename MultExprTrait< DMatScalarMultExpr<MT,ST1,SO>, ST2 >::Type >::Type
888  operator*( const DMatScalarMultExpr<MT,ST1,SO>& mat, ST2 scalar )
889 {
891 
892  return mat.leftOperand() * ( mat.rightOperand() * scalar );
893 }
895 //*************************************************************************************************
896 
897 
898 //*************************************************************************************************
911 template< typename ST1 // Type of the left-hand side scalar
912  , typename MT // Type of the dense matrix of the right-hand side expression
913  , typename ST2 // Type of the scalar of the right-hand side expression
914  , bool SO > // Storage order of the dense matrix
915 inline const typename EnableIf< IsNumeric<ST1>
916  , typename MultExprTrait< ST1, DMatScalarMultExpr<MT,ST2,SO> >::Type >::Type
917  operator*( ST1 scalar, const DMatScalarMultExpr<MT,ST2,SO>& mat )
918 {
920 
921  return mat.leftOperand() * ( scalar * mat.rightOperand() );
922 }
924 //*************************************************************************************************
925 
926 
927 //*************************************************************************************************
940 template< typename MT // Type of the dense matrix of the left-hand side expression
941  , typename ST1 // Type of the scalar of the left-hand side expression
942  , bool SO // Storage order of the dense matrix
943  , typename ST2 > // Type of the right-hand side scalar
944 inline const typename EnableIf< IsFloatingPoint<typename DivTrait<ST1,ST2>::Type>
945  , typename DivExprTrait< DMatScalarMultExpr<MT,ST1,SO>, ST2 >::Type >::Type
946  operator/( const DMatScalarMultExpr<MT,ST1,SO>& mat, ST2 scalar )
947 {
949 
950  return mat.leftOperand() * ( mat.rightOperand() / scalar );
951 }
953 //*************************************************************************************************
954 
955 
956 //*************************************************************************************************
970 template< typename MT // Type of the dense matrix of the left-hand side expression
971  , typename ST // Type of the scalar of the left-hand side expression
972  , bool SO // Storage order of the left-hand side expression
973  , typename VT > // Type of the right-hand side dense vector
974 inline const typename MultExprTrait< DMatScalarMultExpr<MT,ST,SO>, VT >::Type
975  operator*( const DMatScalarMultExpr<MT,ST,SO>& mat, const DenseVector<VT,false>& vec )
976 {
978 
979  return ( mat.leftOperand() * (~vec) ) * mat.rightOperand();
980 }
982 //*************************************************************************************************
983 
984 
985 //*************************************************************************************************
999 template< typename VT // Type of the left-hand side dense vector
1000  , typename MT // Type of the dense matrix of the right-hand side expression
1001  , typename ST // Type of the scalar of the right-hand side expression
1002  , bool SO > // Storage order of the right-hand side expression
1003 inline const typename MultExprTrait< VT, DMatScalarMultExpr<MT,ST,SO> >::Type
1004  operator*( const DenseVector<VT,true>& vec, const DMatScalarMultExpr<MT,ST,SO>& mat )
1005 {
1007 
1008  return ( (~vec) * mat.leftOperand() ) * mat.rightOperand();
1009 }
1011 //*************************************************************************************************
1012 
1013 
1014 //*************************************************************************************************
1030 template< typename MT // Type of the dense matrix of the left-hand side expression
1031  , typename ST1 // Type of the scalar of the left-hand side expression
1032  , bool SO // Storage order of the left-hand side expression
1033  , typename VT // Type of the dense vector of the right-hand side expression
1034  , typename ST2 > // Type of the scalar of the right-hand side expression
1035 inline const DVecScalarMultExpr<typename MultExprTrait<MT,VT>::Type,typename MultTrait<ST1,ST2>::Type,false>
1036  operator*( const DMatScalarMultExpr<MT,ST1,SO>& mat, const DVecScalarMultExpr<VT,ST2,false>& vec )
1037 {
1039 
1040  return ( mat.leftOperand() * vec.leftOperand() ) * ( mat.rightOperand() * vec.rightOperand() );
1041 }
1043 //*************************************************************************************************
1044 
1045 
1046 //*************************************************************************************************
1062 template< typename VT // Type of the dense vector of the left-hand side expression
1063  , typename ST1 // Type of the scalar of the left-hand side expression
1064  , typename MT // Type of the dense matrix of the right-hand side expression
1065  , typename ST2 // Type of the scalar of the right-hand side expression
1066  , bool SO > // Storage order of the right-hand side expression
1067 inline const typename MultExprTrait< DVecScalarMultExpr<VT,ST1,true>, DMatScalarMultExpr<MT,ST2,SO> >::Type
1068  operator*( const DVecScalarMultExpr<VT,ST1,true>& vec, const DMatScalarMultExpr<MT,ST2,SO>& mat )
1069 {
1071 
1072  return ( vec.leftOperand() * mat.leftOperand() ) * ( vec.rightOperand() * mat.rightOperand() );
1073 }
1075 //*************************************************************************************************
1076 
1077 
1078 //*************************************************************************************************
1092 template< typename MT // Type of the dense matrix of the left-hand side expression
1093  , typename ST // Type of the scalar of the left-hand side expression
1094  , bool SO // Storage order of the left-hand side expression
1095  , typename VT > // Type of the right-hand side sparse vector
1096 inline const typename MultExprTrait< DMatScalarMultExpr<MT,ST,SO>, VT >::Type
1097  operator*( const DMatScalarMultExpr<MT,ST,SO>& mat, const SparseVector<VT,false>& vec )
1098 {
1100 
1101  return ( mat.leftOperand() * (~vec) ) * mat.rightOperand();
1102 }
1104 //*************************************************************************************************
1105 
1106 
1107 //*************************************************************************************************
1121 template< typename VT // Type of the left-hand side sparse vector
1122  , typename MT // Type of the dense matrix of the right-hand side expression
1123  , typename ST // Type of the scalar of the right-hand side expression
1124  , bool SO > // Storage order of the right-hand side expression
1125 inline const typename MultExprTrait< VT, DMatScalarMultExpr<MT,ST,SO> >::Type
1126  operator*( const SparseVector<VT,true>& vec, const DMatScalarMultExpr<MT,ST,SO>& mat )
1127 {
1129 
1130  return ( (~vec) * mat.leftOperand() ) * mat.rightOperand();
1131 }
1133 //*************************************************************************************************
1134 
1135 
1136 //*************************************************************************************************
1152 template< typename MT // Type of the dense matrix of the left-hand side expression
1153  , typename ST1 // Type of the scalar of the left-hand side expression
1154  , bool SO // Storage order of the left-hand side expression
1155  , typename VT // Type of the sparse vector of the right-hand side expression
1156  , typename ST2 > // Type of the scalar of the right-hand side expression
1157 inline const typename MultExprTrait< DMatScalarMultExpr<MT,ST1,SO>, SVecScalarMultExpr<VT,ST2,false> >::Type
1158  operator*( const DMatScalarMultExpr<MT,ST1,SO>& mat, const SVecScalarMultExpr<VT,ST2,false>& vec )
1159 {
1161 
1162  return ( mat.leftOperand() * vec.leftOperand() ) * ( mat.rightOperand() * vec.rightOperand() );
1163 }
1165 //*************************************************************************************************
1166 
1167 
1168 //*************************************************************************************************
1184 template< typename VT // Type of the sparse vector of the left-hand side expression
1185  , typename ST1 // Type of the scalar of the left-hand side expression
1186  , typename MT // Type of the dense matrix of the right-hand side expression
1187  , typename ST2 // Type of the scalar of the right-hand side expression
1188  , bool SO > // Storage order of the right-hand side expression
1189 inline const typename MultExprTrait< SVecScalarMultExpr<VT,ST1,true>, DMatScalarMultExpr<MT,ST2,SO> >::Type
1190  operator*( const SVecScalarMultExpr<VT,ST1,true>& vec, const DMatScalarMultExpr<MT,ST2,SO>& mat )
1191 {
1193 
1194  return ( vec.leftOperand() * mat.leftOperand() ) * ( vec.rightOperand() * mat.rightOperand() );
1195 }
1197 //*************************************************************************************************
1198 
1199 
1200 //*************************************************************************************************
1214 template< typename MT1 // Type of the dense matrix of the left-hand side expression
1215  , typename ST // Type of the scalar of the left-hand side expression
1216  , bool SO1 // Storage order of the left-hand side expression
1217  , typename MT2 // Type of the right-hand side dense matrix
1218  , bool SO2 > // Storage order of the right-hand side dense matrix
1219 inline const typename MultExprTrait< DMatScalarMultExpr<MT1,ST,SO1>, MT2 >::Type
1220  operator*( const DMatScalarMultExpr<MT1,ST,SO1>& lhs, const DenseMatrix<MT2,SO2>& rhs )
1221 {
1223 
1224  return ( lhs.leftOperand() * (~rhs) ) * lhs.rightOperand();
1225 }
1227 //*************************************************************************************************
1228 
1229 
1230 //*************************************************************************************************
1244 template< typename MT1 // Type of the left-hand side dense matrix
1245  , bool SO1 // Storage order of the left-hand side dense matrix
1246  , typename MT2 // Type of the dense matrix of the right-hand side expression
1247  , typename ST // Type of the scalar of the right-hand side expression
1248  , bool SO2 > // Storage order of the right-hand side expression
1249 inline const typename MultExprTrait< MT1, DMatScalarMultExpr<MT2,ST,SO2> >::Type
1250  operator*( const DenseMatrix<MT1,SO1>& lhs, const DMatScalarMultExpr<MT2,ST,SO2>& rhs )
1251 {
1253 
1254  return ( (~lhs) * rhs.leftOperand() ) * rhs.rightOperand();
1255 }
1257 //*************************************************************************************************
1258 
1259 
1260 //*************************************************************************************************
1274 template< typename MT1 // Type of the dense matrix of the left-hand side expression
1275  , typename ST1 // Type of the scalar of the left-hand side expression
1276  , bool SO1 // Storage order of the left-hand side expression
1277  , typename MT2 // Type of the right-hand side dense matrix
1278  , typename ST2 // Type of the scalar of the right-hand side expression
1279  , bool SO2 > // Storage order of the right-hand side expression
1280 inline const typename MultExprTrait< DMatScalarMultExpr<MT1,ST1,SO1>, DMatScalarMultExpr<MT2,ST2,SO2> >::Type
1281  operator*( const DMatScalarMultExpr<MT1,ST1,SO1>& lhs, const DMatScalarMultExpr<MT2,ST2,SO2>& rhs )
1282 {
1284 
1285  return ( lhs.leftOperand() * rhs.leftOperand() ) * ( lhs.rightOperand() * rhs.rightOperand() );
1286 }
1288 //*************************************************************************************************
1289 
1290 
1291 //*************************************************************************************************
1305 template< typename MT1 // Type of the dense matrix of the left-hand side expression
1306  , typename ST // Type of the scalar of the left-hand side expression
1307  , bool SO1 // Storage order of the left-hand side expression
1308  , typename MT2 // Type of the right-hand side sparse matrix
1309  , bool SO2 > // Storage order of the right-hand side sparse matrix
1310 inline const typename MultExprTrait< DMatScalarMultExpr<MT1,ST,SO1>, MT2 >::Type
1311  operator*( const DMatScalarMultExpr<MT1,ST,SO1>& lhs, const SparseMatrix<MT2,SO2>& rhs )
1312 {
1314 
1315  return ( lhs.leftOperand() * (~rhs) ) * lhs.rightOperand();
1316 }
1318 //*************************************************************************************************
1319 
1320 
1321 //*************************************************************************************************
1335 template< typename MT1 // Type of the left-hand side sparse matrix
1336  , bool SO1 // Storage order of the left-hand side sparse matrix
1337  , typename MT2 // Type of the dense matrix of the right-hand side expression
1338  , typename ST // Type of the scalar of the right-hand side expression
1339  , bool SO2 > // Storage order of the right-hand side expression
1340 inline const typename MultExprTrait< MT1, DMatScalarMultExpr<MT2,ST,SO2> >::Type
1341  operator*( const SparseMatrix<MT1,SO1>& lhs, const DMatScalarMultExpr<MT2,ST,SO2>& rhs )
1342 {
1344 
1345  return ( (~lhs) * rhs.leftOperand() ) * rhs.rightOperand();
1346 }
1348 //*************************************************************************************************
1349 
1350 
1351 //*************************************************************************************************
1366 template< typename MT1 // Type of the dense matrix of the left-hand side expression
1367  , typename ST1 // Type of the scalar of the left-hand side expression
1368  , bool SO1 // Storage order of the left-hand side expression
1369  , typename MT2 // Type of the sparse matrix of the right-hand side expression
1370  , typename ST2 // Type of the scalar of the right-hand side expression
1371  , bool SO2 > // Storage order of the right-hand side expression
1372 inline const typename MultExprTrait< DMatScalarMultExpr<MT1,ST1,SO1>, SMatScalarMultExpr<MT2,ST2,SO2> >::Type
1373  operator*( const DMatScalarMultExpr<MT1,ST1,SO1>& mat, const SMatScalarMultExpr<MT2,ST2,SO2>& vec )
1374 {
1376 
1377  return ( mat.leftOperand() * vec.leftOperand() ) * ( mat.rightOperand() * vec.rightOperand() );
1378 }
1380 //*************************************************************************************************
1381 
1382 
1383 //*************************************************************************************************
1398 template< typename MT1 // Type of the sparse matrix of the left-hand side expression
1399  , typename ST1 // Type of the scalar of the left-hand side expression
1400  , bool SO1 // Storage order of the left-hand side expression
1401  , typename MT2 // Type of the dense matrix of the right-hand side expression
1402  , typename ST2 // Type of the scalar of the right-hand side expression
1403  , bool SO2 > // Storage order of the right-hand side expression
1404 inline const typename MultExprTrait< SMatScalarMultExpr<MT1,ST1,SO1>, DMatScalarMultExpr<MT2,ST2,SO2> >::Type
1405  operator*( const SMatScalarMultExpr<MT1,ST1,SO1>& mat, const DMatScalarMultExpr<MT2,ST2,SO2>& vec )
1406 {
1408 
1409  return ( mat.leftOperand() * vec.leftOperand() ) * ( mat.rightOperand() * vec.rightOperand() );
1410 }
1412 //*************************************************************************************************
1413 
1414 
1415 
1416 
1417 //=================================================================================================
1418 //
1419 // DMATSCALARMULTEXPRTRAIT SPECIALIZATIONS
1420 //
1421 //=================================================================================================
1422 
1423 //*************************************************************************************************
1425 template< typename MT, typename ST1, typename ST2 >
1426 struct DMatScalarMultExprTrait< DMatScalarMultExpr<MT,ST1,false>, ST2 >
1427 {
1428  public:
1429  //**********************************************************************************************
1430  typedef typename SelectType< IsDenseMatrix<MT>::value && IsRowMajorMatrix<MT>::value &&
1431  IsNumeric<ST1>::value && IsNumeric<ST2>::value
1432  , typename DMatScalarMultExprTrait<MT,typename MultTrait<ST1,ST2>::Type>::Type
1433  , INVALID_TYPE >::Type Type;
1434  //**********************************************************************************************
1435 };
1437 //*************************************************************************************************
1438 
1439 
1440 
1441 
1442 //=================================================================================================
1443 //
1444 // TDMATSCALARMULTEXPRTRAIT SPECIALIZATIONS
1445 //
1446 //=================================================================================================
1447 
1448 //*************************************************************************************************
1450 template< typename MT, typename ST1, typename ST2 >
1451 struct TDMatScalarMultExprTrait< DMatScalarMultExpr<MT,ST1,true>, ST2 >
1452 {
1453  public:
1454  //**********************************************************************************************
1455  typedef typename SelectType< IsDenseMatrix<MT>::value && IsColumnMajorMatrix<MT>::value &&
1456  IsNumeric<ST1>::value && IsNumeric<ST2>::value
1457  , typename TDMatScalarMultExprTrait<MT,typename MultTrait<ST1,ST2>::Type>::Type
1458  , INVALID_TYPE >::Type Type;
1459  //**********************************************************************************************
1460 };
1462 //*************************************************************************************************
1463 
1464 
1465 
1466 
1467 //=================================================================================================
1468 //
1469 // DMATSCALARDIVEXPRTRAIT SPECIALIZATIONS
1470 //
1471 //=================================================================================================
1472 
1473 //*************************************************************************************************
1475 template< typename MT, typename ST1, typename ST2 >
1476 struct DMatScalarDivExprTrait< DMatScalarMultExpr<MT,ST1,false>, ST2 >
1477 {
1478  private:
1479  //**********************************************************************************************
1480  enum { condition = IsFloatingPoint<typename DivTrait<ST1,ST2>::Type>::value };
1481  //**********************************************************************************************
1482 
1483  //**********************************************************************************************
1484  typedef typename DMatScalarMultExprTrait<MT,typename DivTrait<ST1,ST2>::Type>::Type T1;
1485  typedef typename DMatScalarDivExprTrait<MT,typename DivTrait<ST1,ST2>::Type>::Type T2;
1486  //**********************************************************************************************
1487 
1488  public:
1489  //**********************************************************************************************
1490  typedef typename SelectType< IsDenseMatrix<MT>::value && IsRowMajorMatrix<MT>::value &&
1491  IsNumeric<ST1>::value && IsNumeric<ST2>::value
1492  , typename SelectType<condition,T1,T2>::Type
1493  , INVALID_TYPE >::Type Type;
1494  //**********************************************************************************************
1495 };
1497 //*************************************************************************************************
1498 
1499 
1500 
1501 
1502 //=================================================================================================
1503 //
1504 // TDMATSCALARDIVEXPRTRAIT SPECIALIZATIONS
1505 //
1506 //=================================================================================================
1507 
1508 //*************************************************************************************************
1510 template< typename MT, typename ST1, typename ST2 >
1511 struct TDMatScalarDivExprTrait< DMatScalarMultExpr<MT,ST1,true>, ST2 >
1512 {
1513  private:
1514  //**********************************************************************************************
1515  enum { condition = IsFloatingPoint<typename DivTrait<ST1,ST2>::Type>::value };
1516  //**********************************************************************************************
1517 
1518  //**********************************************************************************************
1519  typedef typename TDMatScalarMultExprTrait<MT,typename DivTrait<ST1,ST2>::Type>::Type T1;
1520  typedef typename TDMatScalarDivExprTrait<MT,typename DivTrait<ST1,ST2>::Type>::Type T2;
1521  //**********************************************************************************************
1522 
1523  public:
1524  //**********************************************************************************************
1525  typedef typename SelectType< IsDenseMatrix<MT>::value && IsColumnMajorMatrix<MT>::value &&
1526  IsNumeric<ST1>::value && IsNumeric<ST2>::value
1527  , typename SelectType<condition,T1,T2>::Type
1528  , INVALID_TYPE >::Type Type;
1529  //**********************************************************************************************
1530 };
1532 //*************************************************************************************************
1533 
1534 
1535 
1536 
1537 //=================================================================================================
1538 //
1539 // DMATDVECMULTEXPRTRAIT SPECIALIZATIONS
1540 //
1541 //=================================================================================================
1542 
1543 //*************************************************************************************************
1545 template< typename MT, typename ST, typename VT >
1546 struct DMatDVecMultExprTrait< DMatScalarMultExpr<MT,ST,false>, VT >
1547 {
1548  public:
1549  //**********************************************************************************************
1550  typedef typename SelectType< IsDenseMatrix<MT>::value && IsRowMajorMatrix<MT>::value &&
1551  IsDenseVector<VT>::value && IsColumnVector<VT>::value &&
1552  IsNumeric<ST>::value
1553  , typename DVecScalarMultExprTrait<typename DMatDVecMultExprTrait<MT,VT>::Type,ST>::Type
1554  , INVALID_TYPE >::Type Type;
1555  //**********************************************************************************************
1556 };
1558 //*************************************************************************************************
1559 
1560 
1561 //*************************************************************************************************
1563 template< typename MT, typename ST1, typename VT, typename ST2 >
1564 struct DMatDVecMultExprTrait< DMatScalarMultExpr<MT,ST1,false>, DVecScalarMultExpr<VT,ST2,false> >
1565 {
1566  public:
1567  //**********************************************************************************************
1568  typedef typename SelectType< IsDenseMatrix<MT>::value && IsRowMajorMatrix<MT>::value &&
1569  IsDenseVector<VT>::value && IsColumnVector<VT>::value &&
1570  IsNumeric<ST1>::value && IsNumeric<ST2>::value
1571  , typename DVecScalarMultExprTrait<typename DMatDVecMultExprTrait<MT,VT>::Type,typename MultTrait<ST1,ST2>::Type>::Type
1572  , INVALID_TYPE >::Type Type;
1573  //**********************************************************************************************
1574 };
1576 //*************************************************************************************************
1577 
1578 
1579 
1580 
1581 //=================================================================================================
1582 //
1583 // TDMATDVECMULTEXPRTRAIT SPECIALIZATIONS
1584 //
1585 //=================================================================================================
1586 
1587 //*************************************************************************************************
1589 template< typename MT, typename ST, typename VT >
1590 struct TDMatDVecMultExprTrait< DMatScalarMultExpr<MT,ST,true>, VT >
1591 {
1592  public:
1593  //**********************************************************************************************
1594  typedef typename SelectType< IsDenseMatrix<MT>::value && IsColumnMajorMatrix<MT>::value &&
1595  IsDenseVector<VT>::value && IsColumnVector<VT>::value &&
1596  IsNumeric<ST>::value
1597  , typename DVecScalarMultExprTrait<typename TDMatDVecMultExprTrait<MT,VT>::Type,ST>::Type
1598  , INVALID_TYPE >::Type Type;
1599  //**********************************************************************************************
1600 };
1602 //*************************************************************************************************
1603 
1604 
1605 //*************************************************************************************************
1607 template< typename MT, typename ST1, typename VT, typename ST2 >
1608 struct TDMatDVecMultExprTrait< DMatScalarMultExpr<MT,ST1,true>, DVecScalarMultExpr<VT,ST2,false> >
1609 {
1610  public:
1611  //**********************************************************************************************
1612  typedef typename SelectType< IsDenseMatrix<MT>::value && IsColumnMajorMatrix<MT>::value &&
1613  IsDenseVector<VT>::value && IsColumnVector<VT>::value &&
1614  IsNumeric<ST1>::value && IsNumeric<ST2>::value
1615  , typename DVecScalarMultExprTrait<typename TDMatDVecMultExprTrait<MT,VT>::Type,typename MultTrait<ST1,ST2>::Type>::Type
1616  , INVALID_TYPE >::Type Type;
1617  //**********************************************************************************************
1618 };
1620 //*************************************************************************************************
1621 
1622 
1623 
1624 
1625 //=================================================================================================
1626 //
1627 // TDVECDMATMULTEXPRTRAIT SPECIALIZATIONS
1628 //
1629 //=================================================================================================
1630 
1631 //*************************************************************************************************
1633 template< typename VT, typename MT, typename ST >
1634 struct TDVecDMatMultExprTrait< VT, DMatScalarMultExpr<MT,ST,false> >
1635 {
1636  public:
1637  //**********************************************************************************************
1638  typedef typename SelectType< IsDenseVector<VT>::value && IsRowVector<VT>::value &&
1639  IsDenseMatrix<MT>::value && IsRowMajorMatrix<MT>::value &&
1640  IsNumeric<ST>::value
1641  , typename TDVecScalarMultExprTrait<typename TDVecDMatMultExprTrait<VT,MT>::Type,ST>::Type
1642  , INVALID_TYPE >::Type Type;
1643  //**********************************************************************************************
1644 };
1646 //*************************************************************************************************
1647 
1648 
1649 //*************************************************************************************************
1651 template< typename VT, typename ST1, typename MT, typename ST2 >
1652 struct TDVecDMatMultExprTrait< DVecScalarMultExpr<VT,ST1,true>, DMatScalarMultExpr<MT,ST2,false> >
1653 {
1654  public:
1655  //**********************************************************************************************
1656  typedef typename SelectType< IsDenseVector<VT>::value && IsRowVector<VT>::value &&
1657  IsDenseMatrix<MT>::value && IsRowMajorMatrix<MT>::value &&
1658  IsNumeric<ST1>::value && IsNumeric<ST2>::value
1659  , typename TDVecScalarMultExprTrait<typename TDVecDMatMultExprTrait<VT,MT>::Type,typename MultTrait<ST1,ST2>::Type>::Type
1660  , INVALID_TYPE >::Type Type;
1661  //**********************************************************************************************
1662 };
1664 //*************************************************************************************************
1665 
1666 
1667 
1668 
1669 //=================================================================================================
1670 //
1671 // TDVECTDMATMULTEXPRTRAIT SPECIALIZATIONS
1672 //
1673 //=================================================================================================
1674 
1675 //*************************************************************************************************
1677 template< typename VT, typename MT, typename ST >
1678 struct TDVecTDMatMultExprTrait< VT, DMatScalarMultExpr<MT,ST,true> >
1679 {
1680  public:
1681  //**********************************************************************************************
1682  typedef typename SelectType< IsDenseVector<VT>::value && IsRowVector<VT>::value &&
1683  IsDenseMatrix<MT>::value && IsColumnMajorMatrix<MT>::value &&
1684  IsNumeric<ST>::value
1685  , typename TDVecScalarMultExprTrait<typename TDVecTDMatMultExprTrait<VT,MT>::Type,ST>::Type
1686  , INVALID_TYPE >::Type Type;
1687  //**********************************************************************************************
1688 };
1690 //*************************************************************************************************
1691 
1692 
1693 //*************************************************************************************************
1695 template< typename VT, typename ST1, typename MT, typename ST2 >
1696 struct TDVecTDMatMultExprTrait< DVecScalarMultExpr<VT,ST1,true>, DMatScalarMultExpr<MT,ST2,true> >
1697 {
1698  public:
1699  //**********************************************************************************************
1700  typedef typename SelectType< IsDenseVector<VT>::value && IsRowVector<VT>::value &&
1701  IsDenseMatrix<MT>::value && IsColumnMajorMatrix<MT>::value &&
1702  IsNumeric<ST1>::value && IsNumeric<ST2>::value
1703  , typename TDVecScalarMultExprTrait<typename TDVecTDMatMultExprTrait<VT,MT>::Type,typename MultTrait<ST1,ST2>::Type>::Type
1704  , INVALID_TYPE >::Type Type;
1705  //**********************************************************************************************
1706 };
1708 //*************************************************************************************************
1709 
1710 
1711 
1712 
1713 //=================================================================================================
1714 //
1715 // DMATSVECMULTEXPRTRAIT SPECIALIZATIONS
1716 //
1717 //=================================================================================================
1718 
1719 //*************************************************************************************************
1721 template< typename MT, typename ST, typename VT >
1722 struct DMatSVecMultExprTrait< DMatScalarMultExpr<MT,ST,false>, VT >
1723 {
1724  public:
1725  //**********************************************************************************************
1726  typedef typename SelectType< IsDenseMatrix<MT>::value && IsRowMajorMatrix<MT>::value &&
1727  IsSparseVector<VT>::value && IsColumnVector<VT>::value &&
1728  IsNumeric<ST>::value
1729  , typename DVecScalarMultExprTrait<typename DMatSVecMultExprTrait<MT,VT>::Type,ST>::Type
1730  , INVALID_TYPE >::Type Type;
1731  //**********************************************************************************************
1732 };
1734 //*************************************************************************************************
1735 
1736 
1737 //*************************************************************************************************
1739 template< typename MT, typename ST1, typename VT, typename ST2 >
1740 struct DMatSVecMultExprTrait< DMatScalarMultExpr<MT,ST1,false>, SVecScalarMultExpr<VT,ST2,false> >
1741 {
1742  public:
1743  //**********************************************************************************************
1744  typedef typename SelectType< IsDenseMatrix<MT>::value && IsRowMajorMatrix<MT>::value &&
1745  IsSparseVector<VT>::value && IsColumnVector<VT>::value &&
1746  IsNumeric<ST1>::value && IsNumeric<ST2>::value
1747  , typename DVecScalarMultExprTrait<typename DMatSVecMultExprTrait<MT,VT>::Type,typename MultTrait<ST1,ST2>::Type>::Type
1748  , INVALID_TYPE >::Type Type;
1749  //**********************************************************************************************
1750 };
1752 //*************************************************************************************************
1753 
1754 
1755 
1756 
1757 //=================================================================================================
1758 //
1759 // TDMATSVECMULTEXPRTRAIT SPECIALIZATIONS
1760 //
1761 //=================================================================================================
1762 
1763 //*************************************************************************************************
1765 template< typename MT, typename ST, typename VT >
1766 struct TDMatSVecMultExprTrait< DMatScalarMultExpr<MT,ST,true>, VT >
1767 {
1768  public:
1769  //**********************************************************************************************
1770  typedef typename SelectType< IsDenseMatrix<MT>::value && IsColumnMajorMatrix<MT>::value &&
1771  IsSparseVector<VT>::value && IsColumnVector<VT>::value &&
1772  IsNumeric<ST>::value
1773  , typename DVecScalarMultExprTrait<typename TDMatSVecMultExprTrait<MT,VT>::Type,ST>::Type
1774  , INVALID_TYPE >::Type Type;
1775  //**********************************************************************************************
1776 };
1778 //*************************************************************************************************
1779 
1780 
1781 //*************************************************************************************************
1783 template< typename MT, typename ST1, typename VT, typename ST2 >
1784 struct TDMatSVecMultExprTrait< DMatScalarMultExpr<MT,ST1,true>, SVecScalarMultExpr<VT,ST2,false> >
1785 {
1786  public:
1787  //**********************************************************************************************
1788  typedef typename SelectType< IsDenseMatrix<MT>::value && IsColumnMajorMatrix<MT>::value &&
1789  IsSparseVector<VT>::value && IsColumnVector<VT>::value &&
1790  IsNumeric<ST1>::value && IsNumeric<ST2>::value
1791  , typename DVecScalarMultExprTrait<typename TDMatSVecMultExprTrait<MT,VT>::Type,typename MultTrait<ST1,ST2>::Type>::Type
1792  , INVALID_TYPE >::Type Type;
1793  //**********************************************************************************************
1794 };
1796 //*************************************************************************************************
1797 
1798 
1799 
1800 
1801 //=================================================================================================
1802 //
1803 // TSVECDMATMULTEXPRTRAIT SPECIALIZATIONS
1804 //
1805 //=================================================================================================
1806 
1807 //*************************************************************************************************
1809 template< typename VT, typename MT, typename ST >
1810 struct TSVecDMatMultExprTrait< VT, DMatScalarMultExpr<MT,ST,false> >
1811 {
1812  public:
1813  //**********************************************************************************************
1814  typedef typename SelectType< IsSparseVector<VT>::value && IsRowVector<VT>::value &&
1815  IsDenseMatrix<MT>::value && IsRowMajorMatrix<MT>::value &&
1816  IsNumeric<ST>::value
1817  , typename TDVecScalarMultExprTrait<typename TSVecDMatMultExprTrait<VT,MT>::Type,ST>::Type
1818  , INVALID_TYPE >::Type Type;
1819  //**********************************************************************************************
1820 };
1822 //*************************************************************************************************
1823 
1824 
1825 //*************************************************************************************************
1827 template< typename VT, typename ST1, typename MT, typename ST2 >
1828 struct TSVecDMatMultExprTrait< SVecScalarMultExpr<VT,ST1,true>, DMatScalarMultExpr<MT,ST2,false> >
1829 {
1830  public:
1831  //**********************************************************************************************
1832  typedef typename SelectType< IsSparseVector<VT>::value && IsRowVector<VT>::value &&
1833  IsDenseMatrix<MT>::value && IsRowMajorMatrix<MT>::value &&
1834  IsNumeric<ST1>::value && IsNumeric<ST2>::value
1835  , typename TDVecScalarMultExprTrait<typename TSVecDMatMultExprTrait<VT,MT>::Type,typename MultTrait<ST1,ST2>::Type>::Type
1836  , INVALID_TYPE >::Type Type;
1837  //**********************************************************************************************
1838 };
1840 //*************************************************************************************************
1841 
1842 
1843 
1844 
1845 //=================================================================================================
1846 //
1847 // TSVECTDMATMULTEXPRTRAIT SPECIALIZATIONS
1848 //
1849 //=================================================================================================
1850 
1851 //*************************************************************************************************
1853 template< typename VT, typename MT, typename ST >
1854 struct TSVecTDMatMultExprTrait< VT, DMatScalarMultExpr<MT,ST,true> >
1855 {
1856  public:
1857  //**********************************************************************************************
1858  typedef typename SelectType< IsSparseVector<VT>::value && IsRowVector<VT>::value &&
1859  IsDenseMatrix<MT>::value && IsColumnMajorMatrix<MT>::value &&
1860  IsNumeric<ST>::value
1861  , typename TDVecScalarMultExprTrait<typename TSVecTDMatMultExprTrait<VT,MT>::Type,ST>::Type
1862  , INVALID_TYPE >::Type Type;
1863  //**********************************************************************************************
1864 };
1866 //*************************************************************************************************
1867 
1868 
1869 //*************************************************************************************************
1871 template< typename VT, typename ST1, typename MT, typename ST2 >
1872 struct TSVecTDMatMultExprTrait< SVecScalarMultExpr<VT,ST1,true>, DMatScalarMultExpr<MT,ST2,true> >
1873 {
1874  public:
1875  //**********************************************************************************************
1876  typedef typename SelectType< IsSparseVector<VT>::value && IsRowVector<VT>::value &&
1877  IsDenseMatrix<MT>::value && IsColumnMajorMatrix<MT>::value &&
1878  IsNumeric<ST1>::value && IsNumeric<ST2>::value
1879  , typename TDVecScalarMultExprTrait<typename TSVecTDMatMultExprTrait<VT,MT>::Type,typename MultTrait<ST1,ST2>::Type>::Type
1880  , INVALID_TYPE >::Type Type;
1881  //**********************************************************************************************
1882 };
1884 //*************************************************************************************************
1885 
1886 
1887 
1888 
1889 //=================================================================================================
1890 //
1891 // DMATDMATMULTEXPRTRAIT SPECIALIZATIONS
1892 //
1893 //=================================================================================================
1894 
1895 //*************************************************************************************************
1897 template< typename MT1, typename ST, typename MT2 >
1898 struct DMatDMatMultExprTrait< DMatScalarMultExpr<MT1,ST,false>, MT2 >
1899 {
1900  public:
1901  //**********************************************************************************************
1902  typedef typename SelectType< IsDenseMatrix<MT1>::value && IsRowMajorMatrix<MT1>::value &&
1903  IsDenseMatrix<MT2>::value && IsRowMajorMatrix<MT2>::value &&
1904  IsNumeric<ST>::value
1905  , typename DMatScalarMultExprTrait<typename DMatDMatMultExprTrait<MT1,MT2>::Type,ST>::Type
1906  , INVALID_TYPE >::Type Type;
1907  //**********************************************************************************************
1908 };
1910 //*************************************************************************************************
1911 
1912 
1913 //*************************************************************************************************
1915 template< typename MT1, typename MT2, typename ST >
1916 struct DMatDMatMultExprTrait< MT1, DMatScalarMultExpr<MT2,ST,false> >
1917 {
1918  public:
1919  //**********************************************************************************************
1920  typedef typename SelectType< IsDenseMatrix<MT1>::value && IsRowMajorMatrix<MT1>::value &&
1921  IsDenseMatrix<MT2>::value && IsRowMajorMatrix<MT2>::value &&
1922  IsNumeric<ST>::value
1923  , typename DMatScalarMultExprTrait<typename DMatDMatMultExprTrait<MT1,MT2>::Type,ST>::Type
1924  , INVALID_TYPE >::Type Type;
1925  //**********************************************************************************************
1926 };
1928 //*************************************************************************************************
1929 
1930 
1931 //*************************************************************************************************
1933 template< typename MT1, typename ST1, typename MT2, typename ST2 >
1934 struct DMatDMatMultExprTrait< DMatScalarMultExpr<MT1,ST1,false>, DMatScalarMultExpr<MT2,ST2,false> >
1935 {
1936  public:
1937  //**********************************************************************************************
1938  typedef typename SelectType< IsDenseMatrix<MT1>::value && IsRowMajorMatrix<MT1>::value &&
1939  IsDenseMatrix<MT2>::value && IsRowMajorMatrix<MT2>::value &&
1940  IsNumeric<ST1>::value && IsNumeric<ST2>::value
1941  , typename DMatScalarMultExprTrait<typename DMatDMatMultExprTrait<MT1,MT2>::Type,typename MultTrait<ST1,ST2>::Type>::Type
1942  , INVALID_TYPE >::Type Type;
1943  //**********************************************************************************************
1944 };
1946 //*************************************************************************************************
1947 
1948 
1949 
1950 
1951 //=================================================================================================
1952 //
1953 // DMATTDMATMULTEXPRTRAIT SPECIALIZATIONS
1954 //
1955 //=================================================================================================
1956 
1957 //*************************************************************************************************
1959 template< typename MT1, typename ST, typename MT2 >
1960 struct DMatTDMatMultExprTrait< DMatScalarMultExpr<MT1,ST,false>, MT2 >
1961 {
1962  public:
1963  //**********************************************************************************************
1964  typedef typename SelectType< IsDenseMatrix<MT1>::value && IsRowMajorMatrix<MT1>::value &&
1965  IsDenseMatrix<MT2>::value && IsColumnMajorMatrix<MT2>::value &&
1966  IsNumeric<ST>::value
1967  , typename DMatScalarMultExprTrait<typename DMatTDMatMultExprTrait<MT1,MT2>::Type,ST>::Type
1968  , INVALID_TYPE >::Type Type;
1969  //**********************************************************************************************
1970 };
1972 //*************************************************************************************************
1973 
1974 
1975 //*************************************************************************************************
1977 template< typename MT1, typename MT2, typename ST >
1978 struct DMatTDMatMultExprTrait< MT1, DMatScalarMultExpr<MT2,ST,true> >
1979 {
1980  public:
1981  //**********************************************************************************************
1982  typedef typename SelectType< IsDenseMatrix<MT1>::value && IsRowMajorMatrix<MT1>::value &&
1983  IsDenseMatrix<MT2>::value && IsColumnMajorMatrix<MT2>::value &&
1984  IsNumeric<ST>::value
1985  , typename DMatScalarMultExprTrait<typename DMatTDMatMultExprTrait<MT1,MT2>::Type,ST>::Type
1986  , INVALID_TYPE >::Type Type;
1987  //**********************************************************************************************
1988 };
1990 //*************************************************************************************************
1991 
1992 
1993 //*************************************************************************************************
1995 template< typename MT1, typename ST1, typename MT2, typename ST2 >
1996 struct DMatTDMatMultExprTrait< DMatScalarMultExpr<MT1,ST1,false>, DMatScalarMultExpr<MT2,ST2,true> >
1997 {
1998  public:
1999  //**********************************************************************************************
2000  typedef typename SelectType< IsDenseMatrix<MT1>::value && IsRowMajorMatrix<MT1>::value &&
2001  IsDenseMatrix<MT2>::value && IsColumnMajorMatrix<MT2>::value &&
2002  IsNumeric<ST1>::value && IsNumeric<ST2>::value
2003  , typename DMatScalarMultExprTrait<typename DMatTDMatMultExprTrait<MT1,MT2>::Type,typename MultTrait<ST1,ST2>::Type>::Type
2004  , INVALID_TYPE >::Type Type;
2005  //**********************************************************************************************
2006 };
2008 //*************************************************************************************************
2009 
2010 
2011 
2012 
2013 //=================================================================================================
2014 //
2015 // TDMATDMATMULTEXPRTRAIT SPECIALIZATIONS
2016 //
2017 //=================================================================================================
2018 
2019 //*************************************************************************************************
2021 template< typename MT1, typename ST, typename MT2 >
2022 struct TDMatDMatMultExprTrait< DMatScalarMultExpr<MT1,ST,true>, MT2 >
2023 {
2024  public:
2025  //**********************************************************************************************
2026  typedef typename SelectType< IsDenseMatrix<MT1>::value && IsColumnMajorMatrix<MT1>::value &&
2027  IsDenseMatrix<MT2>::value && IsRowMajorMatrix<MT2>::value &&
2028  IsNumeric<ST>::value
2029  , typename TDMatScalarMultExprTrait<typename TDMatDMatMultExprTrait<MT1,MT2>::Type,ST>::Type
2030  , INVALID_TYPE >::Type Type;
2031  //**********************************************************************************************
2032 };
2034 //*************************************************************************************************
2035 
2036 
2037 //*************************************************************************************************
2039 template< typename MT1, typename MT2, typename ST >
2040 struct TDMatDMatMultExprTrait< MT1, DMatScalarMultExpr<MT2,ST,false> >
2041 {
2042  public:
2043  //**********************************************************************************************
2044  typedef typename SelectType< IsDenseMatrix<MT1>::value && IsColumnMajorMatrix<MT1>::value &&
2045  IsDenseMatrix<MT2>::value && IsRowMajorMatrix<MT2>::value &&
2046  IsNumeric<ST>::value
2047  , typename TDMatScalarMultExprTrait<typename TDMatDMatMultExprTrait<MT1,MT2>::Type,ST>::Type
2048  , INVALID_TYPE >::Type Type;
2049  //**********************************************************************************************
2050 };
2052 //*************************************************************************************************
2053 
2054 
2055 //*************************************************************************************************
2057 template< typename MT1, typename ST1, typename MT2, typename ST2 >
2058 struct TDMatDMatMultExprTrait< DMatScalarMultExpr<MT1,ST1,true>, DMatScalarMultExpr<MT2,ST2,false> >
2059 {
2060  public:
2061  //**********************************************************************************************
2062  typedef typename SelectType< IsDenseMatrix<MT1>::value && IsColumnMajorMatrix<MT1>::value &&
2063  IsDenseMatrix<MT2>::value && IsRowMajorMatrix<MT2>::value &&
2064  IsNumeric<ST1>::value && IsNumeric<ST2>::value
2065  , typename TDMatScalarMultExprTrait<typename TDMatDMatMultExprTrait<MT1,MT2>::Type,typename MultTrait<ST1,ST2>::Type>::Type
2066  , INVALID_TYPE >::Type Type;
2067  //**********************************************************************************************
2068 };
2070 //*************************************************************************************************
2071 
2072 
2073 
2074 
2075 //=================================================================================================
2076 //
2077 // TDMATTDMATMULTEXPRTRAIT SPECIALIZATIONS
2078 //
2079 //=================================================================================================
2080 
2081 //*************************************************************************************************
2083 template< typename MT1, typename ST, typename MT2 >
2084 struct TDMatTDMatMultExprTrait< DMatScalarMultExpr<MT1,ST,true>, MT2 >
2085 {
2086  public:
2087  //**********************************************************************************************
2088  typedef typename SelectType< IsDenseMatrix<MT1>::value && IsColumnMajorMatrix<MT1>::value &&
2089  IsDenseMatrix<MT2>::value && IsColumnMajorMatrix<MT2>::value &&
2090  IsNumeric<ST>::value
2091  , typename TDMatScalarMultExprTrait<typename TDMatTDMatMultExprTrait<MT1,MT2>::Type,ST>::Type
2092  , INVALID_TYPE >::Type Type;
2093  //**********************************************************************************************
2094 };
2096 //*************************************************************************************************
2097 
2098 
2099 //*************************************************************************************************
2101 template< typename MT1, typename MT2, typename ST >
2102 struct TDMatTDMatMultExprTrait< MT1, DMatScalarMultExpr<MT2,ST,true> >
2103 {
2104  public:
2105  //**********************************************************************************************
2106  typedef typename SelectType< IsDenseMatrix<MT1>::value && IsColumnMajorMatrix<MT1>::value &&
2107  IsDenseMatrix<MT2>::value && IsColumnMajorMatrix<MT2>::value &&
2108  IsNumeric<ST>::value
2109  , typename TDMatScalarMultExprTrait<typename TDMatTDMatMultExprTrait<MT1,MT2>::Type,ST>::Type
2110  , INVALID_TYPE >::Type Type;
2111  //**********************************************************************************************
2112 };
2114 //*************************************************************************************************
2115 
2116 
2117 //*************************************************************************************************
2119 template< typename MT1, typename ST1, typename MT2, typename ST2 >
2120 struct TDMatTDMatMultExprTrait< DMatScalarMultExpr<MT1,ST1,true>, DMatScalarMultExpr<MT2,ST2,true> >
2121 {
2122  public:
2123  //**********************************************************************************************
2124  typedef typename SelectType< IsDenseMatrix<MT1>::value && IsColumnMajorMatrix<MT1>::value &&
2125  IsDenseMatrix<MT2>::value && IsColumnMajorMatrix<MT2>::value &&
2126  IsNumeric<ST1>::value && IsNumeric<ST2>::value
2127  , typename TDMatScalarMultExprTrait<typename TDMatTDMatMultExprTrait<MT1,MT2>::Type,typename MultTrait<ST1,ST2>::Type>::Type
2128  , INVALID_TYPE >::Type Type;
2129  //**********************************************************************************************
2130 };
2132 //*************************************************************************************************
2133 
2134 
2135 
2136 
2137 //=================================================================================================
2138 //
2139 // DMATSMATMULTEXPRTRAIT SPECIALIZATIONS
2140 //
2141 //=================================================================================================
2142 
2143 //*************************************************************************************************
2145 template< typename MT1, typename ST, typename MT2 >
2146 struct DMatSMatMultExprTrait< DMatScalarMultExpr<MT1,ST,false>, MT2 >
2147 {
2148  public:
2149  //**********************************************************************************************
2150  typedef typename SelectType< IsDenseMatrix<MT1>::value && IsRowMajorMatrix<MT1>::value &&
2151  IsSparseMatrix<MT2>::value && IsRowMajorMatrix<MT2>::value &&
2152  IsNumeric<ST>::value
2153  , typename DMatScalarMultExprTrait<typename DMatSMatMultExprTrait<MT1,MT2>::Type,ST>::Type
2154  , INVALID_TYPE >::Type Type;
2155  //**********************************************************************************************
2156 };
2158 //*************************************************************************************************
2159 
2160 
2161 //*************************************************************************************************
2163 template< typename MT1, typename ST1, typename MT2, typename ST2 >
2164 struct DMatSMatMultExprTrait< DMatScalarMultExpr<MT1,ST1,false>, SMatScalarMultExpr<MT2,ST2,false> >
2165 {
2166  public:
2167  //**********************************************************************************************
2168  typedef typename SelectType< IsDenseMatrix<MT1>::value && IsRowMajorMatrix<MT1>::value &&
2169  IsSparseMatrix<MT2>::value && IsRowMajorMatrix<MT2>::value &&
2170  IsNumeric<ST1>::value && IsNumeric<ST2>::value
2171  , typename DMatScalarMultExprTrait<typename DMatSMatMultExprTrait<MT1,MT2>::Type,typename MultTrait<ST1,ST2>::Type>::Type
2172  , INVALID_TYPE >::Type Type;
2173  //**********************************************************************************************
2174 };
2176 //*************************************************************************************************
2177 
2178 
2179 
2180 
2181 //=================================================================================================
2182 //
2183 // DMATTSMATMULTEXPRTRAIT SPECIALIZATIONS
2184 //
2185 //=================================================================================================
2186 
2187 //*************************************************************************************************
2189 template< typename MT1, typename ST, typename MT2 >
2190 struct DMatTSMatMultExprTrait< DMatScalarMultExpr<MT1,ST,false>, MT2 >
2191 {
2192  public:
2193  //**********************************************************************************************
2194  typedef typename SelectType< IsDenseMatrix<MT1>::value && IsRowMajorMatrix<MT1>::value &&
2195  IsSparseMatrix<MT2>::value && IsColumnMajorMatrix<MT2>::value &&
2196  IsNumeric<ST>::value
2197  , typename DMatScalarMultExprTrait<typename DMatTSMatMultExprTrait<MT1,MT2>::Type,ST>::Type
2198  , INVALID_TYPE >::Type Type;
2199  //**********************************************************************************************
2200 };
2202 //*************************************************************************************************
2203 
2204 
2205 //*************************************************************************************************
2207 template< typename MT1, typename ST1, typename MT2, typename ST2 >
2208 struct DMatTSMatMultExprTrait< DMatScalarMultExpr<MT1,ST1,false>, SMatScalarMultExpr<MT2,ST2,true> >
2209 {
2210  public:
2211  //**********************************************************************************************
2212  typedef typename SelectType< IsDenseMatrix<MT1>::value && IsRowMajorMatrix<MT1>::value &&
2213  IsSparseMatrix<MT2>::value && IsColumnMajorMatrix<MT2>::value &&
2214  IsNumeric<ST1>::value && IsNumeric<ST2>::value
2215  , typename DMatScalarMultExprTrait<typename DMatTSMatMultExprTrait<MT1,MT2>::Type,typename MultTrait<ST1,ST2>::Type>::Type
2216  , INVALID_TYPE >::Type Type;
2217  //**********************************************************************************************
2218 };
2220 //*************************************************************************************************
2221 
2222 
2223 
2224 
2225 //=================================================================================================
2226 //
2227 // TDMATSMATMULTEXPRTRAIT SPECIALIZATIONS
2228 //
2229 //=================================================================================================
2230 
2231 //*************************************************************************************************
2233 template< typename MT1, typename ST, typename MT2 >
2234 struct TDMatSMatMultExprTrait< DMatScalarMultExpr<MT1,ST,true>, MT2 >
2235 {
2236  public:
2237  //**********************************************************************************************
2238  typedef typename SelectType< IsDenseMatrix<MT1>::value && IsColumnMajorMatrix<MT1>::value &&
2239  IsSparseMatrix<MT2>::value && IsRowMajorMatrix<MT2>::value &&
2240  IsNumeric<ST>::value
2241  , typename TDMatScalarMultExprTrait<typename TDMatSMatMultExprTrait<MT1,MT2>::Type,ST>::Type
2242  , INVALID_TYPE >::Type Type;
2243  //**********************************************************************************************
2244 };
2246 //*************************************************************************************************
2247 
2248 
2249 //*************************************************************************************************
2251 template< typename MT1, typename ST1, typename MT2, typename ST2 >
2252 struct TDMatSMatMultExprTrait< DMatScalarMultExpr<MT1,ST1,true>, SMatScalarMultExpr<MT2,ST2,false> >
2253 {
2254  public:
2255  //**********************************************************************************************
2256  typedef typename SelectType< IsDenseMatrix<MT1>::value && IsColumnMajorMatrix<MT1>::value &&
2257  IsSparseMatrix<MT2>::value && IsRowMajorMatrix<MT2>::value &&
2258  IsNumeric<ST1>::value && IsNumeric<ST2>::value
2259  , typename TDMatScalarMultExprTrait<typename TDMatSMatMultExprTrait<MT1,MT2>::Type,typename MultTrait<ST1,ST2>::Type>::Type
2260  , INVALID_TYPE >::Type Type;
2261  //**********************************************************************************************
2262 };
2264 //*************************************************************************************************
2265 
2266 
2267 
2268 
2269 //=================================================================================================
2270 //
2271 // TDMATTSMATMULTEXPRTRAIT SPECIALIZATIONS
2272 //
2273 //=================================================================================================
2274 
2275 //*************************************************************************************************
2277 template< typename MT1, typename ST, typename MT2 >
2278 struct TDMatTSMatMultExprTrait< DMatScalarMultExpr<MT1,ST,true>, MT2 >
2279 {
2280  public:
2281  //**********************************************************************************************
2282  typedef typename SelectType< IsDenseMatrix<MT1>::value && IsColumnMajorMatrix<MT1>::value &&
2283  IsSparseMatrix<MT2>::value && IsColumnMajorMatrix<MT2>::value &&
2284  IsNumeric<ST>::value
2285  , typename TDMatScalarMultExprTrait<typename TDMatTSMatMultExprTrait<MT1,MT2>::Type,ST>::Type
2286  , INVALID_TYPE >::Type Type;
2287  //**********************************************************************************************
2288 };
2290 //*************************************************************************************************
2291 
2292 
2293 //*************************************************************************************************
2295 template< typename MT1, typename ST1, typename MT2, typename ST2 >
2296 struct TDMatTSMatMultExprTrait< DMatScalarMultExpr<MT1,ST1,true>, SMatScalarMultExpr<MT2,ST2,true> >
2297 {
2298  public:
2299  //**********************************************************************************************
2300  typedef typename SelectType< IsDenseMatrix<MT1>::value && IsColumnMajorMatrix<MT1>::value &&
2301  IsSparseMatrix<MT2>::value && IsColumnMajorMatrix<MT2>::value &&
2302  IsNumeric<ST1>::value && IsNumeric<ST2>::value
2303  , typename TDMatScalarMultExprTrait<typename TDMatTSMatMultExprTrait<MT1,MT2>::Type,typename MultTrait<ST1,ST2>::Type>::Type
2304  , INVALID_TYPE >::Type Type;
2305  //**********************************************************************************************
2306 };
2308 //*************************************************************************************************
2309 
2310 
2311 
2312 
2313 //=================================================================================================
2314 //
2315 // SMATDMATMULTEXPRTRAIT SPECIALIZATIONS
2316 //
2317 //=================================================================================================
2318 
2319 //*************************************************************************************************
2321 template< typename MT1, typename ST, typename MT2 >
2322 struct SMatDMatMultExprTrait< MT1, DMatScalarMultExpr<MT2,ST,false> >
2323 {
2324  public:
2325  //**********************************************************************************************
2326  typedef typename SelectType< IsSparseMatrix<MT1>::value && IsRowMajorMatrix<MT1>::value &&
2327  IsDenseMatrix<MT2>::value && IsRowMajorMatrix<MT2>::value &&
2328  IsNumeric<ST>::value
2329  , typename DMatScalarMultExprTrait<typename SMatDMatMultExprTrait<MT1,MT2>::Type,ST>::Type
2330  , INVALID_TYPE >::Type Type;
2331  //**********************************************************************************************
2332 };
2334 //*************************************************************************************************
2335 
2336 
2337 //*************************************************************************************************
2339 template< typename MT1, typename ST1, typename MT2, typename ST2 >
2340 struct SMatDMatMultExprTrait< SMatScalarMultExpr<MT1,ST1,false>, DMatScalarMultExpr<MT2,ST2,false> >
2341 {
2342  public:
2343  //**********************************************************************************************
2344  typedef typename SelectType< IsSparseMatrix<MT1>::value && IsRowMajorMatrix<MT1>::value &&
2345  IsDenseMatrix<MT2>::value && IsRowMajorMatrix<MT2>::value &&
2346  IsNumeric<ST1>::value && IsNumeric<ST2>::value
2347  , typename DMatScalarMultExprTrait<typename SMatDMatMultExprTrait<MT1,MT2>::Type,typename MultTrait<ST1,ST2>::Type>::Type
2348  , INVALID_TYPE >::Type Type;
2349  //**********************************************************************************************
2350 };
2352 //*************************************************************************************************
2353 
2354 
2355 
2356 
2357 //=================================================================================================
2358 //
2359 // SMATTDMATMULTEXPRTRAIT SPECIALIZATIONS
2360 //
2361 //=================================================================================================
2362 
2363 //*************************************************************************************************
2365 template< typename MT1, typename ST, typename MT2 >
2366 struct SMatTDMatMultExprTrait< MT1, DMatScalarMultExpr<MT2,ST,true> >
2367 {
2368  public:
2369  //**********************************************************************************************
2370  typedef typename SelectType< IsSparseMatrix<MT1>::value && IsRowMajorMatrix<MT1>::value &&
2371  IsDenseMatrix<MT2>::value && IsColumnMajorMatrix<MT2>::value &&
2372  IsNumeric<ST>::value
2373  , typename DMatScalarMultExprTrait<typename SMatTDMatMultExprTrait<MT1,MT2>::Type,ST>::Type
2374  , INVALID_TYPE >::Type Type;
2375  //**********************************************************************************************
2376 };
2378 //*************************************************************************************************
2379 
2380 
2381 //*************************************************************************************************
2383 template< typename MT1, typename ST1, typename MT2, typename ST2 >
2384 struct SMatTDMatMultExprTrait< SMatScalarMultExpr<MT1,ST1,false>, DMatScalarMultExpr<MT2,ST2,true> >
2385 {
2386  public:
2387  //**********************************************************************************************
2388  typedef typename SelectType< IsSparseMatrix<MT1>::value && IsRowMajorMatrix<MT1>::value &&
2389  IsDenseMatrix<MT2>::value && IsColumnMajorMatrix<MT2>::value &&
2390  IsNumeric<ST1>::value && IsNumeric<ST2>::value
2391  , typename DMatScalarMultExprTrait<typename SMatTDMatMultExprTrait<MT1,MT2>::Type,typename MultTrait<ST1,ST2>::Type>::Type
2392  , INVALID_TYPE >::Type Type;
2393  //**********************************************************************************************
2394 };
2396 //*************************************************************************************************
2397 
2398 
2399 
2400 
2401 //=================================================================================================
2402 //
2403 // TSMATDMATMULTEXPRTRAIT SPECIALIZATIONS
2404 //
2405 //=================================================================================================
2406 
2407 //*************************************************************************************************
2409 template< typename MT1, typename ST, typename MT2 >
2410 struct TSMatDMatMultExprTrait< MT1, DMatScalarMultExpr<MT2,ST,false> >
2411 {
2412  public:
2413  //**********************************************************************************************
2414  typedef typename SelectType< IsSparseMatrix<MT1>::value && IsColumnMajorMatrix<MT1>::value &&
2415  IsDenseMatrix<MT2>::value && IsRowMajorMatrix<MT2>::value &&
2416  IsNumeric<ST>::value
2417  , typename TDMatScalarMultExprTrait<typename TSMatDMatMultExprTrait<MT1,MT2>::Type,ST>::Type
2418  , INVALID_TYPE >::Type Type;
2419  //**********************************************************************************************
2420 };
2422 //*************************************************************************************************
2423 
2424 
2425 //*************************************************************************************************
2427 template< typename MT1, typename ST1, typename MT2, typename ST2 >
2428 struct TSMatDMatMultExprTrait< SMatScalarMultExpr<MT1,ST1,true>, DMatScalarMultExpr<MT2,ST2,false> >
2429 {
2430  public:
2431  //**********************************************************************************************
2432  typedef typename SelectType< IsSparseMatrix<MT1>::value && IsColumnMajorMatrix<MT1>::value &&
2433  IsDenseMatrix<MT2>::value && IsRowMajorMatrix<MT2>::value &&
2434  IsNumeric<ST1>::value && IsNumeric<ST2>::value
2435  , typename TDMatScalarMultExprTrait<typename TSMatDMatMultExprTrait<MT1,MT2>::Type,typename MultTrait<ST1,ST2>::Type>::Type
2436  , INVALID_TYPE >::Type Type;
2437  //**********************************************************************************************
2438 };
2440 //*************************************************************************************************
2441 
2442 
2443 
2444 
2445 //=================================================================================================
2446 //
2447 // TSMATTDMATMULTEXPRTRAIT SPECIALIZATIONS
2448 //
2449 //=================================================================================================
2450 
2451 //*************************************************************************************************
2453 template< typename MT1, typename ST, typename MT2 >
2454 struct TSMatTDMatMultExprTrait< MT1, DMatScalarMultExpr<MT2,ST,true> >
2455 {
2456  public:
2457  //**********************************************************************************************
2458  typedef typename SelectType< IsSparseMatrix<MT1>::value && IsColumnMajorMatrix<MT1>::value &&
2459  IsDenseMatrix<MT2>::value && IsColumnMajorMatrix<MT2>::value &&
2460  IsNumeric<ST>::value
2461  , typename TDMatScalarMultExprTrait<typename TSMatTDMatMultExprTrait<MT1,MT2>::Type,ST>::Type
2462  , INVALID_TYPE >::Type Type;
2463  //**********************************************************************************************
2464 };
2466 //*************************************************************************************************
2467 
2468 
2469 //*************************************************************************************************
2471 template< typename MT1, typename ST1, typename MT2, typename ST2 >
2472 struct TSMatTDMatMultExprTrait< SMatScalarMultExpr<MT1,ST1,true>, DMatScalarMultExpr<MT2,ST2,true> >
2473 {
2474  public:
2475  //**********************************************************************************************
2476  typedef typename SelectType< IsSparseMatrix<MT1>::value && IsColumnMajorMatrix<MT1>::value &&
2477  IsDenseMatrix<MT2>::value && IsColumnMajorMatrix<MT2>::value &&
2478  IsNumeric<ST1>::value && IsNumeric<ST2>::value
2479  , typename TDMatScalarMultExprTrait<typename TSMatTDMatMultExprTrait<MT1,MT2>::Type,typename MultTrait<ST1,ST2>::Type>::Type
2480  , INVALID_TYPE >::Type Type;
2481  //**********************************************************************************************
2482 };
2484 //*************************************************************************************************
2485 
2486 
2487 
2488 
2489 //=================================================================================================
2490 //
2491 // SUBMATRIXEXPRTRAIT SPECIALIZATIONS
2492 //
2493 //=================================================================================================
2494 
2495 //*************************************************************************************************
2497 template< typename MT, typename ST, bool SO >
2498 struct SubmatrixExprTrait< DMatScalarMultExpr<MT,ST,SO> >
2499 {
2500  public:
2501  //**********************************************************************************************
2502  typedef typename MultExprTrait< typename SubmatrixExprTrait<const MT>::Type, ST >::Type Type;
2503  //**********************************************************************************************
2504 };
2506 //*************************************************************************************************
2507 
2508 
2509 
2510 
2511 //=================================================================================================
2512 //
2513 // ROWEXPRTRAIT SPECIALIZATIONS
2514 //
2515 //=================================================================================================
2516 
2517 //*************************************************************************************************
2519 template< typename MT, typename ST, bool SO >
2520 struct RowExprTrait< DMatScalarMultExpr<MT,ST,SO> >
2521 {
2522  public:
2523  //**********************************************************************************************
2524  typedef typename MultExprTrait< typename RowExprTrait<const MT>::Type, ST >::Type Type;
2525  //**********************************************************************************************
2526 };
2528 //*************************************************************************************************
2529 
2530 
2531 
2532 
2533 //=================================================================================================
2534 //
2535 // COLUMNEXPRTRAIT SPECIALIZATIONS
2536 //
2537 //=================================================================================================
2538 
2539 //*************************************************************************************************
2541 template< typename MT, typename ST, bool SO >
2542 struct ColumnExprTrait< DMatScalarMultExpr<MT,ST,SO> >
2543 {
2544  public:
2545  //**********************************************************************************************
2546  typedef typename MultExprTrait< typename ColumnExprTrait<const MT>::Type, ST >::Type Type;
2547  //**********************************************************************************************
2548 };
2550 //*************************************************************************************************
2551 
2552 } // namespace blaze
2553 
2554 #endif
LeftOperand leftOperand() const
Returns the left-hand side dense matrix operand.
Definition: DMatScalarMultExpr.h:510
MT::ConstIterator IteratorType
ConstIterator type of the dense matrix expression.
Definition: DMatScalarMultExpr.h:189
IntrinsicType load() const
Access to the intrinsic elements of the matrix.
Definition: DMatScalarMultExpr.h:285
Pointer difference type of the Blaze library.
DifferenceType difference_type
Difference between two iterators.
Definition: DMatScalarMultExpr.h:186
Data type constraint.
Compile time check whether the given type is a computational expression template.This type trait clas...
Definition: IsComputation.h:89
Constraint on the data type.
Compile time check whether the given type is a temporary vector or matrix type.This type trait class ...
Definition: IsTemporary.h:87
RightOperand scalar_
Scalar of the multiplication expression.
Definition: DMatScalarMultExpr.h:406
const DMatDMatMultExpr< T1, T2 > operator*(const DenseMatrix< T1, false > &lhs, const DenseMatrix< T2, false > &rhs)
Multiplication operator for the multiplication of two row-major dense matrices ( ).
Definition: DMatDMatMultExpr.h:3703
const EnableIf< IsNumeric< T2 >, typename DivExprTrait< T1, T2 >::Type >::Type operator/(const DenseMatrix< T1, SO > &mat, T2 scalar)
Division operator for the division of a dense matrix by a scalar value ( ).
Definition: DMatScalarDivExpr.h:745
MultExprTrait< RN, ST >::Type ExprReturnType
Expression return type for the subscript operator.
Definition: DMatScalarMultExpr.h:124
MT::ResultType RT
Result type of the dense matrix expression.
Definition: DMatScalarMultExpr.h:108
ReferenceType reference
Reference return type.
Definition: DMatScalarMultExpr.h:185
ConstIterator & operator++()
Pre-increment operator.
Definition: DMatScalarMultExpr.h:233
Header file for the IsSparseMatrix type trait.
const ConstIterator operator--(int)
Post-decrement operator.
Definition: DMatScalarMultExpr.h:265
#define BLAZE_CONSTRAINT_MUST_BE_MATRIX_WITH_STORAGE_ORDER(T, SO)
Constraint on the data type.In case the given data type T is not a dense or sparse matrix type and in...
Definition: StorageOrder.h:242
Efficient implementation of a compressed matrix.The CompressedMatrix class template is the represent...
Definition: CompressedMatrix.h:196
bool operator>=(const ConstIterator &rhs) const
Greater-than comparison between two ConstIterator objects.
Definition: DMatScalarMultExpr.h:351
#define BLAZE_CONSTRAINT_MUST_BE_DENSE_MATRIX_TYPE(T)
Constraint on the data type.In case the given data type T is not a dense, N-dimensional matrix type...
Definition: DenseMatrix.h:79
Header file for the ColumnExprTrait class template.
Header file for the IsSame and IsStrictlySame type traits.
Header file for the IsColumnMajorMatrix type trait.
RightOperand scalar_
Right-hand side scalar of the multiplication expression.
Definition: DMatScalarMultExpr.h:552
const This & CompositeType
Data type for composite expression templates.
Definition: CompressedMatrix.h:2375
Type ElementType
Type of the sparse matrix elements.
Definition: CompressedMatrix.h:248
IteratorCategory iterator_category
The iterator category.
Definition: DMatScalarMultExpr.h:182
SelectType< useAssign, const ResultType, const DMatScalarMultExpr & >::Type CompositeType
Data type for composite expression templates.
Definition: DMatScalarMultExpr.h:159
Base class for all matrix/scalar multiplication expression templates.The MatScalarMultExpr class serv...
Definition: MatScalarMultExpr.h:66
Header file for the DenseVector base class.
MT::ReturnType RN
Return type of the dense matrix expression.
Definition: DMatScalarMultExpr.h:109
Header file for the Computation base class.
Type relationship analysis.This class tests if the two data types A and B are equal. For this type comparison, the cv-qualifiers of both data types are ignored. If A and B are the same data type (ignoring the cv-qualifiers), then the value member enumeration is set to 1, the nested type definition Type is TrueType, and the class derives from TrueType. Otherwise value is set to 0, Type is FalseType, and the class derives from FalseType.
Definition: IsSame.h:158
Header file for the RequiresEvaluation type trait.
DifferenceType operator-(const ConstIterator &rhs) const
Calculating the number of elements between two iterators.
Definition: DMatScalarMultExpr.h:362
Base class for dense matrices.The DenseMatrix class is a base class for all dense matrix classes...
Definition: DenseMatrix.h:70
Base class for sparse matrices.The SparseMatrix class is a base class for all sparse matrix classes...
Definition: Forward.h:104
ReturnType operator*() const
Direct access to the element at the current iterator position.
Definition: DMatScalarMultExpr.h:275
Constraint on the data type.
Header file for the DivExprTrait class template.
ElementType ValueType
Type of the underlying elements.
Definition: DMatScalarMultExpr.h:176
Constraint on the data type.
Header file for the MultExprTrait class template.
Compile time check to query the requirement to evaluate an expression.Via this type trait it is possi...
Definition: RequiresEvaluation.h:90
const This & CompositeType
Data type for composite expression templates.
Definition: CompressedMatrix.h:250
Compile time type selection.The SelectType class template selects one of the two given types T1 and T...
Definition: SelectType.h:59
Header file for the IsTemporary type trait class.
ptrdiff_t DifferenceType
Difference between two iterators.
Definition: DMatScalarMultExpr.h:179
Header file for the multiplication trait.
size_t rows() const
Returns the current number of rows of the matrix.
Definition: DMatScalarMultExpr.h:490
bool operator<(const ConstIterator &rhs) const
Less-than comparison between two ConstIterator objects.
Definition: DMatScalarMultExpr.h:318
Header file for the IsFloatingPoint type trait.
ReturnType operator()(size_t i, size_t j) const
2D-access to the matrix elements.
Definition: DMatScalarMultExpr.h:437
const Element * ConstIterator
Iterator over constant elements.
Definition: CompressedMatrix.h:2379
Expression object for dense matrix-scalar multiplications.The DMatScalarMultExpr class represents the...
Definition: DMatScalarMultExpr.h:102
bool canAlias(const T *alias) const
Returns whether the expression can alias with the given address alias.
Definition: DMatScalarMultExpr.h:532
ConstIterator & operator+=(size_t inc)
Addition assignment operator.
Definition: DMatScalarMultExpr.h:210
IteratorType iterator_
Iterator to the current element.
Definition: DMatScalarMultExpr.h:405
Header file for the DenseMatrix base class.
bool operator<=(const ConstIterator &rhs) const
Less-than comparison between two ConstIterator objects.
Definition: DMatScalarMultExpr.h:340
IntrinsicType load(size_t i, size_t j) const
Access to the intrinsic elements of the matrix.
Definition: DMatScalarMultExpr.h:451
void assign(Matrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs)
Default implementation of the assignment of a matrix to a matrix.
Definition: Matrix.h:179
const SelectType< returnExpr, ExprReturnType, ElementType >::Type ReturnType
Return type for expression template evaluations.
Definition: DMatScalarMultExpr.h:156
#define BLAZE_CONSTRAINT_MUST_BE_SAME_TYPE(A, B)
Data type constraint.In case the two types A and B are not the same (ignoring all cv-qualifiers of bo...
Definition: SameType.h:89
ElementType * PointerType
Pointer return type.
Definition: DMatScalarMultExpr.h:177
#define BLAZE_CONSTRAINT_MUST_BE_REFERENCE_TYPE(T)
Constraint on the data type.In case the given data type T is not a reference type, a compilation error is created.
Definition: Reference.h:78
bool operator==(const ConstIterator &rhs) const
Equality comparison between two ConstIterator objects.
Definition: DMatScalarMultExpr.h:296
SelectType< IsExpression< MT >::value, const MT, const MT & >::Type LeftOperand
Composite type of the left-hand side dense matrix expression.
Definition: DMatScalarMultExpr.h:162
Constraints on the storage order of matrix types.
LeftOperand matrix_
Left-hand side dense matrix of the multiplication expression.
Definition: DMatScalarMultExpr.h:551
Type ElementType
Type of the sparse matrix elements.
Definition: CompressedMatrix.h:2373
Header file for the SelectType class template.
Header file for the RowExprTrait class template.
Header file for all forward declarations for expression class templates.
Header file for the IsDenseMatrix type trait.
ConstIterator end(size_t i) const
Returns an iterator just past the last non-zero element of row i.
Definition: DMatScalarMultExpr.h:480
Header file for the EnableIf class template.
friend const ConstIterator operator-(const ConstIterator &it, size_t dec)
Subtraction between a ConstIterator and an integral value.
Definition: DMatScalarMultExpr.h:398
Header file for the BaseElementType type trait.
size_t columns() const
Returns the current number of columns of the matrix.
Definition: DMatScalarMultExpr.h:500
ConstIterator(IteratorType iterator, RightOperand scalar)
Constructor for the ConstIterator class.
Definition: DMatScalarMultExpr.h:198
friend const ConstIterator operator+(size_t inc, const ConstIterator &it)
Addition between an integral value and a ConstIterator.
Definition: DMatScalarMultExpr.h:386
Header file for the IsNumeric type trait.
ResultType::ElementType ElementType
Resulting element type.
Definition: DMatScalarMultExpr.h:152
ElementType & ReferenceType
Reference return type.
Definition: DMatScalarMultExpr.h:178
RightOperand rightOperand() const
Returns the right-hand side scalar operand.
Definition: DMatScalarMultExpr.h:520
Header file for the IsSparseVector type trait.
Header file for the SubmatrixExprTrait class template.
const Type & ReturnType
Return type for expression template evaluations.
Definition: CompressedMatrix.h:2374
Header file for the MatScalarMultExpr base class.
Intrinsic characteristics of data types.The IntrinsicTrait class template provides the intrinsic char...
Definition: IntrinsicTrait.h:648
MT::CompositeType CT
Composite type of the dense matrix expression.
Definition: DMatScalarMultExpr.h:111
Header file for run time assertion macros.
Utility type for generic codes.
Base template for the MultTrait class.
Definition: MultTrait.h:141
DMatScalarMultExpr(const MT &matrix, ST scalar)
Constructor for the DMatScalarMultExpr class.
Definition: DMatScalarMultExpr.h:424
Header file for the division trait.
bool isAliased(const T *alias) const
Returns whether the expression is aliased with the given address alias.
Definition: DMatScalarMultExpr.h:544
void addAssign(Matrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs)
Default implementation of the addition assignment of a matrix to a matrix.
Definition: Matrix.h:209
const DenseIterator< Type > operator-(const DenseIterator< Type > &it, ptrdiff_t inc)
Subtraction between a DenseIterator and an integral value.
Definition: DenseIterator.h:585
Substitution Failure Is Not An Error (SFINAE) class.The EnableIf class template is an auxiliary tool ...
Definition: EnableIf.h:184
ConstIterator & operator-=(size_t dec)
Subtraction assignment operator.
Definition: DMatScalarMultExpr.h:222
#define BLAZE_CONSTRAINT_MUST_BE_NUMERIC_TYPE(T)
Constraint on the data type.In case the given data type T is not a numeric (integral or floating poin...
Definition: Numeric.h:79
void subAssign(Matrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs)
Default implementation of the subtraction assignment of a matrix to matrix.
Definition: Matrix.h:239
ConstIterator begin(size_t i) const
Returns an iterator to the first non-zero element of row i.
Definition: DMatScalarMultExpr.h:469
bool operator!=(const ConstIterator &rhs) const
Inequality comparison between two ConstIterator objects.
Definition: DMatScalarMultExpr.h:307
bool operator>(const ConstIterator &rhs) const
Greater-than comparison between two ConstIterator objects.
Definition: DMatScalarMultExpr.h:329
const ConstIterator operator++(int)
Post-increment operator.
Definition: DMatScalarMultExpr.h:244
Evaluation of the base element type of a given data type.Via this type trait it is possible to evalua...
Definition: BaseElementType.h:75
friend const ConstIterator operator+(const ConstIterator &it, size_t inc)
Addition between a ConstIterator and an integral value.
Definition: DMatScalarMultExpr.h:374
Header file for the IsDenseVector type trait.
Header file for all intrinsic functionality.
ConstIterator & operator--()
Pre-decrement operator.
Definition: DMatScalarMultExpr.h:254
MT::ElementType ET
Element type of the dense matrix expression.
Definition: DMatScalarMultExpr.h:110
Header file for the IsRowMajorMatrix type trait.
Header file for the IsComputation type trait class.
ST RightOperand
Composite type of the right-hand side scalar value.
Definition: DMatScalarMultExpr.h:165
Base class for all compute expression templates.The Computation class serves as a tag for all computa...
Definition: Computation.h:59
ResultType::TransposeType TransposeType
Transpose type for expression template evaluations.
Definition: DMatScalarMultExpr.h:151
#define BLAZE_FUNCTION_TRACE
Function trace macro.This macro can be used to reliably trace function calls. In case function tracin...
Definition: FunctionTrace.h:157
PointerType pointer
Pointer return type.
Definition: DMatScalarMultExpr.h:184
This ResultType
Result type for expression template evaluations.
Definition: CompressedMatrix.h:2370
Header file for basic type definitions.
IntrinsicTrait< ElementType >::Type IntrinsicType
Resulting intrinsic element type.
Definition: DMatScalarMultExpr.h:153
Iterator over the elements of the dense matrix.
Definition: DMatScalarMultExpr.h:171
std::random_access_iterator_tag IteratorCategory
The iterator category.
Definition: DMatScalarMultExpr.h:175
MultTrait< RT, ST >::Type ResultType
Result type for expression template evaluations.
Definition: DMatScalarMultExpr.h:149
ResultType::OppositeType OppositeType
Result type with opposite storage order for expression template evaluations.
Definition: DMatScalarMultExpr.h:150
DMatScalarMultExpr< MT, ST, SO > This
Type of this DMatScalarMultExpr instance.
Definition: DMatScalarMultExpr.h:148
Evaluation of the resulting expression type of a multiplication.Via this type trait it is possible to...
Definition: MultExprTrait.h:137
#define BLAZE_INTERNAL_ASSERT(expr, msg)
Run time assertion macro for internal checks.In case of an invalid run time expression, the program execution is terminated. The BLAZE_INTERNAL_ASSERT macro can be disabled by setting the BLAZE_USER_ASSERTION flag to zero or by defining NDEBUG during the compilation.
Definition: Assert.h:101
EnableIf< IsIntegral< T >, Set< T, sizeof(T)> >::Type::Type set(T value)
Sets all values in the vector to the given integral value.
Definition: Set.h:209
Header file for the IsExpression type trait class.
Header file for the FunctionTrace class.
ValueType value_type
Type of the underlying elements.
Definition: DMatScalarMultExpr.h:183