SMatScalarMultExpr.h
Go to the documentation of this file.
1 //=================================================================================================
33 //=================================================================================================
34 
35 #ifndef _BLAZE_MATH_EXPRESSIONS_SMATSCALARMULTEXPR_H_
36 #define _BLAZE_MATH_EXPRESSIONS_SMATSCALARMULTEXPR_H_
37 
38 
39 //*************************************************************************************************
40 // Includes
41 //*************************************************************************************************
42 
43 #include <iterator>
82 #include <blaze/util/Assert.h>
86 #include <blaze/util/EnableIf.h>
87 #include <blaze/util/Exception.h>
88 #include <blaze/util/InvalidType.h>
90 #include <blaze/util/mpl/And.h>
91 #include <blaze/util/SelectType.h>
92 #include <blaze/util/Types.h>
96 
97 
98 namespace blaze {
99 
100 //=================================================================================================
101 //
102 // CLASS SMATSCALARMULTEXPR
103 //
104 //=================================================================================================
105 
106 //*************************************************************************************************
113 template< typename MT // Type of the left-hand side sparse matrix
114  , typename ST // Type of the right-hand side scalar value
115  , bool SO > // Storage order
116 class SMatScalarMultExpr : public SparseMatrix< SMatScalarMultExpr<MT,ST,SO>, SO >
117  , private MatScalarMultExpr
118  , private Computation
119 {
120  private:
121  //**Type definitions****************************************************************************
122  typedef typename MT::ResultType RT;
123  typedef typename MT::ReturnType RN;
124  typedef typename MT::CompositeType CT;
125  //**********************************************************************************************
126 
127  //**Return type evaluation**********************************************************************
129 
134  enum { returnExpr = !IsTemporary<RN>::value };
135 
138  //**********************************************************************************************
139 
140  //**Serial evaluation strategy******************************************************************
142 
148  enum { useAssign = RequiresEvaluation<MT>::value };
149 
151  template< typename MT2 >
153  struct UseAssign {
154  enum { value = useAssign };
155  };
157  //**********************************************************************************************
158 
159  //**Parallel evaluation strategy****************************************************************
161 
167  template< typename MT2 >
168  struct UseSMPAssign {
169  enum { value = ( !MT2::smpAssignable || !MT::smpAssignable ) && useAssign };
170  };
172  //**********************************************************************************************
173 
174  public:
175  //**Type definitions****************************************************************************
181 
184 
187 
189  typedef typename SelectType< IsExpression<MT>::value, const MT, const MT& >::Type LeftOperand;
190 
192  typedef ST RightOperand;
193  //**********************************************************************************************
194 
195  //**ConstIterator class definition**************************************************************
199  {
200  public:
201  //**Type definitions*************************************************************************
204 
207 
208  typedef std::forward_iterator_tag IteratorCategory;
209  typedef Element ValueType;
210  typedef ValueType* PointerType;
211  typedef ValueType& ReferenceType;
213 
214  // STL iterator requirements
215  typedef IteratorCategory iterator_category;
216  typedef ValueType value_type;
217  typedef PointerType pointer;
218  typedef ReferenceType reference;
219  typedef DifferenceType difference_type;
220  //*******************************************************************************************
221 
222  //**Constructor******************************************************************************
225  inline ConstIterator( IteratorType matrix, RightOperand scalar )
226  : matrix_( matrix ) // Iterator over the elements of the left-hand side sparse matrix expression
227  , scalar_( scalar ) // Right-hand side scalar of the multiplication expression
228  {}
229  //*******************************************************************************************
230 
231  //**Prefix increment operator****************************************************************
237  ++matrix_;
238  return *this;
239  }
240  //*******************************************************************************************
241 
242  //**Element access operator******************************************************************
247  inline const Element operator*() const {
248  return Element( matrix_->value() * scalar_, matrix_->index() );
249  }
250  //*******************************************************************************************
251 
252  //**Element access operator******************************************************************
257  inline const ConstIterator* operator->() const {
258  return this;
259  }
260  //*******************************************************************************************
261 
262  //**Value function***************************************************************************
267  inline ReturnType value() const {
268  return matrix_->value() * scalar_;
269  }
270  //*******************************************************************************************
271 
272  //**Index function***************************************************************************
277  inline size_t index() const {
278  return matrix_->index();
279  }
280  //*******************************************************************************************
281 
282  //**Equality operator************************************************************************
288  inline bool operator==( const ConstIterator& rhs ) const {
289  return matrix_ == rhs.matrix_;
290  }
291  //*******************************************************************************************
292 
293  //**Inequality operator**********************************************************************
299  inline bool operator!=( const ConstIterator& rhs ) const {
300  return matrix_ != rhs.matrix_;
301  }
302  //*******************************************************************************************
303 
304  //**Subtraction operator*********************************************************************
310  inline DifferenceType operator-( const ConstIterator& rhs ) const {
311  return matrix_ - rhs.matrix_;
312  }
313  //*******************************************************************************************
314 
315  private:
316  //**Member variables*************************************************************************
317  IteratorType matrix_;
318  RightOperand scalar_;
319  //*******************************************************************************************
320  };
321  //**********************************************************************************************
322 
323  //**Compilation flags***************************************************************************
325  enum { smpAssignable = 0 };
326  //**********************************************************************************************
327 
328  //**Constructor*********************************************************************************
334  explicit inline SMatScalarMultExpr( const MT& matrix, ST scalar )
335  : matrix_( matrix ) // Left-hand side sparse matrix of the multiplication expression
336  , scalar_( scalar ) // Right-hand side scalar of the multiplication expression
337  {}
338  //**********************************************************************************************
339 
340  //**Access operator*****************************************************************************
347  inline ReturnType operator()( size_t i, size_t j ) const {
348  BLAZE_INTERNAL_ASSERT( i < matrix_.rows() , "Invalid row access index" );
349  BLAZE_INTERNAL_ASSERT( j < matrix_.columns(), "Invalid column access index" );
350  return matrix_(i,j) * scalar_;
351  }
352  //**********************************************************************************************
353 
354  //**At function*********************************************************************************
362  inline ReturnType at( size_t i, size_t j ) const {
363  if( i >= matrix_.rows() ) {
364  BLAZE_THROW_OUT_OF_RANGE( "Invalid row access index" );
365  }
366  if( j >= matrix_.columns() ) {
367  BLAZE_THROW_OUT_OF_RANGE( "Invalid column access index" );
368  }
369  return (*this)(i,j);
370  }
371  //**********************************************************************************************
372 
373  //**Begin function******************************************************************************
379  inline ConstIterator begin( size_t i ) const {
380  return ConstIterator( matrix_.begin(i), scalar_ );
381  }
382  //**********************************************************************************************
383 
384  //**End function********************************************************************************
390  inline ConstIterator end( size_t i ) const {
391  return ConstIterator( matrix_.end(i), scalar_ );
392  }
393  //**********************************************************************************************
394 
395  //**Rows function*******************************************************************************
400  inline size_t rows() const {
401  return matrix_.rows();
402  }
403  //**********************************************************************************************
404 
405  //**Columns function****************************************************************************
410  inline size_t columns() const {
411  return matrix_.columns();
412  }
413  //**********************************************************************************************
414 
415  //**NonZeros function***************************************************************************
420  inline size_t nonZeros() const {
421  return matrix_.nonZeros();
422  }
423  //**********************************************************************************************
424 
425  //**NonZeros function***************************************************************************
431  inline size_t nonZeros( size_t i ) const {
432  return matrix_.nonZeros(i);
433  }
434  //**********************************************************************************************
435 
436  //**Find function*******************************************************************************
443  inline ConstIterator find( size_t i, size_t j ) const {
445  return ConstIterator( matrix_.find( i, j ), scalar_ );
446  }
447  //**********************************************************************************************
448 
449  //**LowerBound function*************************************************************************
456  inline ConstIterator lowerBound( size_t i, size_t j ) const {
458  return ConstIterator( matrix_.lowerBound( i, j ), scalar_ );
459  }
460  //**********************************************************************************************
461 
462  //**UpperBound function*************************************************************************
469  inline ConstIterator upperBound( size_t i, size_t j ) const {
471  return ConstIterator( matrix_.upperBound( i, j ), scalar_ );
472  }
473  //**********************************************************************************************
474 
475  //**Left operand access*************************************************************************
480  inline LeftOperand leftOperand() const {
481  return matrix_;
482  }
483  //**********************************************************************************************
484 
485  //**Right operand access************************************************************************
490  inline RightOperand rightOperand() const {
491  return scalar_;
492  }
493  //**********************************************************************************************
494 
495  //**********************************************************************************************
501  template< typename T >
502  inline bool canAlias( const T* alias ) const {
503  return matrix_.canAlias( alias );
504  }
505  //**********************************************************************************************
506 
507  //**********************************************************************************************
513  template< typename T >
514  inline bool isAliased( const T* alias ) const {
515  return matrix_.isAliased( alias );
516  }
517  //**********************************************************************************************
518 
519  private:
520  //**Member variables****************************************************************************
521  LeftOperand matrix_;
522  RightOperand scalar_;
523  //**********************************************************************************************
524 
525  //**Assignment to dense matrices****************************************************************
539  template< typename MT2 // Type of the target dense matrix
540  , bool SO2 > // Storage order of the target dense matrix
541  friend inline typename EnableIf< UseAssign<MT2> >::Type
542  assign( DenseMatrix<MT2,SO2>& lhs, const SMatScalarMultExpr& rhs )
543  {
545 
546  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
547  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
548 
549  assign( ~lhs, rhs.matrix_ );
550  (~lhs) *= rhs.scalar_;
551  }
553  //**********************************************************************************************
554 
555  //**Assignment to sparse matrices***************************************************************
569  template< typename MT2 // Type of the target sparse matrix
570  , bool SO2 > // Storage order of the target sparse matrix
571  friend inline typename EnableIf< UseAssign<MT2> >::Type
572  assign( SparseMatrix<MT2,SO2>& lhs, const SMatScalarMultExpr& rhs )
573  {
575 
576  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
577  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
578 
579  assign( ~lhs, rhs.matrix_ );
580  (~lhs) *= rhs.scalar_;
581  }
583  //**********************************************************************************************
584 
585  //**Addition assignment to dense matrices*******************************************************
599  template< typename MT2 // Type of the target dense matrix
600  , bool SO2 > // Storage order of the target dense matrix
601  friend inline typename EnableIf< UseAssign<MT2> >::Type
602  addAssign( DenseMatrix<MT2,SO2>& lhs, const SMatScalarMultExpr& rhs )
603  {
605 
608 
609  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
610  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
611 
612  const ResultType tmp( serial( rhs ) );
613  addAssign( ~lhs, tmp );
614  }
616  //**********************************************************************************************
617 
618  //**Addition assignment to sparse matrices******************************************************
619  // No special implementation for the addition assignment to sparse matrices.
620  //**********************************************************************************************
621 
622  //**Subtraction assignment to dense matrices****************************************************
636  template< typename MT2 // Type of the target dense matrix
637  , bool SO2 > // Storage order of the target dense matrix
638  friend inline typename EnableIf< UseAssign<MT2> >::Type
639  subAssign( DenseMatrix<MT2,SO2>& lhs, const SMatScalarMultExpr& rhs )
640  {
642 
645 
646  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
647  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
648 
649  const ResultType tmp( serial( rhs ) );
650  subAssign( ~lhs, tmp );
651  }
653  //**********************************************************************************************
654 
655  //**Subtraction assignment to sparse matrices***************************************************
656  // No special implementation for the subtraction assignment to sparse matrices.
657  //**********************************************************************************************
658 
659  //**Multiplication assignment to dense matrices*************************************************
660  // No special implementation for the multiplication assignment to dense matrices.
661  //**********************************************************************************************
662 
663  //**Multiplication assignment to sparse matrices************************************************
664  // No special implementation for the multiplication assignment to sparse matrices.
665  //**********************************************************************************************
666 
667  //**SMP assignment to dense matrices************************************************************
668  // No special implementation for the SMP assignment to dense matrices.
669  //**********************************************************************************************
670 
671  //**SMP assignment to sparse matrices***********************************************************
672  // No special implementation for the SMP assignment to sparse matrices.
673  //**********************************************************************************************
674 
675  //**SMP addition assignment to dense matrices***************************************************
689  template< typename MT2 // Type of the target dense matrix
690  , bool SO2 > // Storage order of the target dense matrix
691  friend inline typename EnableIf< UseSMPAssign<MT2> >::Type
692  smpAddAssign( DenseMatrix<MT2,SO2>& lhs, const SMatScalarMultExpr& rhs )
693  {
695 
698 
699  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
700  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
701 
702  const ResultType tmp( rhs );
703  smpAddAssign( ~lhs, tmp );
704  }
706  //**********************************************************************************************
707 
708  //**SMP addition assignment to sparse matrices**************************************************
709  // No special implementation for the SMP addition assignment to sparse matrices.
710  //**********************************************************************************************
711 
712  //**SMP subtraction assignment to dense matrices************************************************
726  template< typename MT2 // Type of the target dense matrix
727  , bool SO2 > // Storage order of the target dense matrix
728  friend inline typename EnableIf< UseSMPAssign<MT2> >::Type
729  smpSubAssign( DenseMatrix<MT2,SO2>& lhs, const SMatScalarMultExpr& rhs )
730  {
732 
735 
736  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
737  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
738 
739  const ResultType tmp( rhs );
740  smpSubAssign( ~lhs, tmp );
741  }
743  //**********************************************************************************************
744 
745  //**SMP subtraction assignment to sparse matrices***********************************************
746  // No special implementation for the SMP subtraction assignment to sparse matrices.
747  //**********************************************************************************************
748 
749  //**SMP multiplication assignment to dense matrices*********************************************
750  // No special implementation for the SMP multiplication assignment to dense matrices.
751  //**********************************************************************************************
752 
753  //**SMP multiplication assignment to sparse matrices********************************************
754  // No special implementation for the SMP multiplication assignment to sparse matrices.
755  //**********************************************************************************************
756 
757  //**Compile time checks*************************************************************************
762  BLAZE_CONSTRAINT_MUST_BE_SAME_TYPE( ST, RightOperand );
764  //**********************************************************************************************
765 };
766 //*************************************************************************************************
767 
768 
769 
770 
771 //=================================================================================================
772 //
773 // GLOBAL UNARY ARITHMETIC OPERATORS
774 //
775 //=================================================================================================
776 
777 //*************************************************************************************************
794 template< typename MT // Data type of the sparse matrix
795  , bool SO > // Storage order
796 inline const SMatScalarMultExpr<MT,typename UnderlyingBuiltin<MT>::Type,SO>
798 {
800 
801  typedef typename UnderlyingBuiltin<MT>::Type ElementType;
803 }
804 //*************************************************************************************************
805 
806 
807 
808 
809 //=================================================================================================
810 //
811 // GLOBAL BINARY ARITHMETIC OPERATORS
812 //
813 //=================================================================================================
814 
815 //*************************************************************************************************
836 template< typename T1 // Type of the left-hand side sparse matrix
837  , bool SO // Storage order of the left-hand side sparse matrix
838  , typename T2 > // Type of the right-hand side scalar
839 inline const typename EnableIf< IsNumeric<T2>, typename MultExprTrait<T1,T2>::Type >::Type
840  operator*( const SparseMatrix<T1,SO>& mat, T2 scalar )
841 {
843 
844  typedef typename MultExprTrait<T1,T2>::Type Type;
845  return Type( ~mat, scalar );
846 }
847 //*************************************************************************************************
848 
849 
850 //*************************************************************************************************
871 template< typename T1 // Type of the left-hand side scalar
872  , typename T2 // Type of the right-hand side sparse matrix
873  , bool SO > // Storage order of the right-hand side sparse matrix
874 inline const typename EnableIf< IsNumeric<T1>, typename MultExprTrait<T1,T2>::Type >::Type
875  operator*( T1 scalar, const SparseMatrix<T2,SO>& mat )
876 {
878 
879  typedef typename MultExprTrait<T1,T2>::Type Type;
880  return Type( ~mat, scalar );
881 }
882 //*************************************************************************************************
883 
884 
885 
886 
887 //=================================================================================================
888 //
889 // GLOBAL RESTRUCTURING UNARY ARITHMETIC OPERATORS
890 //
891 //=================================================================================================
892 
893 //*************************************************************************************************
905 template< typename VT // Type of the sparse matrix
906  , typename ST // Type of the scalar
907  , bool TF > // Transpose flag
908 inline const SMatScalarMultExpr<VT,ST,TF>
909  operator-( const SMatScalarMultExpr<VT,ST,TF>& sm )
910 {
912 
913  return SMatScalarMultExpr<VT,ST,TF>( sm.leftOperand(), -sm.rightOperand() );
914 }
916 //*************************************************************************************************
917 
918 
919 
920 
921 //=================================================================================================
922 //
923 // GLOBAL RESTRUCTURING BINARY ARITHMETIC OPERATORS
924 //
925 //=================================================================================================
926 
927 //*************************************************************************************************
940 template< typename MT // Type of the sparse matrix
941  , typename ST1 // Type of the first scalar
942  , bool SO // Storage order of the sparse matrix
943  , typename ST2 > // Type of the second scalar
944 inline const typename EnableIf< IsNumeric<ST2>
945  , typename MultExprTrait< SMatScalarMultExpr<MT,ST1,SO>, ST2 >::Type >::Type
946  operator*( const SMatScalarMultExpr<MT,ST1,SO>& mat, ST2 scalar )
947 {
949 
950  return mat.leftOperand() * ( mat.rightOperand() * scalar );
951 }
953 //*************************************************************************************************
954 
955 
956 //*************************************************************************************************
969 template< typename ST1 // Type of the first scalar
970  , typename MT // Type of the sparse matrix
971  , typename ST2 // Type of the second scalar
972  , bool SO > // Storage order of the sparse matrix
973 inline const typename EnableIf< IsNumeric<ST1>
974  , typename MultExprTrait< ST1, SMatScalarMultExpr<MT,ST2,SO> >::Type >::Type
975  operator*( ST1 scalar, const SMatScalarMultExpr<MT,ST2,SO>& mat )
976 {
978 
979  return mat.leftOperand() * ( scalar * mat.rightOperand() );
980 }
982 //*************************************************************************************************
983 
984 
985 //*************************************************************************************************
998 template< typename MT // Type of the sparse matrix
999  , typename ST1 // Type of the first scalar
1000  , bool SO // Storage order of the sparse matrix
1001  , typename ST2 > // Type of the second scalar
1002 inline const typename EnableIf< And< IsNumeric<ST2>, IsInvertible< typename DivTrait<ST1,ST2>::Type > >
1003  , typename DivExprTrait< SMatScalarMultExpr<MT,ST1,SO>, ST2 >::Type >::Type
1004  operator/( const SMatScalarMultExpr<MT,ST1,SO>& mat, ST2 scalar )
1005 {
1007 
1008  return mat.leftOperand() * ( mat.rightOperand() / scalar );
1009 }
1011 //*************************************************************************************************
1012 
1013 
1014 //*************************************************************************************************
1028 template< typename MT // Type of the sparse matrix of the left-hand side expression
1029  , typename ST // Type of the scalar of the left-hand side expression
1030  , bool SO // Storage order of the left-hand side expression
1031  , typename VT > // Type of the right-hand side dense vector
1032 inline const typename MultExprTrait< SMatScalarMultExpr<MT,ST,SO>, VT >::Type
1033  operator*( const SMatScalarMultExpr<MT,ST,SO>& mat, const DenseVector<VT,false>& vec )
1034 {
1036 
1037  return ( mat.leftOperand() * (~vec) ) * mat.rightOperand();
1038 }
1040 //*************************************************************************************************
1041 
1042 
1043 //*************************************************************************************************
1057 template< typename VT // Type of the left-hand side dense vector
1058  , typename MT // Type of the sparse matrix of the right-hand side expression
1059  , typename ST // Type of the scalar of the right-hand side expression
1060  , bool SO > // Storage order of the right-hand side expression
1061 inline const typename MultExprTrait< VT, SMatScalarMultExpr<MT,ST,SO> >::Type
1062  operator*( const DenseVector<VT,true>& vec, const SMatScalarMultExpr<MT,ST,SO>& mat )
1063 {
1065 
1066  return ( (~vec) * mat.leftOperand() ) * mat.rightOperand();
1067 }
1069 //*************************************************************************************************
1070 
1071 
1072 //*************************************************************************************************
1088 template< typename MT // Type of the sparse matrix of the left-hand side expression
1089  , typename ST1 // Type of the scalar of the left-hand side expression
1090  , bool SO // Storage order of the left-hand side expression
1091  , typename VT // Type of the dense vector of the right-hand side expression
1092  , typename ST2 > // Type of the scalar of the right-hand side expression
1093 inline const typename MultExprTrait< SMatScalarMultExpr<MT,ST1,SO>, DVecScalarMultExpr<VT,ST2,false> >::Type
1094  operator*( const SMatScalarMultExpr<MT,ST1,SO>& mat, const DVecScalarMultExpr<VT,ST2,false>& vec )
1095 {
1097 
1098  return ( mat.leftOperand() * vec.leftOperand() ) * ( mat.rightOperand() * vec.rightOperand() );
1099 }
1101 //*************************************************************************************************
1102 
1103 
1104 //*************************************************************************************************
1120 template< typename VT // Type of the dense vector of the left-hand side expression
1121  , typename ST1 // Type of the scalar of the left-hand side expression
1122  , typename MT // Type of the sparse matrix of the right-hand side expression
1123  , typename ST2 // Type of the scalar of the right-hand side expression
1124  , bool SO > // Storage order of the right-hand side expression
1125 inline const typename MultExprTrait< DVecScalarMultExpr<VT,ST1,true>, SMatScalarMultExpr<MT,ST2,SO> >::Type
1126  operator*( const DVecScalarMultExpr<VT,ST1,true>& vec, const SMatScalarMultExpr<MT,ST2,SO>& mat )
1127 {
1129 
1130  return ( vec.leftOperand() * mat.leftOperand() ) * ( vec.rightOperand() * mat.rightOperand() );
1131 }
1133 //*************************************************************************************************
1134 
1135 
1136 //*************************************************************************************************
1150 template< typename MT // Type of the sparse matrix of the left-hand side expression
1151  , typename ST // Type of the scalar of the left-hand side expression
1152  , bool SO // Storage order of the left-hand side expression
1153  , typename VT > // Type of the right-hand side sparse vector
1154 inline const typename MultExprTrait< SMatScalarMultExpr<MT,ST,SO>, VT >::Type
1155  operator*( const SMatScalarMultExpr<MT,ST,SO>& mat, const SparseVector<VT,false>& vec )
1156 {
1158 
1159  return ( mat.leftOperand() * (~vec) ) * mat.rightOperand();
1160 }
1162 //*************************************************************************************************
1163 
1164 
1165 //*************************************************************************************************
1179 template< typename VT // Type of the left-hand side sparse vector
1180  , typename MT // Type of the sparse matrix of the right-hand side expression
1181  , typename ST // Type of the scalar of the right-hand side expression
1182  , bool SO > // Storage order of the right-hand side expression
1183 inline const typename MultExprTrait< VT, SMatScalarMultExpr<MT,ST,SO> >::Type
1184  operator*( const SparseVector<VT,true>& vec, const SMatScalarMultExpr<MT,ST,SO>& mat )
1185 {
1187 
1188  return ( (~vec) * mat.leftOperand() ) * mat.rightOperand();
1189 }
1191 //*************************************************************************************************
1192 
1193 
1194 //*************************************************************************************************
1210 template< typename MT // Type of the sparse matrix of the left-hand side expression
1211  , typename ST1 // Type of the scalar of the left-hand side expression
1212  , bool SO // Storage order of the left-hand side expression
1213  , typename VT // Type of the sparse vector of the right-hand side expression
1214  , typename ST2 > // Type of the scalar of the right-hand side expression
1215 inline const typename MultExprTrait< SMatScalarMultExpr<MT,ST1,SO>, SVecScalarMultExpr<VT,ST2,false> >::Type
1216  operator*( const SMatScalarMultExpr<MT,ST1,SO>& mat, const SVecScalarMultExpr<VT,ST2,false>& vec )
1217 {
1219 
1220  return ( mat.leftOperand() * vec.leftOperand() ) * ( mat.rightOperand() * vec.rightOperand() );
1221 }
1223 //*************************************************************************************************
1224 
1225 
1226 //*************************************************************************************************
1242 template< typename VT // Type of the sparse vector of the left-hand side expression
1243  , typename ST1 // Type of the scalar of the left-hand side expression
1244  , typename MT // Type of the sparse matrix of the right-hand side expression
1245  , typename ST2 // Type of the scalar of the right-hand side expression
1246  , bool SO > // Storage order of the right-hand side expression
1247 inline const typename MultExprTrait< SVecScalarMultExpr<VT,ST1,true>, SMatScalarMultExpr<MT,ST2,SO> >::Type
1248  operator*( const SVecScalarMultExpr<VT,ST1,true>& vec, const SMatScalarMultExpr<MT,ST2,SO>& mat )
1249 {
1251 
1252  return ( vec.leftOperand() * mat.leftOperand() ) * ( vec.rightOperand() * mat.rightOperand() );
1253 }
1255 //*************************************************************************************************
1256 
1257 
1258 //*************************************************************************************************
1272 template< typename MT1 // Type of the sparse matrix of the left-hand side expression
1273  , typename ST // Type of the scalar of the left-hand side expression
1274  , bool SO1 // Storage order of the left-hand side expression
1275  , typename MT2 // Type of the right-hand side dense matrix
1276  , bool SO2 > // Storage order of the right-hand side dense matrix
1277 inline const typename MultExprTrait< SMatScalarMultExpr<MT1,ST,SO1>, MT2 >::Type
1278  operator*( const SMatScalarMultExpr<MT1,ST,SO1>& lhs, const DenseMatrix<MT2,SO2>& rhs )
1279 {
1281 
1282  return ( lhs.leftOperand() * (~rhs) ) * lhs.rightOperand();
1283 }
1285 //*************************************************************************************************
1286 
1287 
1288 //*************************************************************************************************
1302 template< typename MT1 // Type of the left-hand side dense matrix
1303  , bool SO1 // Storage order of the left-hand side dense matrix
1304  , typename MT2 // Type of the sparse matrix of the right-hand side expression
1305  , typename ST // 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< MT1, SMatScalarMultExpr<MT2,ST,SO2> >::Type
1308  operator*( const DenseMatrix<MT1,SO1>& lhs, const SMatScalarMultExpr<MT2,ST,SO2>& rhs )
1309 {
1311 
1312  return ( (~lhs) * rhs.leftOperand() ) * rhs.rightOperand();
1313 }
1315 //*************************************************************************************************
1316 
1317 
1318 //*************************************************************************************************
1332 template< typename MT1 // Type of the sparse 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< SMatScalarMultExpr<MT1,ST,SO1>, MT2 >::Type
1338  operator*( const SMatScalarMultExpr<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 sparse 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, SMatScalarMultExpr<MT2,ST,SO2> >::Type
1368  operator*( const SparseMatrix<MT1,SO1>& lhs, const SMatScalarMultExpr<MT2,ST,SO2>& rhs )
1369 {
1371 
1372  return ( (~lhs) * rhs.leftOperand() ) * rhs.rightOperand();
1373 }
1375 //*************************************************************************************************
1376 
1377 
1378 //*************************************************************************************************
1392 template< typename MT1 // Type of the sparse matrix of the left-hand side expression
1393  , typename ST1 // Type of the scalar of the left-hand side expression
1394  , bool SO1 // Storage order of the left-hand side expression
1395  , typename MT2 // Type of the right-hand side sparse matrix
1396  , typename ST2 // Type of the scalar of the right-hand side expression
1397  , bool SO2 > // Storage order of the right-hand side expression
1398 inline const typename MultExprTrait< SMatScalarMultExpr<MT1,ST1,SO1>, SMatScalarMultExpr<MT2,ST2,SO2> >::Type
1399  operator*( const SMatScalarMultExpr<MT1,ST1,SO1>& lhs, const SMatScalarMultExpr<MT2,ST2,SO2>& rhs )
1400 {
1402 
1403  return ( lhs.leftOperand() * rhs.leftOperand() ) * ( lhs.rightOperand() * rhs.rightOperand() );
1404 }
1406 //*************************************************************************************************
1407 
1408 
1409 
1410 
1411 //=================================================================================================
1412 //
1413 // ROWS SPECIALIZATIONS
1414 //
1415 //=================================================================================================
1416 
1417 //*************************************************************************************************
1419 template< typename MT, typename ST, bool SO >
1420 struct Rows< SMatScalarMultExpr<MT,ST,SO> > : public Columns<MT>
1421 {};
1423 //*************************************************************************************************
1424 
1425 
1426 
1427 
1428 //=================================================================================================
1429 //
1430 // COLUMNS SPECIALIZATIONS
1431 //
1432 //=================================================================================================
1433 
1434 //*************************************************************************************************
1436 template< typename MT, typename ST, bool SO >
1437 struct Columns< SMatScalarMultExpr<MT,ST,SO> > : public Rows<MT>
1438 {};
1440 //*************************************************************************************************
1441 
1442 
1443 
1444 
1445 //=================================================================================================
1446 //
1447 // ISSYMMETRIC SPECIALIZATIONS
1448 //
1449 //=================================================================================================
1450 
1451 //*************************************************************************************************
1453 template< typename MT, typename ST, bool SO >
1454 struct IsSymmetric< SMatScalarMultExpr<MT,ST,SO> > : public IsTrue< IsSymmetric<MT>::value >
1455 {};
1457 //*************************************************************************************************
1458 
1459 
1460 
1461 
1462 //=================================================================================================
1463 //
1464 // ISHERMITIAN SPECIALIZATIONS
1465 //
1466 //=================================================================================================
1467 
1468 //*************************************************************************************************
1470 template< typename MT, typename ST, bool SO >
1471 struct IsHermitian< SMatScalarMultExpr<MT,ST,SO> > : public IsTrue< IsHermitian<MT>::value >
1472 {};
1474 //*************************************************************************************************
1475 
1476 
1477 
1478 
1479 //=================================================================================================
1480 //
1481 // ISLOWER SPECIALIZATIONS
1482 //
1483 //=================================================================================================
1484 
1485 //*************************************************************************************************
1487 template< typename MT, typename ST, bool SO >
1488 struct IsLower< SMatScalarMultExpr<MT,ST,SO> > : public IsTrue< IsLower<MT>::value >
1489 {};
1491 //*************************************************************************************************
1492 
1493 
1494 
1495 
1496 //=================================================================================================
1497 //
1498 // ISSTRICTLYLOWER SPECIALIZATIONS
1499 //
1500 //=================================================================================================
1501 
1502 //*************************************************************************************************
1504 template< typename MT, typename ST, bool SO >
1505 struct IsStrictlyLower< SMatScalarMultExpr<MT,ST,SO> > : public IsTrue< IsStrictlyLower<MT>::value >
1506 {};
1508 //*************************************************************************************************
1509 
1510 
1511 
1512 
1513 //=================================================================================================
1514 //
1515 // ISUPPER SPECIALIZATIONS
1516 //
1517 //=================================================================================================
1518 
1519 //*************************************************************************************************
1521 template< typename MT, typename ST, bool SO >
1522 struct IsUpper< SMatScalarMultExpr<MT,ST,SO> > : public IsTrue< IsUpper<MT>::value >
1523 {};
1525 //*************************************************************************************************
1526 
1527 
1528 
1529 
1530 //=================================================================================================
1531 //
1532 // ISSTRICTLYUPPER SPECIALIZATIONS
1533 //
1534 //=================================================================================================
1535 
1536 //*************************************************************************************************
1538 template< typename MT, typename ST, bool SO >
1539 struct IsStrictlyUpper< SMatScalarMultExpr<MT,ST,SO> > : public IsTrue< IsStrictlyUpper<MT>::value >
1540 {};
1542 //*************************************************************************************************
1543 
1544 
1545 
1546 
1547 //=================================================================================================
1548 //
1549 // SMATSCALARMULTEXPRTRAIT SPECIALIZATIONS
1550 //
1551 //=================================================================================================
1552 
1553 //*************************************************************************************************
1555 template< typename MT, typename ST1, typename ST2 >
1556 struct SMatScalarMultExprTrait< SMatScalarMultExpr<MT,ST1,false>, ST2 >
1557 {
1558  public:
1559  //**********************************************************************************************
1560  typedef typename SelectType< IsSparseMatrix<MT>::value && IsRowMajorMatrix<MT>::value &&
1561  IsNumeric<ST1>::value && IsNumeric<ST2>::value
1562  , typename SMatScalarMultExprTrait<MT,typename MultTrait<ST1,ST2>::Type>::Type
1563  , INVALID_TYPE >::Type Type;
1564  //**********************************************************************************************
1565 };
1567 //*************************************************************************************************
1568 
1569 
1570 
1571 
1572 //=================================================================================================
1573 //
1574 // TSMATSCALARMULTEXPRTRAIT SPECIALIZATIONS
1575 //
1576 //=================================================================================================
1577 
1578 //*************************************************************************************************
1580 template< typename MT, typename ST1, typename ST2 >
1581 struct TSMatScalarMultExprTrait< SMatScalarMultExpr<MT,ST1,true>, ST2 >
1582 {
1583  public:
1584  //**********************************************************************************************
1585  typedef typename SelectType< IsSparseMatrix<MT>::value && IsColumnMajorMatrix<MT>::value &&
1586  IsNumeric<ST1>::value && IsNumeric<ST2>::value
1587  , typename TSMatScalarMultExprTrait<MT,typename MultTrait<ST1,ST2>::Type>::Type
1588  , INVALID_TYPE >::Type Type;
1589  //**********************************************************************************************
1590 };
1592 //*************************************************************************************************
1593 
1594 
1595 
1596 
1597 //=================================================================================================
1598 //
1599 // SMATSCALARDIVEXPRTRAIT SPECIALIZATIONS
1600 //
1601 //=================================================================================================
1602 
1603 //*************************************************************************************************
1605 template< typename MT, typename ST1, typename ST2 >
1606 struct SMatScalarDivExprTrait< SMatScalarMultExpr<MT,ST1,false>, ST2 >
1607 {
1608  private:
1609  //**********************************************************************************************
1610  typedef typename DivTrait<ST1,ST2>::Type ScalarType;
1611  //**********************************************************************************************
1612 
1613  //**********************************************************************************************
1614  enum { condition = IsInvertible<ScalarType>::value };
1615  //**********************************************************************************************
1616 
1617  //**********************************************************************************************
1618  typedef typename SMatScalarMultExprTrait<MT,ScalarType>::Type T1;
1619  typedef typename SMatScalarDivExprTrait<MT,ScalarType>::Type T2;
1620  //**********************************************************************************************
1621 
1622  public:
1623  //**********************************************************************************************
1624  typedef typename SelectType< IsSparseMatrix<MT>::value && IsRowMajorMatrix<MT>::value &&
1625  IsNumeric<ST1>::value && IsNumeric<ST2>::value
1626  , typename SelectType<condition,T1,T2>::Type
1627  , INVALID_TYPE >::Type Type;
1628  //**********************************************************************************************
1629 };
1631 //*************************************************************************************************
1632 
1633 
1634 
1635 
1636 //=================================================================================================
1637 //
1638 // TSMATSCALARDIVEXPRTRAIT SPECIALIZATIONS
1639 //
1640 //=================================================================================================
1641 
1642 //*************************************************************************************************
1644 template< typename MT, typename ST1, typename ST2 >
1645 struct TSMatScalarDivExprTrait< SMatScalarMultExpr<MT,ST1,true>, ST2 >
1646 {
1647  private:
1648  //**********************************************************************************************
1649  typedef typename DivTrait<ST1,ST2>::Type ScalarType;
1650  //**********************************************************************************************
1651 
1652  //**********************************************************************************************
1653  enum { condition = IsInvertible<ScalarType>::value };
1654  //**********************************************************************************************
1655 
1656  //**********************************************************************************************
1657  typedef typename TSMatScalarMultExprTrait<MT,ScalarType>::Type T1;
1658  typedef typename TSMatScalarDivExprTrait<MT,ScalarType>::Type T2;
1659  //**********************************************************************************************
1660 
1661  public:
1662  //**********************************************************************************************
1663  typedef typename SelectType< IsSparseMatrix<MT>::value && IsColumnMajorMatrix<MT>::value &&
1664  IsNumeric<ST1>::value && IsNumeric<ST2>::value
1665  , typename SelectType<condition,T1,T2>::Type
1666  , INVALID_TYPE >::Type Type;
1667  //**********************************************************************************************
1668 };
1670 //*************************************************************************************************
1671 
1672 
1673 
1674 
1675 //=================================================================================================
1676 //
1677 // SMATDVECMULTEXPRTRAIT SPECIALIZATIONS
1678 //
1679 //=================================================================================================
1680 
1681 //*************************************************************************************************
1683 template< typename MT, typename ST, typename VT >
1684 struct SMatDVecMultExprTrait< SMatScalarMultExpr<MT,ST,false>, VT >
1685 {
1686  public:
1687  //**********************************************************************************************
1688  typedef typename SelectType< IsSparseMatrix<MT>::value && IsRowMajorMatrix<MT>::value &&
1689  IsDenseVector<VT>::value && IsColumnVector<VT>::value &&
1690  IsNumeric<ST>::value
1691  , typename DVecScalarMultExprTrait<typename SMatDVecMultExprTrait<MT,VT>::Type,ST>::Type
1692  , INVALID_TYPE >::Type Type;
1693  //**********************************************************************************************
1694 };
1696 //*************************************************************************************************
1697 
1698 
1699 //*************************************************************************************************
1701 template< typename MT, typename ST1, typename VT, typename ST2 >
1702 struct SMatDVecMultExprTrait< SMatScalarMultExpr<MT,ST1,false>, DVecScalarMultExpr<VT,ST2,false> >
1703 {
1704  public:
1705  //**********************************************************************************************
1706  typedef typename SelectType< IsSparseMatrix<MT>::value && IsRowMajorMatrix<MT>::value &&
1707  IsDenseVector<VT>::value && IsColumnVector<VT>::value &&
1708  IsNumeric<ST1>::value && IsNumeric<ST2>::value
1709  , typename DVecScalarMultExprTrait<typename SMatDVecMultExprTrait<MT,VT>::Type,typename MultTrait<ST1,ST2>::Type>::Type
1710  , INVALID_TYPE >::Type Type;
1711  //**********************************************************************************************
1712 };
1714 //*************************************************************************************************
1715 
1716 
1717 
1718 
1719 //=================================================================================================
1720 //
1721 // TSMATDVECMULTEXPRTRAIT SPECIALIZATIONS
1722 //
1723 //=================================================================================================
1724 
1725 //*************************************************************************************************
1727 template< typename MT, typename ST, typename VT >
1728 struct TSMatDVecMultExprTrait< SMatScalarMultExpr<MT,ST,true>, VT >
1729 {
1730  public:
1731  //**********************************************************************************************
1732  typedef typename SelectType< IsSparseMatrix<MT>::value && IsColumnMajorMatrix<MT>::value &&
1733  IsDenseVector<VT>::value && IsColumnVector<VT>::value &&
1734  IsNumeric<ST>::value
1735  , typename DVecScalarMultExprTrait<typename TSMatDVecMultExprTrait<MT,VT>::Type,ST>::Type
1736  , INVALID_TYPE >::Type Type;
1737  //**********************************************************************************************
1738 };
1740 //*************************************************************************************************
1741 
1742 
1743 //*************************************************************************************************
1745 template< typename MT, typename ST1, typename VT, typename ST2 >
1746 struct TSMatDVecMultExprTrait< SMatScalarMultExpr<MT,ST1,true>, DVecScalarMultExpr<VT,ST2,false> >
1747 {
1748  public:
1749  //**********************************************************************************************
1750  typedef typename SelectType< IsSparseMatrix<MT>::value && IsColumnMajorMatrix<MT>::value &&
1751  IsDenseVector<VT>::value && IsColumnVector<VT>::value &&
1752  IsNumeric<ST1>::value && IsNumeric<ST2>::value
1753  , typename DVecScalarMultExprTrait<typename TSMatDVecMultExprTrait<MT,VT>::Type,typename MultTrait<ST1,ST2>::Type>::Type
1754  , INVALID_TYPE >::Type Type;
1755  //**********************************************************************************************
1756 };
1758 //*************************************************************************************************
1759 
1760 
1761 
1762 
1763 //=================================================================================================
1764 //
1765 // TDVECSMATMULTEXPRTRAIT SPECIALIZATIONS
1766 //
1767 //=================================================================================================
1768 
1769 //*************************************************************************************************
1771 template< typename VT, typename MT, typename ST >
1772 struct TDVecSMatMultExprTrait< VT, SMatScalarMultExpr<MT,ST,false> >
1773 {
1774  public:
1775  //**********************************************************************************************
1776  typedef typename SelectType< IsDenseVector<VT>::value && IsRowVector<VT>::value &&
1777  IsSparseMatrix<MT>::value && IsRowMajorMatrix<MT>::value &&
1778  IsNumeric<ST>::value
1779  , typename TDVecScalarMultExprTrait<typename TDVecSMatMultExprTrait<VT,MT>::Type,ST>::Type
1780  , INVALID_TYPE >::Type Type;
1781  //**********************************************************************************************
1782 };
1784 //*************************************************************************************************
1785 
1786 
1787 //*************************************************************************************************
1789 template< typename VT, typename ST1, typename MT, typename ST2 >
1790 struct TDVecSMatMultExprTrait< DVecScalarMultExpr<VT,ST1,true>, SMatScalarMultExpr<MT,ST2,false> >
1791 {
1792  public:
1793  //**********************************************************************************************
1794  typedef typename SelectType< IsDenseVector<VT>::value && IsRowVector<VT>::value &&
1795  IsSparseMatrix<MT>::value && IsRowMajorMatrix<MT>::value &&
1796  IsNumeric<ST1>::value && IsNumeric<ST2>::value
1797  , typename TDVecScalarMultExprTrait<typename TDVecSMatMultExprTrait<VT,MT>::Type,typename MultTrait<ST1,ST2>::Type>::Type
1798  , INVALID_TYPE >::Type Type;
1799  //**********************************************************************************************
1800 };
1802 //*************************************************************************************************
1803 
1804 
1805 
1806 
1807 //=================================================================================================
1808 //
1809 // TDVECTSMATMULTEXPRTRAIT SPECIALIZATIONS
1810 //
1811 //=================================================================================================
1812 
1813 //*************************************************************************************************
1815 template< typename VT, typename MT, typename ST >
1816 struct TDVecTSMatMultExprTrait< VT, SMatScalarMultExpr<MT,ST,true> >
1817 {
1818  public:
1819  //**********************************************************************************************
1820  typedef typename SelectType< IsDenseVector<VT>::value && IsRowVector<VT>::value &&
1821  IsSparseMatrix<MT>::value && IsColumnMajorMatrix<MT>::value &&
1822  IsNumeric<ST>::value
1823  , typename TDVecScalarMultExprTrait<typename TDVecTSMatMultExprTrait<VT,MT>::Type,ST>::Type
1824  , INVALID_TYPE >::Type Type;
1825  //**********************************************************************************************
1826 };
1828 //*************************************************************************************************
1829 
1830 
1831 //*************************************************************************************************
1833 template< typename VT, typename ST1, typename MT, typename ST2 >
1834 struct TDVecTSMatMultExprTrait< DVecScalarMultExpr<VT,ST1,true>, SMatScalarMultExpr<MT,ST2,true> >
1835 {
1836  public:
1837  //**********************************************************************************************
1838  typedef typename SelectType< IsDenseVector<VT>::value && IsRowVector<VT>::value &&
1839  IsSparseMatrix<MT>::value && IsColumnMajorMatrix<MT>::value &&
1840  IsNumeric<ST1>::value && IsNumeric<ST2>::value
1841  , typename TDVecScalarMultExprTrait<typename TDVecTSMatMultExprTrait<VT,MT>::Type,typename MultTrait<ST1,ST2>::Type>::Type
1842  , INVALID_TYPE >::Type Type;
1843  //**********************************************************************************************
1844 };
1846 //*************************************************************************************************
1847 
1848 
1849 
1850 
1851 //=================================================================================================
1852 //
1853 // SMATSVECMULTEXPRTRAIT SPECIALIZATIONS
1854 //
1855 //=================================================================================================
1856 
1857 //*************************************************************************************************
1859 template< typename MT, typename ST, typename VT >
1860 struct SMatSVecMultExprTrait< SMatScalarMultExpr<MT,ST,false>, VT >
1861 {
1862  public:
1863  //**********************************************************************************************
1864  typedef typename SelectType< IsSparseMatrix<MT>::value && IsRowMajorMatrix<MT>::value &&
1865  IsSparseVector<VT>::value && IsColumnVector<VT>::value &&
1866  IsNumeric<ST>::value
1867  , typename SVecScalarMultExprTrait<typename SMatSVecMultExprTrait<MT,VT>::Type,ST>::Type
1868  , INVALID_TYPE >::Type Type;
1869  //**********************************************************************************************
1870 };
1872 //*************************************************************************************************
1873 
1874 
1875 //*************************************************************************************************
1877 template< typename MT, typename ST1, typename VT, typename ST2 >
1878 struct SMatSVecMultExprTrait< SMatScalarMultExpr<MT,ST1,false>, SVecScalarMultExpr<VT,ST2,false> >
1879 {
1880  public:
1881  //**********************************************************************************************
1882  typedef typename SelectType< IsSparseMatrix<MT>::value && IsRowMajorMatrix<MT>::value &&
1883  IsSparseVector<VT>::value && IsColumnVector<VT>::value &&
1884  IsNumeric<ST1>::value && IsNumeric<ST2>::value
1885  , typename SVecScalarMultExprTrait<typename SMatSVecMultExprTrait<MT,VT>::Type,typename MultTrait<ST1,ST2>::Type>::Type
1886  , INVALID_TYPE >::Type Type;
1887  //**********************************************************************************************
1888 };
1890 //*************************************************************************************************
1891 
1892 
1893 
1894 
1895 //=================================================================================================
1896 //
1897 // TSMATSVECMULTEXPRTRAIT SPECIALIZATIONS
1898 //
1899 //=================================================================================================
1900 
1901 //*************************************************************************************************
1903 template< typename MT, typename ST, typename VT >
1904 struct TSMatSVecMultExprTrait< SMatScalarMultExpr<MT,ST,true>, VT >
1905 {
1906  public:
1907  //**********************************************************************************************
1908  typedef typename SelectType< IsSparseMatrix<MT>::value && IsColumnMajorMatrix<MT>::value &&
1909  IsSparseVector<VT>::value && IsColumnVector<VT>::value &&
1910  IsNumeric<ST>::value
1911  , typename SVecScalarMultExprTrait<typename TSMatSVecMultExprTrait<MT,VT>::Type,ST>::Type
1912  , INVALID_TYPE >::Type Type;
1913  //**********************************************************************************************
1914 };
1916 //*************************************************************************************************
1917 
1918 
1919 //*************************************************************************************************
1921 template< typename MT, typename ST1, typename VT, typename ST2 >
1922 struct TSMatSVecMultExprTrait< SMatScalarMultExpr<MT,ST1,true>, SVecScalarMultExpr<VT,ST2,false> >
1923 {
1924  public:
1925  //**********************************************************************************************
1926  typedef typename SelectType< IsSparseMatrix<MT>::value && IsColumnMajorMatrix<MT>::value &&
1927  IsSparseVector<VT>::value && IsColumnVector<VT>::value &&
1928  IsNumeric<ST1>::value && IsNumeric<ST2>::value
1929  , typename SVecScalarMultExprTrait<typename TSMatSVecMultExprTrait<MT,VT>::Type,typename MultTrait<ST1,ST2>::Type>::Type
1930  , INVALID_TYPE >::Type Type;
1931  //**********************************************************************************************
1932 };
1934 //*************************************************************************************************
1935 
1936 
1937 
1938 
1939 //=================================================================================================
1940 //
1941 // TSVECSMATMULTEXPRTRAIT SPECIALIZATIONS
1942 //
1943 //=================================================================================================
1944 
1945 //*************************************************************************************************
1947 template< typename VT, typename MT, typename ST >
1948 struct TSVecSMatMultExprTrait< VT, SMatScalarMultExpr<MT,ST,false> >
1949 {
1950  public:
1951  //**********************************************************************************************
1952  typedef typename SelectType< IsSparseVector<VT>::value && IsRowVector<VT>::value &&
1953  IsSparseMatrix<MT>::value && IsRowMajorMatrix<MT>::value &&
1954  IsNumeric<ST>::value
1955  , typename TSVecScalarMultExprTrait<typename TSVecSMatMultExprTrait<VT,MT>::Type,ST>::Type
1956  , INVALID_TYPE >::Type Type;
1957  //**********************************************************************************************
1958 };
1960 //*************************************************************************************************
1961 
1962 
1963 //*************************************************************************************************
1965 template< typename VT, typename ST1, typename MT, typename ST2 >
1966 struct TSVecSMatMultExprTrait< SVecScalarMultExpr<VT,ST1,true>, SMatScalarMultExpr<MT,ST2,false> >
1967 {
1968  public:
1969  //**********************************************************************************************
1970  typedef typename SelectType< IsSparseVector<VT>::value && IsRowVector<VT>::value &&
1971  IsSparseMatrix<MT>::value && IsRowMajorMatrix<MT>::value &&
1972  IsNumeric<ST1>::value && IsNumeric<ST2>::value
1973  , typename TSVecScalarMultExprTrait<typename TSVecSMatMultExprTrait<VT,MT>::Type,typename MultTrait<ST1,ST2>::Type>::Type
1974  , INVALID_TYPE >::Type Type;
1975  //**********************************************************************************************
1976 };
1978 //*************************************************************************************************
1979 
1980 
1981 
1982 
1983 //=================================================================================================
1984 //
1985 // TSVECTSMATMULTEXPRTRAIT SPECIALIZATIONS
1986 //
1987 //=================================================================================================
1988 
1989 //*************************************************************************************************
1991 template< typename VT, typename MT, typename ST >
1992 struct TSVecTSMatMultExprTrait< VT, SMatScalarMultExpr<MT,ST,true> >
1993 {
1994  public:
1995  //**********************************************************************************************
1996  typedef typename SelectType< IsSparseVector<VT>::value && IsRowVector<VT>::value &&
1997  IsSparseMatrix<MT>::value && IsColumnMajorMatrix<MT>::value &&
1998  IsNumeric<ST>::value
1999  , typename TSVecScalarMultExprTrait<typename TSVecTSMatMultExprTrait<VT,MT>::Type,ST>::Type
2000  , INVALID_TYPE >::Type Type;
2001  //**********************************************************************************************
2002 };
2004 //*************************************************************************************************
2005 
2006 
2007 //*************************************************************************************************
2009 template< typename VT, typename ST1, typename MT, typename ST2 >
2010 struct TSVecTSMatMultExprTrait< SVecScalarMultExpr<VT,ST1,true>, SMatScalarMultExpr<MT,ST2,true> >
2011 {
2012  public:
2013  //**********************************************************************************************
2014  typedef typename SelectType< IsSparseVector<VT>::value && IsRowVector<VT>::value &&
2015  IsSparseMatrix<MT>::value && IsColumnMajorMatrix<MT>::value &&
2016  IsNumeric<ST1>::value && IsNumeric<ST2>::value
2017  , typename TSVecScalarMultExprTrait<typename TSVecTSMatMultExprTrait<VT,MT>::Type,typename MultTrait<ST1,ST2>::Type>::Type
2018  , INVALID_TYPE >::Type Type;
2019  //**********************************************************************************************
2020 };
2022 //*************************************************************************************************
2023 
2024 
2025 
2026 
2027 //=================================================================================================
2028 //
2029 // DMATSMATMULTEXPRTRAIT SPECIALIZATIONS
2030 //
2031 //=================================================================================================
2032 
2033 //*************************************************************************************************
2035 template< typename MT1, typename MT2, typename ST >
2036 struct DMatSMatMultExprTrait< MT1, SMatScalarMultExpr<MT2,ST,false> >
2037 {
2038  public:
2039  //**********************************************************************************************
2040  typedef typename SelectType< IsDenseMatrix<MT1>::value && IsRowMajorMatrix<MT1>::value &&
2041  IsSparseMatrix<MT2>::value && IsRowMajorMatrix<MT2>::value &&
2042  IsNumeric<ST>::value
2043  , typename DMatScalarMultExprTrait<typename DMatSMatMultExprTrait<MT1,MT2>::Type,ST>::Type
2044  , INVALID_TYPE >::Type Type;
2045  //**********************************************************************************************
2046 };
2048 //*************************************************************************************************
2049 
2050 
2051 
2052 
2053 //=================================================================================================
2054 //
2055 // DMATTSMATMULTEXPRTRAIT SPECIALIZATIONS
2056 //
2057 //=================================================================================================
2058 
2059 //*************************************************************************************************
2061 template< typename MT1, typename MT2, typename ST >
2062 struct DMatTSMatMultExprTrait< MT1, SMatScalarMultExpr<MT2,ST,true> >
2063 {
2064  public:
2065  //**********************************************************************************************
2066  typedef typename SelectType< IsDenseMatrix<MT1>::value && IsRowMajorMatrix<MT1>::value &&
2067  IsSparseMatrix<MT2>::value && IsColumnMajorMatrix<MT2>::value &&
2068  IsNumeric<ST>::value
2069  , typename DMatScalarMultExprTrait<typename DMatTSMatMultExprTrait<MT1,MT2>::Type,ST>::Type
2070  , INVALID_TYPE >::Type Type;
2071  //**********************************************************************************************
2072 };
2074 //*************************************************************************************************
2075 
2076 
2077 
2078 
2079 //=================================================================================================
2080 //
2081 // TDMATSMATMULTEXPRTRAIT SPECIALIZATIONS
2082 //
2083 //=================================================================================================
2084 
2085 //*************************************************************************************************
2087 template< typename MT1, typename MT2, typename ST >
2088 struct TDMatSMatMultExprTrait< MT1, SMatScalarMultExpr<MT2,ST,false> >
2089 {
2090  public:
2091  //**********************************************************************************************
2092  typedef typename SelectType< IsDenseMatrix<MT1>::value && IsColumnMajorMatrix<MT1>::value &&
2093  IsSparseMatrix<MT2>::value && IsRowMajorMatrix<MT2>::value &&
2094  IsNumeric<ST>::value
2095  , typename TDMatScalarMultExprTrait<typename TDMatSMatMultExprTrait<MT1,MT2>::Type,ST>::Type
2096  , INVALID_TYPE >::Type Type;
2097  //**********************************************************************************************
2098 };
2100 //*************************************************************************************************
2101 
2102 
2103 
2104 
2105 //=================================================================================================
2106 //
2107 // TDMATTSMATMULTEXPRTRAIT SPECIALIZATIONS
2108 //
2109 //=================================================================================================
2110 
2111 //*************************************************************************************************
2113 template< typename MT1, typename MT2, typename ST >
2114 struct TDMatTSMatMultExprTrait< MT1, SMatScalarMultExpr<MT2,ST,true> >
2115 {
2116  public:
2117  //**********************************************************************************************
2118  typedef typename SelectType< IsDenseMatrix<MT1>::value && IsColumnMajorMatrix<MT1>::value &&
2119  IsSparseMatrix<MT2>::value && IsColumnMajorMatrix<MT2>::value &&
2120  IsNumeric<ST>::value
2121  , typename TDMatScalarMultExprTrait<typename TDMatTSMatMultExprTrait<MT1,MT2>::Type,ST>::Type
2122  , INVALID_TYPE >::Type Type;
2123  //**********************************************************************************************
2124 };
2126 //*************************************************************************************************
2127 
2128 
2129 
2130 
2131 //=================================================================================================
2132 //
2133 // SMATDMATMULTEXPRTRAIT SPECIALIZATIONS
2134 //
2135 //=================================================================================================
2136 
2137 //*************************************************************************************************
2139 template< typename MT1, typename ST, typename MT2 >
2140 struct SMatDMatMultExprTrait< SMatScalarMultExpr<MT1,ST,false>, MT2 >
2141 {
2142  public:
2143  //**********************************************************************************************
2144  typedef typename SelectType< IsSparseMatrix<MT1>::value && IsRowMajorMatrix<MT1>::value &&
2145  IsDenseMatrix<MT2>::value && IsRowMajorMatrix<MT2>::value &&
2146  IsNumeric<ST>::value
2147  , typename DMatScalarMultExprTrait<typename SMatDMatMultExprTrait<MT1,MT2>::Type,ST>::Type
2148  , INVALID_TYPE >::Type Type;
2149  //**********************************************************************************************
2150 };
2152 //*************************************************************************************************
2153 
2154 
2155 
2156 
2157 //=================================================================================================
2158 //
2159 // SMATTDMATMULTEXPRTRAIT SPECIALIZATIONS
2160 //
2161 //=================================================================================================
2162 
2163 //*************************************************************************************************
2165 template< typename MT1, typename ST, typename MT2 >
2166 struct SMatTDMatMultExprTrait< SMatScalarMultExpr<MT1,ST,false>, MT2 >
2167 {
2168  public:
2169  //**********************************************************************************************
2170  typedef typename SelectType< IsSparseMatrix<MT1>::value && IsRowMajorMatrix<MT1>::value &&
2171  IsDenseMatrix<MT2>::value && IsColumnMajorMatrix<MT2>::value &&
2172  IsNumeric<ST>::value
2173  , typename DMatScalarMultExprTrait<typename SMatTDMatMultExprTrait<MT1,MT2>::Type,ST>::Type
2174  , INVALID_TYPE >::Type Type;
2175  //**********************************************************************************************
2176 };
2178 //*************************************************************************************************
2179 
2180 
2181 
2182 
2183 //=================================================================================================
2184 //
2185 // TSMATDMATMULTEXPRTRAIT SPECIALIZATIONS
2186 //
2187 //=================================================================================================
2188 
2189 //*************************************************************************************************
2191 template< typename MT1, typename ST, typename MT2 >
2192 struct TSMatDMatMultExprTrait< SMatScalarMultExpr<MT1,ST,true>, MT2 >
2193 {
2194  public:
2195  //**********************************************************************************************
2196  typedef typename SelectType< IsSparseMatrix<MT1>::value && IsColumnMajorMatrix<MT1>::value &&
2197  IsDenseMatrix<MT2>::value && IsRowMajorMatrix<MT2>::value &&
2198  IsNumeric<ST>::value
2199  , typename TDMatScalarMultExprTrait<typename TSMatDMatMultExprTrait<MT1,MT2>::Type,ST>::Type
2200  , INVALID_TYPE >::Type Type;
2201  //**********************************************************************************************
2202 };
2204 //*************************************************************************************************
2205 
2206 
2207 
2208 
2209 //=================================================================================================
2210 //
2211 // TSMATTDMATMULTEXPRTRAIT SPECIALIZATIONS
2212 //
2213 //=================================================================================================
2214 
2215 //*************************************************************************************************
2217 template< typename MT1, typename ST, typename MT2 >
2218 struct TSMatTDMatMultExprTrait< SMatScalarMultExpr<MT1,ST,true>, MT2 >
2219 {
2220  public:
2221  //**********************************************************************************************
2222  typedef typename SelectType< IsSparseMatrix<MT1>::value && IsColumnMajorMatrix<MT1>::value &&
2223  IsDenseMatrix<MT2>::value && IsColumnMajorMatrix<MT2>::value &&
2224  IsNumeric<ST>::value
2225  , typename TDMatScalarMultExprTrait<typename TSMatTDMatMultExprTrait<MT1,MT2>::Type,ST>::Type
2226  , INVALID_TYPE >::Type Type;
2227  //**********************************************************************************************
2228 };
2230 //*************************************************************************************************
2231 
2232 
2233 
2234 
2235 //=================================================================================================
2236 //
2237 // SMATSMATMULTEXPRTRAIT SPECIALIZATIONS
2238 //
2239 //=================================================================================================
2240 
2241 //*************************************************************************************************
2243 template< typename MT1, typename ST, typename MT2 >
2244 struct SMatSMatMultExprTrait< SMatScalarMultExpr<MT1,ST,false>, MT2 >
2245 {
2246  public:
2247  //**********************************************************************************************
2248  typedef typename SelectType< IsSparseMatrix<MT1>::value && IsRowMajorMatrix<MT1>::value &&
2249  IsSparseMatrix<MT2>::value && IsRowMajorMatrix<MT2>::value &&
2250  IsNumeric<ST>::value
2251  , typename SMatScalarMultExprTrait<typename SMatSMatMultExprTrait<MT1,MT2>::Type,ST>::Type
2252  , INVALID_TYPE >::Type Type;
2253  //**********************************************************************************************
2254 };
2256 //*************************************************************************************************
2257 
2258 
2259 //*************************************************************************************************
2261 template< typename MT1, typename MT2, typename ST >
2262 struct SMatSMatMultExprTrait< MT1, SMatScalarMultExpr<MT2,ST,false> >
2263 {
2264  public:
2265  //**********************************************************************************************
2266  typedef typename SelectType< IsSparseMatrix<MT1>::value && IsRowMajorMatrix<MT1>::value &&
2267  IsSparseMatrix<MT2>::value && IsRowMajorMatrix<MT2>::value &&
2268  IsNumeric<ST>::value
2269  , typename SMatScalarMultExprTrait<typename SMatSMatMultExprTrait<MT1,MT2>::Type,ST>::Type
2270  , INVALID_TYPE >::Type Type;
2271  //**********************************************************************************************
2272 };
2274 //*************************************************************************************************
2275 
2276 
2277 //*************************************************************************************************
2279 template< typename MT1, typename ST1, typename MT2, typename ST2 >
2280 struct SMatSMatMultExprTrait< SMatScalarMultExpr<MT1,ST1,false>, SMatScalarMultExpr<MT2,ST2,false> >
2281 {
2282  public:
2283  //**********************************************************************************************
2284  typedef typename SelectType< IsSparseMatrix<MT1>::value && IsRowMajorMatrix<MT1>::value &&
2285  IsSparseMatrix<MT2>::value && IsRowMajorMatrix<MT2>::value &&
2286  IsNumeric<ST1>::value && IsNumeric<ST2>::value
2287  , typename SMatScalarMultExprTrait<typename SMatSMatMultExprTrait<MT1,MT2>::Type,typename MultTrait<ST1,ST2>::Type>::Type
2288  , INVALID_TYPE >::Type Type;
2289  //**********************************************************************************************
2290 };
2292 //*************************************************************************************************
2293 
2294 
2295 
2296 
2297 //=================================================================================================
2298 //
2299 // SMATTSMATMULTEXPRTRAIT SPECIALIZATIONS
2300 //
2301 //=================================================================================================
2302 
2303 //*************************************************************************************************
2305 template< typename MT1, typename ST, typename MT2 >
2306 struct SMatTSMatMultExprTrait< SMatScalarMultExpr<MT1,ST,false>, MT2 >
2307 {
2308  public:
2309  //**********************************************************************************************
2310  typedef typename SelectType< IsSparseMatrix<MT1>::value && IsRowMajorMatrix<MT1>::value &&
2311  IsSparseMatrix<MT2>::value && IsColumnMajorMatrix<MT2>::value &&
2312  IsNumeric<ST>::value
2313  , typename SMatScalarMultExprTrait<typename SMatTSMatMultExprTrait<MT1,MT2>::Type,ST>::Type
2314  , INVALID_TYPE >::Type Type;
2315  //**********************************************************************************************
2316 };
2318 //*************************************************************************************************
2319 
2320 
2321 //*************************************************************************************************
2323 template< typename MT1, typename MT2, typename ST >
2324 struct SMatTSMatMultExprTrait< MT1, SMatScalarMultExpr<MT2,ST,true> >
2325 {
2326  public:
2327  //**********************************************************************************************
2328  typedef typename SelectType< IsSparseMatrix<MT1>::value && IsRowMajorMatrix<MT1>::value &&
2329  IsSparseMatrix<MT2>::value && IsColumnMajorMatrix<MT2>::value &&
2330  IsNumeric<ST>::value
2331  , typename SMatScalarMultExprTrait<typename SMatTSMatMultExprTrait<MT1,MT2>::Type,ST>::Type
2332  , INVALID_TYPE >::Type Type;
2333  //**********************************************************************************************
2334 };
2336 //*************************************************************************************************
2337 
2338 
2339 //*************************************************************************************************
2341 template< typename MT1, typename ST1, typename MT2, typename ST2 >
2342 struct SMatTSMatMultExprTrait< SMatScalarMultExpr<MT1,ST1,false>, SMatScalarMultExpr<MT2,ST2,true> >
2343 {
2344  public:
2345  //**********************************************************************************************
2346  typedef typename SelectType< IsSparseMatrix<MT1>::value && IsRowMajorMatrix<MT1>::value &&
2347  IsSparseMatrix<MT2>::value && IsColumnMajorMatrix<MT2>::value &&
2348  IsNumeric<ST1>::value && IsNumeric<ST2>::value
2349  , typename SMatScalarMultExprTrait<typename SMatTSMatMultExprTrait<MT1,MT2>::Type,typename MultTrait<ST1,ST2>::Type>::Type
2350  , INVALID_TYPE >::Type Type;
2351  //**********************************************************************************************
2352 };
2354 //*************************************************************************************************
2355 
2356 
2357 
2358 
2359 //=================================================================================================
2360 //
2361 // TSMATSMATMULTEXPRTRAIT SPECIALIZATIONS
2362 //
2363 //=================================================================================================
2364 
2365 //*************************************************************************************************
2367 template< typename MT1, typename ST, typename MT2 >
2368 struct TSMatSMatMultExprTrait< SMatScalarMultExpr<MT1,ST,true>, MT2 >
2369 {
2370  public:
2371  //**********************************************************************************************
2372  typedef typename SelectType< IsSparseMatrix<MT1>::value && IsColumnMajorMatrix<MT1>::value &&
2373  IsSparseMatrix<MT2>::value && IsRowMajorMatrix<MT2>::value &&
2374  IsNumeric<ST>::value
2375  , typename TSMatScalarMultExprTrait<typename TSMatSMatMultExprTrait<MT1,MT2>::Type,ST>::Type
2376  , INVALID_TYPE >::Type Type;
2377  //**********************************************************************************************
2378 };
2380 //*************************************************************************************************
2381 
2382 
2383 //*************************************************************************************************
2385 template< typename MT1, typename MT2, typename ST >
2386 struct TSMatSMatMultExprTrait< MT1, SMatScalarMultExpr<MT2,ST,false> >
2387 {
2388  public:
2389  //**********************************************************************************************
2390  typedef typename SelectType< IsSparseMatrix<MT1>::value && IsColumnMajorMatrix<MT1>::value &&
2391  IsSparseMatrix<MT2>::value && IsRowMajorMatrix<MT2>::value &&
2392  IsNumeric<ST>::value
2393  , typename TSMatScalarMultExprTrait<typename TSMatSMatMultExprTrait<MT1,MT2>::Type,ST>::Type
2394  , INVALID_TYPE >::Type Type;
2395  //**********************************************************************************************
2396 };
2398 //*************************************************************************************************
2399 
2400 
2401 //*************************************************************************************************
2403 template< typename MT1, typename ST1, typename MT2, typename ST2 >
2404 struct TSMatSMatMultExprTrait< SMatScalarMultExpr<MT1,ST1,true>, SMatScalarMultExpr<MT2,ST2,false> >
2405 {
2406  public:
2407  //**********************************************************************************************
2408  typedef typename SelectType< IsSparseMatrix<MT1>::value && IsColumnMajorMatrix<MT1>::value &&
2409  IsSparseMatrix<MT2>::value && IsRowMajorMatrix<MT2>::value &&
2410  IsNumeric<ST1>::value && IsNumeric<ST2>::value
2411  , typename TSMatScalarMultExprTrait<typename TSMatSMatMultExprTrait<MT1,MT2>::Type,typename MultTrait<ST1,ST2>::Type>::Type
2412  , INVALID_TYPE >::Type Type;
2413  //**********************************************************************************************
2414 };
2416 //*************************************************************************************************
2417 
2418 
2419 
2420 
2421 //=================================================================================================
2422 //
2423 // TSMATSMATMULTEXPRTRAIT SPECIALIZATIONS
2424 //
2425 //=================================================================================================
2426 
2427 //*************************************************************************************************
2429 template< typename MT1, typename ST, typename MT2 >
2430 struct TSMatTSMatMultExprTrait< SMatScalarMultExpr<MT1,ST,true>, MT2 >
2431 {
2432  public:
2433  //**********************************************************************************************
2434  typedef typename SelectType< IsSparseMatrix<MT1>::value && IsColumnMajorMatrix<MT1>::value &&
2435  IsSparseMatrix<MT2>::value && IsColumnMajorMatrix<MT2>::value &&
2436  IsNumeric<ST>::value
2437  , typename TSMatScalarMultExprTrait<typename TSMatTSMatMultExprTrait<MT1,MT2>::Type,ST>::Type
2438  , INVALID_TYPE >::Type Type;
2439  //**********************************************************************************************
2440 };
2442 //*************************************************************************************************
2443 
2444 
2445 //*************************************************************************************************
2447 template< typename MT1, typename MT2, typename ST >
2448 struct TSMatTSMatMultExprTrait< MT1, SMatScalarMultExpr<MT2,ST,true> >
2449 {
2450  public:
2451  //**********************************************************************************************
2452  typedef typename SelectType< IsSparseMatrix<MT1>::value && IsColumnMajorMatrix<MT1>::value &&
2453  IsSparseMatrix<MT2>::value && IsColumnMajorMatrix<MT2>::value &&
2454  IsNumeric<ST>::value
2455  , typename TSMatScalarMultExprTrait<typename TSMatTSMatMultExprTrait<MT1,MT2>::Type,ST>::Type
2456  , INVALID_TYPE >::Type Type;
2457  //**********************************************************************************************
2458 };
2460 //*************************************************************************************************
2461 
2462 
2463 //*************************************************************************************************
2465 template< typename MT1, typename ST1, typename MT2, typename ST2 >
2466 struct TSMatTSMatMultExprTrait< SMatScalarMultExpr<MT1,ST1,true>, SMatScalarMultExpr<MT2,ST2,true> >
2467 {
2468  public:
2469  //**********************************************************************************************
2470  typedef typename SelectType< IsSparseMatrix<MT1>::value && IsColumnMajorMatrix<MT1>::value &&
2471  IsSparseMatrix<MT2>::value && IsColumnMajorMatrix<MT2>::value &&
2472  IsNumeric<ST1>::value && IsNumeric<ST2>::value
2473  , typename TSMatScalarMultExprTrait<typename TSMatTSMatMultExprTrait<MT1,MT2>::Type,typename MultTrait<ST1,ST2>::Type>::Type
2474  , INVALID_TYPE >::Type Type;
2475  //**********************************************************************************************
2476 };
2478 //*************************************************************************************************
2479 
2480 
2481 
2482 
2483 //=================================================================================================
2484 //
2485 // SUBMATRIXEXPRTRAIT SPECIALIZATIONS
2486 //
2487 //=================================================================================================
2488 
2489 //*************************************************************************************************
2491 template< typename MT, typename ST, bool SO, bool AF >
2492 struct SubmatrixExprTrait< SMatScalarMultExpr<MT,ST,SO>, AF >
2493 {
2494  public:
2495  //**********************************************************************************************
2496  typedef typename MultExprTrait< typename SubmatrixExprTrait<const MT,AF>::Type, ST >::Type Type;
2497  //**********************************************************************************************
2498 };
2500 //*************************************************************************************************
2501 
2502 
2503 
2504 
2505 //=================================================================================================
2506 //
2507 // ROWEXPRTRAIT SPECIALIZATIONS
2508 //
2509 //=================================================================================================
2510 
2511 //*************************************************************************************************
2513 template< typename MT, typename ST, bool SO >
2514 struct RowExprTrait< SMatScalarMultExpr<MT,ST,SO> >
2515 {
2516  public:
2517  //**********************************************************************************************
2518  typedef typename MultExprTrait< typename RowExprTrait<const MT>::Type, ST >::Type Type;
2519  //**********************************************************************************************
2520 };
2522 //*************************************************************************************************
2523 
2524 
2525 
2526 
2527 //=================================================================================================
2528 //
2529 // COLUMNEXPRTRAIT SPECIALIZATIONS
2530 //
2531 //=================================================================================================
2532 
2533 //*************************************************************************************************
2535 template< typename MT, typename ST, bool SO >
2536 struct ColumnExprTrait< SMatScalarMultExpr<MT,ST,SO> >
2537 {
2538  public:
2539  //**********************************************************************************************
2540  typedef typename MultExprTrait< typename ColumnExprTrait<const MT>::Type, ST >::Type Type;
2541  //**********************************************************************************************
2542 };
2544 //*************************************************************************************************
2545 
2546 } // namespace blaze
2547 
2548 #endif
size_t columns() const
Returns the current number of columns of the matrix.
Definition: SMatScalarMultExpr.h:410
Pointer difference type of the Blaze library.
Data type constraint.
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
Header file for the Rows type trait.
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:7820
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:962
Header file for basic type definitions.
PointerType pointer
Pointer return type.
Definition: SMatScalarMultExpr.h:217
SelectType< IsExpression< MT >::value, const MT, const MT & >::Type LeftOperand
Composite data type of the sparse matrix expression.
Definition: SMatScalarMultExpr.h:189
RightOperand scalar_
Right-hand side scalar of the multiplication expression.
Definition: SMatScalarMultExpr.h:522
ConstIterator end(size_t i) const
Returns an iterator just past the last non-zero element of row i.
Definition: SMatScalarMultExpr.h:390
Header file for the IsSparseMatrix type trait.
#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:81
Efficient implementation of a compressed matrix.The CompressedMatrix class template is the represent...
Definition: CompressedMatrix.h:207
RightOperand scalar_
Right-hand side scalar of the multiplication expression.
Definition: SMatScalarMultExpr.h:318
ConstIterator find(size_t i, size_t j) const
Searches for a specific matrix element.
Definition: SMatScalarMultExpr.h:443
Header file for the ColumnExprTrait class template.
ValueType & ReferenceType
Reference return type.
Definition: SMatScalarMultExpr.h:211
LeftOperand leftOperand() const
Returns the left-hand side sparse matrix operand.
Definition: SMatScalarMultExpr.h:480
Header file for the IsColumnMajorMatrix type trait.
const This & CompositeType
Data type for composite expression templates.
Definition: CompressedMatrix.h:2588
Header file for the IsRowVector type trait.
Type ElementType
Type of the sparse matrix elements.
Definition: CompressedMatrix.h:259
Header file for the And class template.
RightOperand rightOperand() const
Returns the right-hand side scalar operand.
Definition: SMatScalarMultExpr.h:490
size_t index() const
Access to the current index of the sparse element.
Definition: SMatScalarMultExpr.h:277
const DMatSerialExpr< MT, SO > serial(const DenseMatrix< MT, SO > &dm)
Forces the serial evaluation of the given dense matrix expression dm.
Definition: DMatSerialExpr.h:721
ResultType::ElementType ElementType
Resulting element type.
Definition: SMatScalarMultExpr.h:180
Header file for the Computation base class.
Header file for the RequiresEvaluation type trait.
LeftOperand matrix_
Left-hand side sparse matrix of the multiplication expression.
Definition: SMatScalarMultExpr.h:521
size_t nonZeros() const
Returns the number of non-zero elements in the sparse matrix.
Definition: SMatScalarMultExpr.h:420
MultExprTrait< RN, ST >::Type ExprReturnType
Expression return type for the subscript operator.
Definition: SMatScalarMultExpr.h:137
ConstIterator upperBound(size_t i, size_t j) const
Returns an iterator to the first index greater then the given index.
Definition: SMatScalarMultExpr.h:469
ResultType::TransposeType TransposeType
Transpose type for expression template evaluations.
Definition: SMatScalarMultExpr.h:179
std::forward_iterator_tag IteratorCategory
The iterator category.
Definition: SMatScalarMultExpr.h:208
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:117
Constraint on the data type.
Header file for the SparseMatrix base class.
Header file for the DivExprTrait class template.
RemoveReference< LeftOperand >::Type::ConstIterator IteratorType
Iterator type of the sparse matrix expression.
Definition: SMatScalarMultExpr.h:206
Constraint on the data type.
bool canAlias(const T *alias) const
Returns whether the expression can alias with the given address alias.
Definition: SMatScalarMultExpr.h:502
Header file for the MultExprTrait class template.
Compile time check to query the requirement to evaluate an expression.Via this type trait it is possi...
Definition: RequiresEvaluation.h:90
const This & CompositeType
Data type for composite expression templates.
Definition: CompressedMatrix.h:261
ConstIterator begin(size_t i) const
Returns an iterator to the first non-zero element of row i.
Definition: SMatScalarMultExpr.h:379
Evaluation of the underlying builtin element type of a given data type.Via this type trait it is poss...
Definition: UnderlyingBuiltin.h:80
Header file for the ValueIndexPair class.
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.
Header file for the multiplication trait.
ValueIndexPair< ElementType > Element
Element type of the sparse matrix expression.
Definition: SMatScalarMultExpr.h:203
Header file for the IsStrictlyUpper type trait.
Header file for the IsSymmetric type trait.
Namespace of the Blaze C++ math library.
Definition: Blaze.h:57
ReferenceType reference
Reference return type.
Definition: SMatScalarMultExpr.h:218
ConstIterator lowerBound(size_t i, size_t j) const
Returns an iterator to the first index not less then the given index.
Definition: SMatScalarMultExpr.h:456
ConstIterator & operator++()
Pre-increment operator.
Definition: SMatScalarMultExpr.h:236
Header file for the UnderlyingBuiltin type trait.
const Element * ConstIterator
Iterator over constant elements.
Definition: CompressedMatrix.h:2592
ResultType::OppositeType OppositeType
Result type with opposite storage order for expression template evaluations.
Definition: SMatScalarMultExpr.h:178
DifferenceType operator-(const ConstIterator &rhs) const
Calculating the number of elements between two expression iterators.
Definition: SMatScalarMultExpr.h:310
#define BLAZE_THROW_OUT_OF_RANGE(MESSAGE)
Macro for the emission of a std::out_of_range exceptionThis macro encapsulates the default way of Bla...
Definition: Exception.h:331
Header file for the Columns type trait.
const SelectType< returnExpr, ExprReturnType, ElementType >::Type ReturnType
Return type for expression template evaluations.
Definition: SMatScalarMultExpr.h:183
IteratorCategory iterator_category
The iterator category.
Definition: SMatScalarMultExpr.h:215
#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
Header file for the IsLower type trait.
ST RightOperand
Composite type of the right-hand side scalar value.
Definition: SMatScalarMultExpr.h:192
const DenseIterator< Type, AF > operator-(const DenseIterator< Type, AF > &it, ptrdiff_t inc)
Subtraction between a DenseIterator and an integral value.
Definition: DenseIterator.h:642
#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
ReturnType operator()(size_t i, size_t j) const
2D-access to the matrix elements.
Definition: SMatScalarMultExpr.h:347
bool operator!=(const ConstIterator &rhs) const
Inequality comparison between two ConstIterator objects.
Definition: SMatScalarMultExpr.h:299
Constraints on the storage order of matrix types.
Constraint on the data type.
Header file for the SelectType class template.
Header file for the RowExprTrait class template.
Expression object for sparse matrix-scalar multiplications.The SMatScalarMult class represents the co...
Definition: Forward.h:104
Header file for all forward declarations for expression class templates.
Header file for the IsDenseMatrix type trait.
MT::CompositeType CT
Composite type of the sparse matrix expression.
Definition: SMatScalarMultExpr.h:124
Header file for the EnableIf class template.
Header file for the IsStrictlyLower type trait.
size_t rows() const
Returns the current number of rows of the matrix.
Definition: SMatScalarMultExpr.h:400
Header file for the serial shim.
ptrdiff_t DifferenceType
Difference between two iterators.
Definition: SMatScalarMultExpr.h:212
ValueType * PointerType
Pointer return type.
Definition: SMatScalarMultExpr.h:210
Header file for the IsNumeric type trait.
ReturnType at(size_t i, size_t j) const
Checked access to the matrix elements.
Definition: SMatScalarMultExpr.h:362
EnableIf< IsDenseMatrix< MT1 > >::Type smpSubAssign(Matrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs)
Default implementation of the SMP subtraction assignment of a matrix to dense matrix.
Definition: DenseMatrix.h:160
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:2587
Removal of reference modifiers.The RemoveCV type trait removes any reference modifiers from the given...
Definition: RemoveReference.h:69
Header file for the MatScalarMultExpr base class.
Header file for run time assertion macros.
Utility type for generic codes.
MT::ReturnType RN
Return type of the sparse matrix expression.
Definition: SMatScalarMultExpr.h:123
Base template for the MultTrait class.
Definition: MultTrait.h:138
ConstIterator(IteratorType matrix, RightOperand scalar)
Constructor for the ConstIterator class.
Definition: SMatScalarMultExpr.h:225
Header file for the division trait.
SelectType< useAssign, const ResultType, const SMatScalarMultExpr & >::Type CompositeType
Data type for composite expression templates.
Definition: SMatScalarMultExpr.h:186
SMatScalarMultExpr< MT, ST, SO > This
Type of this SMatScalarMultExpr instance.
Definition: SMatScalarMultExpr.h:176
bool operator==(const ConstIterator &rhs) const
Equality comparison between two ConstIterator objects.
Definition: SMatScalarMultExpr.h:288
Substitution Failure Is Not An Error (SFINAE) class.The EnableIf class template is an auxiliary tool ...
Definition: EnableIf.h:184
#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
MT::ResultType RT
Result type of the sparse matrix expression.
Definition: SMatScalarMultExpr.h:122
#define BLAZE_CONSTRAINT_MUST_NOT_REQUIRE_EVALUATION(T)
Constraint on the data type.In case the given data type T requires an intermediate evaluation within ...
Definition: RequiresEvaluation.h:118
Iterator over the elements of the sparse matrix/scalar multiplication expression. ...
Definition: SMatScalarMultExpr.h:198
DifferenceType difference_type
Difference between two iterators.
Definition: SMatScalarMultExpr.h:219
Header file for the RemoveReference type trait.
Header file for the IsInvertible type trait.
const Element operator*() const
Direct access to the sparse matrix element at the current iterator position.
Definition: SMatScalarMultExpr.h:247
Element ValueType
Type of the underlying pointers.
Definition: SMatScalarMultExpr.h:209
Header file for the IsDenseVector type trait.
MultTrait< RT, ST >::Type ResultType
Result type for expression template evaluations.
Definition: SMatScalarMultExpr.h:177
ReturnType value() const
Access to the current value of the sparse element.
Definition: SMatScalarMultExpr.h:267
IteratorType matrix_
Iterator over the elements of the left-hand side sparse matrix expression.
Definition: SMatScalarMultExpr.h:317
Index-value-pair for sparse vectors and matrices.The ValueIndexPair class represents a single index-v...
Definition: ValueIndexPair.h:70
Header file for the IsRowMajorMatrix type trait.
Header file for the IsComputation type trait class.
bool isAliased(const T *alias) const
Returns whether the expression is aliased with the given address alias.
Definition: SMatScalarMultExpr.h:514
EnableIf< IsDenseMatrix< MT1 > >::Type smpAddAssign(Matrix< 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:129
#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
This ResultType
Result type for expression template evaluations.
Definition: CompressedMatrix.h:2583
Header file for the IsTrue value trait.
size_t nonZeros(size_t i) const
Returns the number of non-zero elements in the specified row.
Definition: SMatScalarMultExpr.h:431
Header file for the IsUpper type trait.
const ConstIterator * operator->() const
Direct access to the sparse matrix element at the current iterator position.
Definition: SMatScalarMultExpr.h:257
Header file for exception macros.
SMatScalarMultExpr(const MT &matrix, ST scalar)
Constructor for the SMatScalarMultExpr class.
Definition: SMatScalarMultExpr.h:334
Header file for the IsColumnVector type trait.
Header file for the IsHermitian type trait.
ValueType value_type
Type of the underlying pointers.
Definition: SMatScalarMultExpr.h:216
Evaluation of the resulting expression type of a multiplication.Via this type trait it is possible to...
Definition: MultExprTrait.h:137
#define BLAZE_INTERNAL_ASSERT(expr, msg)
Run time assertion macro for internal checks.In case of an invalid run time expression, the program execution is terminated. The BLAZE_INTERNAL_ASSERT macro can be disabled by setting the BLAZE_USER_ASSERTION flag to zero or by defining NDEBUG during the compilation.
Definition: Assert.h:101
#define BLAZE_CONSTRAINT_MUST_BE_SPARSE_MATRIX_TYPE(T)
Constraint on the data type.In case the given data type T is not a sparse, N-dimensional matrix type...
Definition: SparseMatrix.h:79
Header file for the IsExpression type trait class.
Header file for the FunctionTrace class.