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>
73 #include <blaze/util/Assert.h>
77 #include <blaze/util/EnableIf.h>
78 #include <blaze/util/InvalidType.h>
80 #include <blaze/util/SelectType.h>
81 #include <blaze/util/Types.h>
85 
86 
87 namespace blaze {
88 
89 //=================================================================================================
90 //
91 // CLASS DMATSCALARMULTEXPR
92 //
93 //=================================================================================================
94 
95 //*************************************************************************************************
102 template< typename MT // Type of the left-hand side dense matrix
103  , typename ST // Type of the right-hand side scalar value
104  , bool SO > // Storage order
105 class DMatScalarMultExpr : public DenseMatrix< DMatScalarMultExpr<MT,ST,SO>, SO >
106  , private MatScalarMultExpr
107  , private Computation
108 {
109  private:
110  //**Type definitions****************************************************************************
111  typedef typename MT::ResultType RT;
112  typedef typename MT::ReturnType RN;
113  typedef typename MT::ElementType ET;
114  typedef typename MT::CompositeType CT;
115  //**********************************************************************************************
116 
117  //**Return type evaluation**********************************************************************
119 
124  enum { returnExpr = !IsTemporary<RN>::value };
125 
128  //**********************************************************************************************
129 
130  //**Evaluation strategy*************************************************************************
132 
138  enum { useAssign = RequiresEvaluation<MT>::value };
139 
141  template< typename MT2 >
143  struct UseAssign {
144  enum { value = useAssign };
145  };
147  //**********************************************************************************************
148 
149  public:
150  //**Type definitions****************************************************************************
157 
160 
163 
165  typedef typename SelectType< IsExpression<MT>::value, const MT, const MT& >::Type LeftOperand;
166 
168  typedef ST RightOperand;
169  //**********************************************************************************************
170 
171  //**ConstIterator class definition**************************************************************
175  {
176  public:
177  //**Type definitions*************************************************************************
178  typedef std::random_access_iterator_tag IteratorCategory;
183 
184  // STL iterator requirements
190 
192  typedef typename MT::ConstIterator IteratorType;
193  //*******************************************************************************************
194 
195  //**Constructor******************************************************************************
201  explicit inline ConstIterator( IteratorType iterator, RightOperand scalar )
202  : iterator_( iterator ) // Iterator to the current element
203  , scalar_ ( scalar ) // Scalar of the multiplication expression
204  {}
205  //*******************************************************************************************
206 
207  //**Addition assignment operator*************************************************************
213  inline ConstIterator& operator+=( size_t inc ) {
214  iterator_ += inc;
215  return *this;
216  }
217  //*******************************************************************************************
218 
219  //**Subtraction assignment operator**********************************************************
225  inline ConstIterator& operator-=( size_t dec ) {
226  iterator_ -= dec;
227  return *this;
228  }
229  //*******************************************************************************************
230 
231  //**Prefix increment operator****************************************************************
237  ++iterator_;
238  return *this;
239  }
240  //*******************************************************************************************
241 
242  //**Postfix increment operator***************************************************************
247  inline const ConstIterator operator++( int ) {
248  return ConstIterator( iterator_++ );
249  }
250  //*******************************************************************************************
251 
252  //**Prefix decrement operator****************************************************************
258  --iterator_;
259  return *this;
260  }
261  //*******************************************************************************************
262 
263  //**Postfix decrement operator***************************************************************
268  inline const ConstIterator operator--( int ) {
269  return ConstIterator( iterator_-- );
270  }
271  //*******************************************************************************************
272 
273  //**Element access operator******************************************************************
278  inline ReturnType operator*() const {
279  return *iterator_ * scalar_;
280  }
281  //*******************************************************************************************
282 
283  //**Load function****************************************************************************
288  inline IntrinsicType load() const {
289  return iterator_.load() * set( scalar_ );
290  }
291  //*******************************************************************************************
292 
293  //**Equality operator************************************************************************
299  inline bool operator==( const ConstIterator& rhs ) const {
300  return iterator_ == rhs.iterator_;
301  }
302  //*******************************************************************************************
303 
304  //**Inequality operator**********************************************************************
310  inline bool operator!=( const ConstIterator& rhs ) const {
311  return iterator_ != rhs.iterator_;
312  }
313  //*******************************************************************************************
314 
315  //**Less-than operator***********************************************************************
321  inline bool operator<( const ConstIterator& rhs ) const {
322  return iterator_ < rhs.iterator_;
323  }
324  //*******************************************************************************************
325 
326  //**Greater-than operator********************************************************************
332  inline bool operator>( const ConstIterator& rhs ) const {
333  return iterator_ > rhs.iterator_;
334  }
335  //*******************************************************************************************
336 
337  //**Less-or-equal-than operator**************************************************************
343  inline bool operator<=( const ConstIterator& rhs ) const {
344  return iterator_ <= rhs.iterator_;
345  }
346  //*******************************************************************************************
347 
348  //**Greater-or-equal-than operator***********************************************************
354  inline bool operator>=( const ConstIterator& rhs ) const {
355  return iterator_ >= rhs.iterator_;
356  }
357  //*******************************************************************************************
358 
359  //**Subtraction operator*********************************************************************
365  inline DifferenceType operator-( const ConstIterator& rhs ) const {
366  return iterator_ - rhs.iterator_;
367  }
368  //*******************************************************************************************
369 
370  //**Addition operator************************************************************************
377  friend inline const ConstIterator operator+( const ConstIterator& it, size_t inc ) {
378  return ConstIterator( it.iterator_ + inc );
379  }
380  //*******************************************************************************************
381 
382  //**Addition operator************************************************************************
389  friend inline const ConstIterator operator+( size_t inc, const ConstIterator& it ) {
390  return ConstIterator( it.iterator_ + inc );
391  }
392  //*******************************************************************************************
393 
394  //**Subtraction operator*********************************************************************
401  friend inline const ConstIterator operator-( const ConstIterator& it, size_t dec ) {
402  return ConstIterator( it.iterator_ - dec );
403  }
404  //*******************************************************************************************
405 
406  private:
407  //**Member variables*************************************************************************
410  //*******************************************************************************************
411  };
412  //**********************************************************************************************
413 
414  //**Compilation flags***************************************************************************
416  enum { vectorizable = MT::vectorizable &&
419 
421  enum { smpAssignable = MT::smpAssignable };
422  //**********************************************************************************************
423 
424  //**Constructor*********************************************************************************
430  explicit inline DMatScalarMultExpr( const MT& matrix, ST scalar )
431  : matrix_( matrix ) // Left-hand side dense matrix of the multiplication expression
432  , scalar_( scalar ) // Right-hand side scalar of the multiplication expression
433  {}
434  //**********************************************************************************************
435 
436  //**Access operator*****************************************************************************
443  inline ReturnType operator()( size_t i, size_t j ) const {
444  BLAZE_INTERNAL_ASSERT( i < matrix_.rows() , "Invalid row access index" );
445  BLAZE_INTERNAL_ASSERT( j < matrix_.columns(), "Invalid column access index" );
446  return matrix_(i,j) * scalar_;
447  }
448  //**********************************************************************************************
449 
450  //**Load function*******************************************************************************
457  inline IntrinsicType load( size_t i, size_t j ) const {
458  typedef IntrinsicTrait<ElementType> IT;
459  BLAZE_INTERNAL_ASSERT( i < matrix_.rows() , "Invalid row access index" );
460  BLAZE_INTERNAL_ASSERT( j < matrix_.columns(), "Invalid column access index" );
461  BLAZE_INTERNAL_ASSERT( !SO || ( i % IT::size == 0UL ), "Invalid row access index" );
462  BLAZE_INTERNAL_ASSERT( SO || ( j % IT::size == 0UL ), "Invalid column access index" );
463  const IntrinsicType xmm1( matrix_.load(i,j) );
464  const IntrinsicType xmm2( set( scalar_ ) );
465  return xmm1 * xmm2;
466  }
467  //**********************************************************************************************
468 
469  //**Begin function******************************************************************************
475  inline ConstIterator begin( size_t i ) const {
476  return ConstIterator( matrix_.begin(i), scalar_ );
477  }
478  //**********************************************************************************************
479 
480  //**End function********************************************************************************
486  inline ConstIterator end( size_t i ) const {
487  return ConstIterator( matrix_.end(i), scalar_ );
488  }
489  //**********************************************************************************************
490 
491  //**Rows function*******************************************************************************
496  inline size_t rows() const {
497  return matrix_.rows();
498  }
499  //**********************************************************************************************
500 
501  //**Columns function****************************************************************************
506  inline size_t columns() const {
507  return matrix_.columns();
508  }
509  //**********************************************************************************************
510 
511  //**Left operand access*************************************************************************
516  inline LeftOperand leftOperand() const {
517  return matrix_;
518  }
519  //**********************************************************************************************
520 
521  //**Right operand access************************************************************************
526  inline RightOperand rightOperand() const {
527  return scalar_;
528  }
529  //**********************************************************************************************
530 
531  //**********************************************************************************************
537  template< typename T >
538  inline bool canAlias( const T* alias ) const {
539  return IsComputation<MT>::value && matrix_.canAlias( alias );
540  }
541  //**********************************************************************************************
542 
543  //**********************************************************************************************
549  template< typename T >
550  inline bool isAliased( const T* alias ) const {
551  return matrix_.isAliased( alias );
552  }
553  //**********************************************************************************************
554 
555  //**********************************************************************************************
560  inline bool isAligned() const {
561  return matrix_.isAligned();
562  }
563  //**********************************************************************************************
564 
565  //**********************************************************************************************
570  inline bool canSMPAssign() const {
571  return matrix_.canSMPAssign() ||
572  ( ( ( SO == rowMajor ) ? rows() : columns() ) > SMP_DMATSCALARMULT_THRESHOLD );
573  }
574  //**********************************************************************************************
575 
576  private:
577  //**Member variables****************************************************************************
580  //**********************************************************************************************
581 
582  //**Assignment to dense matrices****************************************************************
596  template< typename MT2 // Type of the target dense matrix
597  , bool SO2 > // Storage order of the target dense matrix
598  friend inline typename EnableIf< UseAssign<MT2> >::Type
600  {
602 
603  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
604  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
605 
606  assign( ~lhs, rhs.matrix_ );
607  (~lhs) *= rhs.scalar_;
608  }
610  //**********************************************************************************************
611 
612  //**Assignment to sparse matrices***************************************************************
626  template< typename MT2 // Type of the target sparse matrix
627  , bool SO2 > // Storage order of the target sparse matrix
628  friend inline typename EnableIf< UseAssign<MT2> >::Type
630  {
632 
633  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
634  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
635 
636  assign( ~lhs, rhs.matrix_ );
637  (~lhs) *= rhs.scalar_;
638  }
640  //**********************************************************************************************
641 
642  //**Addition assignment to dense matrices*******************************************************
656  template< typename MT2 // Type of the target dense matrix
657  , bool SO2 > // Storage order of the target dense matrix
658  friend inline typename EnableIf< UseAssign<MT2> >::Type
659  addAssign( DenseMatrix<MT2,SO2>& lhs, const DMatScalarMultExpr& rhs )
660  {
662 
666 
667  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
668  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
669 
670  const ResultType tmp( rhs );
671  smpAddAssign( ~lhs, tmp );
672  }
674  //**********************************************************************************************
675 
676  //**Addition assignment to sparse matrices******************************************************
677  // No special implementation for the addition assignment to sparse matrices.
678  //**********************************************************************************************
679 
680  //**Subtraction assignment to dense matrices****************************************************
694  template< typename MT2 // Type of the target dense matrix
695  , bool SO2 > // Storage order of the target dense matrix
696  friend inline typename EnableIf< UseAssign<MT2> >::Type
697  subAssign( DenseMatrix<MT2,SO2>& lhs, const DMatScalarMultExpr& rhs )
698  {
700 
704 
705  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
706  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
707 
708  const ResultType tmp( rhs );
709  smpSubAssign( ~lhs, tmp );
710  }
712  //**********************************************************************************************
713 
714  //**Subtraction assignment to sparse matrices***************************************************
715  // No special implementation for the subtraction assignment to sparse matrices.
716  //**********************************************************************************************
717 
718  //**Multiplication assignment to dense matrices*************************************************
719  // No special implementation for the multiplication assignment to dense matrices.
720  //**********************************************************************************************
721 
722  //**Multiplication assignment to sparse matrices************************************************
723  // No special implementation for the multiplication assignment to sparse matrices.
724  //**********************************************************************************************
725 
726  //**Compile time checks*************************************************************************
733  //**********************************************************************************************
734 };
735 //*************************************************************************************************
736 
737 
738 
739 
740 //=================================================================================================
741 //
742 // GLOBAL UNARY ARITHMETIC OPERATORS
743 //
744 //=================================================================================================
745 
746 //*************************************************************************************************
763 template< typename MT // Type of the dense matrix
764  , bool SO > // Storage order
765 inline const DMatScalarMultExpr<MT,typename BaseElementType<MT>::Type,SO>
767 {
769 
770  typedef typename BaseElementType<MT>::Type ElementType;
772 }
773 //*************************************************************************************************
774 
775 
776 
777 
778 //=================================================================================================
779 //
780 // GLOBAL BINARY ARITHMETIC OPERATORS
781 //
782 //=================================================================================================
783 
784 //*************************************************************************************************
805 template< typename T1 // Type of the left-hand side dense matrix
806  , bool SO // Storage order of the left-hand side dense matrix
807  , typename T2 > // Type of the right-hand side scalar
808 inline const typename EnableIf< IsNumeric<T2>, typename MultExprTrait<T1,T2>::Type >::Type
809  operator*( const DenseMatrix<T1,SO>& mat, T2 scalar )
810 {
812 
813  typedef typename MultExprTrait<T1,T2>::Type Type;
814  return Type( ~mat, scalar );
815 }
816 //*************************************************************************************************
817 
818 
819 //*************************************************************************************************
840 template< typename T1 // Type of the left-hand side scalar
841  , typename T2 // Type of the right-hand side dense matrix
842  , bool SO > // Storage order of the right-hand side dense matrix
843 inline const typename EnableIf< IsNumeric<T1>, typename MultExprTrait<T1,T2>::Type >::Type
844  operator*( T1 scalar, const DenseMatrix<T2,SO>& mat )
845 {
847 
848  typedef typename MultExprTrait<T1,T2>::Type Type;
849  return Type( ~mat, scalar );
850 }
851 //*************************************************************************************************
852 
853 
854 
855 
856 //=================================================================================================
857 //
858 // GLOBAL RESTRUCTURING UNARY ARITHMETIC OPERATORS
859 //
860 //=================================================================================================
861 
862 //*************************************************************************************************
874 template< typename VT // Type of the dense matrix
875  , typename ST // Type of the scalar
876  , bool TF > // Transpose flag
877 inline const DMatScalarMultExpr<VT,ST,TF>
878  operator-( const DMatScalarMultExpr<VT,ST,TF>& dm )
879 {
881 
882  return DMatScalarMultExpr<VT,ST,TF>( dm.leftOperand(), -dm.rightOperand() );
883 }
885 //*************************************************************************************************
886 
887 
888 
889 
890 //=================================================================================================
891 //
892 // GLOBAL RESTRUCTURING BINARY ARITHMETIC OPERATORS
893 //
894 //=================================================================================================
895 
896 //*************************************************************************************************
909 template< typename MT // Type of the dense matrix of the left-hand side expression
910  , typename ST1 // Type of the scalar of the left-hand side expression
911  , bool SO // Storage order of the dense matrix
912  , typename ST2 > // Type of the right-hand side scalar
913 inline const typename EnableIf< IsNumeric<ST2>
914  , typename MultExprTrait< DMatScalarMultExpr<MT,ST1,SO>, ST2 >::Type >::Type
915  operator*( const DMatScalarMultExpr<MT,ST1,SO>& mat, ST2 scalar )
916 {
918 
919  return mat.leftOperand() * ( mat.rightOperand() * scalar );
920 }
922 //*************************************************************************************************
923 
924 
925 //*************************************************************************************************
938 template< typename ST1 // Type of the left-hand side scalar
939  , typename MT // Type of the dense matrix of the right-hand side expression
940  , typename ST2 // Type of the scalar of the right-hand side expression
941  , bool SO > // Storage order of the dense matrix
942 inline const typename EnableIf< IsNumeric<ST1>
943  , typename MultExprTrait< ST1, DMatScalarMultExpr<MT,ST2,SO> >::Type >::Type
944  operator*( ST1 scalar, const DMatScalarMultExpr<MT,ST2,SO>& mat )
945 {
947 
948  return mat.leftOperand() * ( scalar * mat.rightOperand() );
949 }
951 //*************************************************************************************************
952 
953 
954 //*************************************************************************************************
967 template< typename MT // Type of the dense matrix of the left-hand side expression
968  , typename ST1 // Type of the scalar of the left-hand side expression
969  , bool SO // Storage order of the dense matrix
970  , typename ST2 > // Type of the right-hand side scalar
971 inline const typename EnableIf< IsFloatingPoint<typename DivTrait<ST1,ST2>::Type>
972  , typename DivExprTrait< DMatScalarMultExpr<MT,ST1,SO>, ST2 >::Type >::Type
973  operator/( const DMatScalarMultExpr<MT,ST1,SO>& mat, ST2 scalar )
974 {
976 
977  return mat.leftOperand() * ( mat.rightOperand() / scalar );
978 }
980 //*************************************************************************************************
981 
982 
983 //*************************************************************************************************
997 template< typename MT // Type of the dense matrix of the left-hand side expression
998  , typename ST // Type of the scalar of the left-hand side expression
999  , bool SO // Storage order of the left-hand side expression
1000  , typename VT > // Type of the right-hand side dense vector
1001 inline const typename MultExprTrait< DMatScalarMultExpr<MT,ST,SO>, VT >::Type
1002  operator*( const DMatScalarMultExpr<MT,ST,SO>& mat, const DenseVector<VT,false>& vec )
1003 {
1005 
1006  return ( mat.leftOperand() * (~vec) ) * mat.rightOperand();
1007 }
1009 //*************************************************************************************************
1010 
1011 
1012 //*************************************************************************************************
1026 template< typename VT // Type of the left-hand side dense vector
1027  , typename MT // Type of the dense matrix of the right-hand side expression
1028  , typename ST // Type of the scalar of the right-hand side expression
1029  , bool SO > // Storage order of the right-hand side expression
1030 inline const typename MultExprTrait< VT, DMatScalarMultExpr<MT,ST,SO> >::Type
1031  operator*( const DenseVector<VT,true>& vec, const DMatScalarMultExpr<MT,ST,SO>& mat )
1032 {
1034 
1035  return ( (~vec) * mat.leftOperand() ) * mat.rightOperand();
1036 }
1038 //*************************************************************************************************
1039 
1040 
1041 //*************************************************************************************************
1057 template< typename MT // Type of the dense matrix of the left-hand side expression
1058  , typename ST1 // Type of the scalar of the left-hand side expression
1059  , bool SO // Storage order of the left-hand side expression
1060  , typename VT // Type of the dense vector of the right-hand side expression
1061  , typename ST2 > // Type of the scalar of the right-hand side expression
1062 inline const DVecScalarMultExpr<typename MultExprTrait<MT,VT>::Type,typename MultTrait<ST1,ST2>::Type,false>
1063  operator*( const DMatScalarMultExpr<MT,ST1,SO>& mat, const DVecScalarMultExpr<VT,ST2,false>& vec )
1064 {
1066 
1067  return ( mat.leftOperand() * vec.leftOperand() ) * ( mat.rightOperand() * vec.rightOperand() );
1068 }
1070 //*************************************************************************************************
1071 
1072 
1073 //*************************************************************************************************
1089 template< typename VT // Type of the dense vector of the left-hand side expression
1090  , typename ST1 // Type of the scalar of the left-hand side expression
1091  , typename MT // Type of the dense matrix of the right-hand side expression
1092  , typename ST2 // Type of the scalar of the right-hand side expression
1093  , bool SO > // Storage order of the right-hand side expression
1094 inline const typename MultExprTrait< DVecScalarMultExpr<VT,ST1,true>, DMatScalarMultExpr<MT,ST2,SO> >::Type
1095  operator*( const DVecScalarMultExpr<VT,ST1,true>& vec, const DMatScalarMultExpr<MT,ST2,SO>& mat )
1096 {
1098 
1099  return ( vec.leftOperand() * mat.leftOperand() ) * ( vec.rightOperand() * mat.rightOperand() );
1100 }
1102 //*************************************************************************************************
1103 
1104 
1105 //*************************************************************************************************
1119 template< typename MT // Type of the dense matrix of the left-hand side expression
1120  , typename ST // Type of the scalar of the left-hand side expression
1121  , bool SO // Storage order of the left-hand side expression
1122  , typename VT > // Type of the right-hand side sparse vector
1123 inline const typename MultExprTrait< DMatScalarMultExpr<MT,ST,SO>, VT >::Type
1124  operator*( const DMatScalarMultExpr<MT,ST,SO>& mat, const SparseVector<VT,false>& vec )
1125 {
1127 
1128  return ( mat.leftOperand() * (~vec) ) * mat.rightOperand();
1129 }
1131 //*************************************************************************************************
1132 
1133 
1134 //*************************************************************************************************
1148 template< typename VT // Type of the left-hand side sparse vector
1149  , typename MT // Type of the dense matrix of the right-hand side expression
1150  , typename ST // Type of the scalar of the right-hand side expression
1151  , bool SO > // Storage order of the right-hand side expression
1152 inline const typename MultExprTrait< VT, DMatScalarMultExpr<MT,ST,SO> >::Type
1153  operator*( const SparseVector<VT,true>& vec, const DMatScalarMultExpr<MT,ST,SO>& mat )
1154 {
1156 
1157  return ( (~vec) * mat.leftOperand() ) * mat.rightOperand();
1158 }
1160 //*************************************************************************************************
1161 
1162 
1163 //*************************************************************************************************
1179 template< typename MT // Type of the dense matrix of the left-hand side expression
1180  , typename ST1 // Type of the scalar of the left-hand side expression
1181  , bool SO // Storage order of the left-hand side expression
1182  , typename VT // Type of the sparse vector of the right-hand side expression
1183  , typename ST2 > // Type of the scalar of the right-hand side expression
1184 inline const typename MultExprTrait< DMatScalarMultExpr<MT,ST1,SO>, SVecScalarMultExpr<VT,ST2,false> >::Type
1185  operator*( const DMatScalarMultExpr<MT,ST1,SO>& mat, const SVecScalarMultExpr<VT,ST2,false>& vec )
1186 {
1188 
1189  return ( mat.leftOperand() * vec.leftOperand() ) * ( mat.rightOperand() * vec.rightOperand() );
1190 }
1192 //*************************************************************************************************
1193 
1194 
1195 //*************************************************************************************************
1211 template< typename VT // Type of the sparse vector of the left-hand side expression
1212  , typename ST1 // Type of the scalar of the left-hand side expression
1213  , typename MT // Type of the dense matrix of the right-hand side expression
1214  , typename ST2 // Type of the scalar of the right-hand side expression
1215  , bool SO > // Storage order of the right-hand side expression
1216 inline const typename MultExprTrait< SVecScalarMultExpr<VT,ST1,true>, DMatScalarMultExpr<MT,ST2,SO> >::Type
1217  operator*( const SVecScalarMultExpr<VT,ST1,true>& vec, const DMatScalarMultExpr<MT,ST2,SO>& mat )
1218 {
1220 
1221  return ( vec.leftOperand() * mat.leftOperand() ) * ( vec.rightOperand() * mat.rightOperand() );
1222 }
1224 //*************************************************************************************************
1225 
1226 
1227 //*************************************************************************************************
1241 template< typename MT1 // Type of the dense matrix of the left-hand side expression
1242  , typename ST // Type of the scalar of the left-hand side expression
1243  , bool SO1 // Storage order of the left-hand side expression
1244  , typename MT2 // Type of the right-hand side dense matrix
1245  , bool SO2 > // Storage order of the right-hand side dense matrix
1246 inline const typename MultExprTrait< DMatScalarMultExpr<MT1,ST,SO1>, MT2 >::Type
1247  operator*( const DMatScalarMultExpr<MT1,ST,SO1>& lhs, const DenseMatrix<MT2,SO2>& rhs )
1248 {
1250 
1251  return ( lhs.leftOperand() * (~rhs) ) * lhs.rightOperand();
1252 }
1254 //*************************************************************************************************
1255 
1256 
1257 //*************************************************************************************************
1271 template< typename MT1 // Type of the left-hand side dense matrix
1272  , bool SO1 // Storage order of the left-hand side dense matrix
1273  , typename MT2 // Type of the dense matrix of the right-hand side expression
1274  , typename ST // Type of the scalar of the right-hand side expression
1275  , bool SO2 > // Storage order of the right-hand side expression
1276 inline const typename MultExprTrait< MT1, DMatScalarMultExpr<MT2,ST,SO2> >::Type
1277  operator*( const DenseMatrix<MT1,SO1>& lhs, const DMatScalarMultExpr<MT2,ST,SO2>& rhs )
1278 {
1280 
1281  return ( (~lhs) * rhs.leftOperand() ) * rhs.rightOperand();
1282 }
1284 //*************************************************************************************************
1285 
1286 
1287 //*************************************************************************************************
1301 template< typename MT1 // Type of the dense matrix of the left-hand side expression
1302  , typename ST1 // Type of the scalar of the left-hand side expression
1303  , bool SO1 // Storage order of the left-hand side expression
1304  , typename MT2 // Type of the right-hand side dense matrix
1305  , typename ST2 // Type of the scalar of the right-hand side expression
1306  , bool SO2 > // Storage order of the right-hand side expression
1307 inline const typename MultExprTrait< DMatScalarMultExpr<MT1,ST1,SO1>, DMatScalarMultExpr<MT2,ST2,SO2> >::Type
1308  operator*( const DMatScalarMultExpr<MT1,ST1,SO1>& lhs, const DMatScalarMultExpr<MT2,ST2,SO2>& rhs )
1309 {
1311 
1312  return ( lhs.leftOperand() * rhs.leftOperand() ) * ( lhs.rightOperand() * rhs.rightOperand() );
1313 }
1315 //*************************************************************************************************
1316 
1317 
1318 //*************************************************************************************************
1332 template< typename MT1 // Type of the dense matrix of the left-hand side expression
1333  , typename ST // Type of the scalar of the left-hand side expression
1334  , bool SO1 // Storage order of the left-hand side expression
1335  , typename MT2 // Type of the right-hand side sparse matrix
1336  , bool SO2 > // Storage order of the right-hand side sparse matrix
1337 inline const typename MultExprTrait< DMatScalarMultExpr<MT1,ST,SO1>, MT2 >::Type
1338  operator*( const DMatScalarMultExpr<MT1,ST,SO1>& lhs, const SparseMatrix<MT2,SO2>& rhs )
1339 {
1341 
1342  return ( lhs.leftOperand() * (~rhs) ) * lhs.rightOperand();
1343 }
1345 //*************************************************************************************************
1346 
1347 
1348 //*************************************************************************************************
1362 template< typename MT1 // Type of the left-hand side sparse matrix
1363  , bool SO1 // Storage order of the left-hand side sparse matrix
1364  , typename MT2 // Type of the dense matrix of the right-hand side expression
1365  , typename ST // Type of the scalar of the right-hand side expression
1366  , bool SO2 > // Storage order of the right-hand side expression
1367 inline const typename MultExprTrait< MT1, DMatScalarMultExpr<MT2,ST,SO2> >::Type
1368  operator*( const SparseMatrix<MT1,SO1>& lhs, const DMatScalarMultExpr<MT2,ST,SO2>& rhs )
1369 {
1371 
1372  return ( (~lhs) * rhs.leftOperand() ) * rhs.rightOperand();
1373 }
1375 //*************************************************************************************************
1376 
1377 
1378 //*************************************************************************************************
1393 template< typename MT1 // Type of the dense matrix of the left-hand side expression
1394  , typename ST1 // Type of the scalar of the left-hand side expression
1395  , bool SO1 // Storage order of the left-hand side expression
1396  , typename MT2 // Type of the sparse matrix of the right-hand side expression
1397  , typename ST2 // Type of the scalar of the right-hand side expression
1398  , bool SO2 > // Storage order of the right-hand side expression
1399 inline const typename MultExprTrait< DMatScalarMultExpr<MT1,ST1,SO1>, SMatScalarMultExpr<MT2,ST2,SO2> >::Type
1400  operator*( const DMatScalarMultExpr<MT1,ST1,SO1>& mat, const SMatScalarMultExpr<MT2,ST2,SO2>& vec )
1401 {
1403 
1404  return ( mat.leftOperand() * vec.leftOperand() ) * ( mat.rightOperand() * vec.rightOperand() );
1405 }
1407 //*************************************************************************************************
1408 
1409 
1410 //*************************************************************************************************
1425 template< typename MT1 // Type of the sparse matrix of the left-hand side expression
1426  , typename ST1 // Type of the scalar of the left-hand side expression
1427  , bool SO1 // Storage order of the left-hand side expression
1428  , typename MT2 // Type of the dense matrix of the right-hand side expression
1429  , typename ST2 // Type of the scalar of the right-hand side expression
1430  , bool SO2 > // Storage order of the right-hand side expression
1431 inline const typename MultExprTrait< SMatScalarMultExpr<MT1,ST1,SO1>, DMatScalarMultExpr<MT2,ST2,SO2> >::Type
1432  operator*( const SMatScalarMultExpr<MT1,ST1,SO1>& mat, const DMatScalarMultExpr<MT2,ST2,SO2>& vec )
1433 {
1435 
1436  return ( mat.leftOperand() * vec.leftOperand() ) * ( mat.rightOperand() * vec.rightOperand() );
1437 }
1439 //*************************************************************************************************
1440 
1441 
1442 
1443 
1444 //=================================================================================================
1445 //
1446 // DMATSCALARMULTEXPRTRAIT SPECIALIZATIONS
1447 //
1448 //=================================================================================================
1449 
1450 //*************************************************************************************************
1452 template< typename MT, typename ST1, typename ST2 >
1453 struct DMatScalarMultExprTrait< DMatScalarMultExpr<MT,ST1,false>, ST2 >
1454 {
1455  public:
1456  //**********************************************************************************************
1457  typedef typename SelectType< IsDenseMatrix<MT>::value && IsRowMajorMatrix<MT>::value &&
1458  IsNumeric<ST1>::value && IsNumeric<ST2>::value
1459  , typename DMatScalarMultExprTrait<MT,typename MultTrait<ST1,ST2>::Type>::Type
1460  , INVALID_TYPE >::Type Type;
1461  //**********************************************************************************************
1462 };
1464 //*************************************************************************************************
1465 
1466 
1467 
1468 
1469 //=================================================================================================
1470 //
1471 // TDMATSCALARMULTEXPRTRAIT SPECIALIZATIONS
1472 //
1473 //=================================================================================================
1474 
1475 //*************************************************************************************************
1477 template< typename MT, typename ST1, typename ST2 >
1478 struct TDMatScalarMultExprTrait< DMatScalarMultExpr<MT,ST1,true>, ST2 >
1479 {
1480  public:
1481  //**********************************************************************************************
1482  typedef typename SelectType< IsDenseMatrix<MT>::value && IsColumnMajorMatrix<MT>::value &&
1483  IsNumeric<ST1>::value && IsNumeric<ST2>::value
1484  , typename TDMatScalarMultExprTrait<MT,typename MultTrait<ST1,ST2>::Type>::Type
1485  , INVALID_TYPE >::Type Type;
1486  //**********************************************************************************************
1487 };
1489 //*************************************************************************************************
1490 
1491 
1492 
1493 
1494 //=================================================================================================
1495 //
1496 // DMATSCALARDIVEXPRTRAIT SPECIALIZATIONS
1497 //
1498 //=================================================================================================
1499 
1500 //*************************************************************************************************
1502 template< typename MT, typename ST1, typename ST2 >
1503 struct DMatScalarDivExprTrait< DMatScalarMultExpr<MT,ST1,false>, ST2 >
1504 {
1505  private:
1506  //**********************************************************************************************
1507  enum { condition = IsFloatingPoint<typename DivTrait<ST1,ST2>::Type>::value };
1508  //**********************************************************************************************
1509 
1510  //**********************************************************************************************
1511  typedef typename DMatScalarMultExprTrait<MT,typename DivTrait<ST1,ST2>::Type>::Type T1;
1512  typedef typename DMatScalarDivExprTrait<MT,typename DivTrait<ST1,ST2>::Type>::Type T2;
1513  //**********************************************************************************************
1514 
1515  public:
1516  //**********************************************************************************************
1517  typedef typename SelectType< IsDenseMatrix<MT>::value && IsRowMajorMatrix<MT>::value &&
1518  IsNumeric<ST1>::value && IsNumeric<ST2>::value
1519  , typename SelectType<condition,T1,T2>::Type
1520  , INVALID_TYPE >::Type Type;
1521  //**********************************************************************************************
1522 };
1524 //*************************************************************************************************
1525 
1526 
1527 
1528 
1529 //=================================================================================================
1530 //
1531 // TDMATSCALARDIVEXPRTRAIT SPECIALIZATIONS
1532 //
1533 //=================================================================================================
1534 
1535 //*************************************************************************************************
1537 template< typename MT, typename ST1, typename ST2 >
1538 struct TDMatScalarDivExprTrait< DMatScalarMultExpr<MT,ST1,true>, ST2 >
1539 {
1540  private:
1541  //**********************************************************************************************
1542  enum { condition = IsFloatingPoint<typename DivTrait<ST1,ST2>::Type>::value };
1543  //**********************************************************************************************
1544 
1545  //**********************************************************************************************
1546  typedef typename TDMatScalarMultExprTrait<MT,typename DivTrait<ST1,ST2>::Type>::Type T1;
1547  typedef typename TDMatScalarDivExprTrait<MT,typename DivTrait<ST1,ST2>::Type>::Type T2;
1548  //**********************************************************************************************
1549 
1550  public:
1551  //**********************************************************************************************
1552  typedef typename SelectType< IsDenseMatrix<MT>::value && IsColumnMajorMatrix<MT>::value &&
1553  IsNumeric<ST1>::value && IsNumeric<ST2>::value
1554  , typename SelectType<condition,T1,T2>::Type
1555  , INVALID_TYPE >::Type Type;
1556  //**********************************************************************************************
1557 };
1559 //*************************************************************************************************
1560 
1561 
1562 
1563 
1564 //=================================================================================================
1565 //
1566 // DMATDVECMULTEXPRTRAIT SPECIALIZATIONS
1567 //
1568 //=================================================================================================
1569 
1570 //*************************************************************************************************
1572 template< typename MT, typename ST, typename VT >
1573 struct DMatDVecMultExprTrait< DMatScalarMultExpr<MT,ST,false>, VT >
1574 {
1575  public:
1576  //**********************************************************************************************
1577  typedef typename SelectType< IsDenseMatrix<MT>::value && IsRowMajorMatrix<MT>::value &&
1578  IsDenseVector<VT>::value && IsColumnVector<VT>::value &&
1579  IsNumeric<ST>::value
1580  , typename DVecScalarMultExprTrait<typename DMatDVecMultExprTrait<MT,VT>::Type,ST>::Type
1581  , INVALID_TYPE >::Type Type;
1582  //**********************************************************************************************
1583 };
1585 //*************************************************************************************************
1586 
1587 
1588 //*************************************************************************************************
1590 template< typename MT, typename ST1, typename VT, typename ST2 >
1591 struct DMatDVecMultExprTrait< DMatScalarMultExpr<MT,ST1,false>, DVecScalarMultExpr<VT,ST2,false> >
1592 {
1593  public:
1594  //**********************************************************************************************
1595  typedef typename SelectType< IsDenseMatrix<MT>::value && IsRowMajorMatrix<MT>::value &&
1596  IsDenseVector<VT>::value && IsColumnVector<VT>::value &&
1597  IsNumeric<ST1>::value && IsNumeric<ST2>::value
1598  , typename DVecScalarMultExprTrait<typename DMatDVecMultExprTrait<MT,VT>::Type,typename MultTrait<ST1,ST2>::Type>::Type
1599  , INVALID_TYPE >::Type Type;
1600  //**********************************************************************************************
1601 };
1603 //*************************************************************************************************
1604 
1605 
1606 
1607 
1608 //=================================================================================================
1609 //
1610 // TDMATDVECMULTEXPRTRAIT SPECIALIZATIONS
1611 //
1612 //=================================================================================================
1613 
1614 //*************************************************************************************************
1616 template< typename MT, typename ST, typename VT >
1617 struct TDMatDVecMultExprTrait< DMatScalarMultExpr<MT,ST,true>, VT >
1618 {
1619  public:
1620  //**********************************************************************************************
1621  typedef typename SelectType< IsDenseMatrix<MT>::value && IsColumnMajorMatrix<MT>::value &&
1622  IsDenseVector<VT>::value && IsColumnVector<VT>::value &&
1623  IsNumeric<ST>::value
1624  , typename DVecScalarMultExprTrait<typename TDMatDVecMultExprTrait<MT,VT>::Type,ST>::Type
1625  , INVALID_TYPE >::Type Type;
1626  //**********************************************************************************************
1627 };
1629 //*************************************************************************************************
1630 
1631 
1632 //*************************************************************************************************
1634 template< typename MT, typename ST1, typename VT, typename ST2 >
1635 struct TDMatDVecMultExprTrait< DMatScalarMultExpr<MT,ST1,true>, DVecScalarMultExpr<VT,ST2,false> >
1636 {
1637  public:
1638  //**********************************************************************************************
1639  typedef typename SelectType< IsDenseMatrix<MT>::value && IsColumnMajorMatrix<MT>::value &&
1640  IsDenseVector<VT>::value && IsColumnVector<VT>::value &&
1641  IsNumeric<ST1>::value && IsNumeric<ST2>::value
1642  , typename DVecScalarMultExprTrait<typename TDMatDVecMultExprTrait<MT,VT>::Type,typename MultTrait<ST1,ST2>::Type>::Type
1643  , INVALID_TYPE >::Type Type;
1644  //**********************************************************************************************
1645 };
1647 //*************************************************************************************************
1648 
1649 
1650 
1651 
1652 //=================================================================================================
1653 //
1654 // TDVECDMATMULTEXPRTRAIT SPECIALIZATIONS
1655 //
1656 //=================================================================================================
1657 
1658 //*************************************************************************************************
1660 template< typename VT, typename MT, typename ST >
1661 struct TDVecDMatMultExprTrait< VT, DMatScalarMultExpr<MT,ST,false> >
1662 {
1663  public:
1664  //**********************************************************************************************
1665  typedef typename SelectType< IsDenseVector<VT>::value && IsRowVector<VT>::value &&
1666  IsDenseMatrix<MT>::value && IsRowMajorMatrix<MT>::value &&
1667  IsNumeric<ST>::value
1668  , typename TDVecScalarMultExprTrait<typename TDVecDMatMultExprTrait<VT,MT>::Type,ST>::Type
1669  , INVALID_TYPE >::Type Type;
1670  //**********************************************************************************************
1671 };
1673 //*************************************************************************************************
1674 
1675 
1676 //*************************************************************************************************
1678 template< typename VT, typename ST1, typename MT, typename ST2 >
1679 struct TDVecDMatMultExprTrait< DVecScalarMultExpr<VT,ST1,true>, DMatScalarMultExpr<MT,ST2,false> >
1680 {
1681  public:
1682  //**********************************************************************************************
1683  typedef typename SelectType< IsDenseVector<VT>::value && IsRowVector<VT>::value &&
1684  IsDenseMatrix<MT>::value && IsRowMajorMatrix<MT>::value &&
1685  IsNumeric<ST1>::value && IsNumeric<ST2>::value
1686  , typename TDVecScalarMultExprTrait<typename TDVecDMatMultExprTrait<VT,MT>::Type,typename MultTrait<ST1,ST2>::Type>::Type
1687  , INVALID_TYPE >::Type Type;
1688  //**********************************************************************************************
1689 };
1691 //*************************************************************************************************
1692 
1693 
1694 
1695 
1696 //=================================================================================================
1697 //
1698 // TDVECTDMATMULTEXPRTRAIT SPECIALIZATIONS
1699 //
1700 //=================================================================================================
1701 
1702 //*************************************************************************************************
1704 template< typename VT, typename MT, typename ST >
1705 struct TDVecTDMatMultExprTrait< VT, DMatScalarMultExpr<MT,ST,true> >
1706 {
1707  public:
1708  //**********************************************************************************************
1709  typedef typename SelectType< IsDenseVector<VT>::value && IsRowVector<VT>::value &&
1710  IsDenseMatrix<MT>::value && IsColumnMajorMatrix<MT>::value &&
1711  IsNumeric<ST>::value
1712  , typename TDVecScalarMultExprTrait<typename TDVecTDMatMultExprTrait<VT,MT>::Type,ST>::Type
1713  , INVALID_TYPE >::Type Type;
1714  //**********************************************************************************************
1715 };
1717 //*************************************************************************************************
1718 
1719 
1720 //*************************************************************************************************
1722 template< typename VT, typename ST1, typename MT, typename ST2 >
1723 struct TDVecTDMatMultExprTrait< DVecScalarMultExpr<VT,ST1,true>, DMatScalarMultExpr<MT,ST2,true> >
1724 {
1725  public:
1726  //**********************************************************************************************
1727  typedef typename SelectType< IsDenseVector<VT>::value && IsRowVector<VT>::value &&
1728  IsDenseMatrix<MT>::value && IsColumnMajorMatrix<MT>::value &&
1729  IsNumeric<ST1>::value && IsNumeric<ST2>::value
1730  , typename TDVecScalarMultExprTrait<typename TDVecTDMatMultExprTrait<VT,MT>::Type,typename MultTrait<ST1,ST2>::Type>::Type
1731  , INVALID_TYPE >::Type Type;
1732  //**********************************************************************************************
1733 };
1735 //*************************************************************************************************
1736 
1737 
1738 
1739 
1740 //=================================================================================================
1741 //
1742 // DMATSVECMULTEXPRTRAIT SPECIALIZATIONS
1743 //
1744 //=================================================================================================
1745 
1746 //*************************************************************************************************
1748 template< typename MT, typename ST, typename VT >
1749 struct DMatSVecMultExprTrait< DMatScalarMultExpr<MT,ST,false>, VT >
1750 {
1751  public:
1752  //**********************************************************************************************
1753  typedef typename SelectType< IsDenseMatrix<MT>::value && IsRowMajorMatrix<MT>::value &&
1754  IsSparseVector<VT>::value && IsColumnVector<VT>::value &&
1755  IsNumeric<ST>::value
1756  , typename DVecScalarMultExprTrait<typename DMatSVecMultExprTrait<MT,VT>::Type,ST>::Type
1757  , INVALID_TYPE >::Type Type;
1758  //**********************************************************************************************
1759 };
1761 //*************************************************************************************************
1762 
1763 
1764 //*************************************************************************************************
1766 template< typename MT, typename ST1, typename VT, typename ST2 >
1767 struct DMatSVecMultExprTrait< DMatScalarMultExpr<MT,ST1,false>, SVecScalarMultExpr<VT,ST2,false> >
1768 {
1769  public:
1770  //**********************************************************************************************
1771  typedef typename SelectType< IsDenseMatrix<MT>::value && IsRowMajorMatrix<MT>::value &&
1772  IsSparseVector<VT>::value && IsColumnVector<VT>::value &&
1773  IsNumeric<ST1>::value && IsNumeric<ST2>::value
1774  , typename DVecScalarMultExprTrait<typename DMatSVecMultExprTrait<MT,VT>::Type,typename MultTrait<ST1,ST2>::Type>::Type
1775  , INVALID_TYPE >::Type Type;
1776  //**********************************************************************************************
1777 };
1779 //*************************************************************************************************
1780 
1781 
1782 
1783 
1784 //=================================================================================================
1785 //
1786 // TDMATSVECMULTEXPRTRAIT SPECIALIZATIONS
1787 //
1788 //=================================================================================================
1789 
1790 //*************************************************************************************************
1792 template< typename MT, typename ST, typename VT >
1793 struct TDMatSVecMultExprTrait< DMatScalarMultExpr<MT,ST,true>, VT >
1794 {
1795  public:
1796  //**********************************************************************************************
1797  typedef typename SelectType< IsDenseMatrix<MT>::value && IsColumnMajorMatrix<MT>::value &&
1798  IsSparseVector<VT>::value && IsColumnVector<VT>::value &&
1799  IsNumeric<ST>::value
1800  , typename DVecScalarMultExprTrait<typename TDMatSVecMultExprTrait<MT,VT>::Type,ST>::Type
1801  , INVALID_TYPE >::Type Type;
1802  //**********************************************************************************************
1803 };
1805 //*************************************************************************************************
1806 
1807 
1808 //*************************************************************************************************
1810 template< typename MT, typename ST1, typename VT, typename ST2 >
1811 struct TDMatSVecMultExprTrait< DMatScalarMultExpr<MT,ST1,true>, SVecScalarMultExpr<VT,ST2,false> >
1812 {
1813  public:
1814  //**********************************************************************************************
1815  typedef typename SelectType< IsDenseMatrix<MT>::value && IsColumnMajorMatrix<MT>::value &&
1816  IsSparseVector<VT>::value && IsColumnVector<VT>::value &&
1817  IsNumeric<ST1>::value && IsNumeric<ST2>::value
1818  , typename DVecScalarMultExprTrait<typename TDMatSVecMultExprTrait<MT,VT>::Type,typename MultTrait<ST1,ST2>::Type>::Type
1819  , INVALID_TYPE >::Type Type;
1820  //**********************************************************************************************
1821 };
1823 //*************************************************************************************************
1824 
1825 
1826 
1827 
1828 //=================================================================================================
1829 //
1830 // TSVECDMATMULTEXPRTRAIT SPECIALIZATIONS
1831 //
1832 //=================================================================================================
1833 
1834 //*************************************************************************************************
1836 template< typename VT, typename MT, typename ST >
1837 struct TSVecDMatMultExprTrait< VT, DMatScalarMultExpr<MT,ST,false> >
1838 {
1839  public:
1840  //**********************************************************************************************
1841  typedef typename SelectType< IsSparseVector<VT>::value && IsRowVector<VT>::value &&
1842  IsDenseMatrix<MT>::value && IsRowMajorMatrix<MT>::value &&
1843  IsNumeric<ST>::value
1844  , typename TDVecScalarMultExprTrait<typename TSVecDMatMultExprTrait<VT,MT>::Type,ST>::Type
1845  , INVALID_TYPE >::Type Type;
1846  //**********************************************************************************************
1847 };
1849 //*************************************************************************************************
1850 
1851 
1852 //*************************************************************************************************
1854 template< typename VT, typename ST1, typename MT, typename ST2 >
1855 struct TSVecDMatMultExprTrait< SVecScalarMultExpr<VT,ST1,true>, DMatScalarMultExpr<MT,ST2,false> >
1856 {
1857  public:
1858  //**********************************************************************************************
1859  typedef typename SelectType< IsSparseVector<VT>::value && IsRowVector<VT>::value &&
1860  IsDenseMatrix<MT>::value && IsRowMajorMatrix<MT>::value &&
1861  IsNumeric<ST1>::value && IsNumeric<ST2>::value
1862  , typename TDVecScalarMultExprTrait<typename TSVecDMatMultExprTrait<VT,MT>::Type,typename MultTrait<ST1,ST2>::Type>::Type
1863  , INVALID_TYPE >::Type Type;
1864  //**********************************************************************************************
1865 };
1867 //*************************************************************************************************
1868 
1869 
1870 
1871 
1872 //=================================================================================================
1873 //
1874 // TSVECTDMATMULTEXPRTRAIT SPECIALIZATIONS
1875 //
1876 //=================================================================================================
1877 
1878 //*************************************************************************************************
1880 template< typename VT, typename MT, typename ST >
1881 struct TSVecTDMatMultExprTrait< VT, DMatScalarMultExpr<MT,ST,true> >
1882 {
1883  public:
1884  //**********************************************************************************************
1885  typedef typename SelectType< IsSparseVector<VT>::value && IsRowVector<VT>::value &&
1886  IsDenseMatrix<MT>::value && IsColumnMajorMatrix<MT>::value &&
1887  IsNumeric<ST>::value
1888  , typename TDVecScalarMultExprTrait<typename TSVecTDMatMultExprTrait<VT,MT>::Type,ST>::Type
1889  , INVALID_TYPE >::Type Type;
1890  //**********************************************************************************************
1891 };
1893 //*************************************************************************************************
1894 
1895 
1896 //*************************************************************************************************
1898 template< typename VT, typename ST1, typename MT, typename ST2 >
1899 struct TSVecTDMatMultExprTrait< SVecScalarMultExpr<VT,ST1,true>, DMatScalarMultExpr<MT,ST2,true> >
1900 {
1901  public:
1902  //**********************************************************************************************
1903  typedef typename SelectType< IsSparseVector<VT>::value && IsRowVector<VT>::value &&
1904  IsDenseMatrix<MT>::value && IsColumnMajorMatrix<MT>::value &&
1905  IsNumeric<ST1>::value && IsNumeric<ST2>::value
1906  , typename TDVecScalarMultExprTrait<typename TSVecTDMatMultExprTrait<VT,MT>::Type,typename MultTrait<ST1,ST2>::Type>::Type
1907  , INVALID_TYPE >::Type Type;
1908  //**********************************************************************************************
1909 };
1911 //*************************************************************************************************
1912 
1913 
1914 
1915 
1916 //=================================================================================================
1917 //
1918 // DMATDMATMULTEXPRTRAIT SPECIALIZATIONS
1919 //
1920 //=================================================================================================
1921 
1922 //*************************************************************************************************
1924 template< typename MT1, typename ST, typename MT2 >
1925 struct DMatDMatMultExprTrait< DMatScalarMultExpr<MT1,ST,false>, MT2 >
1926 {
1927  public:
1928  //**********************************************************************************************
1929  typedef typename SelectType< IsDenseMatrix<MT1>::value && IsRowMajorMatrix<MT1>::value &&
1930  IsDenseMatrix<MT2>::value && IsRowMajorMatrix<MT2>::value &&
1931  IsNumeric<ST>::value
1932  , typename DMatScalarMultExprTrait<typename DMatDMatMultExprTrait<MT1,MT2>::Type,ST>::Type
1933  , INVALID_TYPE >::Type Type;
1934  //**********************************************************************************************
1935 };
1937 //*************************************************************************************************
1938 
1939 
1940 //*************************************************************************************************
1942 template< typename MT1, typename MT2, typename ST >
1943 struct DMatDMatMultExprTrait< MT1, DMatScalarMultExpr<MT2,ST,false> >
1944 {
1945  public:
1946  //**********************************************************************************************
1947  typedef typename SelectType< IsDenseMatrix<MT1>::value && IsRowMajorMatrix<MT1>::value &&
1948  IsDenseMatrix<MT2>::value && IsRowMajorMatrix<MT2>::value &&
1949  IsNumeric<ST>::value
1950  , typename DMatScalarMultExprTrait<typename DMatDMatMultExprTrait<MT1,MT2>::Type,ST>::Type
1951  , INVALID_TYPE >::Type Type;
1952  //**********************************************************************************************
1953 };
1955 //*************************************************************************************************
1956 
1957 
1958 //*************************************************************************************************
1960 template< typename MT1, typename ST1, typename MT2, typename ST2 >
1961 struct DMatDMatMultExprTrait< DMatScalarMultExpr<MT1,ST1,false>, DMatScalarMultExpr<MT2,ST2,false> >
1962 {
1963  public:
1964  //**********************************************************************************************
1965  typedef typename SelectType< IsDenseMatrix<MT1>::value && IsRowMajorMatrix<MT1>::value &&
1966  IsDenseMatrix<MT2>::value && IsRowMajorMatrix<MT2>::value &&
1967  IsNumeric<ST1>::value && IsNumeric<ST2>::value
1968  , typename DMatScalarMultExprTrait<typename DMatDMatMultExprTrait<MT1,MT2>::Type,typename MultTrait<ST1,ST2>::Type>::Type
1969  , INVALID_TYPE >::Type Type;
1970  //**********************************************************************************************
1971 };
1973 //*************************************************************************************************
1974 
1975 
1976 
1977 
1978 //=================================================================================================
1979 //
1980 // DMATTDMATMULTEXPRTRAIT SPECIALIZATIONS
1981 //
1982 //=================================================================================================
1983 
1984 //*************************************************************************************************
1986 template< typename MT1, typename ST, typename MT2 >
1987 struct DMatTDMatMultExprTrait< DMatScalarMultExpr<MT1,ST,false>, MT2 >
1988 {
1989  public:
1990  //**********************************************************************************************
1991  typedef typename SelectType< IsDenseMatrix<MT1>::value && IsRowMajorMatrix<MT1>::value &&
1992  IsDenseMatrix<MT2>::value && IsColumnMajorMatrix<MT2>::value &&
1993  IsNumeric<ST>::value
1994  , typename DMatScalarMultExprTrait<typename DMatTDMatMultExprTrait<MT1,MT2>::Type,ST>::Type
1995  , INVALID_TYPE >::Type Type;
1996  //**********************************************************************************************
1997 };
1999 //*************************************************************************************************
2000 
2001 
2002 //*************************************************************************************************
2004 template< typename MT1, typename MT2, typename ST >
2005 struct DMatTDMatMultExprTrait< MT1, DMatScalarMultExpr<MT2,ST,true> >
2006 {
2007  public:
2008  //**********************************************************************************************
2009  typedef typename SelectType< IsDenseMatrix<MT1>::value && IsRowMajorMatrix<MT1>::value &&
2010  IsDenseMatrix<MT2>::value && IsColumnMajorMatrix<MT2>::value &&
2011  IsNumeric<ST>::value
2012  , typename DMatScalarMultExprTrait<typename DMatTDMatMultExprTrait<MT1,MT2>::Type,ST>::Type
2013  , INVALID_TYPE >::Type Type;
2014  //**********************************************************************************************
2015 };
2017 //*************************************************************************************************
2018 
2019 
2020 //*************************************************************************************************
2022 template< typename MT1, typename ST1, typename MT2, typename ST2 >
2023 struct DMatTDMatMultExprTrait< DMatScalarMultExpr<MT1,ST1,false>, DMatScalarMultExpr<MT2,ST2,true> >
2024 {
2025  public:
2026  //**********************************************************************************************
2027  typedef typename SelectType< IsDenseMatrix<MT1>::value && IsRowMajorMatrix<MT1>::value &&
2028  IsDenseMatrix<MT2>::value && IsColumnMajorMatrix<MT2>::value &&
2029  IsNumeric<ST1>::value && IsNumeric<ST2>::value
2030  , typename DMatScalarMultExprTrait<typename DMatTDMatMultExprTrait<MT1,MT2>::Type,typename MultTrait<ST1,ST2>::Type>::Type
2031  , INVALID_TYPE >::Type Type;
2032  //**********************************************************************************************
2033 };
2035 //*************************************************************************************************
2036 
2037 
2038 
2039 
2040 //=================================================================================================
2041 //
2042 // TDMATDMATMULTEXPRTRAIT SPECIALIZATIONS
2043 //
2044 //=================================================================================================
2045 
2046 //*************************************************************************************************
2048 template< typename MT1, typename ST, typename MT2 >
2049 struct TDMatDMatMultExprTrait< DMatScalarMultExpr<MT1,ST,true>, MT2 >
2050 {
2051  public:
2052  //**********************************************************************************************
2053  typedef typename SelectType< IsDenseMatrix<MT1>::value && IsColumnMajorMatrix<MT1>::value &&
2054  IsDenseMatrix<MT2>::value && IsRowMajorMatrix<MT2>::value &&
2055  IsNumeric<ST>::value
2056  , typename TDMatScalarMultExprTrait<typename TDMatDMatMultExprTrait<MT1,MT2>::Type,ST>::Type
2057  , INVALID_TYPE >::Type Type;
2058  //**********************************************************************************************
2059 };
2061 //*************************************************************************************************
2062 
2063 
2064 //*************************************************************************************************
2066 template< typename MT1, typename MT2, typename ST >
2067 struct TDMatDMatMultExprTrait< MT1, DMatScalarMultExpr<MT2,ST,false> >
2068 {
2069  public:
2070  //**********************************************************************************************
2071  typedef typename SelectType< IsDenseMatrix<MT1>::value && IsColumnMajorMatrix<MT1>::value &&
2072  IsDenseMatrix<MT2>::value && IsRowMajorMatrix<MT2>::value &&
2073  IsNumeric<ST>::value
2074  , typename TDMatScalarMultExprTrait<typename TDMatDMatMultExprTrait<MT1,MT2>::Type,ST>::Type
2075  , INVALID_TYPE >::Type Type;
2076  //**********************************************************************************************
2077 };
2079 //*************************************************************************************************
2080 
2081 
2082 //*************************************************************************************************
2084 template< typename MT1, typename ST1, typename MT2, typename ST2 >
2085 struct TDMatDMatMultExprTrait< DMatScalarMultExpr<MT1,ST1,true>, DMatScalarMultExpr<MT2,ST2,false> >
2086 {
2087  public:
2088  //**********************************************************************************************
2089  typedef typename SelectType< IsDenseMatrix<MT1>::value && IsColumnMajorMatrix<MT1>::value &&
2090  IsDenseMatrix<MT2>::value && IsRowMajorMatrix<MT2>::value &&
2091  IsNumeric<ST1>::value && IsNumeric<ST2>::value
2092  , typename TDMatScalarMultExprTrait<typename TDMatDMatMultExprTrait<MT1,MT2>::Type,typename MultTrait<ST1,ST2>::Type>::Type
2093  , INVALID_TYPE >::Type Type;
2094  //**********************************************************************************************
2095 };
2097 //*************************************************************************************************
2098 
2099 
2100 
2101 
2102 //=================================================================================================
2103 //
2104 // TDMATTDMATMULTEXPRTRAIT SPECIALIZATIONS
2105 //
2106 //=================================================================================================
2107 
2108 //*************************************************************************************************
2110 template< typename MT1, typename ST, typename MT2 >
2111 struct TDMatTDMatMultExprTrait< DMatScalarMultExpr<MT1,ST,true>, MT2 >
2112 {
2113  public:
2114  //**********************************************************************************************
2115  typedef typename SelectType< IsDenseMatrix<MT1>::value && IsColumnMajorMatrix<MT1>::value &&
2116  IsDenseMatrix<MT2>::value && IsColumnMajorMatrix<MT2>::value &&
2117  IsNumeric<ST>::value
2118  , typename TDMatScalarMultExprTrait<typename TDMatTDMatMultExprTrait<MT1,MT2>::Type,ST>::Type
2119  , INVALID_TYPE >::Type Type;
2120  //**********************************************************************************************
2121 };
2123 //*************************************************************************************************
2124 
2125 
2126 //*************************************************************************************************
2128 template< typename MT1, typename MT2, typename ST >
2129 struct TDMatTDMatMultExprTrait< MT1, DMatScalarMultExpr<MT2,ST,true> >
2130 {
2131  public:
2132  //**********************************************************************************************
2133  typedef typename SelectType< IsDenseMatrix<MT1>::value && IsColumnMajorMatrix<MT1>::value &&
2134  IsDenseMatrix<MT2>::value && IsColumnMajorMatrix<MT2>::value &&
2135  IsNumeric<ST>::value
2136  , typename TDMatScalarMultExprTrait<typename TDMatTDMatMultExprTrait<MT1,MT2>::Type,ST>::Type
2137  , INVALID_TYPE >::Type Type;
2138  //**********************************************************************************************
2139 };
2141 //*************************************************************************************************
2142 
2143 
2144 //*************************************************************************************************
2146 template< typename MT1, typename ST1, typename MT2, typename ST2 >
2147 struct TDMatTDMatMultExprTrait< DMatScalarMultExpr<MT1,ST1,true>, DMatScalarMultExpr<MT2,ST2,true> >
2148 {
2149  public:
2150  //**********************************************************************************************
2151  typedef typename SelectType< IsDenseMatrix<MT1>::value && IsColumnMajorMatrix<MT1>::value &&
2152  IsDenseMatrix<MT2>::value && IsColumnMajorMatrix<MT2>::value &&
2153  IsNumeric<ST1>::value && IsNumeric<ST2>::value
2154  , typename TDMatScalarMultExprTrait<typename TDMatTDMatMultExprTrait<MT1,MT2>::Type,typename MultTrait<ST1,ST2>::Type>::Type
2155  , INVALID_TYPE >::Type Type;
2156  //**********************************************************************************************
2157 };
2159 //*************************************************************************************************
2160 
2161 
2162 
2163 
2164 //=================================================================================================
2165 //
2166 // DMATSMATMULTEXPRTRAIT SPECIALIZATIONS
2167 //
2168 //=================================================================================================
2169 
2170 //*************************************************************************************************
2172 template< typename MT1, typename ST, typename MT2 >
2173 struct DMatSMatMultExprTrait< DMatScalarMultExpr<MT1,ST,false>, MT2 >
2174 {
2175  public:
2176  //**********************************************************************************************
2177  typedef typename SelectType< IsDenseMatrix<MT1>::value && IsRowMajorMatrix<MT1>::value &&
2178  IsSparseMatrix<MT2>::value && IsRowMajorMatrix<MT2>::value &&
2179  IsNumeric<ST>::value
2180  , typename DMatScalarMultExprTrait<typename DMatSMatMultExprTrait<MT1,MT2>::Type,ST>::Type
2181  , INVALID_TYPE >::Type Type;
2182  //**********************************************************************************************
2183 };
2185 //*************************************************************************************************
2186 
2187 
2188 //*************************************************************************************************
2190 template< typename MT1, typename ST1, typename MT2, typename ST2 >
2191 struct DMatSMatMultExprTrait< DMatScalarMultExpr<MT1,ST1,false>, SMatScalarMultExpr<MT2,ST2,false> >
2192 {
2193  public:
2194  //**********************************************************************************************
2195  typedef typename SelectType< IsDenseMatrix<MT1>::value && IsRowMajorMatrix<MT1>::value &&
2196  IsSparseMatrix<MT2>::value && IsRowMajorMatrix<MT2>::value &&
2197  IsNumeric<ST1>::value && IsNumeric<ST2>::value
2198  , typename DMatScalarMultExprTrait<typename DMatSMatMultExprTrait<MT1,MT2>::Type,typename MultTrait<ST1,ST2>::Type>::Type
2199  , INVALID_TYPE >::Type Type;
2200  //**********************************************************************************************
2201 };
2203 //*************************************************************************************************
2204 
2205 
2206 
2207 
2208 //=================================================================================================
2209 //
2210 // DMATTSMATMULTEXPRTRAIT SPECIALIZATIONS
2211 //
2212 //=================================================================================================
2213 
2214 //*************************************************************************************************
2216 template< typename MT1, typename ST, typename MT2 >
2217 struct DMatTSMatMultExprTrait< DMatScalarMultExpr<MT1,ST,false>, MT2 >
2218 {
2219  public:
2220  //**********************************************************************************************
2221  typedef typename SelectType< IsDenseMatrix<MT1>::value && IsRowMajorMatrix<MT1>::value &&
2222  IsSparseMatrix<MT2>::value && IsColumnMajorMatrix<MT2>::value &&
2223  IsNumeric<ST>::value
2224  , typename DMatScalarMultExprTrait<typename DMatTSMatMultExprTrait<MT1,MT2>::Type,ST>::Type
2225  , INVALID_TYPE >::Type Type;
2226  //**********************************************************************************************
2227 };
2229 //*************************************************************************************************
2230 
2231 
2232 //*************************************************************************************************
2234 template< typename MT1, typename ST1, typename MT2, typename ST2 >
2235 struct DMatTSMatMultExprTrait< DMatScalarMultExpr<MT1,ST1,false>, SMatScalarMultExpr<MT2,ST2,true> >
2236 {
2237  public:
2238  //**********************************************************************************************
2239  typedef typename SelectType< IsDenseMatrix<MT1>::value && IsRowMajorMatrix<MT1>::value &&
2240  IsSparseMatrix<MT2>::value && IsColumnMajorMatrix<MT2>::value &&
2241  IsNumeric<ST1>::value && IsNumeric<ST2>::value
2242  , typename DMatScalarMultExprTrait<typename DMatTSMatMultExprTrait<MT1,MT2>::Type,typename MultTrait<ST1,ST2>::Type>::Type
2243  , INVALID_TYPE >::Type Type;
2244  //**********************************************************************************************
2245 };
2247 //*************************************************************************************************
2248 
2249 
2250 
2251 
2252 //=================================================================================================
2253 //
2254 // TDMATSMATMULTEXPRTRAIT SPECIALIZATIONS
2255 //
2256 //=================================================================================================
2257 
2258 //*************************************************************************************************
2260 template< typename MT1, typename ST, typename MT2 >
2261 struct TDMatSMatMultExprTrait< DMatScalarMultExpr<MT1,ST,true>, MT2 >
2262 {
2263  public:
2264  //**********************************************************************************************
2265  typedef typename SelectType< IsDenseMatrix<MT1>::value && IsColumnMajorMatrix<MT1>::value &&
2266  IsSparseMatrix<MT2>::value && IsRowMajorMatrix<MT2>::value &&
2267  IsNumeric<ST>::value
2268  , typename TDMatScalarMultExprTrait<typename TDMatSMatMultExprTrait<MT1,MT2>::Type,ST>::Type
2269  , INVALID_TYPE >::Type Type;
2270  //**********************************************************************************************
2271 };
2273 //*************************************************************************************************
2274 
2275 
2276 //*************************************************************************************************
2278 template< typename MT1, typename ST1, typename MT2, typename ST2 >
2279 struct TDMatSMatMultExprTrait< DMatScalarMultExpr<MT1,ST1,true>, SMatScalarMultExpr<MT2,ST2,false> >
2280 {
2281  public:
2282  //**********************************************************************************************
2283  typedef typename SelectType< IsDenseMatrix<MT1>::value && IsColumnMajorMatrix<MT1>::value &&
2284  IsSparseMatrix<MT2>::value && IsRowMajorMatrix<MT2>::value &&
2285  IsNumeric<ST1>::value && IsNumeric<ST2>::value
2286  , typename TDMatScalarMultExprTrait<typename TDMatSMatMultExprTrait<MT1,MT2>::Type,typename MultTrait<ST1,ST2>::Type>::Type
2287  , INVALID_TYPE >::Type Type;
2288  //**********************************************************************************************
2289 };
2291 //*************************************************************************************************
2292 
2293 
2294 
2295 
2296 //=================================================================================================
2297 //
2298 // TDMATTSMATMULTEXPRTRAIT SPECIALIZATIONS
2299 //
2300 //=================================================================================================
2301 
2302 //*************************************************************************************************
2304 template< typename MT1, typename ST, typename MT2 >
2305 struct TDMatTSMatMultExprTrait< DMatScalarMultExpr<MT1,ST,true>, MT2 >
2306 {
2307  public:
2308  //**********************************************************************************************
2309  typedef typename SelectType< IsDenseMatrix<MT1>::value && IsColumnMajorMatrix<MT1>::value &&
2310  IsSparseMatrix<MT2>::value && IsColumnMajorMatrix<MT2>::value &&
2311  IsNumeric<ST>::value
2312  , typename TDMatScalarMultExprTrait<typename TDMatTSMatMultExprTrait<MT1,MT2>::Type,ST>::Type
2313  , INVALID_TYPE >::Type Type;
2314  //**********************************************************************************************
2315 };
2317 //*************************************************************************************************
2318 
2319 
2320 //*************************************************************************************************
2322 template< typename MT1, typename ST1, typename MT2, typename ST2 >
2323 struct TDMatTSMatMultExprTrait< DMatScalarMultExpr<MT1,ST1,true>, SMatScalarMultExpr<MT2,ST2,true> >
2324 {
2325  public:
2326  //**********************************************************************************************
2327  typedef typename SelectType< IsDenseMatrix<MT1>::value && IsColumnMajorMatrix<MT1>::value &&
2328  IsSparseMatrix<MT2>::value && IsColumnMajorMatrix<MT2>::value &&
2329  IsNumeric<ST1>::value && IsNumeric<ST2>::value
2330  , typename TDMatScalarMultExprTrait<typename TDMatTSMatMultExprTrait<MT1,MT2>::Type,typename MultTrait<ST1,ST2>::Type>::Type
2331  , INVALID_TYPE >::Type Type;
2332  //**********************************************************************************************
2333 };
2335 //*************************************************************************************************
2336 
2337 
2338 
2339 
2340 //=================================================================================================
2341 //
2342 // SMATDMATMULTEXPRTRAIT SPECIALIZATIONS
2343 //
2344 //=================================================================================================
2345 
2346 //*************************************************************************************************
2348 template< typename MT1, typename ST, typename MT2 >
2349 struct SMatDMatMultExprTrait< MT1, DMatScalarMultExpr<MT2,ST,false> >
2350 {
2351  public:
2352  //**********************************************************************************************
2353  typedef typename SelectType< IsSparseMatrix<MT1>::value && IsRowMajorMatrix<MT1>::value &&
2354  IsDenseMatrix<MT2>::value && IsRowMajorMatrix<MT2>::value &&
2355  IsNumeric<ST>::value
2356  , typename DMatScalarMultExprTrait<typename SMatDMatMultExprTrait<MT1,MT2>::Type,ST>::Type
2357  , INVALID_TYPE >::Type Type;
2358  //**********************************************************************************************
2359 };
2361 //*************************************************************************************************
2362 
2363 
2364 //*************************************************************************************************
2366 template< typename MT1, typename ST1, typename MT2, typename ST2 >
2367 struct SMatDMatMultExprTrait< SMatScalarMultExpr<MT1,ST1,false>, DMatScalarMultExpr<MT2,ST2,false> >
2368 {
2369  public:
2370  //**********************************************************************************************
2371  typedef typename SelectType< IsSparseMatrix<MT1>::value && IsRowMajorMatrix<MT1>::value &&
2372  IsDenseMatrix<MT2>::value && IsRowMajorMatrix<MT2>::value &&
2373  IsNumeric<ST1>::value && IsNumeric<ST2>::value
2374  , typename DMatScalarMultExprTrait<typename SMatDMatMultExprTrait<MT1,MT2>::Type,typename MultTrait<ST1,ST2>::Type>::Type
2375  , INVALID_TYPE >::Type Type;
2376  //**********************************************************************************************
2377 };
2379 //*************************************************************************************************
2380 
2381 
2382 
2383 
2384 //=================================================================================================
2385 //
2386 // SMATTDMATMULTEXPRTRAIT SPECIALIZATIONS
2387 //
2388 //=================================================================================================
2389 
2390 //*************************************************************************************************
2392 template< typename MT1, typename ST, typename MT2 >
2393 struct SMatTDMatMultExprTrait< MT1, DMatScalarMultExpr<MT2,ST,true> >
2394 {
2395  public:
2396  //**********************************************************************************************
2397  typedef typename SelectType< IsSparseMatrix<MT1>::value && IsRowMajorMatrix<MT1>::value &&
2398  IsDenseMatrix<MT2>::value && IsColumnMajorMatrix<MT2>::value &&
2399  IsNumeric<ST>::value
2400  , typename DMatScalarMultExprTrait<typename SMatTDMatMultExprTrait<MT1,MT2>::Type,ST>::Type
2401  , INVALID_TYPE >::Type Type;
2402  //**********************************************************************************************
2403 };
2405 //*************************************************************************************************
2406 
2407 
2408 //*************************************************************************************************
2410 template< typename MT1, typename ST1, typename MT2, typename ST2 >
2411 struct SMatTDMatMultExprTrait< SMatScalarMultExpr<MT1,ST1,false>, DMatScalarMultExpr<MT2,ST2,true> >
2412 {
2413  public:
2414  //**********************************************************************************************
2415  typedef typename SelectType< IsSparseMatrix<MT1>::value && IsRowMajorMatrix<MT1>::value &&
2416  IsDenseMatrix<MT2>::value && IsColumnMajorMatrix<MT2>::value &&
2417  IsNumeric<ST1>::value && IsNumeric<ST2>::value
2418  , typename DMatScalarMultExprTrait<typename SMatTDMatMultExprTrait<MT1,MT2>::Type,typename MultTrait<ST1,ST2>::Type>::Type
2419  , INVALID_TYPE >::Type Type;
2420  //**********************************************************************************************
2421 };
2423 //*************************************************************************************************
2424 
2425 
2426 
2427 
2428 //=================================================================================================
2429 //
2430 // TSMATDMATMULTEXPRTRAIT SPECIALIZATIONS
2431 //
2432 //=================================================================================================
2433 
2434 //*************************************************************************************************
2436 template< typename MT1, typename ST, typename MT2 >
2437 struct TSMatDMatMultExprTrait< MT1, DMatScalarMultExpr<MT2,ST,false> >
2438 {
2439  public:
2440  //**********************************************************************************************
2441  typedef typename SelectType< IsSparseMatrix<MT1>::value && IsColumnMajorMatrix<MT1>::value &&
2442  IsDenseMatrix<MT2>::value && IsRowMajorMatrix<MT2>::value &&
2443  IsNumeric<ST>::value
2444  , typename TDMatScalarMultExprTrait<typename TSMatDMatMultExprTrait<MT1,MT2>::Type,ST>::Type
2445  , INVALID_TYPE >::Type Type;
2446  //**********************************************************************************************
2447 };
2449 //*************************************************************************************************
2450 
2451 
2452 //*************************************************************************************************
2454 template< typename MT1, typename ST1, typename MT2, typename ST2 >
2455 struct TSMatDMatMultExprTrait< SMatScalarMultExpr<MT1,ST1,true>, DMatScalarMultExpr<MT2,ST2,false> >
2456 {
2457  public:
2458  //**********************************************************************************************
2459  typedef typename SelectType< IsSparseMatrix<MT1>::value && IsColumnMajorMatrix<MT1>::value &&
2460  IsDenseMatrix<MT2>::value && IsRowMajorMatrix<MT2>::value &&
2461  IsNumeric<ST1>::value && IsNumeric<ST2>::value
2462  , typename TDMatScalarMultExprTrait<typename TSMatDMatMultExprTrait<MT1,MT2>::Type,typename MultTrait<ST1,ST2>::Type>::Type
2463  , INVALID_TYPE >::Type Type;
2464  //**********************************************************************************************
2465 };
2467 //*************************************************************************************************
2468 
2469 
2470 
2471 
2472 //=================================================================================================
2473 //
2474 // TSMATTDMATMULTEXPRTRAIT SPECIALIZATIONS
2475 //
2476 //=================================================================================================
2477 
2478 //*************************************************************************************************
2480 template< typename MT1, typename ST, typename MT2 >
2481 struct TSMatTDMatMultExprTrait< MT1, DMatScalarMultExpr<MT2,ST,true> >
2482 {
2483  public:
2484  //**********************************************************************************************
2485  typedef typename SelectType< IsSparseMatrix<MT1>::value && IsColumnMajorMatrix<MT1>::value &&
2486  IsDenseMatrix<MT2>::value && IsColumnMajorMatrix<MT2>::value &&
2487  IsNumeric<ST>::value
2488  , typename TDMatScalarMultExprTrait<typename TSMatTDMatMultExprTrait<MT1,MT2>::Type,ST>::Type
2489  , INVALID_TYPE >::Type Type;
2490  //**********************************************************************************************
2491 };
2493 //*************************************************************************************************
2494 
2495 
2496 //*************************************************************************************************
2498 template< typename MT1, typename ST1, typename MT2, typename ST2 >
2499 struct TSMatTDMatMultExprTrait< SMatScalarMultExpr<MT1,ST1,true>, DMatScalarMultExpr<MT2,ST2,true> >
2500 {
2501  public:
2502  //**********************************************************************************************
2503  typedef typename SelectType< IsSparseMatrix<MT1>::value && IsColumnMajorMatrix<MT1>::value &&
2504  IsDenseMatrix<MT2>::value && IsColumnMajorMatrix<MT2>::value &&
2505  IsNumeric<ST1>::value && IsNumeric<ST2>::value
2506  , typename TDMatScalarMultExprTrait<typename TSMatTDMatMultExprTrait<MT1,MT2>::Type,typename MultTrait<ST1,ST2>::Type>::Type
2507  , INVALID_TYPE >::Type Type;
2508  //**********************************************************************************************
2509 };
2511 //*************************************************************************************************
2512 
2513 
2514 
2515 
2516 //=================================================================================================
2517 //
2518 // SUBMATRIXEXPRTRAIT SPECIALIZATIONS
2519 //
2520 //=================================================================================================
2521 
2522 //*************************************************************************************************
2524 template< typename MT, typename ST, bool SO, bool AF >
2525 struct SubmatrixExprTrait< DMatScalarMultExpr<MT,ST,SO>, AF >
2526 {
2527  public:
2528  //**********************************************************************************************
2529  typedef typename MultExprTrait< typename SubmatrixExprTrait<const MT,AF>::Type, ST >::Type Type;
2530  //**********************************************************************************************
2531 };
2533 //*************************************************************************************************
2534 
2535 
2536 
2537 
2538 //=================================================================================================
2539 //
2540 // ROWEXPRTRAIT SPECIALIZATIONS
2541 //
2542 //=================================================================================================
2543 
2544 //*************************************************************************************************
2546 template< typename MT, typename ST, bool SO >
2547 struct RowExprTrait< DMatScalarMultExpr<MT,ST,SO> >
2548 {
2549  public:
2550  //**********************************************************************************************
2551  typedef typename MultExprTrait< typename RowExprTrait<const MT>::Type, ST >::Type Type;
2552  //**********************************************************************************************
2553 };
2555 //*************************************************************************************************
2556 
2557 
2558 
2559 
2560 //=================================================================================================
2561 //
2562 // COLUMNEXPRTRAIT SPECIALIZATIONS
2563 //
2564 //=================================================================================================
2565 
2566 //*************************************************************************************************
2568 template< typename MT, typename ST, bool SO >
2569 struct ColumnExprTrait< DMatScalarMultExpr<MT,ST,SO> >
2570 {
2571  public:
2572  //**********************************************************************************************
2573  typedef typename MultExprTrait< typename ColumnExprTrait<const MT>::Type, ST >::Type Type;
2574  //**********************************************************************************************
2575 };
2577 //*************************************************************************************************
2578 
2579 } // namespace blaze
2580 
2581 #endif
LeftOperand leftOperand() const
Returns the left-hand side dense matrix operand.
Definition: DMatScalarMultExpr.h:516
MT::ConstIterator IteratorType
ConstIterator type of the dense matrix expression.
Definition: DMatScalarMultExpr.h:192
IntrinsicType load() const
Access to the intrinsic elements of the matrix.
Definition: DMatScalarMultExpr.h:288
Pointer difference type of the Blaze library.
DifferenceType difference_type
Difference between two iterators.
Definition: DMatScalarMultExpr.h:189
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:409
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:4075
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:772
MultExprTrait< RN, ST >::Type ExprReturnType
Expression return type for the subscript operator.
Definition: DMatScalarMultExpr.h:127
MT::ResultType RT
Result type of the dense matrix expression.
Definition: DMatScalarMultExpr.h:111
void smpSubAssign(DenseMatrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs)
Default implementation of the SMP subtraction assignment of a matrix to dense matrix.
Definition: DenseMatrix.h:151
bool isAligned() const
Returns whether the operands of the expression are properly aligned in memory.
Definition: DMatScalarMultExpr.h:560
ReferenceType reference
Reference return type.
Definition: DMatScalarMultExpr.h:188
ConstIterator & operator++()
Pre-increment operator.
Definition: DMatScalarMultExpr.h:236
Header file for the IsSparseMatrix type trait.
const ConstIterator operator--(int)
Post-decrement operator.
Definition: DMatScalarMultExpr.h:268
#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:197
bool operator>=(const ConstIterator &rhs) const
Greater-than comparison between two ConstIterator objects.
Definition: DMatScalarMultExpr.h:354
#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:579
Header file for the sparse matrix SMP implementation.
const This & CompositeType
Data type for composite expression templates.
Definition: CompressedMatrix.h:2384
Type ElementType
Type of the sparse matrix elements.
Definition: CompressedMatrix.h:249
IteratorCategory iterator_category
The iterator category.
Definition: DMatScalarMultExpr.h:185
SelectType< useAssign, const ResultType, const DMatScalarMultExpr & >::Type CompositeType
Data type for composite expression templates.
Definition: DMatScalarMultExpr.h:162
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:112
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:365
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:278
Constraint on the data type.
Header file for the DivExprTrait class template.
ElementType ValueType
Type of the underlying elements.
Definition: DMatScalarMultExpr.h:179
Constraint on the data type.
Header file for the MultExprTrait class template.
void smpAddAssign(DenseMatrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs)
Default implementation of the SMP addition assignment of a matrix to a dense matrix.
Definition: DenseMatrix.h:121
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:251
bool canSMPAssign() const
Returns whether the expression can be used in SMP assignments.
Definition: DMatScalarMultExpr.h:570
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:182
Header file for the multiplication trait.
size_t rows() const
Returns the current number of rows of the matrix.
Definition: DMatScalarMultExpr.h:496
bool operator<(const ConstIterator &rhs) const
Less-than comparison between two ConstIterator objects.
Definition: DMatScalarMultExpr.h:321
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:443
const Element * ConstIterator
Iterator over constant elements.
Definition: CompressedMatrix.h:2388
Expression object for dense matrix-scalar multiplications.The DMatScalarMultExpr class represents the...
Definition: DMatScalarMultExpr.h:105
bool canAlias(const T *alias) const
Returns whether the expression can alias with the given address alias.
Definition: DMatScalarMultExpr.h:538
Header file for the dense matrix SMP implementation.
ConstIterator & operator+=(size_t inc)
Addition assignment operator.
Definition: DMatScalarMultExpr.h:213
IteratorType iterator_
Iterator to the current element.
Definition: DMatScalarMultExpr.h:408
Header file for the DenseMatrix base class.
bool operator<=(const ConstIterator &rhs) const
Less-than comparison between two ConstIterator objects.
Definition: DMatScalarMultExpr.h:343
IntrinsicType load(size_t i, size_t j) const
Access to the intrinsic elements of the matrix.
Definition: DMatScalarMultExpr.h:457
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:159
#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:180
#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:299
SelectType< IsExpression< MT >::value, const MT, const MT & >::Type LeftOperand
Composite type of the left-hand side dense matrix expression.
Definition: DMatScalarMultExpr.h:165
Constraints on the storage order of matrix types.
LeftOperand matrix_
Left-hand side dense matrix of the multiplication expression.
Definition: DMatScalarMultExpr.h:578
Type ElementType
Type of the sparse matrix elements.
Definition: CompressedMatrix.h:2382
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:486
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:401
Header file for the BaseElementType type trait.
size_t columns() const
Returns the current number of columns of the matrix.
Definition: DMatScalarMultExpr.h:506
ConstIterator(IteratorType iterator, RightOperand scalar)
Constructor for the ConstIterator class.
Definition: DMatScalarMultExpr.h:201
friend const ConstIterator operator+(size_t inc, const ConstIterator &it)
Addition between an integral value and a ConstIterator.
Definition: DMatScalarMultExpr.h:389
Header file for the IsNumeric type trait.
ResultType::ElementType ElementType
Resulting element type.
Definition: DMatScalarMultExpr.h:155
ElementType & ReferenceType
Reference return type.
Definition: DMatScalarMultExpr.h:181
RightOperand rightOperand() const
Returns the right-hand side scalar operand.
Definition: DMatScalarMultExpr.h:526
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:2383
Header file for the MatScalarMultExpr base class.
Intrinsic characteristics of data types.The IntrinsicTrait class template provides the intrinsic char...
Definition: IntrinsicTrait.h:748
MT::CompositeType CT
Composite type of the dense matrix expression.
Definition: DMatScalarMultExpr.h:114
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:430
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:550
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:225
#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:475
bool operator!=(const ConstIterator &rhs) const
Inequality comparison between two ConstIterator objects.
Definition: DMatScalarMultExpr.h:310
bool operator>(const ConstIterator &rhs) const
Greater-than comparison between two ConstIterator objects.
Definition: DMatScalarMultExpr.h:332
const ConstIterator operator++(int)
Post-increment operator.
Definition: DMatScalarMultExpr.h:247
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:377
Header file for the IsDenseVector type trait.
Header file for all intrinsic functionality.
ConstIterator & operator--()
Pre-decrement operator.
Definition: DMatScalarMultExpr.h:257
MT::ElementType ET
Element type of the dense matrix expression.
Definition: DMatScalarMultExpr.h:113
Header file for the IsRowMajorMatrix type trait.
const bool rowMajor
Storage order flag for row-major matrices.
Definition: StorageOrder.h:71
Header file for the IsComputation type trait class.
ST RightOperand
Composite type of the right-hand side scalar value.
Definition: DMatScalarMultExpr.h:168
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:154
#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:187
This ResultType
Result type for expression template evaluations.
Definition: CompressedMatrix.h:2379
Header file for basic type definitions.
IntrinsicTrait< ElementType >::Type IntrinsicType
Resulting intrinsic element type.
Definition: DMatScalarMultExpr.h:156
Iterator over the elements of the dense matrix.
Definition: DMatScalarMultExpr.h:174
std::random_access_iterator_tag IteratorCategory
The iterator category.
Definition: DMatScalarMultExpr.h:178
MultTrait< RT, ST >::Type ResultType
Result type for expression template evaluations.
Definition: DMatScalarMultExpr.h:152
ResultType::OppositeType OppositeType
Result type with opposite storage order for expression template evaluations.
Definition: DMatScalarMultExpr.h:153
DMatScalarMultExpr< MT, ST, SO > This
Type of this DMatScalarMultExpr instance.
Definition: DMatScalarMultExpr.h:151
Evaluation of the resulting expression type of a multiplication.Via this type trait it is possible to...
Definition: MultExprTrait.h:137
Header file for the thresholds for matrix/vector and matrix/matrix multiplications.
#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
const size_t SMP_DMATSCALARMULT_THRESHOLD
SMP dense matrix/scalar multiplication/division threshold.This threshold represents the system-specif...
Definition: Thresholds.h:420
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:186