All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
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>
78 #include <blaze/util/Assert.h>
82 #include <blaze/util/EnableIf.h>
83 #include <blaze/util/InvalidType.h>
85 #include <blaze/util/SelectType.h>
86 #include <blaze/util/Types.h>
91 
92 
93 namespace blaze {
94 
95 //=================================================================================================
96 //
97 // CLASS SMATSCALARMULTEXPR
98 //
99 //=================================================================================================
100 
101 //*************************************************************************************************
108 template< typename MT // Type of the left-hand side sparse matrix
109  , typename ST // Type of the right-hand side scalar value
110  , bool SO > // Storage order
111 class SMatScalarMultExpr : public SparseMatrix< SMatScalarMultExpr<MT,ST,SO>, SO >
112  , private MatScalarMultExpr
113  , private Computation
114 {
115  private:
116  //**Type definitions****************************************************************************
117  typedef typename MT::ResultType RT;
118  typedef typename MT::ReturnType RN;
119  typedef typename MT::CompositeType CT;
120  //**********************************************************************************************
121 
122  //**Return type evaluation**********************************************************************
124 
129  enum { returnExpr = !IsTemporary<RN>::value };
130 
133  //**********************************************************************************************
134 
135  //**Serial evaluation strategy******************************************************************
137 
143  enum { useAssign = RequiresEvaluation<MT>::value };
144 
146  template< typename MT2 >
148  struct UseAssign {
149  enum { value = useAssign };
150  };
152  //**********************************************************************************************
153 
154  //**Parallel evaluation strategy****************************************************************
156 
162  template< typename MT2 >
163  struct UseSMPAssign {
164  enum { value = ( !MT2::smpAssignable || !MT::smpAssignable ) && useAssign };
165  };
167  //**********************************************************************************************
168 
169  public:
170  //**Type definitions****************************************************************************
176 
179 
182 
184  typedef typename SelectType< IsExpression<MT>::value, const MT, const MT& >::Type LeftOperand;
185 
187  typedef ST RightOperand;
188  //**********************************************************************************************
189 
190  //**ConstIterator class definition**************************************************************
194  {
195  public:
196  //**Type definitions*************************************************************************
199 
202 
203  typedef std::forward_iterator_tag IteratorCategory;
204  typedef Element ValueType;
208 
209  // STL iterator requirements
215  //*******************************************************************************************
216 
217  //**Constructor******************************************************************************
220  inline ConstIterator( IteratorType matrix, RightOperand scalar )
221  : matrix_( matrix ) // Iterator over the elements of the left-hand side sparse matrix expression
222  , scalar_( scalar ) // Right-hand side scalar of the multiplication expression
223  {}
224  //*******************************************************************************************
225 
226  //**Prefix increment operator****************************************************************
232  ++matrix_;
233  return *this;
234  }
235  //*******************************************************************************************
236 
237  //**Element access operator******************************************************************
242  inline const Element operator*() const {
243  return Element( matrix_->value() * scalar_, matrix_->index() );
244  }
245  //*******************************************************************************************
246 
247  //**Element access operator******************************************************************
252  inline const ConstIterator* operator->() const {
253  return this;
254  }
255  //*******************************************************************************************
256 
257  //**Value function***************************************************************************
262  inline ReturnType value() const {
263  return matrix_->value() * scalar_;
264  }
265  //*******************************************************************************************
266 
267  //**Index function***************************************************************************
272  inline size_t index() const {
273  return matrix_->index();
274  }
275  //*******************************************************************************************
276 
277  //**Equality operator************************************************************************
283  inline bool operator==( const ConstIterator& rhs ) const {
284  return matrix_ == rhs.matrix_;
285  }
286  //*******************************************************************************************
287 
288  //**Inequality operator**********************************************************************
294  inline bool operator!=( const ConstIterator& rhs ) const {
295  return matrix_ != rhs.matrix_;
296  }
297  //*******************************************************************************************
298 
299  //**Subtraction operator*********************************************************************
305  inline DifferenceType operator-( const ConstIterator& rhs ) const {
306  return matrix_ - rhs.matrix_;
307  }
308  //*******************************************************************************************
309 
310  private:
311  //**Member variables*************************************************************************
314  //*******************************************************************************************
315  };
316  //**********************************************************************************************
317 
318  //**Compilation flags***************************************************************************
320  enum { smpAssignable = 0 };
321  //**********************************************************************************************
322 
323  //**Constructor*********************************************************************************
329  explicit inline SMatScalarMultExpr( const MT& matrix, ST scalar )
330  : matrix_( matrix ) // Left-hand side sparse matrix of the multiplication expression
331  , scalar_( scalar ) // Right-hand side scalar of the multiplication expression
332  {}
333  //**********************************************************************************************
334 
335  //**Access operator*****************************************************************************
342  inline ReturnType operator()( size_t i, size_t j ) const {
343  BLAZE_INTERNAL_ASSERT( i < matrix_.rows() , "Invalid row access index" );
344  BLAZE_INTERNAL_ASSERT( j < matrix_.columns(), "Invalid column access index" );
345  return matrix_(i,j) * scalar_;
346  }
347  //**********************************************************************************************
348 
349  //**Begin function******************************************************************************
355  inline ConstIterator begin( size_t i ) const {
356  return ConstIterator( matrix_.begin(i), scalar_ );
357  }
358  //**********************************************************************************************
359 
360  //**End function********************************************************************************
366  inline ConstIterator end( size_t i ) const {
367  return ConstIterator( matrix_.end(i), scalar_ );
368  }
369  //**********************************************************************************************
370 
371  //**Rows function*******************************************************************************
376  inline size_t rows() const {
377  return matrix_.rows();
378  }
379  //**********************************************************************************************
380 
381  //**Columns function****************************************************************************
386  inline size_t columns() const {
387  return matrix_.columns();
388  }
389  //**********************************************************************************************
390 
391  //**NonZeros function***************************************************************************
396  inline size_t nonZeros() const {
397  return matrix_.nonZeros();
398  }
399  //**********************************************************************************************
400 
401  //**NonZeros function***************************************************************************
407  inline size_t nonZeros( size_t i ) const {
408  return matrix_.nonZeros(i);
409  }
410  //**********************************************************************************************
411 
412  //**Find function*******************************************************************************
419  inline ConstIterator find( size_t i, size_t j ) const {
421  return ConstIterator( matrix_.find( i, j ), scalar_ );
422  }
423  //**********************************************************************************************
424 
425  //**LowerBound function*************************************************************************
432  inline ConstIterator lowerBound( size_t i, size_t j ) const {
434  return ConstIterator( matrix_.lowerBound( i, j ), scalar_ );
435  }
436  //**********************************************************************************************
437 
438  //**UpperBound function*************************************************************************
445  inline ConstIterator upperBound( size_t i, size_t j ) const {
447  return ConstIterator( matrix_.upperBound( i, j ), scalar_ );
448  }
449  //**********************************************************************************************
450 
451  //**Left operand access*************************************************************************
456  inline LeftOperand leftOperand() const {
457  return matrix_;
458  }
459  //**********************************************************************************************
460 
461  //**Right operand access************************************************************************
466  inline RightOperand rightOperand() const {
467  return scalar_;
468  }
469  //**********************************************************************************************
470 
471  //**********************************************************************************************
477  template< typename T >
478  inline bool canAlias( const T* alias ) const {
479  return matrix_.canAlias( alias );
480  }
481  //**********************************************************************************************
482 
483  //**********************************************************************************************
489  template< typename T >
490  inline bool isAliased( const T* alias ) const {
491  return matrix_.isAliased( alias );
492  }
493  //**********************************************************************************************
494 
495  private:
496  //**Member variables****************************************************************************
499  //**********************************************************************************************
500 
501  //**Assignment to dense matrices****************************************************************
515  template< typename MT2 // Type of the target dense matrix
516  , bool SO2 > // Storage order of the target dense matrix
517  friend inline typename EnableIf< UseAssign<MT2> >::Type
519  {
521 
522  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
523  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
524 
525  assign( ~lhs, rhs.matrix_ );
526  (~lhs) *= rhs.scalar_;
527  }
529  //**********************************************************************************************
530 
531  //**Assignment to sparse matrices***************************************************************
545  template< typename MT2 // Type of the target sparse matrix
546  , bool SO2 > // Storage order of the target sparse matrix
547  friend inline typename EnableIf< UseAssign<MT2> >::Type
549  {
551 
552  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
553  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
554 
555  assign( ~lhs, rhs.matrix_ );
556  (~lhs) *= rhs.scalar_;
557  }
559  //**********************************************************************************************
560 
561  //**Addition assignment to dense matrices*******************************************************
575  template< typename MT2 // Type of the target dense matrix
576  , bool SO2 > // Storage order of the target dense matrix
577  friend inline typename EnableIf< UseAssign<MT2> >::Type
578  addAssign( DenseMatrix<MT2,SO2>& lhs, const SMatScalarMultExpr& rhs )
579  {
581 
584 
585  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
586  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
587 
588  const ResultType tmp( serial( rhs ) );
589  addAssign( ~lhs, tmp );
590  }
592  //**********************************************************************************************
593 
594  //**Addition assignment to sparse matrices******************************************************
595  // No special implementation for the addition assignment to sparse matrices.
596  //**********************************************************************************************
597 
598  //**Subtraction assignment to dense matrices****************************************************
612  template< typename MT2 // Type of the target dense matrix
613  , bool SO2 > // Storage order of the target dense matrix
614  friend inline typename EnableIf< UseAssign<MT2> >::Type
615  subAssign( DenseMatrix<MT2,SO2>& lhs, const SMatScalarMultExpr& rhs )
616  {
618 
621 
622  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
623  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
624 
625  const ResultType tmp( serial( rhs ) );
626  subAssign( ~lhs, tmp );
627  }
629  //**********************************************************************************************
630 
631  //**Subtraction assignment to sparse matrices***************************************************
632  // No special implementation for the subtraction assignment to sparse matrices.
633  //**********************************************************************************************
634 
635  //**Multiplication assignment to dense matrices*************************************************
636  // No special implementation for the multiplication assignment to dense matrices.
637  //**********************************************************************************************
638 
639  //**Multiplication assignment to sparse matrices************************************************
640  // No special implementation for the multiplication assignment to sparse matrices.
641  //**********************************************************************************************
642 
643  //**SMP assignment to dense matrices************************************************************
644  // No special implementation for the SMP assignment to dense matrices.
645  //**********************************************************************************************
646 
647  //**SMP assignment to sparse matrices***********************************************************
648  // No special implementation for the SMP assignment to sparse matrices.
649  //**********************************************************************************************
650 
651  //**SMP addition assignment to dense matrices***************************************************
665  template< typename MT2 // Type of the target dense matrix
666  , bool SO2 > // Storage order of the target dense matrix
667  friend inline typename EnableIf< UseSMPAssign<MT2> >::Type
668  smpAddAssign( DenseMatrix<MT2,SO2>& lhs, const SMatScalarMultExpr& rhs )
669  {
671 
674 
675  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
676  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
677 
678  const ResultType tmp( rhs );
679  smpAddAssign( ~lhs, tmp );
680  }
682  //**********************************************************************************************
683 
684  //**SMP addition assignment to sparse matrices**************************************************
685  // No special implementation for the SMP addition assignment to sparse matrices.
686  //**********************************************************************************************
687 
688  //**SMP subtraction assignment to dense matrices************************************************
702  template< typename MT2 // Type of the target dense matrix
703  , bool SO2 > // Storage order of the target dense matrix
704  friend inline typename EnableIf< UseSMPAssign<MT2> >::Type
705  smpSubAssign( DenseMatrix<MT2,SO2>& lhs, const SMatScalarMultExpr& rhs )
706  {
708 
711 
712  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
713  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
714 
715  const ResultType tmp( rhs );
716  smpSubAssign( ~lhs, tmp );
717  }
719  //**********************************************************************************************
720 
721  //**SMP subtraction assignment to sparse matrices***********************************************
722  // No special implementation for the SMP subtraction assignment to sparse matrices.
723  //**********************************************************************************************
724 
725  //**SMP multiplication assignment to dense matrices*********************************************
726  // No special implementation for the SMP multiplication assignment to dense matrices.
727  //**********************************************************************************************
728 
729  //**SMP multiplication assignment to sparse matrices********************************************
730  // No special implementation for the SMP multiplication assignment to sparse matrices.
731  //**********************************************************************************************
732 
733  //**Compile time checks*************************************************************************
740  //**********************************************************************************************
741 };
742 //*************************************************************************************************
743 
744 
745 
746 
747 //=================================================================================================
748 //
749 // GLOBAL UNARY ARITHMETIC OPERATORS
750 //
751 //=================================================================================================
752 
753 //*************************************************************************************************
770 template< typename MT // Data type of the sparse matrix
771  , bool SO > // Storage order
772 inline const SMatScalarMultExpr<MT,typename BaseElementType<MT>::Type,SO>
774 {
776 
777  typedef typename BaseElementType<MT>::Type ElementType;
779 }
780 //*************************************************************************************************
781 
782 
783 
784 
785 //=================================================================================================
786 //
787 // GLOBAL BINARY ARITHMETIC OPERATORS
788 //
789 //=================================================================================================
790 
791 //*************************************************************************************************
812 template< typename T1 // Type of the left-hand side sparse matrix
813  , bool SO // Storage order of the left-hand side sparse matrix
814  , typename T2 > // Type of the right-hand side scalar
815 inline const typename EnableIf< IsNumeric<T2>, typename MultExprTrait<T1,T2>::Type >::Type
816  operator*( const SparseMatrix<T1,SO>& mat, T2 scalar )
817 {
819 
820  typedef typename MultExprTrait<T1,T2>::Type Type;
821  return Type( ~mat, scalar );
822 }
823 //*************************************************************************************************
824 
825 
826 //*************************************************************************************************
847 template< typename T1 // Type of the left-hand side scalar
848  , typename T2 // Type of the right-hand side sparse matrix
849  , bool SO > // Storage order of the right-hand side sparse matrix
850 inline const typename EnableIf< IsNumeric<T1>, typename MultExprTrait<T1,T2>::Type >::Type
851  operator*( T1 scalar, const SparseMatrix<T2,SO>& mat )
852 {
854 
855  typedef typename MultExprTrait<T1,T2>::Type Type;
856  return Type( ~mat, scalar );
857 }
858 //*************************************************************************************************
859 
860 
861 
862 
863 //=================================================================================================
864 //
865 // GLOBAL RESTRUCTURING UNARY ARITHMETIC OPERATORS
866 //
867 //=================================================================================================
868 
869 //*************************************************************************************************
881 template< typename VT // Type of the sparse matrix
882  , typename ST // Type of the scalar
883  , bool TF > // Transpose flag
884 inline const SMatScalarMultExpr<VT,ST,TF>
885  operator-( const SMatScalarMultExpr<VT,ST,TF>& sm )
886 {
888 
889  return SMatScalarMultExpr<VT,ST,TF>( sm.leftOperand(), -sm.rightOperand() );
890 }
892 //*************************************************************************************************
893 
894 
895 
896 
897 //=================================================================================================
898 //
899 // GLOBAL RESTRUCTURING BINARY ARITHMETIC OPERATORS
900 //
901 //=================================================================================================
902 
903 //*************************************************************************************************
916 template< typename MT // Type of the sparse matrix
917  , typename ST1 // Type of the first scalar
918  , bool SO // Storage order of the sparse matrix
919  , typename ST2 > // Type of the second scalar
920 inline const typename EnableIf< IsNumeric<ST2>
921  , typename MultExprTrait< SMatScalarMultExpr<MT,ST1,SO>, ST2 >::Type >::Type
922  operator*( const SMatScalarMultExpr<MT,ST1,SO>& mat, ST2 scalar )
923 {
925 
926  return mat.leftOperand() * ( mat.rightOperand() * scalar );
927 }
929 //*************************************************************************************************
930 
931 
932 //*************************************************************************************************
945 template< typename ST1 // Type of the first scalar
946  , typename MT // Type of the sparse matrix
947  , typename ST2 // Type of the second scalar
948  , bool SO > // Storage order of the sparse matrix
949 inline const typename EnableIf< IsNumeric<ST1>
950  , typename MultExprTrait< ST1, SMatScalarMultExpr<MT,ST2,SO> >::Type >::Type
951  operator*( ST1 scalar, const SMatScalarMultExpr<MT,ST2,SO>& mat )
952 {
954 
955  return mat.leftOperand() * ( scalar * mat.rightOperand() );
956 }
958 //*************************************************************************************************
959 
960 
961 //*************************************************************************************************
974 template< typename MT // Type of the sparse matrix
975  , typename ST1 // Type of the first scalar
976  , bool SO // Storage order of the sparse matrix
977  , typename ST2 > // Type of the second scalar
978 inline const typename EnableIf< IsFloatingPoint<typename DivTrait<ST1,ST2>::Type>
979  , typename DivExprTrait< SMatScalarMultExpr<MT,ST1,SO>, ST2 >::Type >::Type
980  operator/( const SMatScalarMultExpr<MT,ST1,SO>& mat, ST2 scalar )
981 {
983 
984  return mat.leftOperand() * ( mat.rightOperand() / scalar );
985 }
987 //*************************************************************************************************
988 
989 
990 //*************************************************************************************************
1004 template< typename MT // Type of the sparse matrix of the left-hand side expression
1005  , typename ST // Type of the scalar of the left-hand side expression
1006  , bool SO // Storage order of the left-hand side expression
1007  , typename VT > // Type of the right-hand side dense vector
1008 inline const typename MultExprTrait< SMatScalarMultExpr<MT,ST,SO>, VT >::Type
1009  operator*( const SMatScalarMultExpr<MT,ST,SO>& mat, const DenseVector<VT,false>& vec )
1010 {
1012 
1013  return ( mat.leftOperand() * (~vec) ) * mat.rightOperand();
1014 }
1016 //*************************************************************************************************
1017 
1018 
1019 //*************************************************************************************************
1033 template< typename VT // Type of the left-hand side dense vector
1034  , typename MT // Type of the sparse matrix of the right-hand side expression
1035  , typename ST // Type of the scalar of the right-hand side expression
1036  , bool SO > // Storage order of the right-hand side expression
1037 inline const typename MultExprTrait< VT, SMatScalarMultExpr<MT,ST,SO> >::Type
1038  operator*( const DenseVector<VT,true>& vec, const SMatScalarMultExpr<MT,ST,SO>& mat )
1039 {
1041 
1042  return ( (~vec) * mat.leftOperand() ) * mat.rightOperand();
1043 }
1045 //*************************************************************************************************
1046 
1047 
1048 //*************************************************************************************************
1064 template< typename MT // Type of the sparse matrix of the left-hand side expression
1065  , typename ST1 // Type of the scalar of the left-hand side expression
1066  , bool SO // Storage order of the left-hand side expression
1067  , typename VT // Type of the dense vector of the right-hand side expression
1068  , typename ST2 > // Type of the scalar of the right-hand side expression
1069 inline const typename MultExprTrait< SMatScalarMultExpr<MT,ST1,SO>, DVecScalarMultExpr<VT,ST2,false> >::Type
1070  operator*( const SMatScalarMultExpr<MT,ST1,SO>& mat, const DVecScalarMultExpr<VT,ST2,false>& vec )
1071 {
1073 
1074  return ( mat.leftOperand() * vec.leftOperand() ) * ( mat.rightOperand() * vec.rightOperand() );
1075 }
1077 //*************************************************************************************************
1078 
1079 
1080 //*************************************************************************************************
1096 template< typename VT // Type of the dense vector of the left-hand side expression
1097  , typename ST1 // Type of the scalar of the left-hand side expression
1098  , typename MT // Type of the sparse matrix of the right-hand side expression
1099  , typename ST2 // Type of the scalar of the right-hand side expression
1100  , bool SO > // Storage order of the right-hand side expression
1101 inline const typename MultExprTrait< DVecScalarMultExpr<VT,ST1,true>, SMatScalarMultExpr<MT,ST2,SO> >::Type
1102  operator*( const DVecScalarMultExpr<VT,ST1,true>& vec, const SMatScalarMultExpr<MT,ST2,SO>& mat )
1103 {
1105 
1106  return ( vec.leftOperand() * mat.leftOperand() ) * ( vec.rightOperand() * mat.rightOperand() );
1107 }
1109 //*************************************************************************************************
1110 
1111 
1112 //*************************************************************************************************
1126 template< typename MT // Type of the sparse matrix of the left-hand side expression
1127  , typename ST // Type of the scalar of the left-hand side expression
1128  , bool SO // Storage order of the left-hand side expression
1129  , typename VT > // Type of the right-hand side sparse vector
1130 inline const typename MultExprTrait< SMatScalarMultExpr<MT,ST,SO>, VT >::Type
1131  operator*( const SMatScalarMultExpr<MT,ST,SO>& mat, const SparseVector<VT,false>& vec )
1132 {
1134 
1135  return ( mat.leftOperand() * (~vec) ) * mat.rightOperand();
1136 }
1138 //*************************************************************************************************
1139 
1140 
1141 //*************************************************************************************************
1155 template< typename VT // Type of the left-hand side sparse vector
1156  , typename MT // Type of the sparse matrix of the right-hand side expression
1157  , typename ST // Type of the scalar of the right-hand side expression
1158  , bool SO > // Storage order of the right-hand side expression
1159 inline const typename MultExprTrait< VT, SMatScalarMultExpr<MT,ST,SO> >::Type
1160  operator*( const SparseVector<VT,true>& vec, const SMatScalarMultExpr<MT,ST,SO>& mat )
1161 {
1163 
1164  return ( (~vec) * mat.leftOperand() ) * mat.rightOperand();
1165 }
1167 //*************************************************************************************************
1168 
1169 
1170 //*************************************************************************************************
1186 template< typename MT // Type of the sparse matrix of the left-hand side expression
1187  , typename ST1 // Type of the scalar of the left-hand side expression
1188  , bool SO // Storage order of the left-hand side expression
1189  , typename VT // Type of the sparse vector of the right-hand side expression
1190  , typename ST2 > // Type of the scalar of the right-hand side expression
1191 inline const typename MultExprTrait< SMatScalarMultExpr<MT,ST1,SO>, SVecScalarMultExpr<VT,ST2,false> >::Type
1192  operator*( const SMatScalarMultExpr<MT,ST1,SO>& mat, const SVecScalarMultExpr<VT,ST2,false>& vec )
1193 {
1195 
1196  return ( mat.leftOperand() * vec.leftOperand() ) * ( mat.rightOperand() * vec.rightOperand() );
1197 }
1199 //*************************************************************************************************
1200 
1201 
1202 //*************************************************************************************************
1218 template< typename VT // Type of the sparse vector of the left-hand side expression
1219  , typename ST1 // Type of the scalar of the left-hand side expression
1220  , typename MT // Type of the sparse matrix of the right-hand side expression
1221  , typename ST2 // Type of the scalar of the right-hand side expression
1222  , bool SO > // Storage order of the right-hand side expression
1223 inline const typename MultExprTrait< SVecScalarMultExpr<VT,ST1,true>, SMatScalarMultExpr<MT,ST2,SO> >::Type
1224  operator*( const SVecScalarMultExpr<VT,ST1,true>& vec, const SMatScalarMultExpr<MT,ST2,SO>& mat )
1225 {
1227 
1228  return ( vec.leftOperand() * mat.leftOperand() ) * ( vec.rightOperand() * mat.rightOperand() );
1229 }
1231 //*************************************************************************************************
1232 
1233 
1234 //*************************************************************************************************
1248 template< typename MT1 // Type of the sparse matrix of the left-hand side expression
1249  , typename ST // Type of the scalar of the left-hand side expression
1250  , bool SO1 // Storage order of the left-hand side expression
1251  , typename MT2 // Type of the right-hand side dense matrix
1252  , bool SO2 > // Storage order of the right-hand side dense matrix
1253 inline const typename MultExprTrait< SMatScalarMultExpr<MT1,ST,SO1>, MT2 >::Type
1254  operator*( const SMatScalarMultExpr<MT1,ST,SO1>& lhs, const DenseMatrix<MT2,SO2>& rhs )
1255 {
1257 
1258  return ( lhs.leftOperand() * (~rhs) ) * lhs.rightOperand();
1259 }
1261 //*************************************************************************************************
1262 
1263 
1264 //*************************************************************************************************
1278 template< typename MT1 // Type of the left-hand side dense matrix
1279  , bool SO1 // Storage order of the left-hand side dense matrix
1280  , typename MT2 // Type of the sparse matrix of the right-hand side expression
1281  , typename ST // Type of the scalar of the right-hand side expression
1282  , bool SO2 > // Storage order of the right-hand side expression
1283 inline const typename MultExprTrait< MT1, SMatScalarMultExpr<MT2,ST,SO2> >::Type
1284  operator*( const DenseMatrix<MT1,SO1>& lhs, const SMatScalarMultExpr<MT2,ST,SO2>& rhs )
1285 {
1287 
1288  return ( (~lhs) * rhs.leftOperand() ) * rhs.rightOperand();
1289 }
1291 //*************************************************************************************************
1292 
1293 
1294 //*************************************************************************************************
1308 template< typename MT1 // Type of the sparse matrix of the left-hand side expression
1309  , typename ST // Type of the scalar of the left-hand side expression
1310  , bool SO1 // Storage order of the left-hand side expression
1311  , typename MT2 // Type of the right-hand side sparse matrix
1312  , bool SO2 > // Storage order of the right-hand side sparse matrix
1313 inline const typename MultExprTrait< SMatScalarMultExpr<MT1,ST,SO1>, MT2 >::Type
1314  operator*( const SMatScalarMultExpr<MT1,ST,SO1>& lhs, const SparseMatrix<MT2,SO2>& rhs )
1315 {
1317 
1318  return ( lhs.leftOperand() * (~rhs) ) * lhs.rightOperand();
1319 }
1321 //*************************************************************************************************
1322 
1323 
1324 //*************************************************************************************************
1338 template< typename MT1 // Type of the left-hand side sparse matrix
1339  , bool SO1 // Storage order of the left-hand side sparse matrix
1340  , typename MT2 // Type of the sparse matrix of the right-hand side expression
1341  , typename ST // Type of the scalar of the right-hand side expression
1342  , bool SO2 > // Storage order of the right-hand side expression
1343 inline const typename MultExprTrait< MT1, SMatScalarMultExpr<MT2,ST,SO2> >::Type
1344  operator*( const SparseMatrix<MT1,SO1>& lhs, const SMatScalarMultExpr<MT2,ST,SO2>& rhs )
1345 {
1347 
1348  return ( (~lhs) * rhs.leftOperand() ) * rhs.rightOperand();
1349 }
1351 //*************************************************************************************************
1352 
1353 
1354 //*************************************************************************************************
1368 template< typename MT1 // Type of the sparse matrix of the left-hand side expression
1369  , typename ST1 // Type of the scalar of the left-hand side expression
1370  , bool SO1 // Storage order of the left-hand side expression
1371  , typename MT2 // Type of the right-hand side sparse matrix
1372  , typename ST2 // Type of the scalar of the right-hand side expression
1373  , bool SO2 > // Storage order of the right-hand side expression
1374 inline const typename MultExprTrait< SMatScalarMultExpr<MT1,ST1,SO1>, SMatScalarMultExpr<MT2,ST2,SO2> >::Type
1375  operator*( const SMatScalarMultExpr<MT1,ST1,SO1>& lhs, const SMatScalarMultExpr<MT2,ST2,SO2>& rhs )
1376 {
1378 
1379  return ( lhs.leftOperand() * rhs.leftOperand() ) * ( lhs.rightOperand() * rhs.rightOperand() );
1380 }
1382 //*************************************************************************************************
1383 
1384 
1385 
1386 
1387 //=================================================================================================
1388 //
1389 // ROWS SPECIALIZATIONS
1390 //
1391 //=================================================================================================
1392 
1393 //*************************************************************************************************
1395 template< typename MT, typename ST, bool SO >
1396 struct Rows< SMatScalarMultExpr<MT,ST,SO> > : public Columns<MT>
1397 {};
1399 //*************************************************************************************************
1400 
1401 
1402 
1403 
1404 //=================================================================================================
1405 //
1406 // COLUMNS SPECIALIZATIONS
1407 //
1408 //=================================================================================================
1409 
1410 //*************************************************************************************************
1412 template< typename MT, typename ST, bool SO >
1413 struct Columns< SMatScalarMultExpr<MT,ST,SO> > : public Rows<MT>
1414 {};
1416 //*************************************************************************************************
1417 
1418 
1419 
1420 
1421 //=================================================================================================
1422 //
1423 // ISSYMMETRIC SPECIALIZATIONS
1424 //
1425 //=================================================================================================
1426 
1427 //*************************************************************************************************
1429 template< typename MT, typename ST, bool SO >
1430 struct IsSymmetric< SMatScalarMultExpr<MT,ST,SO> > : public IsTrue< IsSymmetric<MT>::value >
1431 {};
1433 //*************************************************************************************************
1434 
1435 
1436 
1437 
1438 //=================================================================================================
1439 //
1440 // ISLOWER SPECIALIZATIONS
1441 //
1442 //=================================================================================================
1443 
1444 //*************************************************************************************************
1446 template< typename MT, typename ST, bool SO >
1447 struct IsLower< SMatScalarMultExpr<MT,ST,SO> > : public IsTrue< IsLower<MT>::value >
1448 {};
1450 //*************************************************************************************************
1451 
1452 
1453 
1454 
1455 //=================================================================================================
1456 //
1457 // ISUPPER SPECIALIZATIONS
1458 //
1459 //=================================================================================================
1460 
1461 //*************************************************************************************************
1463 template< typename MT, typename ST, bool SO >
1464 struct IsUpper< SMatScalarMultExpr<MT,ST,SO> > : public IsTrue< IsUpper<MT>::value >
1465 {};
1467 //*************************************************************************************************
1468 
1469 
1470 
1471 
1472 //=================================================================================================
1473 //
1474 // SMATSCALARMULTEXPRTRAIT SPECIALIZATIONS
1475 //
1476 //=================================================================================================
1477 
1478 //*************************************************************************************************
1480 template< typename MT, typename ST1, typename ST2 >
1481 struct SMatScalarMultExprTrait< SMatScalarMultExpr<MT,ST1,false>, ST2 >
1482 {
1483  public:
1484  //**********************************************************************************************
1485  typedef typename SelectType< IsSparseMatrix<MT>::value && IsRowMajorMatrix<MT>::value &&
1486  IsNumeric<ST1>::value && IsNumeric<ST2>::value
1487  , typename SMatScalarMultExprTrait<MT,typename MultTrait<ST1,ST2>::Type>::Type
1488  , INVALID_TYPE >::Type Type;
1489  //**********************************************************************************************
1490 };
1492 //*************************************************************************************************
1493 
1494 
1495 
1496 
1497 //=================================================================================================
1498 //
1499 // TSMATSCALARMULTEXPRTRAIT SPECIALIZATIONS
1500 //
1501 //=================================================================================================
1502 
1503 //*************************************************************************************************
1505 template< typename MT, typename ST1, typename ST2 >
1506 struct TSMatScalarMultExprTrait< SMatScalarMultExpr<MT,ST1,true>, ST2 >
1507 {
1508  public:
1509  //**********************************************************************************************
1510  typedef typename SelectType< IsSparseMatrix<MT>::value && IsColumnMajorMatrix<MT>::value &&
1511  IsNumeric<ST1>::value && IsNumeric<ST2>::value
1512  , typename TSMatScalarMultExprTrait<MT,typename MultTrait<ST1,ST2>::Type>::Type
1513  , INVALID_TYPE >::Type Type;
1514  //**********************************************************************************************
1515 };
1517 //*************************************************************************************************
1518 
1519 
1520 
1521 
1522 //=================================================================================================
1523 //
1524 // SMATSCALARDIVEXPRTRAIT SPECIALIZATIONS
1525 //
1526 //=================================================================================================
1527 
1528 //*************************************************************************************************
1530 template< typename MT, typename ST1, typename ST2 >
1531 struct SMatScalarDivExprTrait< SMatScalarMultExpr<MT,ST1,false>, ST2 >
1532 {
1533  private:
1534  //**********************************************************************************************
1535  enum { condition = IsFloatingPoint<typename DivTrait<ST1,ST2>::Type>::value };
1536  //**********************************************************************************************
1537 
1538  //**********************************************************************************************
1539  typedef typename SMatScalarMultExprTrait<MT,typename DivTrait<ST1,ST2>::Type>::Type T1;
1540  typedef typename SMatScalarDivExprTrait<MT,typename DivTrait<ST1,ST2>::Type>::Type T2;
1541  //**********************************************************************************************
1542 
1543  public:
1544  //**********************************************************************************************
1545  typedef typename SelectType< IsSparseMatrix<MT>::value && IsRowMajorMatrix<MT>::value &&
1546  IsNumeric<ST1>::value && IsNumeric<ST2>::value
1547  , typename SelectType<condition,T1,T2>::Type
1548  , INVALID_TYPE >::Type Type;
1549  //**********************************************************************************************
1550 };
1552 //*************************************************************************************************
1553 
1554 
1555 
1556 
1557 //=================================================================================================
1558 //
1559 // TSMATSCALARDIVEXPRTRAIT SPECIALIZATIONS
1560 //
1561 //=================================================================================================
1562 
1563 //*************************************************************************************************
1565 template< typename MT, typename ST1, typename ST2 >
1566 struct TSMatScalarDivExprTrait< SMatScalarMultExpr<MT,ST1,true>, ST2 >
1567 {
1568  private:
1569  //**********************************************************************************************
1570  enum { condition = IsFloatingPoint<typename DivTrait<ST1,ST2>::Type>::value };
1571  //**********************************************************************************************
1572 
1573  //**********************************************************************************************
1574  typedef typename TSMatScalarMultExprTrait<MT,typename DivTrait<ST1,ST2>::Type>::Type T1;
1575  typedef typename TSMatScalarDivExprTrait<MT,typename DivTrait<ST1,ST2>::Type>::Type T2;
1576  //**********************************************************************************************
1577 
1578  public:
1579  //**********************************************************************************************
1580  typedef typename SelectType< IsSparseMatrix<MT>::value && IsColumnMajorMatrix<MT>::value &&
1581  IsNumeric<ST1>::value && IsNumeric<ST2>::value
1582  , typename SelectType<condition,T1,T2>::Type
1583  , INVALID_TYPE >::Type Type;
1584  //**********************************************************************************************
1585 };
1587 //*************************************************************************************************
1588 
1589 
1590 
1591 
1592 //=================================================================================================
1593 //
1594 // SMATDVECMULTEXPRTRAIT SPECIALIZATIONS
1595 //
1596 //=================================================================================================
1597 
1598 //*************************************************************************************************
1600 template< typename MT, typename ST, typename VT >
1601 struct SMatDVecMultExprTrait< SMatScalarMultExpr<MT,ST,false>, VT >
1602 {
1603  public:
1604  //**********************************************************************************************
1605  typedef typename SelectType< IsSparseMatrix<MT>::value && IsRowMajorMatrix<MT>::value &&
1606  IsDenseVector<VT>::value && IsColumnVector<VT>::value &&
1607  IsNumeric<ST>::value
1608  , typename DVecScalarMultExprTrait<typename SMatDVecMultExprTrait<MT,VT>::Type,ST>::Type
1609  , INVALID_TYPE >::Type Type;
1610  //**********************************************************************************************
1611 };
1613 //*************************************************************************************************
1614 
1615 
1616 //*************************************************************************************************
1618 template< typename MT, typename ST1, typename VT, typename ST2 >
1619 struct SMatDVecMultExprTrait< SMatScalarMultExpr<MT,ST1,false>, DVecScalarMultExpr<VT,ST2,false> >
1620 {
1621  public:
1622  //**********************************************************************************************
1623  typedef typename SelectType< IsSparseMatrix<MT>::value && IsRowMajorMatrix<MT>::value &&
1624  IsDenseVector<VT>::value && IsColumnVector<VT>::value &&
1625  IsNumeric<ST1>::value && IsNumeric<ST2>::value
1626  , typename DVecScalarMultExprTrait<typename SMatDVecMultExprTrait<MT,VT>::Type,typename MultTrait<ST1,ST2>::Type>::Type
1627  , INVALID_TYPE >::Type Type;
1628  //**********************************************************************************************
1629 };
1631 //*************************************************************************************************
1632 
1633 
1634 
1635 
1636 //=================================================================================================
1637 //
1638 // TSMATDVECMULTEXPRTRAIT SPECIALIZATIONS
1639 //
1640 //=================================================================================================
1641 
1642 //*************************************************************************************************
1644 template< typename MT, typename ST, typename VT >
1645 struct TSMatDVecMultExprTrait< SMatScalarMultExpr<MT,ST,true>, VT >
1646 {
1647  public:
1648  //**********************************************************************************************
1649  typedef typename SelectType< IsSparseMatrix<MT>::value && IsColumnMajorMatrix<MT>::value &&
1650  IsDenseVector<VT>::value && IsColumnVector<VT>::value &&
1651  IsNumeric<ST>::value
1652  , typename DVecScalarMultExprTrait<typename TSMatDVecMultExprTrait<MT,VT>::Type,ST>::Type
1653  , INVALID_TYPE >::Type Type;
1654  //**********************************************************************************************
1655 };
1657 //*************************************************************************************************
1658 
1659 
1660 //*************************************************************************************************
1662 template< typename MT, typename ST1, typename VT, typename ST2 >
1663 struct TSMatDVecMultExprTrait< SMatScalarMultExpr<MT,ST1,true>, DVecScalarMultExpr<VT,ST2,false> >
1664 {
1665  public:
1666  //**********************************************************************************************
1667  typedef typename SelectType< IsSparseMatrix<MT>::value && IsColumnMajorMatrix<MT>::value &&
1668  IsDenseVector<VT>::value && IsColumnVector<VT>::value &&
1669  IsNumeric<ST1>::value && IsNumeric<ST2>::value
1670  , typename DVecScalarMultExprTrait<typename TSMatDVecMultExprTrait<MT,VT>::Type,typename MultTrait<ST1,ST2>::Type>::Type
1671  , INVALID_TYPE >::Type Type;
1672  //**********************************************************************************************
1673 };
1675 //*************************************************************************************************
1676 
1677 
1678 
1679 
1680 //=================================================================================================
1681 //
1682 // TDVECSMATMULTEXPRTRAIT SPECIALIZATIONS
1683 //
1684 //=================================================================================================
1685 
1686 //*************************************************************************************************
1688 template< typename VT, typename MT, typename ST >
1689 struct TDVecSMatMultExprTrait< VT, SMatScalarMultExpr<MT,ST,false> >
1690 {
1691  public:
1692  //**********************************************************************************************
1693  typedef typename SelectType< IsDenseVector<VT>::value && IsRowVector<VT>::value &&
1694  IsSparseMatrix<MT>::value && IsRowMajorMatrix<MT>::value &&
1695  IsNumeric<ST>::value
1696  , typename TDVecScalarMultExprTrait<typename TDVecSMatMultExprTrait<VT,MT>::Type,ST>::Type
1697  , INVALID_TYPE >::Type Type;
1698  //**********************************************************************************************
1699 };
1701 //*************************************************************************************************
1702 
1703 
1704 //*************************************************************************************************
1706 template< typename VT, typename ST1, typename MT, typename ST2 >
1707 struct TDVecSMatMultExprTrait< DVecScalarMultExpr<VT,ST1,true>, SMatScalarMultExpr<MT,ST2,false> >
1708 {
1709  public:
1710  //**********************************************************************************************
1711  typedef typename SelectType< IsDenseVector<VT>::value && IsRowVector<VT>::value &&
1712  IsSparseMatrix<MT>::value && IsRowMajorMatrix<MT>::value &&
1713  IsNumeric<ST1>::value && IsNumeric<ST2>::value
1714  , typename TDVecScalarMultExprTrait<typename TDVecSMatMultExprTrait<VT,MT>::Type,typename MultTrait<ST1,ST2>::Type>::Type
1715  , INVALID_TYPE >::Type Type;
1716  //**********************************************************************************************
1717 };
1719 //*************************************************************************************************
1720 
1721 
1722 
1723 
1724 //=================================================================================================
1725 //
1726 // TDVECTSMATMULTEXPRTRAIT SPECIALIZATIONS
1727 //
1728 //=================================================================================================
1729 
1730 //*************************************************************************************************
1732 template< typename VT, typename MT, typename ST >
1733 struct TDVecTSMatMultExprTrait< VT, SMatScalarMultExpr<MT,ST,true> >
1734 {
1735  public:
1736  //**********************************************************************************************
1737  typedef typename SelectType< IsDenseVector<VT>::value && IsRowVector<VT>::value &&
1738  IsSparseMatrix<MT>::value && IsColumnMajorMatrix<MT>::value &&
1739  IsNumeric<ST>::value
1740  , typename TDVecScalarMultExprTrait<typename TDVecTSMatMultExprTrait<VT,MT>::Type,ST>::Type
1741  , INVALID_TYPE >::Type Type;
1742  //**********************************************************************************************
1743 };
1745 //*************************************************************************************************
1746 
1747 
1748 //*************************************************************************************************
1750 template< typename VT, typename ST1, typename MT, typename ST2 >
1751 struct TDVecTSMatMultExprTrait< DVecScalarMultExpr<VT,ST1,true>, SMatScalarMultExpr<MT,ST2,true> >
1752 {
1753  public:
1754  //**********************************************************************************************
1755  typedef typename SelectType< IsDenseVector<VT>::value && IsRowVector<VT>::value &&
1756  IsSparseMatrix<MT>::value && IsColumnMajorMatrix<MT>::value &&
1757  IsNumeric<ST1>::value && IsNumeric<ST2>::value
1758  , typename TDVecScalarMultExprTrait<typename TDVecTSMatMultExprTrait<VT,MT>::Type,typename MultTrait<ST1,ST2>::Type>::Type
1759  , INVALID_TYPE >::Type Type;
1760  //**********************************************************************************************
1761 };
1763 //*************************************************************************************************
1764 
1765 
1766 
1767 
1768 //=================================================================================================
1769 //
1770 // SMATSVECMULTEXPRTRAIT SPECIALIZATIONS
1771 //
1772 //=================================================================================================
1773 
1774 //*************************************************************************************************
1776 template< typename MT, typename ST, typename VT >
1777 struct SMatSVecMultExprTrait< SMatScalarMultExpr<MT,ST,false>, VT >
1778 {
1779  public:
1780  //**********************************************************************************************
1781  typedef typename SelectType< IsSparseMatrix<MT>::value && IsRowMajorMatrix<MT>::value &&
1782  IsSparseVector<VT>::value && IsColumnVector<VT>::value &&
1783  IsNumeric<ST>::value
1784  , typename SVecScalarMultExprTrait<typename SMatSVecMultExprTrait<MT,VT>::Type,ST>::Type
1785  , INVALID_TYPE >::Type Type;
1786  //**********************************************************************************************
1787 };
1789 //*************************************************************************************************
1790 
1791 
1792 //*************************************************************************************************
1794 template< typename MT, typename ST1, typename VT, typename ST2 >
1795 struct SMatSVecMultExprTrait< SMatScalarMultExpr<MT,ST1,false>, SVecScalarMultExpr<VT,ST2,false> >
1796 {
1797  public:
1798  //**********************************************************************************************
1799  typedef typename SelectType< IsSparseMatrix<MT>::value && IsRowMajorMatrix<MT>::value &&
1800  IsSparseVector<VT>::value && IsColumnVector<VT>::value &&
1801  IsNumeric<ST1>::value && IsNumeric<ST2>::value
1802  , typename SVecScalarMultExprTrait<typename SMatSVecMultExprTrait<MT,VT>::Type,typename MultTrait<ST1,ST2>::Type>::Type
1803  , INVALID_TYPE >::Type Type;
1804  //**********************************************************************************************
1805 };
1807 //*************************************************************************************************
1808 
1809 
1810 
1811 
1812 //=================================================================================================
1813 //
1814 // TSMATSVECMULTEXPRTRAIT SPECIALIZATIONS
1815 //
1816 //=================================================================================================
1817 
1818 //*************************************************************************************************
1820 template< typename MT, typename ST, typename VT >
1821 struct TSMatSVecMultExprTrait< SMatScalarMultExpr<MT,ST,true>, VT >
1822 {
1823  public:
1824  //**********************************************************************************************
1825  typedef typename SelectType< IsSparseMatrix<MT>::value && IsColumnMajorMatrix<MT>::value &&
1826  IsSparseVector<VT>::value && IsColumnVector<VT>::value &&
1827  IsNumeric<ST>::value
1828  , typename SVecScalarMultExprTrait<typename TSMatSVecMultExprTrait<MT,VT>::Type,ST>::Type
1829  , INVALID_TYPE >::Type Type;
1830  //**********************************************************************************************
1831 };
1833 //*************************************************************************************************
1834 
1835 
1836 //*************************************************************************************************
1838 template< typename MT, typename ST1, typename VT, typename ST2 >
1839 struct TSMatSVecMultExprTrait< SMatScalarMultExpr<MT,ST1,true>, SVecScalarMultExpr<VT,ST2,false> >
1840 {
1841  public:
1842  //**********************************************************************************************
1843  typedef typename SelectType< IsSparseMatrix<MT>::value && IsColumnMajorMatrix<MT>::value &&
1844  IsSparseVector<VT>::value && IsColumnVector<VT>::value &&
1845  IsNumeric<ST1>::value && IsNumeric<ST2>::value
1846  , typename SVecScalarMultExprTrait<typename TSMatSVecMultExprTrait<MT,VT>::Type,typename MultTrait<ST1,ST2>::Type>::Type
1847  , INVALID_TYPE >::Type Type;
1848  //**********************************************************************************************
1849 };
1851 //*************************************************************************************************
1852 
1853 
1854 
1855 
1856 //=================================================================================================
1857 //
1858 // TSVECSMATMULTEXPRTRAIT SPECIALIZATIONS
1859 //
1860 //=================================================================================================
1861 
1862 //*************************************************************************************************
1864 template< typename VT, typename MT, typename ST >
1865 struct TSVecSMatMultExprTrait< VT, SMatScalarMultExpr<MT,ST,false> >
1866 {
1867  public:
1868  //**********************************************************************************************
1869  typedef typename SelectType< IsSparseVector<VT>::value && IsRowVector<VT>::value &&
1870  IsSparseMatrix<MT>::value && IsRowMajorMatrix<MT>::value &&
1871  IsNumeric<ST>::value
1872  , typename TSVecScalarMultExprTrait<typename TSVecSMatMultExprTrait<VT,MT>::Type,ST>::Type
1873  , INVALID_TYPE >::Type Type;
1874  //**********************************************************************************************
1875 };
1877 //*************************************************************************************************
1878 
1879 
1880 //*************************************************************************************************
1882 template< typename VT, typename ST1, typename MT, typename ST2 >
1883 struct TSVecSMatMultExprTrait< SVecScalarMultExpr<VT,ST1,true>, SMatScalarMultExpr<MT,ST2,false> >
1884 {
1885  public:
1886  //**********************************************************************************************
1887  typedef typename SelectType< IsSparseVector<VT>::value && IsRowVector<VT>::value &&
1888  IsSparseMatrix<MT>::value && IsRowMajorMatrix<MT>::value &&
1889  IsNumeric<ST1>::value && IsNumeric<ST2>::value
1890  , typename TSVecScalarMultExprTrait<typename TSVecSMatMultExprTrait<VT,MT>::Type,typename MultTrait<ST1,ST2>::Type>::Type
1891  , INVALID_TYPE >::Type Type;
1892  //**********************************************************************************************
1893 };
1895 //*************************************************************************************************
1896 
1897 
1898 
1899 
1900 //=================================================================================================
1901 //
1902 // TSVECTSMATMULTEXPRTRAIT SPECIALIZATIONS
1903 //
1904 //=================================================================================================
1905 
1906 //*************************************************************************************************
1908 template< typename VT, typename MT, typename ST >
1909 struct TSVecTSMatMultExprTrait< VT, SMatScalarMultExpr<MT,ST,true> >
1910 {
1911  public:
1912  //**********************************************************************************************
1913  typedef typename SelectType< IsSparseVector<VT>::value && IsRowVector<VT>::value &&
1914  IsSparseMatrix<MT>::value && IsColumnMajorMatrix<MT>::value &&
1915  IsNumeric<ST>::value
1916  , typename TSVecScalarMultExprTrait<typename TSVecTSMatMultExprTrait<VT,MT>::Type,ST>::Type
1917  , INVALID_TYPE >::Type Type;
1918  //**********************************************************************************************
1919 };
1921 //*************************************************************************************************
1922 
1923 
1924 //*************************************************************************************************
1926 template< typename VT, typename ST1, typename MT, typename ST2 >
1927 struct TSVecTSMatMultExprTrait< SVecScalarMultExpr<VT,ST1,true>, SMatScalarMultExpr<MT,ST2,true> >
1928 {
1929  public:
1930  //**********************************************************************************************
1931  typedef typename SelectType< IsSparseVector<VT>::value && IsRowVector<VT>::value &&
1932  IsSparseMatrix<MT>::value && IsColumnMajorMatrix<MT>::value &&
1933  IsNumeric<ST1>::value && IsNumeric<ST2>::value
1934  , typename TSVecScalarMultExprTrait<typename TSVecTSMatMultExprTrait<VT,MT>::Type,typename MultTrait<ST1,ST2>::Type>::Type
1935  , INVALID_TYPE >::Type Type;
1936  //**********************************************************************************************
1937 };
1939 //*************************************************************************************************
1940 
1941 
1942 
1943 
1944 //=================================================================================================
1945 //
1946 // DMATSMATMULTEXPRTRAIT SPECIALIZATIONS
1947 //
1948 //=================================================================================================
1949 
1950 //*************************************************************************************************
1952 template< typename MT1, typename MT2, typename ST >
1953 struct DMatSMatMultExprTrait< MT1, SMatScalarMultExpr<MT2,ST,false> >
1954 {
1955  public:
1956  //**********************************************************************************************
1957  typedef typename SelectType< IsDenseMatrix<MT1>::value && IsRowMajorMatrix<MT1>::value &&
1958  IsSparseMatrix<MT2>::value && IsRowMajorMatrix<MT2>::value &&
1959  IsNumeric<ST>::value
1960  , typename DMatScalarMultExprTrait<typename DMatSMatMultExprTrait<MT1,MT2>::Type,ST>::Type
1961  , INVALID_TYPE >::Type Type;
1962  //**********************************************************************************************
1963 };
1965 //*************************************************************************************************
1966 
1967 
1968 
1969 
1970 //=================================================================================================
1971 //
1972 // DMATTSMATMULTEXPRTRAIT SPECIALIZATIONS
1973 //
1974 //=================================================================================================
1975 
1976 //*************************************************************************************************
1978 template< typename MT1, typename MT2, typename ST >
1979 struct DMatTSMatMultExprTrait< MT1, SMatScalarMultExpr<MT2,ST,true> >
1980 {
1981  public:
1982  //**********************************************************************************************
1983  typedef typename SelectType< IsDenseMatrix<MT1>::value && IsRowMajorMatrix<MT1>::value &&
1984  IsSparseMatrix<MT2>::value && IsColumnMajorMatrix<MT2>::value &&
1985  IsNumeric<ST>::value
1986  , typename DMatScalarMultExprTrait<typename DMatTSMatMultExprTrait<MT1,MT2>::Type,ST>::Type
1987  , INVALID_TYPE >::Type Type;
1988  //**********************************************************************************************
1989 };
1991 //*************************************************************************************************
1992 
1993 
1994 
1995 
1996 //=================================================================================================
1997 //
1998 // TDMATSMATMULTEXPRTRAIT SPECIALIZATIONS
1999 //
2000 //=================================================================================================
2001 
2002 //*************************************************************************************************
2004 template< typename MT1, typename MT2, typename ST >
2005 struct TDMatSMatMultExprTrait< MT1, SMatScalarMultExpr<MT2,ST,false> >
2006 {
2007  public:
2008  //**********************************************************************************************
2009  typedef typename SelectType< IsDenseMatrix<MT1>::value && IsColumnMajorMatrix<MT1>::value &&
2010  IsSparseMatrix<MT2>::value && IsRowMajorMatrix<MT2>::value &&
2011  IsNumeric<ST>::value
2012  , typename TDMatScalarMultExprTrait<typename TDMatSMatMultExprTrait<MT1,MT2>::Type,ST>::Type
2013  , INVALID_TYPE >::Type Type;
2014  //**********************************************************************************************
2015 };
2017 //*************************************************************************************************
2018 
2019 
2020 
2021 
2022 //=================================================================================================
2023 //
2024 // TDMATTSMATMULTEXPRTRAIT SPECIALIZATIONS
2025 //
2026 //=================================================================================================
2027 
2028 //*************************************************************************************************
2030 template< typename MT1, typename MT2, typename ST >
2031 struct TDMatTSMatMultExprTrait< MT1, SMatScalarMultExpr<MT2,ST,true> >
2032 {
2033  public:
2034  //**********************************************************************************************
2035  typedef typename SelectType< IsDenseMatrix<MT1>::value && IsColumnMajorMatrix<MT1>::value &&
2036  IsSparseMatrix<MT2>::value && IsColumnMajorMatrix<MT2>::value &&
2037  IsNumeric<ST>::value
2038  , typename TDMatScalarMultExprTrait<typename TDMatTSMatMultExprTrait<MT1,MT2>::Type,ST>::Type
2039  , INVALID_TYPE >::Type Type;
2040  //**********************************************************************************************
2041 };
2043 //*************************************************************************************************
2044 
2045 
2046 
2047 
2048 //=================================================================================================
2049 //
2050 // SMATDMATMULTEXPRTRAIT SPECIALIZATIONS
2051 //
2052 //=================================================================================================
2053 
2054 //*************************************************************************************************
2056 template< typename MT1, typename ST, typename MT2 >
2057 struct SMatDMatMultExprTrait< SMatScalarMultExpr<MT1,ST,false>, MT2 >
2058 {
2059  public:
2060  //**********************************************************************************************
2061  typedef typename SelectType< IsSparseMatrix<MT1>::value && IsRowMajorMatrix<MT1>::value &&
2062  IsDenseMatrix<MT2>::value && IsRowMajorMatrix<MT2>::value &&
2063  IsNumeric<ST>::value
2064  , typename DMatScalarMultExprTrait<typename SMatDMatMultExprTrait<MT1,MT2>::Type,ST>::Type
2065  , INVALID_TYPE >::Type Type;
2066  //**********************************************************************************************
2067 };
2069 //*************************************************************************************************
2070 
2071 
2072 
2073 
2074 //=================================================================================================
2075 //
2076 // SMATTDMATMULTEXPRTRAIT SPECIALIZATIONS
2077 //
2078 //=================================================================================================
2079 
2080 //*************************************************************************************************
2082 template< typename MT1, typename ST, typename MT2 >
2083 struct SMatTDMatMultExprTrait< SMatScalarMultExpr<MT1,ST,false>, MT2 >
2084 {
2085  public:
2086  //**********************************************************************************************
2087  typedef typename SelectType< IsSparseMatrix<MT1>::value && IsRowMajorMatrix<MT1>::value &&
2088  IsDenseMatrix<MT2>::value && IsColumnMajorMatrix<MT2>::value &&
2089  IsNumeric<ST>::value
2090  , typename DMatScalarMultExprTrait<typename SMatTDMatMultExprTrait<MT1,MT2>::Type,ST>::Type
2091  , INVALID_TYPE >::Type Type;
2092  //**********************************************************************************************
2093 };
2095 //*************************************************************************************************
2096 
2097 
2098 
2099 
2100 //=================================================================================================
2101 //
2102 // TSMATDMATMULTEXPRTRAIT SPECIALIZATIONS
2103 //
2104 //=================================================================================================
2105 
2106 //*************************************************************************************************
2108 template< typename MT1, typename ST, typename MT2 >
2109 struct TSMatDMatMultExprTrait< SMatScalarMultExpr<MT1,ST,true>, MT2 >
2110 {
2111  public:
2112  //**********************************************************************************************
2113  typedef typename SelectType< IsSparseMatrix<MT1>::value && IsColumnMajorMatrix<MT1>::value &&
2114  IsDenseMatrix<MT2>::value && IsRowMajorMatrix<MT2>::value &&
2115  IsNumeric<ST>::value
2116  , typename TDMatScalarMultExprTrait<typename TSMatDMatMultExprTrait<MT1,MT2>::Type,ST>::Type
2117  , INVALID_TYPE >::Type Type;
2118  //**********************************************************************************************
2119 };
2121 //*************************************************************************************************
2122 
2123 
2124 
2125 
2126 //=================================================================================================
2127 //
2128 // TSMATTDMATMULTEXPRTRAIT SPECIALIZATIONS
2129 //
2130 //=================================================================================================
2131 
2132 //*************************************************************************************************
2134 template< typename MT1, typename ST, typename MT2 >
2135 struct TSMatTDMatMultExprTrait< SMatScalarMultExpr<MT1,ST,true>, MT2 >
2136 {
2137  public:
2138  //**********************************************************************************************
2139  typedef typename SelectType< IsSparseMatrix<MT1>::value && IsColumnMajorMatrix<MT1>::value &&
2140  IsDenseMatrix<MT2>::value && IsColumnMajorMatrix<MT2>::value &&
2141  IsNumeric<ST>::value
2142  , typename TDMatScalarMultExprTrait<typename TSMatTDMatMultExprTrait<MT1,MT2>::Type,ST>::Type
2143  , INVALID_TYPE >::Type Type;
2144  //**********************************************************************************************
2145 };
2147 //*************************************************************************************************
2148 
2149 
2150 
2151 
2152 //=================================================================================================
2153 //
2154 // SMATSMATMULTEXPRTRAIT SPECIALIZATIONS
2155 //
2156 //=================================================================================================
2157 
2158 //*************************************************************************************************
2160 template< typename MT1, typename ST, typename MT2 >
2161 struct SMatSMatMultExprTrait< SMatScalarMultExpr<MT1,ST,false>, MT2 >
2162 {
2163  public:
2164  //**********************************************************************************************
2165  typedef typename SelectType< IsSparseMatrix<MT1>::value && IsRowMajorMatrix<MT1>::value &&
2166  IsSparseMatrix<MT2>::value && IsRowMajorMatrix<MT2>::value &&
2167  IsNumeric<ST>::value
2168  , typename SMatScalarMultExprTrait<typename SMatSMatMultExprTrait<MT1,MT2>::Type,ST>::Type
2169  , INVALID_TYPE >::Type Type;
2170  //**********************************************************************************************
2171 };
2173 //*************************************************************************************************
2174 
2175 
2176 //*************************************************************************************************
2178 template< typename MT1, typename MT2, typename ST >
2179 struct SMatSMatMultExprTrait< MT1, SMatScalarMultExpr<MT2,ST,false> >
2180 {
2181  public:
2182  //**********************************************************************************************
2183  typedef typename SelectType< IsSparseMatrix<MT1>::value && IsRowMajorMatrix<MT1>::value &&
2184  IsSparseMatrix<MT2>::value && IsRowMajorMatrix<MT2>::value &&
2185  IsNumeric<ST>::value
2186  , typename SMatScalarMultExprTrait<typename SMatSMatMultExprTrait<MT1,MT2>::Type,ST>::Type
2187  , INVALID_TYPE >::Type Type;
2188  //**********************************************************************************************
2189 };
2191 //*************************************************************************************************
2192 
2193 
2194 //*************************************************************************************************
2196 template< typename MT1, typename ST1, typename MT2, typename ST2 >
2197 struct SMatSMatMultExprTrait< SMatScalarMultExpr<MT1,ST1,false>, SMatScalarMultExpr<MT2,ST2,false> >
2198 {
2199  public:
2200  //**********************************************************************************************
2201  typedef typename SelectType< IsSparseMatrix<MT1>::value && IsRowMajorMatrix<MT1>::value &&
2202  IsSparseMatrix<MT2>::value && IsRowMajorMatrix<MT2>::value &&
2203  IsNumeric<ST1>::value && IsNumeric<ST2>::value
2204  , typename SMatScalarMultExprTrait<typename SMatSMatMultExprTrait<MT1,MT2>::Type,typename MultTrait<ST1,ST2>::Type>::Type
2205  , INVALID_TYPE >::Type Type;
2206  //**********************************************************************************************
2207 };
2209 //*************************************************************************************************
2210 
2211 
2212 
2213 
2214 //=================================================================================================
2215 //
2216 // SMATTSMATMULTEXPRTRAIT SPECIALIZATIONS
2217 //
2218 //=================================================================================================
2219 
2220 //*************************************************************************************************
2222 template< typename MT1, typename ST, typename MT2 >
2223 struct SMatTSMatMultExprTrait< SMatScalarMultExpr<MT1,ST,false>, MT2 >
2224 {
2225  public:
2226  //**********************************************************************************************
2227  typedef typename SelectType< IsSparseMatrix<MT1>::value && IsRowMajorMatrix<MT1>::value &&
2228  IsSparseMatrix<MT2>::value && IsColumnMajorMatrix<MT2>::value &&
2229  IsNumeric<ST>::value
2230  , typename SMatScalarMultExprTrait<typename SMatTSMatMultExprTrait<MT1,MT2>::Type,ST>::Type
2231  , INVALID_TYPE >::Type Type;
2232  //**********************************************************************************************
2233 };
2235 //*************************************************************************************************
2236 
2237 
2238 //*************************************************************************************************
2240 template< typename MT1, typename MT2, typename ST >
2241 struct SMatTSMatMultExprTrait< MT1, SMatScalarMultExpr<MT2,ST,true> >
2242 {
2243  public:
2244  //**********************************************************************************************
2245  typedef typename SelectType< IsSparseMatrix<MT1>::value && IsRowMajorMatrix<MT1>::value &&
2246  IsSparseMatrix<MT2>::value && IsColumnMajorMatrix<MT2>::value &&
2247  IsNumeric<ST>::value
2248  , typename SMatScalarMultExprTrait<typename SMatTSMatMultExprTrait<MT1,MT2>::Type,ST>::Type
2249  , INVALID_TYPE >::Type Type;
2250  //**********************************************************************************************
2251 };
2253 //*************************************************************************************************
2254 
2255 
2256 //*************************************************************************************************
2258 template< typename MT1, typename ST1, typename MT2, typename ST2 >
2259 struct SMatTSMatMultExprTrait< SMatScalarMultExpr<MT1,ST1,false>, SMatScalarMultExpr<MT2,ST2,true> >
2260 {
2261  public:
2262  //**********************************************************************************************
2263  typedef typename SelectType< IsSparseMatrix<MT1>::value && IsRowMajorMatrix<MT1>::value &&
2264  IsSparseMatrix<MT2>::value && IsColumnMajorMatrix<MT2>::value &&
2265  IsNumeric<ST1>::value && IsNumeric<ST2>::value
2266  , typename SMatScalarMultExprTrait<typename SMatTSMatMultExprTrait<MT1,MT2>::Type,typename MultTrait<ST1,ST2>::Type>::Type
2267  , INVALID_TYPE >::Type Type;
2268  //**********************************************************************************************
2269 };
2271 //*************************************************************************************************
2272 
2273 
2274 
2275 
2276 //=================================================================================================
2277 //
2278 // TSMATSMATMULTEXPRTRAIT SPECIALIZATIONS
2279 //
2280 //=================================================================================================
2281 
2282 //*************************************************************************************************
2284 template< typename MT1, typename ST, typename MT2 >
2285 struct TSMatSMatMultExprTrait< SMatScalarMultExpr<MT1,ST,true>, MT2 >
2286 {
2287  public:
2288  //**********************************************************************************************
2289  typedef typename SelectType< IsSparseMatrix<MT1>::value && IsColumnMajorMatrix<MT1>::value &&
2290  IsSparseMatrix<MT2>::value && IsRowMajorMatrix<MT2>::value &&
2291  IsNumeric<ST>::value
2292  , typename TSMatScalarMultExprTrait<typename TSMatSMatMultExprTrait<MT1,MT2>::Type,ST>::Type
2293  , INVALID_TYPE >::Type Type;
2294  //**********************************************************************************************
2295 };
2297 //*************************************************************************************************
2298 
2299 
2300 //*************************************************************************************************
2302 template< typename MT1, typename MT2, typename ST >
2303 struct TSMatSMatMultExprTrait< MT1, SMatScalarMultExpr<MT2,ST,false> >
2304 {
2305  public:
2306  //**********************************************************************************************
2307  typedef typename SelectType< IsSparseMatrix<MT1>::value && IsColumnMajorMatrix<MT1>::value &&
2308  IsSparseMatrix<MT2>::value && IsRowMajorMatrix<MT2>::value &&
2309  IsNumeric<ST>::value
2310  , typename TSMatScalarMultExprTrait<typename TSMatSMatMultExprTrait<MT1,MT2>::Type,ST>::Type
2311  , INVALID_TYPE >::Type Type;
2312  //**********************************************************************************************
2313 };
2315 //*************************************************************************************************
2316 
2317 
2318 //*************************************************************************************************
2320 template< typename MT1, typename ST1, typename MT2, typename ST2 >
2321 struct TSMatSMatMultExprTrait< SMatScalarMultExpr<MT1,ST1,true>, SMatScalarMultExpr<MT2,ST2,false> >
2322 {
2323  public:
2324  //**********************************************************************************************
2325  typedef typename SelectType< IsSparseMatrix<MT1>::value && IsColumnMajorMatrix<MT1>::value &&
2326  IsSparseMatrix<MT2>::value && IsRowMajorMatrix<MT2>::value &&
2327  IsNumeric<ST1>::value && IsNumeric<ST2>::value
2328  , typename TSMatScalarMultExprTrait<typename TSMatSMatMultExprTrait<MT1,MT2>::Type,typename MultTrait<ST1,ST2>::Type>::Type
2329  , INVALID_TYPE >::Type Type;
2330  //**********************************************************************************************
2331 };
2333 //*************************************************************************************************
2334 
2335 
2336 
2337 
2338 //=================================================================================================
2339 //
2340 // TSMATSMATMULTEXPRTRAIT SPECIALIZATIONS
2341 //
2342 //=================================================================================================
2343 
2344 //*************************************************************************************************
2346 template< typename MT1, typename ST, typename MT2 >
2347 struct TSMatTSMatMultExprTrait< SMatScalarMultExpr<MT1,ST,true>, MT2 >
2348 {
2349  public:
2350  //**********************************************************************************************
2351  typedef typename SelectType< IsSparseMatrix<MT1>::value && IsColumnMajorMatrix<MT1>::value &&
2352  IsSparseMatrix<MT2>::value && IsColumnMajorMatrix<MT2>::value &&
2353  IsNumeric<ST>::value
2354  , typename TSMatScalarMultExprTrait<typename TSMatTSMatMultExprTrait<MT1,MT2>::Type,ST>::Type
2355  , INVALID_TYPE >::Type Type;
2356  //**********************************************************************************************
2357 };
2359 //*************************************************************************************************
2360 
2361 
2362 //*************************************************************************************************
2364 template< typename MT1, typename MT2, typename ST >
2365 struct TSMatTSMatMultExprTrait< MT1, SMatScalarMultExpr<MT2,ST,true> >
2366 {
2367  public:
2368  //**********************************************************************************************
2369  typedef typename SelectType< IsSparseMatrix<MT1>::value && IsColumnMajorMatrix<MT1>::value &&
2370  IsSparseMatrix<MT2>::value && IsColumnMajorMatrix<MT2>::value &&
2371  IsNumeric<ST>::value
2372  , typename TSMatScalarMultExprTrait<typename TSMatTSMatMultExprTrait<MT1,MT2>::Type,ST>::Type
2373  , INVALID_TYPE >::Type Type;
2374  //**********************************************************************************************
2375 };
2377 //*************************************************************************************************
2378 
2379 
2380 //*************************************************************************************************
2382 template< typename MT1, typename ST1, typename MT2, typename ST2 >
2383 struct TSMatTSMatMultExprTrait< SMatScalarMultExpr<MT1,ST1,true>, SMatScalarMultExpr<MT2,ST2,true> >
2384 {
2385  public:
2386  //**********************************************************************************************
2387  typedef typename SelectType< IsSparseMatrix<MT1>::value && IsColumnMajorMatrix<MT1>::value &&
2388  IsSparseMatrix<MT2>::value && IsColumnMajorMatrix<MT2>::value &&
2389  IsNumeric<ST1>::value && IsNumeric<ST2>::value
2390  , typename TSMatScalarMultExprTrait<typename TSMatTSMatMultExprTrait<MT1,MT2>::Type,typename MultTrait<ST1,ST2>::Type>::Type
2391  , INVALID_TYPE >::Type Type;
2392  //**********************************************************************************************
2393 };
2395 //*************************************************************************************************
2396 
2397 
2398 
2399 
2400 //=================================================================================================
2401 //
2402 // SUBMATRIXEXPRTRAIT SPECIALIZATIONS
2403 //
2404 //=================================================================================================
2405 
2406 //*************************************************************************************************
2408 template< typename MT, typename ST, bool SO, bool AF >
2409 struct SubmatrixExprTrait< SMatScalarMultExpr<MT,ST,SO>, AF >
2410 {
2411  public:
2412  //**********************************************************************************************
2413  typedef typename MultExprTrait< typename SubmatrixExprTrait<const MT,AF>::Type, ST >::Type Type;
2414  //**********************************************************************************************
2415 };
2417 //*************************************************************************************************
2418 
2419 
2420 
2421 
2422 //=================================================================================================
2423 //
2424 // ROWEXPRTRAIT SPECIALIZATIONS
2425 //
2426 //=================================================================================================
2427 
2428 //*************************************************************************************************
2430 template< typename MT, typename ST, bool SO >
2431 struct RowExprTrait< SMatScalarMultExpr<MT,ST,SO> >
2432 {
2433  public:
2434  //**********************************************************************************************
2435  typedef typename MultExprTrait< typename RowExprTrait<const MT>::Type, ST >::Type Type;
2436  //**********************************************************************************************
2437 };
2439 //*************************************************************************************************
2440 
2441 
2442 
2443 
2444 //=================================================================================================
2445 //
2446 // COLUMNEXPRTRAIT SPECIALIZATIONS
2447 //
2448 //=================================================================================================
2449 
2450 //*************************************************************************************************
2452 template< typename MT, typename ST, bool SO >
2453 struct ColumnExprTrait< SMatScalarMultExpr<MT,ST,SO> >
2454 {
2455  public:
2456  //**********************************************************************************************
2457  typedef typename MultExprTrait< typename ColumnExprTrait<const MT>::Type, ST >::Type Type;
2458  //**********************************************************************************************
2459 };
2461 //*************************************************************************************************
2462 
2463 } // namespace blaze
2464 
2465 #endif
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:4838
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:936
PointerType pointer
Pointer return type.
Definition: SMatScalarMultExpr.h:212
IteratorCategory iterator_category
The iterator category.
Definition: SMatScalarMultExpr.h:210
MT::CompositeType CT
Composite type of the sparse matrix expression.
Definition: SMatScalarMultExpr.h:119
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:205
Header file for the ColumnExprTrait class template.
Header file for the IsColumnMajorMatrix type trait.
RemoveReference< LeftOperand >::Type::ConstIterator IteratorType
Iterator type of the sparse matrix expression.
Definition: SMatScalarMultExpr.h:201
DifferenceType operator-(const ConstIterator &rhs) const
Calculating the number of elements between two expression iterators.
Definition: SMatScalarMultExpr.h:305
const This & CompositeType
Data type for composite expression templates.
Definition: CompressedMatrix.h:2478
Header file for the IsRowVector type trait.
Type ElementType
Type of the sparse matrix elements.
Definition: CompressedMatrix.h:257
ptrdiff_t DifferenceType
Difference between two iterators.
Definition: SMatScalarMultExpr.h:207
size_t columns() const
Returns the current number of columns of the matrix.
Definition: SMatScalarMultExpr.h:386
ValueType value_type
Type of the underlying pointers.
Definition: SMatScalarMultExpr.h:211
const DMatSerialExpr< MT, SO > serial(const DenseMatrix< MT, SO > &dm)
Forces the serial evaluation of the given dense matrix expression dm.
Definition: DMatSerialExpr.h:695
Header file for the Computation base class.
IteratorType matrix_
Iterator over the elements of the left-hand side sparse matrix expression.
Definition: SMatScalarMultExpr.h:312
Header file for the RequiresEvaluation type trait.
bool isAliased(const T *alias) const
Returns whether the expression is aliased with the given address alias.
Definition: SMatScalarMultExpr.h:490
ConstIterator end(size_t i) const
Returns an iterator just past the last non-zero element of row i.
Definition: SMatScalarMultExpr.h:366
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
std::forward_iterator_tag IteratorCategory
The iterator category.
Definition: SMatScalarMultExpr.h:203
Constraint on the data type.
SelectType< useAssign, const ResultType, const SMatScalarMultExpr & >::Type CompositeType
Data type for composite expression templates.
Definition: SMatScalarMultExpr.h:181
Header file for the SparseMatrix base class.
Header file for the DivExprTrait class template.
bool canAlias(const T *alias) const
Returns whether the expression can alias with the given address alias.
Definition: SMatScalarMultExpr.h:478
Constraint on the data type.
Header file for the MultExprTrait class template.
Compile time check to query the requirement to evaluate an expression.Via this type trait it is possi...
Definition: RequiresEvaluation.h:90
const This & CompositeType
Data type for composite expression templates.
Definition: CompressedMatrix.h:259
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.
Header file for the IsSymmetric type trait.
RightOperand scalar_
Right-hand side scalar of the multiplication expression.
Definition: SMatScalarMultExpr.h:498
Header file for the IsFloatingPoint type trait.
const Element * ConstIterator
Iterator over constant elements.
Definition: CompressedMatrix.h:2482
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.
Element ValueType
Type of the underlying pointers.
Definition: SMatScalarMultExpr.h:204
#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.
const SelectType< returnExpr, ExprReturnType, ElementType >::Type ReturnType
Return type for expression template evaluations.
Definition: SMatScalarMultExpr.h:178
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:432
#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
Constraints on the storage order of matrix types.
MultTrait< RT, ST >::Type ResultType
Result type for expression template evaluations.
Definition: SMatScalarMultExpr.h:172
RightOperand scalar_
Right-hand side scalar of the multiplication expression.
Definition: SMatScalarMultExpr.h:313
MultExprTrait< RN, ST >::Type ExprReturnType
Expression return type for the subscript operator.
Definition: SMatScalarMultExpr.h:132
Constraint on the data type.
Header file for the SelectType class template.
SMatScalarMultExpr(const MT &matrix, ST scalar)
Constructor for the SMatScalarMultExpr class.
Definition: SMatScalarMultExpr.h:329
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.
ConstIterator begin(size_t i) const
Returns an iterator to the first non-zero element of row i.
Definition: SMatScalarMultExpr.h:355
Header file for the EnableIf class template.
SMatScalarMultExpr< MT, ST, SO > This
Type of this SMatScalarMultExpr instance.
Definition: SMatScalarMultExpr.h:171
Header file for the serial shim.
Header file for the BaseElementType type trait.
LeftOperand matrix_
Left-hand side sparse matrix of the multiplication expression.
Definition: SMatScalarMultExpr.h:497
Header file for the IsNumeric type trait.
size_t rows() const
Returns the current number of rows of the matrix.
Definition: SMatScalarMultExpr.h:376
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:2477
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.
Base template for the MultTrait class.
Definition: MultTrait.h:142
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.
size_t nonZeros() const
Returns the number of non-zero elements in the sparse matrix.
Definition: SMatScalarMultExpr.h:396
bool operator!=(const ConstIterator &rhs) const
Inequality comparison between two ConstIterator objects.
Definition: SMatScalarMultExpr.h:294
const DenseIterator< Type > operator-(const DenseIterator< Type > &it, ptrdiff_t inc)
Subtraction between a DenseIterator and an integral value.
Definition: DenseIterator.h:585
Substitution Failure Is Not An Error (SFINAE) class.The EnableIf class template is an auxiliary tool ...
Definition: EnableIf.h:184
bool operator==(const ConstIterator &rhs) const
Equality comparison between two ConstIterator objects.
Definition: SMatScalarMultExpr.h:283
#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
RightOperand rightOperand() const
Returns the right-hand side scalar operand.
Definition: SMatScalarMultExpr.h:466
const Element operator*() const
Direct access to the sparse matrix element at the current iterator position.
Definition: SMatScalarMultExpr.h:242
#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:193
Evaluation of the base element type of a given data type.Via this type trait it is possible to evalua...
Definition: BaseElementType.h:80
Header file for the RemoveReference type trait.
ValueType * PointerType
Pointer return type.
Definition: SMatScalarMultExpr.h:205
ConstIterator & operator++()
Pre-increment operator.
Definition: SMatScalarMultExpr.h:231
Header file for the IsDenseVector type trait.
ReturnType operator()(size_t i, size_t j) const
2D-access to the matrix elements.
Definition: SMatScalarMultExpr.h:342
ResultType::ElementType ElementType
Resulting element type.
Definition: SMatScalarMultExpr.h:175
ConstIterator upperBound(size_t i, size_t j) const
Returns an iterator to the first index greater then the given index.
Definition: SMatScalarMultExpr.h:445
ReferenceType reference
Reference return type.
Definition: SMatScalarMultExpr.h:213
ValueIndexPair< ElementType > Element
Element type of the sparse matrix expression.
Definition: SMatScalarMultExpr.h:198
ReturnType value() const
Access to the current value of the sparse element.
Definition: SMatScalarMultExpr.h:262
size_t nonZeros(size_t i) const
Returns the number of non-zero elements in the specified row.
Definition: SMatScalarMultExpr.h:407
Index-value-pair for sparse vectors and matrices.The ValueIndexPair class represents a single index-v...
Definition: ValueIndexPair.h:70
SelectType< IsExpression< MT >::value, const MT, const MT & >::Type LeftOperand
Composite data type of the sparse matrix expression.
Definition: SMatScalarMultExpr.h:184
Header file for the IsRowMajorMatrix type trait.
const ConstIterator * operator->() const
Direct access to the sparse matrix element at the current iterator position.
Definition: SMatScalarMultExpr.h:252
Header file for the IsComputation type trait class.
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
ST RightOperand
Composite type of the right-hand side scalar value.
Definition: SMatScalarMultExpr.h:187
#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:2473
Header file for the IsTrue value trait.
Header file for basic type definitions.
ConstIterator(IteratorType matrix, RightOperand scalar)
Constructor for the ConstIterator class.
Definition: SMatScalarMultExpr.h:220
Header file for the IsUpper type trait.
size_t index() const
Access to the current index of the sparse element.
Definition: SMatScalarMultExpr.h:272
ResultType::OppositeType OppositeType
Result type with opposite storage order for expression template evaluations.
Definition: SMatScalarMultExpr.h:173
Header file for the IsColumnVector type trait.
DifferenceType difference_type
Difference between two iterators.
Definition: SMatScalarMultExpr.h:214
ValueType & ReferenceType
Reference return type.
Definition: SMatScalarMultExpr.h:206
MT::ReturnType RN
Return type of the sparse matrix expression.
Definition: SMatScalarMultExpr.h:118
MT::ResultType RT
Result type of the sparse matrix expression.
Definition: SMatScalarMultExpr.h:117
Evaluation of the resulting expression type of a multiplication.Via this type trait it is possible to...
Definition: MultExprTrait.h:137
ResultType::TransposeType TransposeType
Transpose type for expression template evaluations.
Definition: SMatScalarMultExpr.h:174
#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
ConstIterator find(size_t i, size_t j) const
Searches for a specific matrix element.
Definition: SMatScalarMultExpr.h:419
LeftOperand leftOperand() const
Returns the left-hand side sparse matrix operand.
Definition: SMatScalarMultExpr.h:456
#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