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>
80 #include <blaze/util/Assert.h>
84 #include <blaze/util/EnableIf.h>
85 #include <blaze/util/InvalidType.h>
87 #include <blaze/util/SelectType.h>
88 #include <blaze/util/Types.h>
93 
94 
95 namespace blaze {
96 
97 //=================================================================================================
98 //
99 // CLASS SMATSCALARMULTEXPR
100 //
101 //=================================================================================================
102 
103 //*************************************************************************************************
110 template< typename MT // Type of the left-hand side sparse matrix
111  , typename ST // Type of the right-hand side scalar value
112  , bool SO > // Storage order
113 class SMatScalarMultExpr : public SparseMatrix< SMatScalarMultExpr<MT,ST,SO>, SO >
114  , private MatScalarMultExpr
115  , private Computation
116 {
117  private:
118  //**Type definitions****************************************************************************
119  typedef typename MT::ResultType RT;
120  typedef typename MT::ReturnType RN;
121  typedef typename MT::CompositeType CT;
122  //**********************************************************************************************
123 
124  //**Return type evaluation**********************************************************************
126 
131  enum { returnExpr = !IsTemporary<RN>::value };
132 
135  //**********************************************************************************************
136 
137  //**Serial evaluation strategy******************************************************************
139 
145  enum { useAssign = RequiresEvaluation<MT>::value };
146 
148  template< typename MT2 >
150  struct UseAssign {
151  enum { value = useAssign };
152  };
154  //**********************************************************************************************
155 
156  //**Parallel evaluation strategy****************************************************************
158 
164  template< typename MT2 >
165  struct UseSMPAssign {
166  enum { value = ( !MT2::smpAssignable || !MT::smpAssignable ) && useAssign };
167  };
169  //**********************************************************************************************
170 
171  public:
172  //**Type definitions****************************************************************************
178 
181 
184 
186  typedef typename SelectType< IsExpression<MT>::value, const MT, const MT& >::Type LeftOperand;
187 
189  typedef ST RightOperand;
190  //**********************************************************************************************
191 
192  //**ConstIterator class definition**************************************************************
196  {
197  public:
198  //**Type definitions*************************************************************************
201 
204 
205  typedef std::forward_iterator_tag IteratorCategory;
206  typedef Element ValueType;
207  typedef ValueType* PointerType;
208  typedef ValueType& ReferenceType;
210 
211  // STL iterator requirements
212  typedef IteratorCategory iterator_category;
213  typedef ValueType value_type;
214  typedef PointerType pointer;
215  typedef ReferenceType reference;
216  typedef DifferenceType difference_type;
217  //*******************************************************************************************
218 
219  //**Constructor******************************************************************************
222  inline ConstIterator( IteratorType matrix, RightOperand scalar )
223  : matrix_( matrix ) // Iterator over the elements of the left-hand side sparse matrix expression
224  , scalar_( scalar ) // Right-hand side scalar of the multiplication expression
225  {}
226  //*******************************************************************************************
227 
228  //**Prefix increment operator****************************************************************
234  ++matrix_;
235  return *this;
236  }
237  //*******************************************************************************************
238 
239  //**Element access operator******************************************************************
244  inline const Element operator*() const {
245  return Element( matrix_->value() * scalar_, matrix_->index() );
246  }
247  //*******************************************************************************************
248 
249  //**Element access operator******************************************************************
254  inline const ConstIterator* operator->() const {
255  return this;
256  }
257  //*******************************************************************************************
258 
259  //**Value function***************************************************************************
264  inline ReturnType value() const {
265  return matrix_->value() * scalar_;
266  }
267  //*******************************************************************************************
268 
269  //**Index function***************************************************************************
274  inline size_t index() const {
275  return matrix_->index();
276  }
277  //*******************************************************************************************
278 
279  //**Equality operator************************************************************************
285  inline bool operator==( const ConstIterator& rhs ) const {
286  return matrix_ == rhs.matrix_;
287  }
288  //*******************************************************************************************
289 
290  //**Inequality operator**********************************************************************
296  inline bool operator!=( const ConstIterator& rhs ) const {
297  return matrix_ != rhs.matrix_;
298  }
299  //*******************************************************************************************
300 
301  //**Subtraction operator*********************************************************************
307  inline DifferenceType operator-( const ConstIterator& rhs ) const {
308  return matrix_ - rhs.matrix_;
309  }
310  //*******************************************************************************************
311 
312  private:
313  //**Member variables*************************************************************************
314  IteratorType matrix_;
315  RightOperand scalar_;
316  //*******************************************************************************************
317  };
318  //**********************************************************************************************
319 
320  //**Compilation flags***************************************************************************
322  enum { smpAssignable = 0 };
323  //**********************************************************************************************
324 
325  //**Constructor*********************************************************************************
331  explicit inline SMatScalarMultExpr( const MT& matrix, ST scalar )
332  : matrix_( matrix ) // Left-hand side sparse matrix of the multiplication expression
333  , scalar_( scalar ) // Right-hand side scalar of the multiplication expression
334  {}
335  //**********************************************************************************************
336 
337  //**Access operator*****************************************************************************
344  inline ReturnType operator()( size_t i, size_t j ) const {
345  BLAZE_INTERNAL_ASSERT( i < matrix_.rows() , "Invalid row access index" );
346  BLAZE_INTERNAL_ASSERT( j < matrix_.columns(), "Invalid column access index" );
347  return matrix_(i,j) * scalar_;
348  }
349  //**********************************************************************************************
350 
351  //**Begin function******************************************************************************
357  inline ConstIterator begin( size_t i ) const {
358  return ConstIterator( matrix_.begin(i), scalar_ );
359  }
360  //**********************************************************************************************
361 
362  //**End function********************************************************************************
368  inline ConstIterator end( size_t i ) const {
369  return ConstIterator( matrix_.end(i), scalar_ );
370  }
371  //**********************************************************************************************
372 
373  //**Rows function*******************************************************************************
378  inline size_t rows() const {
379  return matrix_.rows();
380  }
381  //**********************************************************************************************
382 
383  //**Columns function****************************************************************************
388  inline size_t columns() const {
389  return matrix_.columns();
390  }
391  //**********************************************************************************************
392 
393  //**NonZeros function***************************************************************************
398  inline size_t nonZeros() const {
399  return matrix_.nonZeros();
400  }
401  //**********************************************************************************************
402 
403  //**NonZeros function***************************************************************************
409  inline size_t nonZeros( size_t i ) const {
410  return matrix_.nonZeros(i);
411  }
412  //**********************************************************************************************
413 
414  //**Find function*******************************************************************************
421  inline ConstIterator find( size_t i, size_t j ) const {
423  return ConstIterator( matrix_.find( i, j ), scalar_ );
424  }
425  //**********************************************************************************************
426 
427  //**LowerBound function*************************************************************************
434  inline ConstIterator lowerBound( size_t i, size_t j ) const {
436  return ConstIterator( matrix_.lowerBound( i, j ), scalar_ );
437  }
438  //**********************************************************************************************
439 
440  //**UpperBound function*************************************************************************
447  inline ConstIterator upperBound( size_t i, size_t j ) const {
449  return ConstIterator( matrix_.upperBound( i, j ), scalar_ );
450  }
451  //**********************************************************************************************
452 
453  //**Left operand access*************************************************************************
458  inline LeftOperand leftOperand() const {
459  return matrix_;
460  }
461  //**********************************************************************************************
462 
463  //**Right operand access************************************************************************
468  inline RightOperand rightOperand() const {
469  return scalar_;
470  }
471  //**********************************************************************************************
472 
473  //**********************************************************************************************
479  template< typename T >
480  inline bool canAlias( const T* alias ) const {
481  return matrix_.canAlias( alias );
482  }
483  //**********************************************************************************************
484 
485  //**********************************************************************************************
491  template< typename T >
492  inline bool isAliased( const T* alias ) const {
493  return matrix_.isAliased( alias );
494  }
495  //**********************************************************************************************
496 
497  private:
498  //**Member variables****************************************************************************
499  LeftOperand matrix_;
500  RightOperand scalar_;
501  //**********************************************************************************************
502 
503  //**Assignment to dense matrices****************************************************************
517  template< typename MT2 // Type of the target dense matrix
518  , bool SO2 > // Storage order of the target dense matrix
519  friend inline typename EnableIf< UseAssign<MT2> >::Type
521  {
523 
524  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
525  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
526 
527  assign( ~lhs, rhs.matrix_ );
528  (~lhs) *= rhs.scalar_;
529  }
531  //**********************************************************************************************
532 
533  //**Assignment to sparse matrices***************************************************************
547  template< typename MT2 // Type of the target sparse matrix
548  , bool SO2 > // Storage order of the target sparse matrix
549  friend inline typename EnableIf< UseAssign<MT2> >::Type
551  {
553 
554  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
555  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
556 
557  assign( ~lhs, rhs.matrix_ );
558  (~lhs) *= rhs.scalar_;
559  }
561  //**********************************************************************************************
562 
563  //**Addition assignment to dense matrices*******************************************************
577  template< typename MT2 // Type of the target dense matrix
578  , bool SO2 > // Storage order of the target dense matrix
579  friend inline typename EnableIf< UseAssign<MT2> >::Type
580  addAssign( DenseMatrix<MT2,SO2>& lhs, const SMatScalarMultExpr& rhs )
581  {
583 
586 
587  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
588  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
589 
590  const ResultType tmp( serial( rhs ) );
591  addAssign( ~lhs, tmp );
592  }
594  //**********************************************************************************************
595 
596  //**Addition assignment to sparse matrices******************************************************
597  // No special implementation for the addition assignment to sparse matrices.
598  //**********************************************************************************************
599 
600  //**Subtraction assignment to dense matrices****************************************************
614  template< typename MT2 // Type of the target dense matrix
615  , bool SO2 > // Storage order of the target dense matrix
616  friend inline typename EnableIf< UseAssign<MT2> >::Type
617  subAssign( DenseMatrix<MT2,SO2>& lhs, const SMatScalarMultExpr& rhs )
618  {
620 
623 
624  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
625  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
626 
627  const ResultType tmp( serial( rhs ) );
628  subAssign( ~lhs, tmp );
629  }
631  //**********************************************************************************************
632 
633  //**Subtraction assignment to sparse matrices***************************************************
634  // No special implementation for the subtraction assignment to sparse matrices.
635  //**********************************************************************************************
636 
637  //**Multiplication assignment to dense matrices*************************************************
638  // No special implementation for the multiplication assignment to dense matrices.
639  //**********************************************************************************************
640 
641  //**Multiplication assignment to sparse matrices************************************************
642  // No special implementation for the multiplication assignment to sparse matrices.
643  //**********************************************************************************************
644 
645  //**SMP assignment to dense matrices************************************************************
646  // No special implementation for the SMP assignment to dense matrices.
647  //**********************************************************************************************
648 
649  //**SMP assignment to sparse matrices***********************************************************
650  // No special implementation for the SMP assignment to sparse matrices.
651  //**********************************************************************************************
652 
653  //**SMP addition assignment to dense matrices***************************************************
667  template< typename MT2 // Type of the target dense matrix
668  , bool SO2 > // Storage order of the target dense matrix
669  friend inline typename EnableIf< UseSMPAssign<MT2> >::Type
670  smpAddAssign( DenseMatrix<MT2,SO2>& lhs, const SMatScalarMultExpr& rhs )
671  {
673 
676 
677  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
678  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
679 
680  const ResultType tmp( rhs );
681  smpAddAssign( ~lhs, tmp );
682  }
684  //**********************************************************************************************
685 
686  //**SMP addition assignment to sparse matrices**************************************************
687  // No special implementation for the SMP addition assignment to sparse matrices.
688  //**********************************************************************************************
689 
690  //**SMP subtraction assignment to dense matrices************************************************
704  template< typename MT2 // Type of the target dense matrix
705  , bool SO2 > // Storage order of the target dense matrix
706  friend inline typename EnableIf< UseSMPAssign<MT2> >::Type
707  smpSubAssign( DenseMatrix<MT2,SO2>& lhs, const SMatScalarMultExpr& rhs )
708  {
710 
713 
714  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
715  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
716 
717  const ResultType tmp( rhs );
718  smpSubAssign( ~lhs, tmp );
719  }
721  //**********************************************************************************************
722 
723  //**SMP subtraction assignment to sparse matrices***********************************************
724  // No special implementation for the SMP subtraction assignment to sparse matrices.
725  //**********************************************************************************************
726 
727  //**SMP multiplication assignment to dense matrices*********************************************
728  // No special implementation for the SMP multiplication assignment to dense matrices.
729  //**********************************************************************************************
730 
731  //**SMP multiplication assignment to sparse matrices********************************************
732  // No special implementation for the SMP multiplication assignment to sparse matrices.
733  //**********************************************************************************************
734 
735  //**Compile time checks*************************************************************************
740  BLAZE_CONSTRAINT_MUST_BE_SAME_TYPE( ST, RightOperand );
742  //**********************************************************************************************
743 };
744 //*************************************************************************************************
745 
746 
747 
748 
749 //=================================================================================================
750 //
751 // GLOBAL UNARY ARITHMETIC OPERATORS
752 //
753 //=================================================================================================
754 
755 //*************************************************************************************************
772 template< typename MT // Data type of the sparse matrix
773  , bool SO > // Storage order
774 inline const SMatScalarMultExpr<MT,typename BaseElementType<MT>::Type,SO>
776 {
778 
779  typedef typename BaseElementType<MT>::Type ElementType;
781 }
782 //*************************************************************************************************
783 
784 
785 
786 
787 //=================================================================================================
788 //
789 // GLOBAL BINARY ARITHMETIC OPERATORS
790 //
791 //=================================================================================================
792 
793 //*************************************************************************************************
814 template< typename T1 // Type of the left-hand side sparse matrix
815  , bool SO // Storage order of the left-hand side sparse matrix
816  , typename T2 > // Type of the right-hand side scalar
817 inline const typename EnableIf< IsNumeric<T2>, typename MultExprTrait<T1,T2>::Type >::Type
818  operator*( const SparseMatrix<T1,SO>& mat, T2 scalar )
819 {
821 
822  typedef typename MultExprTrait<T1,T2>::Type Type;
823  return Type( ~mat, scalar );
824 }
825 //*************************************************************************************************
826 
827 
828 //*************************************************************************************************
849 template< typename T1 // Type of the left-hand side scalar
850  , typename T2 // Type of the right-hand side sparse matrix
851  , bool SO > // Storage order of the right-hand side sparse matrix
852 inline const typename EnableIf< IsNumeric<T1>, typename MultExprTrait<T1,T2>::Type >::Type
853  operator*( T1 scalar, const SparseMatrix<T2,SO>& mat )
854 {
856 
857  typedef typename MultExprTrait<T1,T2>::Type Type;
858  return Type( ~mat, scalar );
859 }
860 //*************************************************************************************************
861 
862 
863 
864 
865 //=================================================================================================
866 //
867 // GLOBAL RESTRUCTURING UNARY ARITHMETIC OPERATORS
868 //
869 //=================================================================================================
870 
871 //*************************************************************************************************
883 template< typename VT // Type of the sparse matrix
884  , typename ST // Type of the scalar
885  , bool TF > // Transpose flag
886 inline const SMatScalarMultExpr<VT,ST,TF>
887  operator-( const SMatScalarMultExpr<VT,ST,TF>& sm )
888 {
890 
891  return SMatScalarMultExpr<VT,ST,TF>( sm.leftOperand(), -sm.rightOperand() );
892 }
894 //*************************************************************************************************
895 
896 
897 
898 
899 //=================================================================================================
900 //
901 // GLOBAL RESTRUCTURING BINARY ARITHMETIC OPERATORS
902 //
903 //=================================================================================================
904 
905 //*************************************************************************************************
918 template< typename MT // Type of the sparse matrix
919  , typename ST1 // Type of the first scalar
920  , bool SO // Storage order of the sparse matrix
921  , typename ST2 > // Type of the second scalar
922 inline const typename EnableIf< IsNumeric<ST2>
923  , typename MultExprTrait< SMatScalarMultExpr<MT,ST1,SO>, ST2 >::Type >::Type
924  operator*( const SMatScalarMultExpr<MT,ST1,SO>& mat, ST2 scalar )
925 {
927 
928  return mat.leftOperand() * ( mat.rightOperand() * scalar );
929 }
931 //*************************************************************************************************
932 
933 
934 //*************************************************************************************************
947 template< typename ST1 // Type of the first scalar
948  , typename MT // Type of the sparse matrix
949  , typename ST2 // Type of the second scalar
950  , bool SO > // Storage order of the sparse matrix
951 inline const typename EnableIf< IsNumeric<ST1>
952  , typename MultExprTrait< ST1, SMatScalarMultExpr<MT,ST2,SO> >::Type >::Type
953  operator*( ST1 scalar, const SMatScalarMultExpr<MT,ST2,SO>& mat )
954 {
956 
957  return mat.leftOperand() * ( scalar * mat.rightOperand() );
958 }
960 //*************************************************************************************************
961 
962 
963 //*************************************************************************************************
976 template< typename MT // Type of the sparse matrix
977  , typename ST1 // Type of the first scalar
978  , bool SO // Storage order of the sparse matrix
979  , typename ST2 > // Type of the second scalar
980 inline const typename EnableIf< IsFloatingPoint<typename DivTrait<ST1,ST2>::Type>
981  , typename DivExprTrait< SMatScalarMultExpr<MT,ST1,SO>, ST2 >::Type >::Type
982  operator/( const SMatScalarMultExpr<MT,ST1,SO>& mat, ST2 scalar )
983 {
985 
986  return mat.leftOperand() * ( mat.rightOperand() / scalar );
987 }
989 //*************************************************************************************************
990 
991 
992 //*************************************************************************************************
1006 template< typename MT // Type of the sparse matrix of the left-hand side expression
1007  , typename ST // Type of the scalar of the left-hand side expression
1008  , bool SO // Storage order of the left-hand side expression
1009  , typename VT > // Type of the right-hand side dense vector
1010 inline const typename MultExprTrait< SMatScalarMultExpr<MT,ST,SO>, VT >::Type
1011  operator*( const SMatScalarMultExpr<MT,ST,SO>& mat, const DenseVector<VT,false>& vec )
1012 {
1014 
1015  return ( mat.leftOperand() * (~vec) ) * mat.rightOperand();
1016 }
1018 //*************************************************************************************************
1019 
1020 
1021 //*************************************************************************************************
1035 template< typename VT // Type of the left-hand side dense vector
1036  , typename MT // Type of the sparse matrix of the right-hand side expression
1037  , typename ST // Type of the scalar of the right-hand side expression
1038  , bool SO > // Storage order of the right-hand side expression
1039 inline const typename MultExprTrait< VT, SMatScalarMultExpr<MT,ST,SO> >::Type
1040  operator*( const DenseVector<VT,true>& vec, const SMatScalarMultExpr<MT,ST,SO>& mat )
1041 {
1043 
1044  return ( (~vec) * mat.leftOperand() ) * mat.rightOperand();
1045 }
1047 //*************************************************************************************************
1048 
1049 
1050 //*************************************************************************************************
1066 template< typename MT // Type of the sparse matrix of the left-hand side expression
1067  , typename ST1 // Type of the scalar of the left-hand side expression
1068  , bool SO // Storage order of the left-hand side expression
1069  , typename VT // Type of the dense vector of the right-hand side expression
1070  , typename ST2 > // Type of the scalar of the right-hand side expression
1071 inline const typename MultExprTrait< SMatScalarMultExpr<MT,ST1,SO>, DVecScalarMultExpr<VT,ST2,false> >::Type
1072  operator*( const SMatScalarMultExpr<MT,ST1,SO>& mat, const DVecScalarMultExpr<VT,ST2,false>& vec )
1073 {
1075 
1076  return ( mat.leftOperand() * vec.leftOperand() ) * ( mat.rightOperand() * vec.rightOperand() );
1077 }
1079 //*************************************************************************************************
1080 
1081 
1082 //*************************************************************************************************
1098 template< typename VT // Type of the dense vector of the left-hand side expression
1099  , typename ST1 // Type of the scalar of the left-hand side expression
1100  , typename MT // Type of the sparse matrix of the right-hand side expression
1101  , typename ST2 // Type of the scalar of the right-hand side expression
1102  , bool SO > // Storage order of the right-hand side expression
1103 inline const typename MultExprTrait< DVecScalarMultExpr<VT,ST1,true>, SMatScalarMultExpr<MT,ST2,SO> >::Type
1104  operator*( const DVecScalarMultExpr<VT,ST1,true>& vec, const SMatScalarMultExpr<MT,ST2,SO>& mat )
1105 {
1107 
1108  return ( vec.leftOperand() * mat.leftOperand() ) * ( vec.rightOperand() * mat.rightOperand() );
1109 }
1111 //*************************************************************************************************
1112 
1113 
1114 //*************************************************************************************************
1128 template< typename MT // Type of the sparse matrix of the left-hand side expression
1129  , typename ST // Type of the scalar of the left-hand side expression
1130  , bool SO // Storage order of the left-hand side expression
1131  , typename VT > // Type of the right-hand side sparse vector
1132 inline const typename MultExprTrait< SMatScalarMultExpr<MT,ST,SO>, VT >::Type
1133  operator*( const SMatScalarMultExpr<MT,ST,SO>& mat, const SparseVector<VT,false>& vec )
1134 {
1136 
1137  return ( mat.leftOperand() * (~vec) ) * mat.rightOperand();
1138 }
1140 //*************************************************************************************************
1141 
1142 
1143 //*************************************************************************************************
1157 template< typename VT // Type of the left-hand side sparse vector
1158  , typename MT // Type of the sparse matrix of the right-hand side expression
1159  , typename ST // Type of the scalar of the right-hand side expression
1160  , bool SO > // Storage order of the right-hand side expression
1161 inline const typename MultExprTrait< VT, SMatScalarMultExpr<MT,ST,SO> >::Type
1162  operator*( const SparseVector<VT,true>& vec, const SMatScalarMultExpr<MT,ST,SO>& mat )
1163 {
1165 
1166  return ( (~vec) * mat.leftOperand() ) * mat.rightOperand();
1167 }
1169 //*************************************************************************************************
1170 
1171 
1172 //*************************************************************************************************
1188 template< typename MT // Type of the sparse matrix of the left-hand side expression
1189  , typename ST1 // Type of the scalar of the left-hand side expression
1190  , bool SO // Storage order of the left-hand side expression
1191  , typename VT // Type of the sparse vector of the right-hand side expression
1192  , typename ST2 > // Type of the scalar of the right-hand side expression
1193 inline const typename MultExprTrait< SMatScalarMultExpr<MT,ST1,SO>, SVecScalarMultExpr<VT,ST2,false> >::Type
1194  operator*( const SMatScalarMultExpr<MT,ST1,SO>& mat, const SVecScalarMultExpr<VT,ST2,false>& vec )
1195 {
1197 
1198  return ( mat.leftOperand() * vec.leftOperand() ) * ( mat.rightOperand() * vec.rightOperand() );
1199 }
1201 //*************************************************************************************************
1202 
1203 
1204 //*************************************************************************************************
1220 template< typename VT // Type of the sparse vector of the left-hand side expression
1221  , typename ST1 // Type of the scalar of the left-hand side expression
1222  , typename MT // Type of the sparse matrix of the right-hand side expression
1223  , typename ST2 // Type of the scalar of the right-hand side expression
1224  , bool SO > // Storage order of the right-hand side expression
1225 inline const typename MultExprTrait< SVecScalarMultExpr<VT,ST1,true>, SMatScalarMultExpr<MT,ST2,SO> >::Type
1226  operator*( const SVecScalarMultExpr<VT,ST1,true>& vec, const SMatScalarMultExpr<MT,ST2,SO>& mat )
1227 {
1229 
1230  return ( vec.leftOperand() * mat.leftOperand() ) * ( vec.rightOperand() * mat.rightOperand() );
1231 }
1233 //*************************************************************************************************
1234 
1235 
1236 //*************************************************************************************************
1250 template< typename MT1 // Type of the sparse matrix of the left-hand side expression
1251  , typename ST // Type of the scalar of the left-hand side expression
1252  , bool SO1 // Storage order of the left-hand side expression
1253  , typename MT2 // Type of the right-hand side dense matrix
1254  , bool SO2 > // Storage order of the right-hand side dense matrix
1255 inline const typename MultExprTrait< SMatScalarMultExpr<MT1,ST,SO1>, MT2 >::Type
1256  operator*( const SMatScalarMultExpr<MT1,ST,SO1>& lhs, const DenseMatrix<MT2,SO2>& rhs )
1257 {
1259 
1260  return ( lhs.leftOperand() * (~rhs) ) * lhs.rightOperand();
1261 }
1263 //*************************************************************************************************
1264 
1265 
1266 //*************************************************************************************************
1280 template< typename MT1 // Type of the left-hand side dense matrix
1281  , bool SO1 // Storage order of the left-hand side dense matrix
1282  , typename MT2 // Type of the sparse matrix of the right-hand side expression
1283  , typename ST // Type of the scalar of the right-hand side expression
1284  , bool SO2 > // Storage order of the right-hand side expression
1285 inline const typename MultExprTrait< MT1, SMatScalarMultExpr<MT2,ST,SO2> >::Type
1286  operator*( const DenseMatrix<MT1,SO1>& lhs, const SMatScalarMultExpr<MT2,ST,SO2>& rhs )
1287 {
1289 
1290  return ( (~lhs) * rhs.leftOperand() ) * rhs.rightOperand();
1291 }
1293 //*************************************************************************************************
1294 
1295 
1296 //*************************************************************************************************
1310 template< typename MT1 // Type of the sparse matrix of the left-hand side expression
1311  , typename ST // Type of the scalar of the left-hand side expression
1312  , bool SO1 // Storage order of the left-hand side expression
1313  , typename MT2 // Type of the right-hand side sparse matrix
1314  , bool SO2 > // Storage order of the right-hand side sparse matrix
1315 inline const typename MultExprTrait< SMatScalarMultExpr<MT1,ST,SO1>, MT2 >::Type
1316  operator*( const SMatScalarMultExpr<MT1,ST,SO1>& lhs, const SparseMatrix<MT2,SO2>& rhs )
1317 {
1319 
1320  return ( lhs.leftOperand() * (~rhs) ) * lhs.rightOperand();
1321 }
1323 //*************************************************************************************************
1324 
1325 
1326 //*************************************************************************************************
1340 template< typename MT1 // Type of the left-hand side sparse matrix
1341  , bool SO1 // Storage order of the left-hand side sparse matrix
1342  , typename MT2 // Type of the sparse matrix of the right-hand side expression
1343  , typename ST // Type of the scalar of the right-hand side expression
1344  , bool SO2 > // Storage order of the right-hand side expression
1345 inline const typename MultExprTrait< MT1, SMatScalarMultExpr<MT2,ST,SO2> >::Type
1346  operator*( const SparseMatrix<MT1,SO1>& lhs, const SMatScalarMultExpr<MT2,ST,SO2>& rhs )
1347 {
1349 
1350  return ( (~lhs) * rhs.leftOperand() ) * rhs.rightOperand();
1351 }
1353 //*************************************************************************************************
1354 
1355 
1356 //*************************************************************************************************
1370 template< typename MT1 // Type of the sparse matrix of the left-hand side expression
1371  , typename ST1 // Type of the scalar of the left-hand side expression
1372  , bool SO1 // Storage order of the left-hand side expression
1373  , typename MT2 // Type of the right-hand side sparse matrix
1374  , typename ST2 // Type of the scalar of the right-hand side expression
1375  , bool SO2 > // Storage order of the right-hand side expression
1376 inline const typename MultExprTrait< SMatScalarMultExpr<MT1,ST1,SO1>, SMatScalarMultExpr<MT2,ST2,SO2> >::Type
1377  operator*( const SMatScalarMultExpr<MT1,ST1,SO1>& lhs, const SMatScalarMultExpr<MT2,ST2,SO2>& rhs )
1378 {
1380 
1381  return ( lhs.leftOperand() * rhs.leftOperand() ) * ( lhs.rightOperand() * rhs.rightOperand() );
1382 }
1384 //*************************************************************************************************
1385 
1386 
1387 
1388 
1389 //=================================================================================================
1390 //
1391 // ROWS SPECIALIZATIONS
1392 //
1393 //=================================================================================================
1394 
1395 //*************************************************************************************************
1397 template< typename MT, typename ST, bool SO >
1398 struct Rows< SMatScalarMultExpr<MT,ST,SO> > : public Columns<MT>
1399 {};
1401 //*************************************************************************************************
1402 
1403 
1404 
1405 
1406 //=================================================================================================
1407 //
1408 // COLUMNS SPECIALIZATIONS
1409 //
1410 //=================================================================================================
1411 
1412 //*************************************************************************************************
1414 template< typename MT, typename ST, bool SO >
1415 struct Columns< SMatScalarMultExpr<MT,ST,SO> > : public Rows<MT>
1416 {};
1418 //*************************************************************************************************
1419 
1420 
1421 
1422 
1423 //=================================================================================================
1424 //
1425 // ISSYMMETRIC SPECIALIZATIONS
1426 //
1427 //=================================================================================================
1428 
1429 //*************************************************************************************************
1431 template< typename MT, typename ST, bool SO >
1432 struct IsSymmetric< SMatScalarMultExpr<MT,ST,SO> > : public IsTrue< IsSymmetric<MT>::value >
1433 {};
1435 //*************************************************************************************************
1436 
1437 
1438 
1439 
1440 //=================================================================================================
1441 //
1442 // ISLOWER SPECIALIZATIONS
1443 //
1444 //=================================================================================================
1445 
1446 //*************************************************************************************************
1448 template< typename MT, typename ST, bool SO >
1449 struct IsLower< SMatScalarMultExpr<MT,ST,SO> > : public IsTrue< IsLower<MT>::value >
1450 {};
1452 //*************************************************************************************************
1453 
1454 
1455 
1456 
1457 //=================================================================================================
1458 //
1459 // ISSTRICTLYLOWER SPECIALIZATIONS
1460 //
1461 //=================================================================================================
1462 
1463 //*************************************************************************************************
1465 template< typename MT, typename ST, bool SO >
1466 struct IsStrictlyLower< SMatScalarMultExpr<MT,ST,SO> > : public IsTrue< IsStrictlyLower<MT>::value >
1467 {};
1469 //*************************************************************************************************
1470 
1471 
1472 
1473 
1474 //=================================================================================================
1475 //
1476 // ISUPPER SPECIALIZATIONS
1477 //
1478 //=================================================================================================
1479 
1480 //*************************************************************************************************
1482 template< typename MT, typename ST, bool SO >
1483 struct IsUpper< SMatScalarMultExpr<MT,ST,SO> > : public IsTrue< IsUpper<MT>::value >
1484 {};
1486 //*************************************************************************************************
1487 
1488 
1489 
1490 
1491 //=================================================================================================
1492 //
1493 // ISSTRICTLYUPPER SPECIALIZATIONS
1494 //
1495 //=================================================================================================
1496 
1497 //*************************************************************************************************
1499 template< typename MT, typename ST, bool SO >
1500 struct IsStrictlyUpper< SMatScalarMultExpr<MT,ST,SO> > : public IsTrue< IsStrictlyUpper<MT>::value >
1501 {};
1503 //*************************************************************************************************
1504 
1505 
1506 
1507 
1508 //=================================================================================================
1509 //
1510 // SMATSCALARMULTEXPRTRAIT SPECIALIZATIONS
1511 //
1512 //=================================================================================================
1513 
1514 //*************************************************************************************************
1516 template< typename MT, typename ST1, typename ST2 >
1517 struct SMatScalarMultExprTrait< SMatScalarMultExpr<MT,ST1,false>, ST2 >
1518 {
1519  public:
1520  //**********************************************************************************************
1521  typedef typename SelectType< IsSparseMatrix<MT>::value && IsRowMajorMatrix<MT>::value &&
1522  IsNumeric<ST1>::value && IsNumeric<ST2>::value
1523  , typename SMatScalarMultExprTrait<MT,typename MultTrait<ST1,ST2>::Type>::Type
1524  , INVALID_TYPE >::Type Type;
1525  //**********************************************************************************************
1526 };
1528 //*************************************************************************************************
1529 
1530 
1531 
1532 
1533 //=================================================================================================
1534 //
1535 // TSMATSCALARMULTEXPRTRAIT SPECIALIZATIONS
1536 //
1537 //=================================================================================================
1538 
1539 //*************************************************************************************************
1541 template< typename MT, typename ST1, typename ST2 >
1542 struct TSMatScalarMultExprTrait< SMatScalarMultExpr<MT,ST1,true>, ST2 >
1543 {
1544  public:
1545  //**********************************************************************************************
1546  typedef typename SelectType< IsSparseMatrix<MT>::value && IsColumnMajorMatrix<MT>::value &&
1547  IsNumeric<ST1>::value && IsNumeric<ST2>::value
1548  , typename TSMatScalarMultExprTrait<MT,typename MultTrait<ST1,ST2>::Type>::Type
1549  , INVALID_TYPE >::Type Type;
1550  //**********************************************************************************************
1551 };
1553 //*************************************************************************************************
1554 
1555 
1556 
1557 
1558 //=================================================================================================
1559 //
1560 // SMATSCALARDIVEXPRTRAIT SPECIALIZATIONS
1561 //
1562 //=================================================================================================
1563 
1564 //*************************************************************************************************
1566 template< typename MT, typename ST1, typename ST2 >
1567 struct SMatScalarDivExprTrait< SMatScalarMultExpr<MT,ST1,false>, ST2 >
1568 {
1569  private:
1570  //**********************************************************************************************
1571  enum { condition = IsFloatingPoint<typename DivTrait<ST1,ST2>::Type>::value };
1572  //**********************************************************************************************
1573 
1574  //**********************************************************************************************
1575  typedef typename SMatScalarMultExprTrait<MT,typename DivTrait<ST1,ST2>::Type>::Type T1;
1576  typedef typename SMatScalarDivExprTrait<MT,typename DivTrait<ST1,ST2>::Type>::Type T2;
1577  //**********************************************************************************************
1578 
1579  public:
1580  //**********************************************************************************************
1581  typedef typename SelectType< IsSparseMatrix<MT>::value && IsRowMajorMatrix<MT>::value &&
1582  IsNumeric<ST1>::value && IsNumeric<ST2>::value
1583  , typename SelectType<condition,T1,T2>::Type
1584  , INVALID_TYPE >::Type Type;
1585  //**********************************************************************************************
1586 };
1588 //*************************************************************************************************
1589 
1590 
1591 
1592 
1593 //=================================================================================================
1594 //
1595 // TSMATSCALARDIVEXPRTRAIT SPECIALIZATIONS
1596 //
1597 //=================================================================================================
1598 
1599 //*************************************************************************************************
1601 template< typename MT, typename ST1, typename ST2 >
1602 struct TSMatScalarDivExprTrait< SMatScalarMultExpr<MT,ST1,true>, ST2 >
1603 {
1604  private:
1605  //**********************************************************************************************
1606  enum { condition = IsFloatingPoint<typename DivTrait<ST1,ST2>::Type>::value };
1607  //**********************************************************************************************
1608 
1609  //**********************************************************************************************
1610  typedef typename TSMatScalarMultExprTrait<MT,typename DivTrait<ST1,ST2>::Type>::Type T1;
1611  typedef typename TSMatScalarDivExprTrait<MT,typename DivTrait<ST1,ST2>::Type>::Type T2;
1612  //**********************************************************************************************
1613 
1614  public:
1615  //**********************************************************************************************
1616  typedef typename SelectType< IsSparseMatrix<MT>::value && IsColumnMajorMatrix<MT>::value &&
1617  IsNumeric<ST1>::value && IsNumeric<ST2>::value
1618  , typename SelectType<condition,T1,T2>::Type
1619  , INVALID_TYPE >::Type Type;
1620  //**********************************************************************************************
1621 };
1623 //*************************************************************************************************
1624 
1625 
1626 
1627 
1628 //=================================================================================================
1629 //
1630 // SMATDVECMULTEXPRTRAIT SPECIALIZATIONS
1631 //
1632 //=================================================================================================
1633 
1634 //*************************************************************************************************
1636 template< typename MT, typename ST, typename VT >
1637 struct SMatDVecMultExprTrait< SMatScalarMultExpr<MT,ST,false>, VT >
1638 {
1639  public:
1640  //**********************************************************************************************
1641  typedef typename SelectType< IsSparseMatrix<MT>::value && IsRowMajorMatrix<MT>::value &&
1642  IsDenseVector<VT>::value && IsColumnVector<VT>::value &&
1643  IsNumeric<ST>::value
1644  , typename DVecScalarMultExprTrait<typename SMatDVecMultExprTrait<MT,VT>::Type,ST>::Type
1645  , INVALID_TYPE >::Type Type;
1646  //**********************************************************************************************
1647 };
1649 //*************************************************************************************************
1650 
1651 
1652 //*************************************************************************************************
1654 template< typename MT, typename ST1, typename VT, typename ST2 >
1655 struct SMatDVecMultExprTrait< SMatScalarMultExpr<MT,ST1,false>, DVecScalarMultExpr<VT,ST2,false> >
1656 {
1657  public:
1658  //**********************************************************************************************
1659  typedef typename SelectType< IsSparseMatrix<MT>::value && IsRowMajorMatrix<MT>::value &&
1660  IsDenseVector<VT>::value && IsColumnVector<VT>::value &&
1661  IsNumeric<ST1>::value && IsNumeric<ST2>::value
1662  , typename DVecScalarMultExprTrait<typename SMatDVecMultExprTrait<MT,VT>::Type,typename MultTrait<ST1,ST2>::Type>::Type
1663  , INVALID_TYPE >::Type Type;
1664  //**********************************************************************************************
1665 };
1667 //*************************************************************************************************
1668 
1669 
1670 
1671 
1672 //=================================================================================================
1673 //
1674 // TSMATDVECMULTEXPRTRAIT SPECIALIZATIONS
1675 //
1676 //=================================================================================================
1677 
1678 //*************************************************************************************************
1680 template< typename MT, typename ST, typename VT >
1681 struct TSMatDVecMultExprTrait< SMatScalarMultExpr<MT,ST,true>, VT >
1682 {
1683  public:
1684  //**********************************************************************************************
1685  typedef typename SelectType< IsSparseMatrix<MT>::value && IsColumnMajorMatrix<MT>::value &&
1686  IsDenseVector<VT>::value && IsColumnVector<VT>::value &&
1687  IsNumeric<ST>::value
1688  , typename DVecScalarMultExprTrait<typename TSMatDVecMultExprTrait<MT,VT>::Type,ST>::Type
1689  , INVALID_TYPE >::Type Type;
1690  //**********************************************************************************************
1691 };
1693 //*************************************************************************************************
1694 
1695 
1696 //*************************************************************************************************
1698 template< typename MT, typename ST1, typename VT, typename ST2 >
1699 struct TSMatDVecMultExprTrait< SMatScalarMultExpr<MT,ST1,true>, DVecScalarMultExpr<VT,ST2,false> >
1700 {
1701  public:
1702  //**********************************************************************************************
1703  typedef typename SelectType< IsSparseMatrix<MT>::value && IsColumnMajorMatrix<MT>::value &&
1704  IsDenseVector<VT>::value && IsColumnVector<VT>::value &&
1705  IsNumeric<ST1>::value && IsNumeric<ST2>::value
1706  , typename DVecScalarMultExprTrait<typename TSMatDVecMultExprTrait<MT,VT>::Type,typename MultTrait<ST1,ST2>::Type>::Type
1707  , INVALID_TYPE >::Type Type;
1708  //**********************************************************************************************
1709 };
1711 //*************************************************************************************************
1712 
1713 
1714 
1715 
1716 //=================================================================================================
1717 //
1718 // TDVECSMATMULTEXPRTRAIT SPECIALIZATIONS
1719 //
1720 //=================================================================================================
1721 
1722 //*************************************************************************************************
1724 template< typename VT, typename MT, typename ST >
1725 struct TDVecSMatMultExprTrait< VT, SMatScalarMultExpr<MT,ST,false> >
1726 {
1727  public:
1728  //**********************************************************************************************
1729  typedef typename SelectType< IsDenseVector<VT>::value && IsRowVector<VT>::value &&
1730  IsSparseMatrix<MT>::value && IsRowMajorMatrix<MT>::value &&
1731  IsNumeric<ST>::value
1732  , typename TDVecScalarMultExprTrait<typename TDVecSMatMultExprTrait<VT,MT>::Type,ST>::Type
1733  , INVALID_TYPE >::Type Type;
1734  //**********************************************************************************************
1735 };
1737 //*************************************************************************************************
1738 
1739 
1740 //*************************************************************************************************
1742 template< typename VT, typename ST1, typename MT, typename ST2 >
1743 struct TDVecSMatMultExprTrait< DVecScalarMultExpr<VT,ST1,true>, SMatScalarMultExpr<MT,ST2,false> >
1744 {
1745  public:
1746  //**********************************************************************************************
1747  typedef typename SelectType< IsDenseVector<VT>::value && IsRowVector<VT>::value &&
1748  IsSparseMatrix<MT>::value && IsRowMajorMatrix<MT>::value &&
1749  IsNumeric<ST1>::value && IsNumeric<ST2>::value
1750  , typename TDVecScalarMultExprTrait<typename TDVecSMatMultExprTrait<VT,MT>::Type,typename MultTrait<ST1,ST2>::Type>::Type
1751  , INVALID_TYPE >::Type Type;
1752  //**********************************************************************************************
1753 };
1755 //*************************************************************************************************
1756 
1757 
1758 
1759 
1760 //=================================================================================================
1761 //
1762 // TDVECTSMATMULTEXPRTRAIT SPECIALIZATIONS
1763 //
1764 //=================================================================================================
1765 
1766 //*************************************************************************************************
1768 template< typename VT, typename MT, typename ST >
1769 struct TDVecTSMatMultExprTrait< VT, SMatScalarMultExpr<MT,ST,true> >
1770 {
1771  public:
1772  //**********************************************************************************************
1773  typedef typename SelectType< IsDenseVector<VT>::value && IsRowVector<VT>::value &&
1774  IsSparseMatrix<MT>::value && IsColumnMajorMatrix<MT>::value &&
1775  IsNumeric<ST>::value
1776  , typename TDVecScalarMultExprTrait<typename TDVecTSMatMultExprTrait<VT,MT>::Type,ST>::Type
1777  , INVALID_TYPE >::Type Type;
1778  //**********************************************************************************************
1779 };
1781 //*************************************************************************************************
1782 
1783 
1784 //*************************************************************************************************
1786 template< typename VT, typename ST1, typename MT, typename ST2 >
1787 struct TDVecTSMatMultExprTrait< DVecScalarMultExpr<VT,ST1,true>, SMatScalarMultExpr<MT,ST2,true> >
1788 {
1789  public:
1790  //**********************************************************************************************
1791  typedef typename SelectType< IsDenseVector<VT>::value && IsRowVector<VT>::value &&
1792  IsSparseMatrix<MT>::value && IsColumnMajorMatrix<MT>::value &&
1793  IsNumeric<ST1>::value && IsNumeric<ST2>::value
1794  , typename TDVecScalarMultExprTrait<typename TDVecTSMatMultExprTrait<VT,MT>::Type,typename MultTrait<ST1,ST2>::Type>::Type
1795  , INVALID_TYPE >::Type Type;
1796  //**********************************************************************************************
1797 };
1799 //*************************************************************************************************
1800 
1801 
1802 
1803 
1804 //=================================================================================================
1805 //
1806 // SMATSVECMULTEXPRTRAIT SPECIALIZATIONS
1807 //
1808 //=================================================================================================
1809 
1810 //*************************************************************************************************
1812 template< typename MT, typename ST, typename VT >
1813 struct SMatSVecMultExprTrait< SMatScalarMultExpr<MT,ST,false>, VT >
1814 {
1815  public:
1816  //**********************************************************************************************
1817  typedef typename SelectType< IsSparseMatrix<MT>::value && IsRowMajorMatrix<MT>::value &&
1818  IsSparseVector<VT>::value && IsColumnVector<VT>::value &&
1819  IsNumeric<ST>::value
1820  , typename SVecScalarMultExprTrait<typename SMatSVecMultExprTrait<MT,VT>::Type,ST>::Type
1821  , INVALID_TYPE >::Type Type;
1822  //**********************************************************************************************
1823 };
1825 //*************************************************************************************************
1826 
1827 
1828 //*************************************************************************************************
1830 template< typename MT, typename ST1, typename VT, typename ST2 >
1831 struct SMatSVecMultExprTrait< SMatScalarMultExpr<MT,ST1,false>, SVecScalarMultExpr<VT,ST2,false> >
1832 {
1833  public:
1834  //**********************************************************************************************
1835  typedef typename SelectType< IsSparseMatrix<MT>::value && IsRowMajorMatrix<MT>::value &&
1836  IsSparseVector<VT>::value && IsColumnVector<VT>::value &&
1837  IsNumeric<ST1>::value && IsNumeric<ST2>::value
1838  , typename SVecScalarMultExprTrait<typename SMatSVecMultExprTrait<MT,VT>::Type,typename MultTrait<ST1,ST2>::Type>::Type
1839  , INVALID_TYPE >::Type Type;
1840  //**********************************************************************************************
1841 };
1843 //*************************************************************************************************
1844 
1845 
1846 
1847 
1848 //=================================================================================================
1849 //
1850 // TSMATSVECMULTEXPRTRAIT SPECIALIZATIONS
1851 //
1852 //=================================================================================================
1853 
1854 //*************************************************************************************************
1856 template< typename MT, typename ST, typename VT >
1857 struct TSMatSVecMultExprTrait< SMatScalarMultExpr<MT,ST,true>, VT >
1858 {
1859  public:
1860  //**********************************************************************************************
1861  typedef typename SelectType< IsSparseMatrix<MT>::value && IsColumnMajorMatrix<MT>::value &&
1862  IsSparseVector<VT>::value && IsColumnVector<VT>::value &&
1863  IsNumeric<ST>::value
1864  , typename SVecScalarMultExprTrait<typename TSMatSVecMultExprTrait<MT,VT>::Type,ST>::Type
1865  , INVALID_TYPE >::Type Type;
1866  //**********************************************************************************************
1867 };
1869 //*************************************************************************************************
1870 
1871 
1872 //*************************************************************************************************
1874 template< typename MT, typename ST1, typename VT, typename ST2 >
1875 struct TSMatSVecMultExprTrait< SMatScalarMultExpr<MT,ST1,true>, SVecScalarMultExpr<VT,ST2,false> >
1876 {
1877  public:
1878  //**********************************************************************************************
1879  typedef typename SelectType< IsSparseMatrix<MT>::value && IsColumnMajorMatrix<MT>::value &&
1880  IsSparseVector<VT>::value && IsColumnVector<VT>::value &&
1881  IsNumeric<ST1>::value && IsNumeric<ST2>::value
1882  , typename SVecScalarMultExprTrait<typename TSMatSVecMultExprTrait<MT,VT>::Type,typename MultTrait<ST1,ST2>::Type>::Type
1883  , INVALID_TYPE >::Type Type;
1884  //**********************************************************************************************
1885 };
1887 //*************************************************************************************************
1888 
1889 
1890 
1891 
1892 //=================================================================================================
1893 //
1894 // TSVECSMATMULTEXPRTRAIT SPECIALIZATIONS
1895 //
1896 //=================================================================================================
1897 
1898 //*************************************************************************************************
1900 template< typename VT, typename MT, typename ST >
1901 struct TSVecSMatMultExprTrait< VT, SMatScalarMultExpr<MT,ST,false> >
1902 {
1903  public:
1904  //**********************************************************************************************
1905  typedef typename SelectType< IsSparseVector<VT>::value && IsRowVector<VT>::value &&
1906  IsSparseMatrix<MT>::value && IsRowMajorMatrix<MT>::value &&
1907  IsNumeric<ST>::value
1908  , typename TSVecScalarMultExprTrait<typename TSVecSMatMultExprTrait<VT,MT>::Type,ST>::Type
1909  , INVALID_TYPE >::Type Type;
1910  //**********************************************************************************************
1911 };
1913 //*************************************************************************************************
1914 
1915 
1916 //*************************************************************************************************
1918 template< typename VT, typename ST1, typename MT, typename ST2 >
1919 struct TSVecSMatMultExprTrait< SVecScalarMultExpr<VT,ST1,true>, SMatScalarMultExpr<MT,ST2,false> >
1920 {
1921  public:
1922  //**********************************************************************************************
1923  typedef typename SelectType< IsSparseVector<VT>::value && IsRowVector<VT>::value &&
1924  IsSparseMatrix<MT>::value && IsRowMajorMatrix<MT>::value &&
1925  IsNumeric<ST1>::value && IsNumeric<ST2>::value
1926  , typename TSVecScalarMultExprTrait<typename TSVecSMatMultExprTrait<VT,MT>::Type,typename MultTrait<ST1,ST2>::Type>::Type
1927  , INVALID_TYPE >::Type Type;
1928  //**********************************************************************************************
1929 };
1931 //*************************************************************************************************
1932 
1933 
1934 
1935 
1936 //=================================================================================================
1937 //
1938 // TSVECTSMATMULTEXPRTRAIT SPECIALIZATIONS
1939 //
1940 //=================================================================================================
1941 
1942 //*************************************************************************************************
1944 template< typename VT, typename MT, typename ST >
1945 struct TSVecTSMatMultExprTrait< VT, SMatScalarMultExpr<MT,ST,true> >
1946 {
1947  public:
1948  //**********************************************************************************************
1949  typedef typename SelectType< IsSparseVector<VT>::value && IsRowVector<VT>::value &&
1950  IsSparseMatrix<MT>::value && IsColumnMajorMatrix<MT>::value &&
1951  IsNumeric<ST>::value
1952  , typename TSVecScalarMultExprTrait<typename TSVecTSMatMultExprTrait<VT,MT>::Type,ST>::Type
1953  , INVALID_TYPE >::Type Type;
1954  //**********************************************************************************************
1955 };
1957 //*************************************************************************************************
1958 
1959 
1960 //*************************************************************************************************
1962 template< typename VT, typename ST1, typename MT, typename ST2 >
1963 struct TSVecTSMatMultExprTrait< SVecScalarMultExpr<VT,ST1,true>, SMatScalarMultExpr<MT,ST2,true> >
1964 {
1965  public:
1966  //**********************************************************************************************
1967  typedef typename SelectType< IsSparseVector<VT>::value && IsRowVector<VT>::value &&
1968  IsSparseMatrix<MT>::value && IsColumnMajorMatrix<MT>::value &&
1969  IsNumeric<ST1>::value && IsNumeric<ST2>::value
1970  , typename TSVecScalarMultExprTrait<typename TSVecTSMatMultExprTrait<VT,MT>::Type,typename MultTrait<ST1,ST2>::Type>::Type
1971  , INVALID_TYPE >::Type Type;
1972  //**********************************************************************************************
1973 };
1975 //*************************************************************************************************
1976 
1977 
1978 
1979 
1980 //=================================================================================================
1981 //
1982 // DMATSMATMULTEXPRTRAIT SPECIALIZATIONS
1983 //
1984 //=================================================================================================
1985 
1986 //*************************************************************************************************
1988 template< typename MT1, typename MT2, typename ST >
1989 struct DMatSMatMultExprTrait< MT1, SMatScalarMultExpr<MT2,ST,false> >
1990 {
1991  public:
1992  //**********************************************************************************************
1993  typedef typename SelectType< IsDenseMatrix<MT1>::value && IsRowMajorMatrix<MT1>::value &&
1994  IsSparseMatrix<MT2>::value && IsRowMajorMatrix<MT2>::value &&
1995  IsNumeric<ST>::value
1996  , typename DMatScalarMultExprTrait<typename DMatSMatMultExprTrait<MT1,MT2>::Type,ST>::Type
1997  , INVALID_TYPE >::Type Type;
1998  //**********************************************************************************************
1999 };
2001 //*************************************************************************************************
2002 
2003 
2004 
2005 
2006 //=================================================================================================
2007 //
2008 // DMATTSMATMULTEXPRTRAIT SPECIALIZATIONS
2009 //
2010 //=================================================================================================
2011 
2012 //*************************************************************************************************
2014 template< typename MT1, typename MT2, typename ST >
2015 struct DMatTSMatMultExprTrait< MT1, SMatScalarMultExpr<MT2,ST,true> >
2016 {
2017  public:
2018  //**********************************************************************************************
2019  typedef typename SelectType< IsDenseMatrix<MT1>::value && IsRowMajorMatrix<MT1>::value &&
2020  IsSparseMatrix<MT2>::value && IsColumnMajorMatrix<MT2>::value &&
2021  IsNumeric<ST>::value
2022  , typename DMatScalarMultExprTrait<typename DMatTSMatMultExprTrait<MT1,MT2>::Type,ST>::Type
2023  , INVALID_TYPE >::Type Type;
2024  //**********************************************************************************************
2025 };
2027 //*************************************************************************************************
2028 
2029 
2030 
2031 
2032 //=================================================================================================
2033 //
2034 // TDMATSMATMULTEXPRTRAIT SPECIALIZATIONS
2035 //
2036 //=================================================================================================
2037 
2038 //*************************************************************************************************
2040 template< typename MT1, typename MT2, typename ST >
2041 struct TDMatSMatMultExprTrait< MT1, SMatScalarMultExpr<MT2,ST,false> >
2042 {
2043  public:
2044  //**********************************************************************************************
2045  typedef typename SelectType< IsDenseMatrix<MT1>::value && IsColumnMajorMatrix<MT1>::value &&
2046  IsSparseMatrix<MT2>::value && IsRowMajorMatrix<MT2>::value &&
2047  IsNumeric<ST>::value
2048  , typename TDMatScalarMultExprTrait<typename TDMatSMatMultExprTrait<MT1,MT2>::Type,ST>::Type
2049  , INVALID_TYPE >::Type Type;
2050  //**********************************************************************************************
2051 };
2053 //*************************************************************************************************
2054 
2055 
2056 
2057 
2058 //=================================================================================================
2059 //
2060 // TDMATTSMATMULTEXPRTRAIT SPECIALIZATIONS
2061 //
2062 //=================================================================================================
2063 
2064 //*************************************************************************************************
2066 template< typename MT1, typename MT2, typename ST >
2067 struct TDMatTSMatMultExprTrait< MT1, SMatScalarMultExpr<MT2,ST,true> >
2068 {
2069  public:
2070  //**********************************************************************************************
2071  typedef typename SelectType< IsDenseMatrix<MT1>::value && IsColumnMajorMatrix<MT1>::value &&
2072  IsSparseMatrix<MT2>::value && IsColumnMajorMatrix<MT2>::value &&
2073  IsNumeric<ST>::value
2074  , typename TDMatScalarMultExprTrait<typename TDMatTSMatMultExprTrait<MT1,MT2>::Type,ST>::Type
2075  , INVALID_TYPE >::Type Type;
2076  //**********************************************************************************************
2077 };
2079 //*************************************************************************************************
2080 
2081 
2082 
2083 
2084 //=================================================================================================
2085 //
2086 // SMATDMATMULTEXPRTRAIT SPECIALIZATIONS
2087 //
2088 //=================================================================================================
2089 
2090 //*************************************************************************************************
2092 template< typename MT1, typename ST, typename MT2 >
2093 struct SMatDMatMultExprTrait< SMatScalarMultExpr<MT1,ST,false>, MT2 >
2094 {
2095  public:
2096  //**********************************************************************************************
2097  typedef typename SelectType< IsSparseMatrix<MT1>::value && IsRowMajorMatrix<MT1>::value &&
2098  IsDenseMatrix<MT2>::value && IsRowMajorMatrix<MT2>::value &&
2099  IsNumeric<ST>::value
2100  , typename DMatScalarMultExprTrait<typename SMatDMatMultExprTrait<MT1,MT2>::Type,ST>::Type
2101  , INVALID_TYPE >::Type Type;
2102  //**********************************************************************************************
2103 };
2105 //*************************************************************************************************
2106 
2107 
2108 
2109 
2110 //=================================================================================================
2111 //
2112 // SMATTDMATMULTEXPRTRAIT SPECIALIZATIONS
2113 //
2114 //=================================================================================================
2115 
2116 //*************************************************************************************************
2118 template< typename MT1, typename ST, typename MT2 >
2119 struct SMatTDMatMultExprTrait< SMatScalarMultExpr<MT1,ST,false>, MT2 >
2120 {
2121  public:
2122  //**********************************************************************************************
2123  typedef typename SelectType< IsSparseMatrix<MT1>::value && IsRowMajorMatrix<MT1>::value &&
2124  IsDenseMatrix<MT2>::value && IsColumnMajorMatrix<MT2>::value &&
2125  IsNumeric<ST>::value
2126  , typename DMatScalarMultExprTrait<typename SMatTDMatMultExprTrait<MT1,MT2>::Type,ST>::Type
2127  , INVALID_TYPE >::Type Type;
2128  //**********************************************************************************************
2129 };
2131 //*************************************************************************************************
2132 
2133 
2134 
2135 
2136 //=================================================================================================
2137 //
2138 // TSMATDMATMULTEXPRTRAIT SPECIALIZATIONS
2139 //
2140 //=================================================================================================
2141 
2142 //*************************************************************************************************
2144 template< typename MT1, typename ST, typename MT2 >
2145 struct TSMatDMatMultExprTrait< SMatScalarMultExpr<MT1,ST,true>, MT2 >
2146 {
2147  public:
2148  //**********************************************************************************************
2149  typedef typename SelectType< IsSparseMatrix<MT1>::value && IsColumnMajorMatrix<MT1>::value &&
2150  IsDenseMatrix<MT2>::value && IsRowMajorMatrix<MT2>::value &&
2151  IsNumeric<ST>::value
2152  , typename TDMatScalarMultExprTrait<typename TSMatDMatMultExprTrait<MT1,MT2>::Type,ST>::Type
2153  , INVALID_TYPE >::Type Type;
2154  //**********************************************************************************************
2155 };
2157 //*************************************************************************************************
2158 
2159 
2160 
2161 
2162 //=================================================================================================
2163 //
2164 // TSMATTDMATMULTEXPRTRAIT SPECIALIZATIONS
2165 //
2166 //=================================================================================================
2167 
2168 //*************************************************************************************************
2170 template< typename MT1, typename ST, typename MT2 >
2171 struct TSMatTDMatMultExprTrait< SMatScalarMultExpr<MT1,ST,true>, MT2 >
2172 {
2173  public:
2174  //**********************************************************************************************
2175  typedef typename SelectType< IsSparseMatrix<MT1>::value && IsColumnMajorMatrix<MT1>::value &&
2176  IsDenseMatrix<MT2>::value && IsColumnMajorMatrix<MT2>::value &&
2177  IsNumeric<ST>::value
2178  , typename TDMatScalarMultExprTrait<typename TSMatTDMatMultExprTrait<MT1,MT2>::Type,ST>::Type
2179  , INVALID_TYPE >::Type Type;
2180  //**********************************************************************************************
2181 };
2183 //*************************************************************************************************
2184 
2185 
2186 
2187 
2188 //=================================================================================================
2189 //
2190 // SMATSMATMULTEXPRTRAIT SPECIALIZATIONS
2191 //
2192 //=================================================================================================
2193 
2194 //*************************************************************************************************
2196 template< typename MT1, typename ST, typename MT2 >
2197 struct SMatSMatMultExprTrait< SMatScalarMultExpr<MT1,ST,false>, MT2 >
2198 {
2199  public:
2200  //**********************************************************************************************
2201  typedef typename SelectType< IsSparseMatrix<MT1>::value && IsRowMajorMatrix<MT1>::value &&
2202  IsSparseMatrix<MT2>::value && IsRowMajorMatrix<MT2>::value &&
2203  IsNumeric<ST>::value
2204  , typename SMatScalarMultExprTrait<typename SMatSMatMultExprTrait<MT1,MT2>::Type,ST>::Type
2205  , INVALID_TYPE >::Type Type;
2206  //**********************************************************************************************
2207 };
2209 //*************************************************************************************************
2210 
2211 
2212 //*************************************************************************************************
2214 template< typename MT1, typename MT2, typename ST >
2215 struct SMatSMatMultExprTrait< MT1, SMatScalarMultExpr<MT2,ST,false> >
2216 {
2217  public:
2218  //**********************************************************************************************
2219  typedef typename SelectType< IsSparseMatrix<MT1>::value && IsRowMajorMatrix<MT1>::value &&
2220  IsSparseMatrix<MT2>::value && IsRowMajorMatrix<MT2>::value &&
2221  IsNumeric<ST>::value
2222  , typename SMatScalarMultExprTrait<typename SMatSMatMultExprTrait<MT1,MT2>::Type,ST>::Type
2223  , INVALID_TYPE >::Type Type;
2224  //**********************************************************************************************
2225 };
2227 //*************************************************************************************************
2228 
2229 
2230 //*************************************************************************************************
2232 template< typename MT1, typename ST1, typename MT2, typename ST2 >
2233 struct SMatSMatMultExprTrait< SMatScalarMultExpr<MT1,ST1,false>, SMatScalarMultExpr<MT2,ST2,false> >
2234 {
2235  public:
2236  //**********************************************************************************************
2237  typedef typename SelectType< IsSparseMatrix<MT1>::value && IsRowMajorMatrix<MT1>::value &&
2238  IsSparseMatrix<MT2>::value && IsRowMajorMatrix<MT2>::value &&
2239  IsNumeric<ST1>::value && IsNumeric<ST2>::value
2240  , typename SMatScalarMultExprTrait<typename SMatSMatMultExprTrait<MT1,MT2>::Type,typename MultTrait<ST1,ST2>::Type>::Type
2241  , INVALID_TYPE >::Type Type;
2242  //**********************************************************************************************
2243 };
2245 //*************************************************************************************************
2246 
2247 
2248 
2249 
2250 //=================================================================================================
2251 //
2252 // SMATTSMATMULTEXPRTRAIT SPECIALIZATIONS
2253 //
2254 //=================================================================================================
2255 
2256 //*************************************************************************************************
2258 template< typename MT1, typename ST, typename MT2 >
2259 struct SMatTSMatMultExprTrait< SMatScalarMultExpr<MT1,ST,false>, MT2 >
2260 {
2261  public:
2262  //**********************************************************************************************
2263  typedef typename SelectType< IsSparseMatrix<MT1>::value && IsRowMajorMatrix<MT1>::value &&
2264  IsSparseMatrix<MT2>::value && IsColumnMajorMatrix<MT2>::value &&
2265  IsNumeric<ST>::value
2266  , typename SMatScalarMultExprTrait<typename SMatTSMatMultExprTrait<MT1,MT2>::Type,ST>::Type
2267  , INVALID_TYPE >::Type Type;
2268  //**********************************************************************************************
2269 };
2271 //*************************************************************************************************
2272 
2273 
2274 //*************************************************************************************************
2276 template< typename MT1, typename MT2, typename ST >
2277 struct SMatTSMatMultExprTrait< MT1, SMatScalarMultExpr<MT2,ST,true> >
2278 {
2279  public:
2280  //**********************************************************************************************
2281  typedef typename SelectType< IsSparseMatrix<MT1>::value && IsRowMajorMatrix<MT1>::value &&
2282  IsSparseMatrix<MT2>::value && IsColumnMajorMatrix<MT2>::value &&
2283  IsNumeric<ST>::value
2284  , typename SMatScalarMultExprTrait<typename SMatTSMatMultExprTrait<MT1,MT2>::Type,ST>::Type
2285  , INVALID_TYPE >::Type Type;
2286  //**********************************************************************************************
2287 };
2289 //*************************************************************************************************
2290 
2291 
2292 //*************************************************************************************************
2294 template< typename MT1, typename ST1, typename MT2, typename ST2 >
2295 struct SMatTSMatMultExprTrait< SMatScalarMultExpr<MT1,ST1,false>, SMatScalarMultExpr<MT2,ST2,true> >
2296 {
2297  public:
2298  //**********************************************************************************************
2299  typedef typename SelectType< IsSparseMatrix<MT1>::value && IsRowMajorMatrix<MT1>::value &&
2300  IsSparseMatrix<MT2>::value && IsColumnMajorMatrix<MT2>::value &&
2301  IsNumeric<ST1>::value && IsNumeric<ST2>::value
2302  , typename SMatScalarMultExprTrait<typename SMatTSMatMultExprTrait<MT1,MT2>::Type,typename MultTrait<ST1,ST2>::Type>::Type
2303  , INVALID_TYPE >::Type Type;
2304  //**********************************************************************************************
2305 };
2307 //*************************************************************************************************
2308 
2309 
2310 
2311 
2312 //=================================================================================================
2313 //
2314 // TSMATSMATMULTEXPRTRAIT SPECIALIZATIONS
2315 //
2316 //=================================================================================================
2317 
2318 //*************************************************************************************************
2320 template< typename MT1, typename ST, typename MT2 >
2321 struct TSMatSMatMultExprTrait< SMatScalarMultExpr<MT1,ST,true>, MT2 >
2322 {
2323  public:
2324  //**********************************************************************************************
2325  typedef typename SelectType< IsSparseMatrix<MT1>::value && IsColumnMajorMatrix<MT1>::value &&
2326  IsSparseMatrix<MT2>::value && IsRowMajorMatrix<MT2>::value &&
2327  IsNumeric<ST>::value
2328  , typename TSMatScalarMultExprTrait<typename TSMatSMatMultExprTrait<MT1,MT2>::Type,ST>::Type
2329  , INVALID_TYPE >::Type Type;
2330  //**********************************************************************************************
2331 };
2333 //*************************************************************************************************
2334 
2335 
2336 //*************************************************************************************************
2338 template< typename MT1, typename MT2, typename ST >
2339 struct TSMatSMatMultExprTrait< MT1, SMatScalarMultExpr<MT2,ST,false> >
2340 {
2341  public:
2342  //**********************************************************************************************
2343  typedef typename SelectType< IsSparseMatrix<MT1>::value && IsColumnMajorMatrix<MT1>::value &&
2344  IsSparseMatrix<MT2>::value && IsRowMajorMatrix<MT2>::value &&
2345  IsNumeric<ST>::value
2346  , typename TSMatScalarMultExprTrait<typename TSMatSMatMultExprTrait<MT1,MT2>::Type,ST>::Type
2347  , INVALID_TYPE >::Type Type;
2348  //**********************************************************************************************
2349 };
2351 //*************************************************************************************************
2352 
2353 
2354 //*************************************************************************************************
2356 template< typename MT1, typename ST1, typename MT2, typename ST2 >
2357 struct TSMatSMatMultExprTrait< SMatScalarMultExpr<MT1,ST1,true>, SMatScalarMultExpr<MT2,ST2,false> >
2358 {
2359  public:
2360  //**********************************************************************************************
2361  typedef typename SelectType< IsSparseMatrix<MT1>::value && IsColumnMajorMatrix<MT1>::value &&
2362  IsSparseMatrix<MT2>::value && IsRowMajorMatrix<MT2>::value &&
2363  IsNumeric<ST1>::value && IsNumeric<ST2>::value
2364  , typename TSMatScalarMultExprTrait<typename TSMatSMatMultExprTrait<MT1,MT2>::Type,typename MultTrait<ST1,ST2>::Type>::Type
2365  , INVALID_TYPE >::Type Type;
2366  //**********************************************************************************************
2367 };
2369 //*************************************************************************************************
2370 
2371 
2372 
2373 
2374 //=================================================================================================
2375 //
2376 // TSMATSMATMULTEXPRTRAIT SPECIALIZATIONS
2377 //
2378 //=================================================================================================
2379 
2380 //*************************************************************************************************
2382 template< typename MT1, typename ST, typename MT2 >
2383 struct TSMatTSMatMultExprTrait< SMatScalarMultExpr<MT1,ST,true>, MT2 >
2384 {
2385  public:
2386  //**********************************************************************************************
2387  typedef typename SelectType< IsSparseMatrix<MT1>::value && IsColumnMajorMatrix<MT1>::value &&
2388  IsSparseMatrix<MT2>::value && IsColumnMajorMatrix<MT2>::value &&
2389  IsNumeric<ST>::value
2390  , typename TSMatScalarMultExprTrait<typename TSMatTSMatMultExprTrait<MT1,MT2>::Type,ST>::Type
2391  , INVALID_TYPE >::Type Type;
2392  //**********************************************************************************************
2393 };
2395 //*************************************************************************************************
2396 
2397 
2398 //*************************************************************************************************
2400 template< typename MT1, typename MT2, typename ST >
2401 struct TSMatTSMatMultExprTrait< MT1, SMatScalarMultExpr<MT2,ST,true> >
2402 {
2403  public:
2404  //**********************************************************************************************
2405  typedef typename SelectType< IsSparseMatrix<MT1>::value && IsColumnMajorMatrix<MT1>::value &&
2406  IsSparseMatrix<MT2>::value && IsColumnMajorMatrix<MT2>::value &&
2407  IsNumeric<ST>::value
2408  , typename TSMatScalarMultExprTrait<typename TSMatTSMatMultExprTrait<MT1,MT2>::Type,ST>::Type
2409  , INVALID_TYPE >::Type Type;
2410  //**********************************************************************************************
2411 };
2413 //*************************************************************************************************
2414 
2415 
2416 //*************************************************************************************************
2418 template< typename MT1, typename ST1, typename MT2, typename ST2 >
2419 struct TSMatTSMatMultExprTrait< SMatScalarMultExpr<MT1,ST1,true>, SMatScalarMultExpr<MT2,ST2,true> >
2420 {
2421  public:
2422  //**********************************************************************************************
2423  typedef typename SelectType< IsSparseMatrix<MT1>::value && IsColumnMajorMatrix<MT1>::value &&
2424  IsSparseMatrix<MT2>::value && IsColumnMajorMatrix<MT2>::value &&
2425  IsNumeric<ST1>::value && IsNumeric<ST2>::value
2426  , typename TSMatScalarMultExprTrait<typename TSMatTSMatMultExprTrait<MT1,MT2>::Type,typename MultTrait<ST1,ST2>::Type>::Type
2427  , INVALID_TYPE >::Type Type;
2428  //**********************************************************************************************
2429 };
2431 //*************************************************************************************************
2432 
2433 
2434 
2435 
2436 //=================================================================================================
2437 //
2438 // SUBMATRIXEXPRTRAIT SPECIALIZATIONS
2439 //
2440 //=================================================================================================
2441 
2442 //*************************************************************************************************
2444 template< typename MT, typename ST, bool SO, bool AF >
2445 struct SubmatrixExprTrait< SMatScalarMultExpr<MT,ST,SO>, AF >
2446 {
2447  public:
2448  //**********************************************************************************************
2449  typedef typename MultExprTrait< typename SubmatrixExprTrait<const MT,AF>::Type, ST >::Type Type;
2450  //**********************************************************************************************
2451 };
2453 //*************************************************************************************************
2454 
2455 
2456 
2457 
2458 //=================================================================================================
2459 //
2460 // ROWEXPRTRAIT SPECIALIZATIONS
2461 //
2462 //=================================================================================================
2463 
2464 //*************************************************************************************************
2466 template< typename MT, typename ST, bool SO >
2467 struct RowExprTrait< SMatScalarMultExpr<MT,ST,SO> >
2468 {
2469  public:
2470  //**********************************************************************************************
2471  typedef typename MultExprTrait< typename RowExprTrait<const MT>::Type, ST >::Type Type;
2472  //**********************************************************************************************
2473 };
2475 //*************************************************************************************************
2476 
2477 
2478 
2479 
2480 //=================================================================================================
2481 //
2482 // COLUMNEXPRTRAIT SPECIALIZATIONS
2483 //
2484 //=================================================================================================
2485 
2486 //*************************************************************************************************
2488 template< typename MT, typename ST, bool SO >
2489 struct ColumnExprTrait< SMatScalarMultExpr<MT,ST,SO> >
2490 {
2491  public:
2492  //**********************************************************************************************
2493  typedef typename MultExprTrait< typename ColumnExprTrait<const MT>::Type, ST >::Type Type;
2494  //**********************************************************************************************
2495 };
2497 //*************************************************************************************************
2498 
2499 } // namespace blaze
2500 
2501 #endif
size_t columns() const
Returns the current number of columns of the matrix.
Definition: SMatScalarMultExpr.h:388
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:8247
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:939
Header file for basic type definitions.
PointerType pointer
Pointer return type.
Definition: SMatScalarMultExpr.h:214
SelectType< IsExpression< MT >::value, const MT, const MT & >::Type LeftOperand
Composite data type of the sparse matrix expression.
Definition: SMatScalarMultExpr.h:186
RightOperand scalar_
Right-hand side scalar of the multiplication expression.
Definition: SMatScalarMultExpr.h:500
ConstIterator end(size_t i) const
Returns an iterator just past the last non-zero element of row i.
Definition: SMatScalarMultExpr.h:368
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:242
Efficient implementation of a compressed matrix.The CompressedMatrix class template is the represent...
Definition: CompressedMatrix.h:209
RightOperand scalar_
Right-hand side scalar of the multiplication expression.
Definition: SMatScalarMultExpr.h:315
ConstIterator find(size_t i, size_t j) const
Searches for a specific matrix element.
Definition: SMatScalarMultExpr.h:421
Header file for the ColumnExprTrait class template.
ValueType & ReferenceType
Reference return type.
Definition: SMatScalarMultExpr.h:208
LeftOperand leftOperand() const
Returns the left-hand side sparse matrix operand.
Definition: SMatScalarMultExpr.h:458
Header file for the IsColumnMajorMatrix type trait.
const This & CompositeType
Data type for composite expression templates.
Definition: CompressedMatrix.h:2507
Header file for the IsRowVector type trait.
Type ElementType
Type of the sparse matrix elements.
Definition: CompressedMatrix.h:261
RightOperand rightOperand() const
Returns the right-hand side scalar operand.
Definition: SMatScalarMultExpr.h:468
size_t index() const
Access to the current index of the sparse element.
Definition: SMatScalarMultExpr.h:274
const DMatSerialExpr< MT, SO > serial(const DenseMatrix< MT, SO > &dm)
Forces the serial evaluation of the given dense matrix expression dm.
Definition: DMatSerialExpr.h:699
ResultType::ElementType ElementType
Resulting element type.
Definition: SMatScalarMultExpr.h:177
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:499
size_t nonZeros() const
Returns the number of non-zero elements in the sparse matrix.
Definition: SMatScalarMultExpr.h:398
MultExprTrait< RN, ST >::Type ExprReturnType
Expression return type for the subscript operator.
Definition: SMatScalarMultExpr.h:134
ConstIterator upperBound(size_t i, size_t j) const
Returns an iterator to the first index greater then the given index.
Definition: SMatScalarMultExpr.h:447
ResultType::TransposeType TransposeType
Transpose type for expression template evaluations.
Definition: SMatScalarMultExpr.h:176
std::forward_iterator_tag IteratorCategory
The iterator category.
Definition: SMatScalarMultExpr.h:205
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:107
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:203
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:480
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:263
ConstIterator begin(size_t i) const
Returns an iterator to the first non-zero element of row i.
Definition: SMatScalarMultExpr.h:357
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:200
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:215
Header file for the IsFloatingPoint type trait.
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:434
ConstIterator & operator++()
Pre-increment operator.
Definition: SMatScalarMultExpr.h:233
const Element * ConstIterator
Iterator over constant elements.
Definition: CompressedMatrix.h:2511
ResultType::OppositeType OppositeType
Result type with opposite storage order for expression template evaluations.
Definition: SMatScalarMultExpr.h:175
DifferenceType operator-(const ConstIterator &rhs) const
Calculating the number of elements between two expression iterators.
Definition: SMatScalarMultExpr.h:307
BLAZE_ALWAYS_INLINE void assign(Matrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs)
Default implementation of the assignment of a matrix to a matrix.
Definition: Matrix.h:635
Header file for the Columns type trait.
const SelectType< returnExpr, ExprReturnType, ElementType >::Type ReturnType
Return type for expression template evaluations.
Definition: SMatScalarMultExpr.h:180
IteratorCategory iterator_category
The iterator category.
Definition: SMatScalarMultExpr.h:212
#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:189
#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:344
bool operator!=(const ConstIterator &rhs) const
Inequality comparison between two ConstIterator objects.
Definition: SMatScalarMultExpr.h:296
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:94
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:121
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:378
Header file for the serial shim.
Header file for the BaseElementType type trait.
ptrdiff_t DifferenceType
Difference between two iterators.
Definition: SMatScalarMultExpr.h:209
ValueType * PointerType
Pointer return type.
Definition: SMatScalarMultExpr.h:207
Header file for the IsNumeric type trait.
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:2506
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:120
Base template for the MultTrait class.
Definition: MultTrait.h:150
ConstIterator(IteratorType matrix, RightOperand scalar)
Constructor for the ConstIterator class.
Definition: SMatScalarMultExpr.h:222
BLAZE_ALWAYS_INLINE void addAssign(Matrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs)
Default implementation of the addition assignment of a matrix to a matrix.
Definition: Matrix.h:742
Header file for the division trait.
SelectType< useAssign, const ResultType, const SMatScalarMultExpr & >::Type CompositeType
Data type for composite expression templates.
Definition: SMatScalarMultExpr.h:183
SMatScalarMultExpr< MT, ST, SO > This
Type of this SMatScalarMultExpr instance.
Definition: SMatScalarMultExpr.h:173
const DenseIterator< Type > operator-(const DenseIterator< Type > &it, ptrdiff_t inc)
Subtraction between a DenseIterator and an integral value.
Definition: DenseIterator.h:585
bool operator==(const ConstIterator &rhs) const
Equality comparison between two ConstIterator objects.
Definition: SMatScalarMultExpr.h:285
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:119
#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:195
Evaluation of the base element type of a given data type.Via this type trait it is possible to evalua...
Definition: BaseElementType.h:80
DifferenceType difference_type
Difference between two iterators.
Definition: SMatScalarMultExpr.h:216
Header file for the RemoveReference type trait.
const Element operator*() const
Direct access to the sparse matrix element at the current iterator position.
Definition: SMatScalarMultExpr.h:244
Element ValueType
Type of the underlying pointers.
Definition: SMatScalarMultExpr.h:206
Header file for the IsDenseVector type trait.
MultTrait< RT, ST >::Type ResultType
Result type for expression template evaluations.
Definition: SMatScalarMultExpr.h:174
ReturnType value() const
Access to the current value of the sparse element.
Definition: SMatScalarMultExpr.h:264
IteratorType matrix_
Iterator over the elements of the left-hand side sparse matrix expression.
Definition: SMatScalarMultExpr.h:314
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:492
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:2502
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:409
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:254
SMatScalarMultExpr(const MT &matrix, ST scalar)
Constructor for the SMatScalarMultExpr class.
Definition: SMatScalarMultExpr.h:331
Header file for the IsColumnVector type trait.
ValueType value_type
Type of the underlying pointers.
Definition: SMatScalarMultExpr.h:213
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.
BLAZE_ALWAYS_INLINE void subAssign(Matrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs)
Default implementation of the subtraction assignment of a matrix to matrix.
Definition: Matrix.h:849