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>
72 #include <blaze/util/Assert.h>
76 #include <blaze/util/EnableIf.h>
77 #include <blaze/util/InvalidType.h>
79 #include <blaze/util/SelectType.h>
80 #include <blaze/util/Types.h>
84 
85 
86 namespace blaze {
87 
88 //=================================================================================================
89 //
90 // CLASS SMATSCALARMULTEXPR
91 //
92 //=================================================================================================
93 
94 //*************************************************************************************************
101 template< typename MT // Type of the left-hand side sparse matrix
102  , typename ST // Type of the right-hand side scalar value
103  , bool SO > // Storage order
104 class SMatScalarMultExpr : public SparseMatrix< SMatScalarMultExpr<MT,ST,SO>, SO >
105  , private MatScalarMultExpr
106  , private Computation
107 {
108  private:
109  //**Type definitions****************************************************************************
110  typedef typename MT::ResultType RT;
111  typedef typename MT::ReturnType RN;
112  typedef typename MT::CompositeType CT;
113  //**********************************************************************************************
114 
115  //**Return type evaluation**********************************************************************
117 
122  enum { returnExpr = !IsTemporary<RN>::value };
123 
126  //**********************************************************************************************
127 
128  //**Evaluation strategy*************************************************************************
130 
136  enum { useAssign = RequiresEvaluation<MT>::value };
137 
139  template< typename MT2 >
141  struct UseAssign {
142  enum { value = useAssign };
143  };
145  //**********************************************************************************************
146 
147  public:
148  //**Type definitions****************************************************************************
154 
157 
160 
162  typedef typename SelectType< IsExpression<MT>::value, const MT, const MT& >::Type LeftOperand;
163 
165  typedef ST RightOperand;
166  //**********************************************************************************************
167 
168  //**ConstIterator class definition**************************************************************
172  {
173  public:
174  //**Type definitions*************************************************************************
177 
180 
181  typedef std::forward_iterator_tag IteratorCategory;
182  typedef Element ValueType;
186 
187  // STL iterator requirements
193  //*******************************************************************************************
194 
195  //**Constructor******************************************************************************
198  inline ConstIterator( IteratorType matrix, RightOperand scalar )
199  : matrix_( matrix ) // Iterator over the elements of the left-hand side sparse matrix expression
200  , scalar_( scalar ) // Right-hand side scalar of the multiplication expression
201  {}
202  //*******************************************************************************************
203 
204  //**Prefix increment operator****************************************************************
210  ++matrix_;
211  return *this;
212  }
213  //*******************************************************************************************
214 
215  //**Element access operator******************************************************************
220  inline const Element operator*() const {
221  return Element( matrix_->value() * scalar_, matrix_->index() );
222  }
223  //*******************************************************************************************
224 
225  //**Element access operator******************************************************************
230  inline const ConstIterator* operator->() const {
231  return this;
232  }
233  //*******************************************************************************************
234 
235  //**Value function***************************************************************************
240  inline ReturnType value() const {
241  return matrix_->value() * scalar_;
242  }
243  //*******************************************************************************************
244 
245  //**Index function***************************************************************************
250  inline size_t index() const {
251  return matrix_->index();
252  }
253  //*******************************************************************************************
254 
255  //**Equality operator************************************************************************
261  inline bool operator==( const ConstIterator& rhs ) const {
262  return matrix_ == rhs.matrix_;
263  }
264  //*******************************************************************************************
265 
266  //**Inequality operator**********************************************************************
272  inline bool operator!=( const ConstIterator& rhs ) const {
273  return matrix_ != rhs.matrix_;
274  }
275  //*******************************************************************************************
276 
277  //**Subtraction operator*********************************************************************
283  inline DifferenceType operator-( const ConstIterator& rhs ) const {
284  return matrix_ - rhs.matrix_;
285  }
286  //*******************************************************************************************
287 
288  private:
289  //**Member variables*************************************************************************
292  //*******************************************************************************************
293  };
294  //**********************************************************************************************
295 
296  //**Compilation flags***************************************************************************
298  enum { smpAssignable = 0 };
299  //**********************************************************************************************
300 
301  //**Constructor*********************************************************************************
307  explicit inline SMatScalarMultExpr( const MT& matrix, ST scalar )
308  : matrix_( matrix ) // Left-hand side sparse matrix of the multiplication expression
309  , scalar_( scalar ) // Right-hand side scalar of the multiplication expression
310  {}
311  //**********************************************************************************************
312 
313  //**Access operator*****************************************************************************
320  inline ReturnType operator()( size_t i, size_t j ) const {
321  BLAZE_INTERNAL_ASSERT( i < matrix_.rows() , "Invalid row access index" );
322  BLAZE_INTERNAL_ASSERT( j < matrix_.columns(), "Invalid column access index" );
323  return matrix_(i,j) * scalar_;
324  }
325  //**********************************************************************************************
326 
327  //**Begin function******************************************************************************
333  inline ConstIterator begin( size_t i ) const {
334  return ConstIterator( matrix_.begin(i), scalar_ );
335  }
336  //**********************************************************************************************
337 
338  //**End function********************************************************************************
344  inline ConstIterator end( size_t i ) const {
345  return ConstIterator( matrix_.end(i), scalar_ );
346  }
347  //**********************************************************************************************
348 
349  //**Rows function*******************************************************************************
354  inline size_t rows() const {
355  return matrix_.rows();
356  }
357  //**********************************************************************************************
358 
359  //**Columns function****************************************************************************
364  inline size_t columns() const {
365  return matrix_.columns();
366  }
367  //**********************************************************************************************
368 
369  //**NonZeros function***************************************************************************
374  inline size_t nonZeros() const {
375  return matrix_.nonZeros();
376  }
377  //**********************************************************************************************
378 
379  //**NonZeros function***************************************************************************
385  inline size_t nonZeros( size_t i ) const {
386  return matrix_.nonZeros(i);
387  }
388  //**********************************************************************************************
389 
390  //**Left operand access*************************************************************************
395  inline LeftOperand leftOperand() const {
396  return matrix_;
397  }
398  //**********************************************************************************************
399 
400  //**Right operand access************************************************************************
405  inline RightOperand rightOperand() const {
406  return scalar_;
407  }
408  //**********************************************************************************************
409 
410  //**********************************************************************************************
416  template< typename T >
417  inline bool canAlias( const T* alias ) const {
418  return matrix_.canAlias( alias );
419  }
420  //**********************************************************************************************
421 
422  //**********************************************************************************************
428  template< typename T >
429  inline bool isAliased( const T* alias ) const {
430  return matrix_.isAliased( alias );
431  }
432  //**********************************************************************************************
433 
434  private:
435  //**Member variables****************************************************************************
438  //**********************************************************************************************
439 
440  //**Assignment to dense matrices****************************************************************
454  template< typename MT2 // Type of the target dense matrix
455  , bool SO2 > // Storage order of the target dense matrix
456  friend inline typename EnableIf< UseAssign<MT2> >::Type
458  {
460 
461  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
462  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
463 
464  assign( ~lhs, rhs.matrix_ );
465  (~lhs) *= rhs.scalar_;
466  }
468  //**********************************************************************************************
469 
470  //**Assignment to sparse matrices***************************************************************
484  template< typename MT2 // Type of the target sparse matrix
485  , bool SO2 > // Storage order of the target sparse matrix
486  friend inline typename EnableIf< UseAssign<MT2> >::Type
488  {
490 
491  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
492  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
493 
494  assign( ~lhs, rhs.matrix_ );
495  (~lhs) *= rhs.scalar_;
496  }
498  //**********************************************************************************************
499 
500  //**Addition assignment to dense matrices*******************************************************
514  template< typename MT2 // Type of the target dense matrix
515  , bool SO2 > // Storage order of the target dense matrix
516  friend inline typename EnableIf< UseAssign<MT2> >::Type
517  addAssign( DenseMatrix<MT2,SO2>& lhs, const SMatScalarMultExpr& rhs )
518  {
520 
523 
524  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
525  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
526 
527  const ResultType tmp( rhs );
528  smpAddAssign( ~lhs, tmp );
529  }
531  //**********************************************************************************************
532 
533  //**Addition assignment to sparse matrices******************************************************
534  // No special implementation for the addition assignment to sparse matrices.
535  //**********************************************************************************************
536 
537  //**Subtraction assignment to dense matrices****************************************************
551  template< typename MT2 // Type of the target dense matrix
552  , bool SO2 > // Storage order of the target dense matrix
553  friend inline typename EnableIf< UseAssign<MT2> >::Type
554  subAssign( DenseMatrix<MT2,SO2>& lhs, const SMatScalarMultExpr& rhs )
555  {
557 
560 
561  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
562  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
563 
564  const ResultType tmp( rhs );
565  smpSubAssign( ~lhs, tmp );
566  }
568  //**********************************************************************************************
569 
570  //**Subtraction assignment to sparse matrices***************************************************
571  // No special implementation for the subtraction assignment to sparse matrices.
572  //**********************************************************************************************
573 
574  //**Multiplication assignment to dense matrices*************************************************
575  // No special implementation for the multiplication assignment to dense matrices.
576  //**********************************************************************************************
577 
578  //**Multiplication assignment to sparse matrices************************************************
579  // No special implementation for the multiplication assignment to sparse matrices.
580  //**********************************************************************************************
581 
582  //**Compile time checks*************************************************************************
589  //**********************************************************************************************
590 };
591 //*************************************************************************************************
592 
593 
594 
595 
596 //=================================================================================================
597 //
598 // GLOBAL UNARY ARITHMETIC OPERATORS
599 //
600 //=================================================================================================
601 
602 //*************************************************************************************************
619 template< typename MT // Data type of the sparse matrix
620  , bool SO > // Storage order
621 inline const SMatScalarMultExpr<MT,typename BaseElementType<MT>::Type,SO>
623 {
625 
626  typedef typename BaseElementType<MT>::Type ElementType;
628 }
629 //*************************************************************************************************
630 
631 
632 
633 
634 //=================================================================================================
635 //
636 // GLOBAL BINARY ARITHMETIC OPERATORS
637 //
638 //=================================================================================================
639 
640 //*************************************************************************************************
661 template< typename T1 // Type of the left-hand side sparse matrix
662  , bool SO // Storage order of the left-hand side sparse matrix
663  , typename T2 > // Type of the right-hand side scalar
664 inline const typename EnableIf< IsNumeric<T2>, typename MultExprTrait<T1,T2>::Type >::Type
665  operator*( const SparseMatrix<T1,SO>& mat, T2 scalar )
666 {
668 
669  typedef typename MultExprTrait<T1,T2>::Type Type;
670  return Type( ~mat, scalar );
671 }
672 //*************************************************************************************************
673 
674 
675 //*************************************************************************************************
696 template< typename T1 // Type of the left-hand side scalar
697  , typename T2 // Type of the right-hand side sparse matrix
698  , bool SO > // Storage order of the right-hand side sparse matrix
699 inline const typename EnableIf< IsNumeric<T1>, typename MultExprTrait<T1,T2>::Type >::Type
700  operator*( T1 scalar, const SparseMatrix<T2,SO>& mat )
701 {
703 
704  typedef typename MultExprTrait<T1,T2>::Type Type;
705  return Type( ~mat, scalar );
706 }
707 //*************************************************************************************************
708 
709 
710 
711 
712 //=================================================================================================
713 //
714 // GLOBAL RESTRUCTURING UNARY ARITHMETIC OPERATORS
715 //
716 //=================================================================================================
717 
718 //*************************************************************************************************
730 template< typename VT // Type of the sparse matrix
731  , typename ST // Type of the scalar
732  , bool TF > // Transpose flag
733 inline const SMatScalarMultExpr<VT,ST,TF>
734  operator-( const SMatScalarMultExpr<VT,ST,TF>& sm )
735 {
737 
738  return SMatScalarMultExpr<VT,ST,TF>( sm.leftOperand(), -sm.rightOperand() );
739 }
741 //*************************************************************************************************
742 
743 
744 
745 
746 //=================================================================================================
747 //
748 // GLOBAL RESTRUCTURING BINARY ARITHMETIC OPERATORS
749 //
750 //=================================================================================================
751 
752 //*************************************************************************************************
765 template< typename MT // Type of the sparse matrix
766  , typename ST1 // Type of the first scalar
767  , bool SO // Storage order of the sparse matrix
768  , typename ST2 > // Type of the second scalar
769 inline const typename EnableIf< IsNumeric<ST2>
770  , typename MultExprTrait< SMatScalarMultExpr<MT,ST1,SO>, ST2 >::Type >::Type
771  operator*( const SMatScalarMultExpr<MT,ST1,SO>& mat, ST2 scalar )
772 {
774 
775  return mat.leftOperand() * ( mat.rightOperand() * scalar );
776 }
778 //*************************************************************************************************
779 
780 
781 //*************************************************************************************************
794 template< typename ST1 // Type of the first scalar
795  , typename MT // Type of the sparse matrix
796  , typename ST2 // Type of the second scalar
797  , bool SO > // Storage order of the sparse matrix
798 inline const typename EnableIf< IsNumeric<ST1>
799  , typename MultExprTrait< ST1, SMatScalarMultExpr<MT,ST2,SO> >::Type >::Type
800  operator*( ST1 scalar, const SMatScalarMultExpr<MT,ST2,SO>& mat )
801 {
803 
804  return mat.leftOperand() * ( scalar * mat.rightOperand() );
805 }
807 //*************************************************************************************************
808 
809 
810 //*************************************************************************************************
823 template< typename MT // Type of the sparse matrix
824  , typename ST1 // Type of the first scalar
825  , bool SO // Storage order of the sparse matrix
826  , typename ST2 > // Type of the second scalar
827 inline const typename EnableIf< IsFloatingPoint<typename DivTrait<ST1,ST2>::Type>
828  , typename DivExprTrait< SMatScalarMultExpr<MT,ST1,SO>, ST2 >::Type >::Type
829  operator/( const SMatScalarMultExpr<MT,ST1,SO>& mat, ST2 scalar )
830 {
832 
833  return mat.leftOperand() * ( mat.rightOperand() / scalar );
834 }
836 //*************************************************************************************************
837 
838 
839 //*************************************************************************************************
853 template< typename MT // Type of the sparse matrix of the left-hand side expression
854  , typename ST // Type of the scalar of the left-hand side expression
855  , bool SO // Storage order of the left-hand side expression
856  , typename VT > // Type of the right-hand side dense vector
857 inline const typename MultExprTrait< SMatScalarMultExpr<MT,ST,SO>, VT >::Type
858  operator*( const SMatScalarMultExpr<MT,ST,SO>& mat, const DenseVector<VT,false>& vec )
859 {
861 
862  return ( mat.leftOperand() * (~vec) ) * mat.rightOperand();
863 }
865 //*************************************************************************************************
866 
867 
868 //*************************************************************************************************
882 template< typename VT // Type of the left-hand side dense vector
883  , typename MT // Type of the sparse matrix of the right-hand side expression
884  , typename ST // Type of the scalar of the right-hand side expression
885  , bool SO > // Storage order of the right-hand side expression
886 inline const typename MultExprTrait< VT, SMatScalarMultExpr<MT,ST,SO> >::Type
887  operator*( const DenseVector<VT,true>& vec, const SMatScalarMultExpr<MT,ST,SO>& mat )
888 {
890 
891  return ( (~vec) * mat.leftOperand() ) * mat.rightOperand();
892 }
894 //*************************************************************************************************
895 
896 
897 //*************************************************************************************************
913 template< typename MT // Type of the sparse matrix of the left-hand side expression
914  , typename ST1 // Type of the scalar of the left-hand side expression
915  , bool SO // Storage order of the left-hand side expression
916  , typename VT // Type of the dense vector of the right-hand side expression
917  , typename ST2 > // Type of the scalar of the right-hand side expression
918 inline const typename MultExprTrait< SMatScalarMultExpr<MT,ST1,SO>, DVecScalarMultExpr<VT,ST2,false> >::Type
919  operator*( const SMatScalarMultExpr<MT,ST1,SO>& mat, const DVecScalarMultExpr<VT,ST2,false>& vec )
920 {
922 
923  return ( mat.leftOperand() * vec.leftOperand() ) * ( mat.rightOperand() * vec.rightOperand() );
924 }
926 //*************************************************************************************************
927 
928 
929 //*************************************************************************************************
945 template< typename VT // Type of the dense vector of the left-hand side expression
946  , typename ST1 // Type of the scalar of the left-hand side expression
947  , typename MT // Type of the sparse matrix of the right-hand side expression
948  , typename ST2 // Type of the scalar of the right-hand side expression
949  , bool SO > // Storage order of the right-hand side expression
950 inline const typename MultExprTrait< DVecScalarMultExpr<VT,ST1,true>, SMatScalarMultExpr<MT,ST2,SO> >::Type
951  operator*( const DVecScalarMultExpr<VT,ST1,true>& vec, const SMatScalarMultExpr<MT,ST2,SO>& mat )
952 {
954 
955  return ( vec.leftOperand() * mat.leftOperand() ) * ( vec.rightOperand() * mat.rightOperand() );
956 }
958 //*************************************************************************************************
959 
960 
961 //*************************************************************************************************
975 template< typename MT // Type of the sparse matrix of the left-hand side expression
976  , typename ST // Type of the scalar of the left-hand side expression
977  , bool SO // Storage order of the left-hand side expression
978  , typename VT > // Type of the right-hand side sparse vector
979 inline const typename MultExprTrait< SMatScalarMultExpr<MT,ST,SO>, VT >::Type
980  operator*( const SMatScalarMultExpr<MT,ST,SO>& mat, const SparseVector<VT,false>& vec )
981 {
983 
984  return ( mat.leftOperand() * (~vec) ) * mat.rightOperand();
985 }
987 //*************************************************************************************************
988 
989 
990 //*************************************************************************************************
1004 template< typename VT // Type of the left-hand side sparse vector
1005  , typename MT // Type of the sparse matrix of the right-hand side expression
1006  , typename ST // Type of the scalar of the right-hand side expression
1007  , bool SO > // Storage order of the right-hand side expression
1008 inline const typename MultExprTrait< VT, SMatScalarMultExpr<MT,ST,SO> >::Type
1009  operator*( const SparseVector<VT,true>& vec, const SMatScalarMultExpr<MT,ST,SO>& mat )
1010 {
1012 
1013  return ( (~vec) * mat.leftOperand() ) * mat.rightOperand();
1014 }
1016 //*************************************************************************************************
1017 
1018 
1019 //*************************************************************************************************
1035 template< typename MT // Type of the sparse matrix of the left-hand side expression
1036  , typename ST1 // Type of the scalar of the left-hand side expression
1037  , bool SO // Storage order of the left-hand side expression
1038  , typename VT // Type of the sparse vector of the right-hand side expression
1039  , typename ST2 > // Type of the scalar of the right-hand side expression
1040 inline const typename MultExprTrait< SMatScalarMultExpr<MT,ST1,SO>, SVecScalarMultExpr<VT,ST2,false> >::Type
1041  operator*( const SMatScalarMultExpr<MT,ST1,SO>& mat, const SVecScalarMultExpr<VT,ST2,false>& vec )
1042 {
1044 
1045  return ( mat.leftOperand() * vec.leftOperand() ) * ( mat.rightOperand() * vec.rightOperand() );
1046 }
1048 //*************************************************************************************************
1049 
1050 
1051 //*************************************************************************************************
1067 template< typename VT // Type of the sparse vector of the left-hand side expression
1068  , typename ST1 // Type of the scalar of the left-hand side expression
1069  , typename MT // Type of the sparse matrix of the right-hand side expression
1070  , typename ST2 // Type of the scalar of the right-hand side expression
1071  , bool SO > // Storage order of the right-hand side expression
1072 inline const typename MultExprTrait< SVecScalarMultExpr<VT,ST1,true>, SMatScalarMultExpr<MT,ST2,SO> >::Type
1073  operator*( const SVecScalarMultExpr<VT,ST1,true>& vec, const SMatScalarMultExpr<MT,ST2,SO>& mat )
1074 {
1076 
1077  return ( vec.leftOperand() * mat.leftOperand() ) * ( vec.rightOperand() * mat.rightOperand() );
1078 }
1080 //*************************************************************************************************
1081 
1082 
1083 //*************************************************************************************************
1097 template< typename MT1 // Type of the sparse matrix of the left-hand side expression
1098  , typename ST // Type of the scalar of the left-hand side expression
1099  , bool SO1 // Storage order of the left-hand side expression
1100  , typename MT2 // Type of the right-hand side dense matrix
1101  , bool SO2 > // Storage order of the right-hand side dense matrix
1102 inline const typename MultExprTrait< SMatScalarMultExpr<MT1,ST,SO1>, MT2 >::Type
1103  operator*( const SMatScalarMultExpr<MT1,ST,SO1>& lhs, const DenseMatrix<MT2,SO2>& rhs )
1104 {
1106 
1107  return ( lhs.leftOperand() * (~rhs) ) * lhs.rightOperand();
1108 }
1110 //*************************************************************************************************
1111 
1112 
1113 //*************************************************************************************************
1127 template< typename MT1 // Type of the left-hand side dense matrix
1128  , bool SO1 // Storage order of the left-hand side dense matrix
1129  , typename MT2 // Type of the sparse matrix of the right-hand side expression
1130  , typename ST // Type of the scalar of the right-hand side expression
1131  , bool SO2 > // Storage order of the right-hand side expression
1132 inline const typename MultExprTrait< MT1, SMatScalarMultExpr<MT2,ST,SO2> >::Type
1133  operator*( const DenseMatrix<MT1,SO1>& lhs, const SMatScalarMultExpr<MT2,ST,SO2>& rhs )
1134 {
1136 
1137  return ( (~lhs) * rhs.leftOperand() ) * rhs.rightOperand();
1138 }
1140 //*************************************************************************************************
1141 
1142 
1143 //*************************************************************************************************
1157 template< typename MT1 // Type of the sparse matrix of the left-hand side expression
1158  , typename ST // Type of the scalar of the left-hand side expression
1159  , bool SO1 // Storage order of the left-hand side expression
1160  , typename MT2 // Type of the right-hand side sparse matrix
1161  , bool SO2 > // Storage order of the right-hand side sparse matrix
1162 inline const typename MultExprTrait< SMatScalarMultExpr<MT1,ST,SO1>, MT2 >::Type
1163  operator*( const SMatScalarMultExpr<MT1,ST,SO1>& lhs, const SparseMatrix<MT2,SO2>& rhs )
1164 {
1166 
1167  return ( lhs.leftOperand() * (~rhs) ) * lhs.rightOperand();
1168 }
1170 //*************************************************************************************************
1171 
1172 
1173 //*************************************************************************************************
1187 template< typename MT1 // Type of the left-hand side sparse matrix
1188  , bool SO1 // Storage order of the left-hand side sparse matrix
1189  , typename MT2 // Type of the sparse matrix of the right-hand side expression
1190  , typename ST // Type of the scalar of the right-hand side expression
1191  , bool SO2 > // Storage order of the right-hand side expression
1192 inline const typename MultExprTrait< MT1, SMatScalarMultExpr<MT2,ST,SO2> >::Type
1193  operator*( const SparseMatrix<MT1,SO1>& lhs, const SMatScalarMultExpr<MT2,ST,SO2>& rhs )
1194 {
1196 
1197  return ( (~lhs) * rhs.leftOperand() ) * rhs.rightOperand();
1198 }
1200 //*************************************************************************************************
1201 
1202 
1203 //*************************************************************************************************
1217 template< typename MT1 // Type of the sparse matrix of the left-hand side expression
1218  , typename ST1 // Type of the scalar of the left-hand side expression
1219  , bool SO1 // Storage order of the left-hand side expression
1220  , typename MT2 // Type of the right-hand side sparse matrix
1221  , typename ST2 // Type of the scalar of the right-hand side expression
1222  , bool SO2 > // Storage order of the right-hand side expression
1223 inline const typename MultExprTrait< SMatScalarMultExpr<MT1,ST1,SO1>, SMatScalarMultExpr<MT2,ST2,SO2> >::Type
1224  operator*( const SMatScalarMultExpr<MT1,ST1,SO1>& lhs, const SMatScalarMultExpr<MT2,ST2,SO2>& rhs )
1225 {
1227 
1228  return ( lhs.leftOperand() * rhs.leftOperand() ) * ( lhs.rightOperand() * rhs.rightOperand() );
1229 }
1231 //*************************************************************************************************
1232 
1233 
1234 
1235 
1236 //=================================================================================================
1237 //
1238 // SMATSCALARMULTEXPRTRAIT SPECIALIZATIONS
1239 //
1240 //=================================================================================================
1241 
1242 //*************************************************************************************************
1244 template< typename MT, typename ST1, typename ST2 >
1245 struct SMatScalarMultExprTrait< SMatScalarMultExpr<MT,ST1,false>, ST2 >
1246 {
1247  public:
1248  //**********************************************************************************************
1249  typedef typename SelectType< IsSparseMatrix<MT>::value && IsRowMajorMatrix<MT>::value &&
1250  IsNumeric<ST1>::value && IsNumeric<ST2>::value
1251  , typename SMatScalarMultExprTrait<MT,typename MultTrait<ST1,ST2>::Type>::Type
1252  , INVALID_TYPE >::Type Type;
1253  //**********************************************************************************************
1254 };
1256 //*************************************************************************************************
1257 
1258 
1259 
1260 
1261 //=================================================================================================
1262 //
1263 // TSMATSCALARMULTEXPRTRAIT SPECIALIZATIONS
1264 //
1265 //=================================================================================================
1266 
1267 //*************************************************************************************************
1269 template< typename MT, typename ST1, typename ST2 >
1270 struct TSMatScalarMultExprTrait< SMatScalarMultExpr<MT,ST1,true>, ST2 >
1271 {
1272  public:
1273  //**********************************************************************************************
1274  typedef typename SelectType< IsSparseMatrix<MT>::value && IsColumnMajorMatrix<MT>::value &&
1275  IsNumeric<ST1>::value && IsNumeric<ST2>::value
1276  , typename TSMatScalarMultExprTrait<MT,typename MultTrait<ST1,ST2>::Type>::Type
1277  , INVALID_TYPE >::Type Type;
1278  //**********************************************************************************************
1279 };
1281 //*************************************************************************************************
1282 
1283 
1284 
1285 
1286 //=================================================================================================
1287 //
1288 // SMATSCALARDIVEXPRTRAIT SPECIALIZATIONS
1289 //
1290 //=================================================================================================
1291 
1292 //*************************************************************************************************
1294 template< typename MT, typename ST1, typename ST2 >
1295 struct SMatScalarDivExprTrait< SMatScalarMultExpr<MT,ST1,false>, ST2 >
1296 {
1297  private:
1298  //**********************************************************************************************
1299  enum { condition = IsFloatingPoint<typename DivTrait<ST1,ST2>::Type>::value };
1300  //**********************************************************************************************
1301 
1302  //**********************************************************************************************
1303  typedef typename SMatScalarMultExprTrait<MT,typename DivTrait<ST1,ST2>::Type>::Type T1;
1304  typedef typename SMatScalarDivExprTrait<MT,typename DivTrait<ST1,ST2>::Type>::Type T2;
1305  //**********************************************************************************************
1306 
1307  public:
1308  //**********************************************************************************************
1309  typedef typename SelectType< IsSparseMatrix<MT>::value && IsRowMajorMatrix<MT>::value &&
1310  IsNumeric<ST1>::value && IsNumeric<ST2>::value
1311  , typename SelectType<condition,T1,T2>::Type
1312  , INVALID_TYPE >::Type Type;
1313  //**********************************************************************************************
1314 };
1316 //*************************************************************************************************
1317 
1318 
1319 
1320 
1321 //=================================================================================================
1322 //
1323 // TSMATSCALARDIVEXPRTRAIT SPECIALIZATIONS
1324 //
1325 //=================================================================================================
1326 
1327 //*************************************************************************************************
1329 template< typename MT, typename ST1, typename ST2 >
1330 struct TSMatScalarDivExprTrait< SMatScalarMultExpr<MT,ST1,true>, ST2 >
1331 {
1332  private:
1333  //**********************************************************************************************
1334  enum { condition = IsFloatingPoint<typename DivTrait<ST1,ST2>::Type>::value };
1335  //**********************************************************************************************
1336 
1337  //**********************************************************************************************
1338  typedef typename TSMatScalarMultExprTrait<MT,typename DivTrait<ST1,ST2>::Type>::Type T1;
1339  typedef typename TSMatScalarDivExprTrait<MT,typename DivTrait<ST1,ST2>::Type>::Type T2;
1340  //**********************************************************************************************
1341 
1342  public:
1343  //**********************************************************************************************
1344  typedef typename SelectType< IsSparseMatrix<MT>::value && IsColumnMajorMatrix<MT>::value &&
1345  IsNumeric<ST1>::value && IsNumeric<ST2>::value
1346  , typename SelectType<condition,T1,T2>::Type
1347  , INVALID_TYPE >::Type Type;
1348  //**********************************************************************************************
1349 };
1351 //*************************************************************************************************
1352 
1353 
1354 
1355 
1356 //=================================================================================================
1357 //
1358 // SMATDVECMULTEXPRTRAIT SPECIALIZATIONS
1359 //
1360 //=================================================================================================
1361 
1362 //*************************************************************************************************
1364 template< typename MT, typename ST, typename VT >
1365 struct SMatDVecMultExprTrait< SMatScalarMultExpr<MT,ST,false>, VT >
1366 {
1367  public:
1368  //**********************************************************************************************
1369  typedef typename SelectType< IsSparseMatrix<MT>::value && IsRowMajorMatrix<MT>::value &&
1370  IsDenseVector<VT>::value && IsColumnVector<VT>::value &&
1371  IsNumeric<ST>::value
1372  , typename DVecScalarMultExprTrait<typename SMatDVecMultExprTrait<MT,VT>::Type,ST>::Type
1373  , INVALID_TYPE >::Type Type;
1374  //**********************************************************************************************
1375 };
1377 //*************************************************************************************************
1378 
1379 
1380 //*************************************************************************************************
1382 template< typename MT, typename ST1, typename VT, typename ST2 >
1383 struct SMatDVecMultExprTrait< SMatScalarMultExpr<MT,ST1,false>, DVecScalarMultExpr<VT,ST2,false> >
1384 {
1385  public:
1386  //**********************************************************************************************
1387  typedef typename SelectType< IsSparseMatrix<MT>::value && IsRowMajorMatrix<MT>::value &&
1388  IsDenseVector<VT>::value && IsColumnVector<VT>::value &&
1389  IsNumeric<ST1>::value && IsNumeric<ST2>::value
1390  , typename DVecScalarMultExprTrait<typename SMatDVecMultExprTrait<MT,VT>::Type,typename MultTrait<ST1,ST2>::Type>::Type
1391  , INVALID_TYPE >::Type Type;
1392  //**********************************************************************************************
1393 };
1395 //*************************************************************************************************
1396 
1397 
1398 
1399 
1400 //=================================================================================================
1401 //
1402 // TSMATDVECMULTEXPRTRAIT SPECIALIZATIONS
1403 //
1404 //=================================================================================================
1405 
1406 //*************************************************************************************************
1408 template< typename MT, typename ST, typename VT >
1409 struct TSMatDVecMultExprTrait< SMatScalarMultExpr<MT,ST,true>, VT >
1410 {
1411  public:
1412  //**********************************************************************************************
1413  typedef typename SelectType< IsSparseMatrix<MT>::value && IsColumnMajorMatrix<MT>::value &&
1414  IsDenseVector<VT>::value && IsColumnVector<VT>::value &&
1415  IsNumeric<ST>::value
1416  , typename DVecScalarMultExprTrait<typename TSMatDVecMultExprTrait<MT,VT>::Type,ST>::Type
1417  , INVALID_TYPE >::Type Type;
1418  //**********************************************************************************************
1419 };
1421 //*************************************************************************************************
1422 
1423 
1424 //*************************************************************************************************
1426 template< typename MT, typename ST1, typename VT, typename ST2 >
1427 struct TSMatDVecMultExprTrait< SMatScalarMultExpr<MT,ST1,true>, DVecScalarMultExpr<VT,ST2,false> >
1428 {
1429  public:
1430  //**********************************************************************************************
1431  typedef typename SelectType< IsSparseMatrix<MT>::value && IsColumnMajorMatrix<MT>::value &&
1432  IsDenseVector<VT>::value && IsColumnVector<VT>::value &&
1433  IsNumeric<ST1>::value && IsNumeric<ST2>::value
1434  , typename DVecScalarMultExprTrait<typename TSMatDVecMultExprTrait<MT,VT>::Type,typename MultTrait<ST1,ST2>::Type>::Type
1435  , INVALID_TYPE >::Type Type;
1436  //**********************************************************************************************
1437 };
1439 //*************************************************************************************************
1440 
1441 
1442 
1443 
1444 //=================================================================================================
1445 //
1446 // TDVECSMATMULTEXPRTRAIT SPECIALIZATIONS
1447 //
1448 //=================================================================================================
1449 
1450 //*************************************************************************************************
1452 template< typename VT, typename MT, typename ST >
1453 struct TDVecSMatMultExprTrait< VT, SMatScalarMultExpr<MT,ST,false> >
1454 {
1455  public:
1456  //**********************************************************************************************
1457  typedef typename SelectType< IsDenseVector<VT>::value && IsRowVector<VT>::value &&
1458  IsSparseMatrix<MT>::value && IsRowMajorMatrix<MT>::value &&
1459  IsNumeric<ST>::value
1460  , typename TDVecScalarMultExprTrait<typename TDVecSMatMultExprTrait<VT,MT>::Type,ST>::Type
1461  , INVALID_TYPE >::Type Type;
1462  //**********************************************************************************************
1463 };
1465 //*************************************************************************************************
1466 
1467 
1468 //*************************************************************************************************
1470 template< typename VT, typename ST1, typename MT, typename ST2 >
1471 struct TDVecSMatMultExprTrait< DVecScalarMultExpr<VT,ST1,true>, SMatScalarMultExpr<MT,ST2,false> >
1472 {
1473  public:
1474  //**********************************************************************************************
1475  typedef typename SelectType< IsDenseVector<VT>::value && IsRowVector<VT>::value &&
1476  IsSparseMatrix<MT>::value && IsRowMajorMatrix<MT>::value &&
1477  IsNumeric<ST1>::value && IsNumeric<ST2>::value
1478  , typename TDVecScalarMultExprTrait<typename TDVecSMatMultExprTrait<VT,MT>::Type,typename MultTrait<ST1,ST2>::Type>::Type
1479  , INVALID_TYPE >::Type Type;
1480  //**********************************************************************************************
1481 };
1483 //*************************************************************************************************
1484 
1485 
1486 
1487 
1488 //=================================================================================================
1489 //
1490 // TDVECTSMATMULTEXPRTRAIT SPECIALIZATIONS
1491 //
1492 //=================================================================================================
1493 
1494 //*************************************************************************************************
1496 template< typename VT, typename MT, typename ST >
1497 struct TDVecTSMatMultExprTrait< VT, SMatScalarMultExpr<MT,ST,true> >
1498 {
1499  public:
1500  //**********************************************************************************************
1501  typedef typename SelectType< IsDenseVector<VT>::value && IsRowVector<VT>::value &&
1502  IsSparseMatrix<MT>::value && IsColumnMajorMatrix<MT>::value &&
1503  IsNumeric<ST>::value
1504  , typename TDVecScalarMultExprTrait<typename TDVecTSMatMultExprTrait<VT,MT>::Type,ST>::Type
1505  , INVALID_TYPE >::Type Type;
1506  //**********************************************************************************************
1507 };
1509 //*************************************************************************************************
1510 
1511 
1512 //*************************************************************************************************
1514 template< typename VT, typename ST1, typename MT, typename ST2 >
1515 struct TDVecTSMatMultExprTrait< DVecScalarMultExpr<VT,ST1,true>, SMatScalarMultExpr<MT,ST2,true> >
1516 {
1517  public:
1518  //**********************************************************************************************
1519  typedef typename SelectType< IsDenseVector<VT>::value && IsRowVector<VT>::value &&
1520  IsSparseMatrix<MT>::value && IsColumnMajorMatrix<MT>::value &&
1521  IsNumeric<ST1>::value && IsNumeric<ST2>::value
1522  , typename TDVecScalarMultExprTrait<typename TDVecTSMatMultExprTrait<VT,MT>::Type,typename MultTrait<ST1,ST2>::Type>::Type
1523  , INVALID_TYPE >::Type Type;
1524  //**********************************************************************************************
1525 };
1527 //*************************************************************************************************
1528 
1529 
1530 
1531 
1532 //=================================================================================================
1533 //
1534 // SMATSVECMULTEXPRTRAIT SPECIALIZATIONS
1535 //
1536 //=================================================================================================
1537 
1538 //*************************************************************************************************
1540 template< typename MT, typename ST, typename VT >
1541 struct SMatSVecMultExprTrait< SMatScalarMultExpr<MT,ST,false>, VT >
1542 {
1543  public:
1544  //**********************************************************************************************
1545  typedef typename SelectType< IsSparseMatrix<MT>::value && IsRowMajorMatrix<MT>::value &&
1546  IsSparseVector<VT>::value && IsColumnVector<VT>::value &&
1547  IsNumeric<ST>::value
1548  , typename SVecScalarMultExprTrait<typename SMatSVecMultExprTrait<MT,VT>::Type,ST>::Type
1549  , INVALID_TYPE >::Type Type;
1550  //**********************************************************************************************
1551 };
1553 //*************************************************************************************************
1554 
1555 
1556 //*************************************************************************************************
1558 template< typename MT, typename ST1, typename VT, typename ST2 >
1559 struct SMatSVecMultExprTrait< SMatScalarMultExpr<MT,ST1,false>, SVecScalarMultExpr<VT,ST2,false> >
1560 {
1561  public:
1562  //**********************************************************************************************
1563  typedef typename SelectType< IsSparseMatrix<MT>::value && IsRowMajorMatrix<MT>::value &&
1564  IsSparseVector<VT>::value && IsColumnVector<VT>::value &&
1565  IsNumeric<ST1>::value && IsNumeric<ST2>::value
1566  , typename SVecScalarMultExprTrait<typename SMatSVecMultExprTrait<MT,VT>::Type,typename MultTrait<ST1,ST2>::Type>::Type
1567  , INVALID_TYPE >::Type Type;
1568  //**********************************************************************************************
1569 };
1571 //*************************************************************************************************
1572 
1573 
1574 
1575 
1576 //=================================================================================================
1577 //
1578 // TSMATSVECMULTEXPRTRAIT SPECIALIZATIONS
1579 //
1580 //=================================================================================================
1581 
1582 //*************************************************************************************************
1584 template< typename MT, typename ST, typename VT >
1585 struct TSMatSVecMultExprTrait< SMatScalarMultExpr<MT,ST,true>, VT >
1586 {
1587  public:
1588  //**********************************************************************************************
1589  typedef typename SelectType< IsSparseMatrix<MT>::value && IsColumnMajorMatrix<MT>::value &&
1590  IsSparseVector<VT>::value && IsColumnVector<VT>::value &&
1591  IsNumeric<ST>::value
1592  , typename SVecScalarMultExprTrait<typename TSMatSVecMultExprTrait<MT,VT>::Type,ST>::Type
1593  , INVALID_TYPE >::Type Type;
1594  //**********************************************************************************************
1595 };
1597 //*************************************************************************************************
1598 
1599 
1600 //*************************************************************************************************
1602 template< typename MT, typename ST1, typename VT, typename ST2 >
1603 struct TSMatSVecMultExprTrait< SMatScalarMultExpr<MT,ST1,true>, SVecScalarMultExpr<VT,ST2,false> >
1604 {
1605  public:
1606  //**********************************************************************************************
1607  typedef typename SelectType< IsSparseMatrix<MT>::value && IsColumnMajorMatrix<MT>::value &&
1608  IsSparseVector<VT>::value && IsColumnVector<VT>::value &&
1609  IsNumeric<ST1>::value && IsNumeric<ST2>::value
1610  , typename SVecScalarMultExprTrait<typename TSMatSVecMultExprTrait<MT,VT>::Type,typename MultTrait<ST1,ST2>::Type>::Type
1611  , INVALID_TYPE >::Type Type;
1612  //**********************************************************************************************
1613 };
1615 //*************************************************************************************************
1616 
1617 
1618 
1619 
1620 //=================================================================================================
1621 //
1622 // TSVECSMATMULTEXPRTRAIT SPECIALIZATIONS
1623 //
1624 //=================================================================================================
1625 
1626 //*************************************************************************************************
1628 template< typename VT, typename MT, typename ST >
1629 struct TSVecSMatMultExprTrait< VT, SMatScalarMultExpr<MT,ST,false> >
1630 {
1631  public:
1632  //**********************************************************************************************
1633  typedef typename SelectType< IsSparseVector<VT>::value && IsRowVector<VT>::value &&
1634  IsSparseMatrix<MT>::value && IsRowMajorMatrix<MT>::value &&
1635  IsNumeric<ST>::value
1636  , typename TSVecScalarMultExprTrait<typename TSVecSMatMultExprTrait<VT,MT>::Type,ST>::Type
1637  , INVALID_TYPE >::Type Type;
1638  //**********************************************************************************************
1639 };
1641 //*************************************************************************************************
1642 
1643 
1644 //*************************************************************************************************
1646 template< typename VT, typename ST1, typename MT, typename ST2 >
1647 struct TSVecSMatMultExprTrait< SVecScalarMultExpr<VT,ST1,true>, SMatScalarMultExpr<MT,ST2,false> >
1648 {
1649  public:
1650  //**********************************************************************************************
1651  typedef typename SelectType< IsSparseVector<VT>::value && IsRowVector<VT>::value &&
1652  IsSparseMatrix<MT>::value && IsRowMajorMatrix<MT>::value &&
1653  IsNumeric<ST1>::value && IsNumeric<ST2>::value
1654  , typename TSVecScalarMultExprTrait<typename TSVecSMatMultExprTrait<VT,MT>::Type,typename MultTrait<ST1,ST2>::Type>::Type
1655  , INVALID_TYPE >::Type Type;
1656  //**********************************************************************************************
1657 };
1659 //*************************************************************************************************
1660 
1661 
1662 
1663 
1664 //=================================================================================================
1665 //
1666 // TSVECTSMATMULTEXPRTRAIT SPECIALIZATIONS
1667 //
1668 //=================================================================================================
1669 
1670 //*************************************************************************************************
1672 template< typename VT, typename MT, typename ST >
1673 struct TSVecTSMatMultExprTrait< VT, SMatScalarMultExpr<MT,ST,true> >
1674 {
1675  public:
1676  //**********************************************************************************************
1677  typedef typename SelectType< IsSparseVector<VT>::value && IsRowVector<VT>::value &&
1678  IsSparseMatrix<MT>::value && IsColumnMajorMatrix<MT>::value &&
1679  IsNumeric<ST>::value
1680  , typename TSVecScalarMultExprTrait<typename TSVecTSMatMultExprTrait<VT,MT>::Type,ST>::Type
1681  , INVALID_TYPE >::Type Type;
1682  //**********************************************************************************************
1683 };
1685 //*************************************************************************************************
1686 
1687 
1688 //*************************************************************************************************
1690 template< typename VT, typename ST1, typename MT, typename ST2 >
1691 struct TSVecTSMatMultExprTrait< SVecScalarMultExpr<VT,ST1,true>, SMatScalarMultExpr<MT,ST2,true> >
1692 {
1693  public:
1694  //**********************************************************************************************
1695  typedef typename SelectType< IsSparseVector<VT>::value && IsRowVector<VT>::value &&
1696  IsSparseMatrix<MT>::value && IsColumnMajorMatrix<MT>::value &&
1697  IsNumeric<ST1>::value && IsNumeric<ST2>::value
1698  , typename TSVecScalarMultExprTrait<typename TSVecTSMatMultExprTrait<VT,MT>::Type,typename MultTrait<ST1,ST2>::Type>::Type
1699  , INVALID_TYPE >::Type Type;
1700  //**********************************************************************************************
1701 };
1703 //*************************************************************************************************
1704 
1705 
1706 
1707 
1708 //=================================================================================================
1709 //
1710 // DMATSMATMULTEXPRTRAIT SPECIALIZATIONS
1711 //
1712 //=================================================================================================
1713 
1714 //*************************************************************************************************
1716 template< typename MT1, typename MT2, typename ST >
1717 struct DMatSMatMultExprTrait< MT1, SMatScalarMultExpr<MT2,ST,false> >
1718 {
1719  public:
1720  //**********************************************************************************************
1721  typedef typename SelectType< IsDenseMatrix<MT1>::value && IsRowMajorMatrix<MT1>::value &&
1722  IsSparseMatrix<MT2>::value && IsRowMajorMatrix<MT2>::value &&
1723  IsNumeric<ST>::value
1724  , typename DMatScalarMultExprTrait<typename DMatSMatMultExprTrait<MT1,MT2>::Type,ST>::Type
1725  , INVALID_TYPE >::Type Type;
1726  //**********************************************************************************************
1727 };
1729 //*************************************************************************************************
1730 
1731 
1732 
1733 
1734 //=================================================================================================
1735 //
1736 // DMATTSMATMULTEXPRTRAIT SPECIALIZATIONS
1737 //
1738 //=================================================================================================
1739 
1740 //*************************************************************************************************
1742 template< typename MT1, typename MT2, typename ST >
1743 struct DMatTSMatMultExprTrait< MT1, SMatScalarMultExpr<MT2,ST,true> >
1744 {
1745  public:
1746  //**********************************************************************************************
1747  typedef typename SelectType< IsDenseMatrix<MT1>::value && IsRowMajorMatrix<MT1>::value &&
1748  IsSparseMatrix<MT2>::value && IsColumnMajorMatrix<MT2>::value &&
1749  IsNumeric<ST>::value
1750  , typename DMatScalarMultExprTrait<typename DMatTSMatMultExprTrait<MT1,MT2>::Type,ST>::Type
1751  , INVALID_TYPE >::Type Type;
1752  //**********************************************************************************************
1753 };
1755 //*************************************************************************************************
1756 
1757 
1758 
1759 
1760 //=================================================================================================
1761 //
1762 // TDMATSMATMULTEXPRTRAIT SPECIALIZATIONS
1763 //
1764 //=================================================================================================
1765 
1766 //*************************************************************************************************
1768 template< typename MT1, typename MT2, typename ST >
1769 struct TDMatSMatMultExprTrait< MT1, SMatScalarMultExpr<MT2,ST,false> >
1770 {
1771  public:
1772  //**********************************************************************************************
1773  typedef typename SelectType< IsDenseMatrix<MT1>::value && IsColumnMajorMatrix<MT1>::value &&
1774  IsSparseMatrix<MT2>::value && IsRowMajorMatrix<MT2>::value &&
1775  IsNumeric<ST>::value
1776  , typename TDMatScalarMultExprTrait<typename TDMatSMatMultExprTrait<MT1,MT2>::Type,ST>::Type
1777  , INVALID_TYPE >::Type Type;
1778  //**********************************************************************************************
1779 };
1781 //*************************************************************************************************
1782 
1783 
1784 
1785 
1786 //=================================================================================================
1787 //
1788 // TDMATTSMATMULTEXPRTRAIT SPECIALIZATIONS
1789 //
1790 //=================================================================================================
1791 
1792 //*************************************************************************************************
1794 template< typename MT1, typename MT2, typename ST >
1795 struct TDMatTSMatMultExprTrait< MT1, SMatScalarMultExpr<MT2,ST,true> >
1796 {
1797  public:
1798  //**********************************************************************************************
1799  typedef typename SelectType< IsDenseMatrix<MT1>::value && IsColumnMajorMatrix<MT1>::value &&
1800  IsSparseMatrix<MT2>::value && IsColumnMajorMatrix<MT2>::value &&
1801  IsNumeric<ST>::value
1802  , typename TDMatScalarMultExprTrait<typename TDMatTSMatMultExprTrait<MT1,MT2>::Type,ST>::Type
1803  , INVALID_TYPE >::Type Type;
1804  //**********************************************************************************************
1805 };
1807 //*************************************************************************************************
1808 
1809 
1810 
1811 
1812 //=================================================================================================
1813 //
1814 // SMATDMATMULTEXPRTRAIT SPECIALIZATIONS
1815 //
1816 //=================================================================================================
1817 
1818 //*************************************************************************************************
1820 template< typename MT1, typename ST, typename MT2 >
1821 struct SMatDMatMultExprTrait< SMatScalarMultExpr<MT1,ST,false>, MT2 >
1822 {
1823  public:
1824  //**********************************************************************************************
1825  typedef typename SelectType< IsSparseMatrix<MT1>::value && IsRowMajorMatrix<MT1>::value &&
1826  IsDenseMatrix<MT2>::value && IsRowMajorMatrix<MT2>::value &&
1827  IsNumeric<ST>::value
1828  , typename DMatScalarMultExprTrait<typename SMatDMatMultExprTrait<MT1,MT2>::Type,ST>::Type
1829  , INVALID_TYPE >::Type Type;
1830  //**********************************************************************************************
1831 };
1833 //*************************************************************************************************
1834 
1835 
1836 
1837 
1838 //=================================================================================================
1839 //
1840 // SMATTDMATMULTEXPRTRAIT SPECIALIZATIONS
1841 //
1842 //=================================================================================================
1843 
1844 //*************************************************************************************************
1846 template< typename MT1, typename ST, typename MT2 >
1847 struct SMatTDMatMultExprTrait< SMatScalarMultExpr<MT1,ST,false>, MT2 >
1848 {
1849  public:
1850  //**********************************************************************************************
1851  typedef typename SelectType< IsSparseMatrix<MT1>::value && IsRowMajorMatrix<MT1>::value &&
1852  IsDenseMatrix<MT2>::value && IsColumnMajorMatrix<MT2>::value &&
1853  IsNumeric<ST>::value
1854  , typename DMatScalarMultExprTrait<typename SMatTDMatMultExprTrait<MT1,MT2>::Type,ST>::Type
1855  , INVALID_TYPE >::Type Type;
1856  //**********************************************************************************************
1857 };
1859 //*************************************************************************************************
1860 
1861 
1862 
1863 
1864 //=================================================================================================
1865 //
1866 // TSMATDMATMULTEXPRTRAIT SPECIALIZATIONS
1867 //
1868 //=================================================================================================
1869 
1870 //*************************************************************************************************
1872 template< typename MT1, typename ST, typename MT2 >
1873 struct TSMatDMatMultExprTrait< SMatScalarMultExpr<MT1,ST,true>, MT2 >
1874 {
1875  public:
1876  //**********************************************************************************************
1877  typedef typename SelectType< IsSparseMatrix<MT1>::value && IsColumnMajorMatrix<MT1>::value &&
1878  IsDenseMatrix<MT2>::value && IsRowMajorMatrix<MT2>::value &&
1879  IsNumeric<ST>::value
1880  , typename TDMatScalarMultExprTrait<typename TSMatDMatMultExprTrait<MT1,MT2>::Type,ST>::Type
1881  , INVALID_TYPE >::Type Type;
1882  //**********************************************************************************************
1883 };
1885 //*************************************************************************************************
1886 
1887 
1888 
1889 
1890 //=================================================================================================
1891 //
1892 // TSMATTDMATMULTEXPRTRAIT SPECIALIZATIONS
1893 //
1894 //=================================================================================================
1895 
1896 //*************************************************************************************************
1898 template< typename MT1, typename ST, typename MT2 >
1899 struct TSMatTDMatMultExprTrait< SMatScalarMultExpr<MT1,ST,true>, MT2 >
1900 {
1901  public:
1902  //**********************************************************************************************
1903  typedef typename SelectType< IsSparseMatrix<MT1>::value && IsColumnMajorMatrix<MT1>::value &&
1904  IsDenseMatrix<MT2>::value && IsColumnMajorMatrix<MT2>::value &&
1905  IsNumeric<ST>::value
1906  , typename TDMatScalarMultExprTrait<typename TSMatTDMatMultExprTrait<MT1,MT2>::Type,ST>::Type
1907  , INVALID_TYPE >::Type Type;
1908  //**********************************************************************************************
1909 };
1911 //*************************************************************************************************
1912 
1913 
1914 
1915 
1916 //=================================================================================================
1917 //
1918 // SMATSMATMULTEXPRTRAIT SPECIALIZATIONS
1919 //
1920 //=================================================================================================
1921 
1922 //*************************************************************************************************
1924 template< typename MT1, typename ST, typename MT2 >
1925 struct SMatSMatMultExprTrait< SMatScalarMultExpr<MT1,ST,false>, MT2 >
1926 {
1927  public:
1928  //**********************************************************************************************
1929  typedef typename SelectType< IsSparseMatrix<MT1>::value && IsRowMajorMatrix<MT1>::value &&
1930  IsSparseMatrix<MT2>::value && IsRowMajorMatrix<MT2>::value &&
1931  IsNumeric<ST>::value
1932  , typename SMatScalarMultExprTrait<typename SMatSMatMultExprTrait<MT1,MT2>::Type,ST>::Type
1933  , INVALID_TYPE >::Type Type;
1934  //**********************************************************************************************
1935 };
1937 //*************************************************************************************************
1938 
1939 
1940 //*************************************************************************************************
1942 template< typename MT1, typename MT2, typename ST >
1943 struct SMatSMatMultExprTrait< MT1, SMatScalarMultExpr<MT2,ST,false> >
1944 {
1945  public:
1946  //**********************************************************************************************
1947  typedef typename SelectType< IsSparseMatrix<MT1>::value && IsRowMajorMatrix<MT1>::value &&
1948  IsSparseMatrix<MT2>::value && IsRowMajorMatrix<MT2>::value &&
1949  IsNumeric<ST>::value
1950  , typename SMatScalarMultExprTrait<typename SMatSMatMultExprTrait<MT1,MT2>::Type,ST>::Type
1951  , INVALID_TYPE >::Type Type;
1952  //**********************************************************************************************
1953 };
1955 //*************************************************************************************************
1956 
1957 
1958 //*************************************************************************************************
1960 template< typename MT1, typename ST1, typename MT2, typename ST2 >
1961 struct SMatSMatMultExprTrait< SMatScalarMultExpr<MT1,ST1,false>, SMatScalarMultExpr<MT2,ST2,false> >
1962 {
1963  public:
1964  //**********************************************************************************************
1965  typedef typename SelectType< IsSparseMatrix<MT1>::value && IsRowMajorMatrix<MT1>::value &&
1966  IsSparseMatrix<MT2>::value && IsRowMajorMatrix<MT2>::value &&
1967  IsNumeric<ST1>::value && IsNumeric<ST2>::value
1968  , typename SMatScalarMultExprTrait<typename SMatSMatMultExprTrait<MT1,MT2>::Type,typename MultTrait<ST1,ST2>::Type>::Type
1969  , INVALID_TYPE >::Type Type;
1970  //**********************************************************************************************
1971 };
1973 //*************************************************************************************************
1974 
1975 
1976 
1977 
1978 //=================================================================================================
1979 //
1980 // SMATTSMATMULTEXPRTRAIT SPECIALIZATIONS
1981 //
1982 //=================================================================================================
1983 
1984 //*************************************************************************************************
1986 template< typename MT1, typename ST, typename MT2 >
1987 struct SMatTSMatMultExprTrait< SMatScalarMultExpr<MT1,ST,false>, MT2 >
1988 {
1989  public:
1990  //**********************************************************************************************
1991  typedef typename SelectType< IsSparseMatrix<MT1>::value && IsRowMajorMatrix<MT1>::value &&
1992  IsSparseMatrix<MT2>::value && IsColumnMajorMatrix<MT2>::value &&
1993  IsNumeric<ST>::value
1994  , typename SMatScalarMultExprTrait<typename SMatTSMatMultExprTrait<MT1,MT2>::Type,ST>::Type
1995  , INVALID_TYPE >::Type Type;
1996  //**********************************************************************************************
1997 };
1999 //*************************************************************************************************
2000 
2001 
2002 //*************************************************************************************************
2004 template< typename MT1, typename MT2, typename ST >
2005 struct SMatTSMatMultExprTrait< MT1, SMatScalarMultExpr<MT2,ST,true> >
2006 {
2007  public:
2008  //**********************************************************************************************
2009  typedef typename SelectType< IsSparseMatrix<MT1>::value && IsRowMajorMatrix<MT1>::value &&
2010  IsSparseMatrix<MT2>::value && IsColumnMajorMatrix<MT2>::value &&
2011  IsNumeric<ST>::value
2012  , typename SMatScalarMultExprTrait<typename SMatTSMatMultExprTrait<MT1,MT2>::Type,ST>::Type
2013  , INVALID_TYPE >::Type Type;
2014  //**********************************************************************************************
2015 };
2017 //*************************************************************************************************
2018 
2019 
2020 //*************************************************************************************************
2022 template< typename MT1, typename ST1, typename MT2, typename ST2 >
2023 struct SMatTSMatMultExprTrait< SMatScalarMultExpr<MT1,ST1,false>, SMatScalarMultExpr<MT2,ST2,true> >
2024 {
2025  public:
2026  //**********************************************************************************************
2027  typedef typename SelectType< IsSparseMatrix<MT1>::value && IsRowMajorMatrix<MT1>::value &&
2028  IsSparseMatrix<MT2>::value && IsColumnMajorMatrix<MT2>::value &&
2029  IsNumeric<ST1>::value && IsNumeric<ST2>::value
2030  , typename SMatScalarMultExprTrait<typename SMatTSMatMultExprTrait<MT1,MT2>::Type,typename MultTrait<ST1,ST2>::Type>::Type
2031  , INVALID_TYPE >::Type Type;
2032  //**********************************************************************************************
2033 };
2035 //*************************************************************************************************
2036 
2037 
2038 
2039 
2040 //=================================================================================================
2041 //
2042 // TSMATSMATMULTEXPRTRAIT SPECIALIZATIONS
2043 //
2044 //=================================================================================================
2045 
2046 //*************************************************************************************************
2048 template< typename MT1, typename ST, typename MT2 >
2049 struct TSMatSMatMultExprTrait< SMatScalarMultExpr<MT1,ST,true>, MT2 >
2050 {
2051  public:
2052  //**********************************************************************************************
2053  typedef typename SelectType< IsSparseMatrix<MT1>::value && IsColumnMajorMatrix<MT1>::value &&
2054  IsSparseMatrix<MT2>::value && IsRowMajorMatrix<MT2>::value &&
2055  IsNumeric<ST>::value
2056  , typename TSMatScalarMultExprTrait<typename TSMatSMatMultExprTrait<MT1,MT2>::Type,ST>::Type
2057  , INVALID_TYPE >::Type Type;
2058  //**********************************************************************************************
2059 };
2061 //*************************************************************************************************
2062 
2063 
2064 //*************************************************************************************************
2066 template< typename MT1, typename MT2, typename ST >
2067 struct TSMatSMatMultExprTrait< MT1, SMatScalarMultExpr<MT2,ST,false> >
2068 {
2069  public:
2070  //**********************************************************************************************
2071  typedef typename SelectType< IsSparseMatrix<MT1>::value && IsColumnMajorMatrix<MT1>::value &&
2072  IsSparseMatrix<MT2>::value && IsRowMajorMatrix<MT2>::value &&
2073  IsNumeric<ST>::value
2074  , typename TSMatScalarMultExprTrait<typename TSMatSMatMultExprTrait<MT1,MT2>::Type,ST>::Type
2075  , INVALID_TYPE >::Type Type;
2076  //**********************************************************************************************
2077 };
2079 //*************************************************************************************************
2080 
2081 
2082 //*************************************************************************************************
2084 template< typename MT1, typename ST1, typename MT2, typename ST2 >
2085 struct TSMatSMatMultExprTrait< SMatScalarMultExpr<MT1,ST1,true>, SMatScalarMultExpr<MT2,ST2,false> >
2086 {
2087  public:
2088  //**********************************************************************************************
2089  typedef typename SelectType< IsSparseMatrix<MT1>::value && IsColumnMajorMatrix<MT1>::value &&
2090  IsSparseMatrix<MT2>::value && IsRowMajorMatrix<MT2>::value &&
2091  IsNumeric<ST1>::value && IsNumeric<ST2>::value
2092  , typename TSMatScalarMultExprTrait<typename TSMatSMatMultExprTrait<MT1,MT2>::Type,typename MultTrait<ST1,ST2>::Type>::Type
2093  , INVALID_TYPE >::Type Type;
2094  //**********************************************************************************************
2095 };
2097 //*************************************************************************************************
2098 
2099 
2100 
2101 
2102 //=================================================================================================
2103 //
2104 // TSMATSMATMULTEXPRTRAIT SPECIALIZATIONS
2105 //
2106 //=================================================================================================
2107 
2108 //*************************************************************************************************
2110 template< typename MT1, typename ST, typename MT2 >
2111 struct TSMatTSMatMultExprTrait< SMatScalarMultExpr<MT1,ST,true>, MT2 >
2112 {
2113  public:
2114  //**********************************************************************************************
2115  typedef typename SelectType< IsSparseMatrix<MT1>::value && IsColumnMajorMatrix<MT1>::value &&
2116  IsSparseMatrix<MT2>::value && IsColumnMajorMatrix<MT2>::value &&
2117  IsNumeric<ST>::value
2118  , typename TSMatScalarMultExprTrait<typename TSMatTSMatMultExprTrait<MT1,MT2>::Type,ST>::Type
2119  , INVALID_TYPE >::Type Type;
2120  //**********************************************************************************************
2121 };
2123 //*************************************************************************************************
2124 
2125 
2126 //*************************************************************************************************
2128 template< typename MT1, typename MT2, typename ST >
2129 struct TSMatTSMatMultExprTrait< MT1, SMatScalarMultExpr<MT2,ST,true> >
2130 {
2131  public:
2132  //**********************************************************************************************
2133  typedef typename SelectType< IsSparseMatrix<MT1>::value && IsColumnMajorMatrix<MT1>::value &&
2134  IsSparseMatrix<MT2>::value && IsColumnMajorMatrix<MT2>::value &&
2135  IsNumeric<ST>::value
2136  , typename TSMatScalarMultExprTrait<typename TSMatTSMatMultExprTrait<MT1,MT2>::Type,ST>::Type
2137  , INVALID_TYPE >::Type Type;
2138  //**********************************************************************************************
2139 };
2141 //*************************************************************************************************
2142 
2143 
2144 //*************************************************************************************************
2146 template< typename MT1, typename ST1, typename MT2, typename ST2 >
2147 struct TSMatTSMatMultExprTrait< SMatScalarMultExpr<MT1,ST1,true>, SMatScalarMultExpr<MT2,ST2,true> >
2148 {
2149  public:
2150  //**********************************************************************************************
2151  typedef typename SelectType< IsSparseMatrix<MT1>::value && IsColumnMajorMatrix<MT1>::value &&
2152  IsSparseMatrix<MT2>::value && IsColumnMajorMatrix<MT2>::value &&
2153  IsNumeric<ST1>::value && IsNumeric<ST2>::value
2154  , typename TSMatScalarMultExprTrait<typename TSMatTSMatMultExprTrait<MT1,MT2>::Type,typename MultTrait<ST1,ST2>::Type>::Type
2155  , INVALID_TYPE >::Type Type;
2156  //**********************************************************************************************
2157 };
2159 //*************************************************************************************************
2160 
2161 
2162 
2163 
2164 //=================================================================================================
2165 //
2166 // SUBMATRIXEXPRTRAIT SPECIALIZATIONS
2167 //
2168 //=================================================================================================
2169 
2170 //*************************************************************************************************
2172 template< typename MT, typename ST, bool SO, bool AF >
2173 struct SubmatrixExprTrait< SMatScalarMultExpr<MT,ST,SO>, AF >
2174 {
2175  public:
2176  //**********************************************************************************************
2177  typedef typename MultExprTrait< typename SubmatrixExprTrait<const MT,AF>::Type, ST >::Type Type;
2178  //**********************************************************************************************
2179 };
2181 //*************************************************************************************************
2182 
2183 
2184 
2185 
2186 //=================================================================================================
2187 //
2188 // ROWEXPRTRAIT SPECIALIZATIONS
2189 //
2190 //=================================================================================================
2191 
2192 //*************************************************************************************************
2194 template< typename MT, typename ST, bool SO >
2195 struct RowExprTrait< SMatScalarMultExpr<MT,ST,SO> >
2196 {
2197  public:
2198  //**********************************************************************************************
2199  typedef typename MultExprTrait< typename RowExprTrait<const MT>::Type, ST >::Type Type;
2200  //**********************************************************************************************
2201 };
2203 //*************************************************************************************************
2204 
2205 
2206 
2207 
2208 //=================================================================================================
2209 //
2210 // COLUMNEXPRTRAIT SPECIALIZATIONS
2211 //
2212 //=================================================================================================
2213 
2214 //*************************************************************************************************
2216 template< typename MT, typename ST, bool SO >
2217 struct ColumnExprTrait< SMatScalarMultExpr<MT,ST,SO> >
2218 {
2219  public:
2220  //**********************************************************************************************
2221  typedef typename MultExprTrait< typename ColumnExprTrait<const MT>::Type, ST >::Type Type;
2222  //**********************************************************************************************
2223 };
2225 //*************************************************************************************************
2226 
2227 } // namespace blaze
2228 
2229 #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
const DMatDMatMultExpr< T1, T2 > operator*(const DenseMatrix< T1, false > &lhs, const DenseMatrix< T2, false > &rhs)
Multiplication operator for the multiplication of two row-major dense matrices ( ).
Definition: DMatDMatMultExpr.h:4075
const EnableIf< IsNumeric< T2 >, typename DivExprTrait< T1, T2 >::Type >::Type operator/(const DenseMatrix< T1, SO > &mat, T2 scalar)
Division operator for the division of a dense matrix by a scalar value ( ).
Definition: DMatScalarDivExpr.h:772
PointerType pointer
Pointer return type.
Definition: SMatScalarMultExpr.h:190
IteratorCategory iterator_category
The iterator category.
Definition: SMatScalarMultExpr.h:188
MT::CompositeType CT
Composite type of the sparse matrix expression.
Definition: SMatScalarMultExpr.h:112
void smpSubAssign(DenseMatrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs)
Default implementation of the SMP subtraction assignment of a matrix to dense matrix.
Definition: DenseMatrix.h:151
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:197
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:179
DifferenceType operator-(const ConstIterator &rhs) const
Calculating the number of elements between two expression iterators.
Definition: SMatScalarMultExpr.h:283
const This & CompositeType
Data type for composite expression templates.
Definition: CompressedMatrix.h:2384
Header file for the IsRowVector type trait.
Type ElementType
Type of the sparse matrix elements.
Definition: CompressedMatrix.h:249
ptrdiff_t DifferenceType
Difference between two iterators.
Definition: SMatScalarMultExpr.h:185
size_t columns() const
Returns the current number of columns of the matrix.
Definition: SMatScalarMultExpr.h:364
ValueType value_type
Type of the underlying pointers.
Definition: SMatScalarMultExpr.h:189
Header file for the Computation base class.
IteratorType matrix_
Iterator over the elements of the left-hand side sparse matrix expression.
Definition: SMatScalarMultExpr.h:290
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:429
ConstIterator end(size_t i) const
Returns an iterator just past the last non-zero element of row i.
Definition: SMatScalarMultExpr.h:344
Base class for dense matrices.The DenseMatrix class is a base class for all dense matrix classes...
Definition: DenseMatrix.h:70
Base class for sparse matrices.The SparseMatrix class is a base class for all sparse matrix classes...
Definition: Forward.h:104
std::forward_iterator_tag IteratorCategory
The iterator category.
Definition: SMatScalarMultExpr.h:181
Constraint on the data type.
SelectType< useAssign, const ResultType, const SMatScalarMultExpr & >::Type CompositeType
Data type for composite expression templates.
Definition: SMatScalarMultExpr.h:159
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:417
Constraint on the data type.
Header file for the MultExprTrait class template.
void smpAddAssign(DenseMatrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs)
Default implementation of the SMP addition assignment of a matrix to a dense matrix.
Definition: DenseMatrix.h:121
Compile time check to query the requirement to evaluate an expression.Via this type trait it is possi...
Definition: RequiresEvaluation.h:90
const This & CompositeType
Data type for composite expression templates.
Definition: CompressedMatrix.h:251
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.
RightOperand scalar_
Right-hand side scalar of the multiplication expression.
Definition: SMatScalarMultExpr.h:437
Header file for the IsFloatingPoint type trait.
const Element * ConstIterator
Iterator over constant elements.
Definition: CompressedMatrix.h:2388
Header file for the dense matrix SMP implementation.
void assign(Matrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs)
Default implementation of the assignment of a matrix to a matrix.
Definition: Matrix.h:179
Element ValueType
Type of the underlying pointers.
Definition: SMatScalarMultExpr.h:182
#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
const SelectType< returnExpr, ExprReturnType, ElementType >::Type ReturnType
Return type for expression template evaluations.
Definition: SMatScalarMultExpr.h:156
#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:150
RightOperand scalar_
Right-hand side scalar of the multiplication expression.
Definition: SMatScalarMultExpr.h:291
MultExprTrait< RN, ST >::Type ExprReturnType
Expression return type for the subscript operator.
Definition: SMatScalarMultExpr.h:125
Type ElementType
Type of the sparse matrix elements.
Definition: CompressedMatrix.h:2382
Header file for the SelectType class template.
SMatScalarMultExpr(const MT &matrix, ST scalar)
Constructor for the SMatScalarMultExpr class.
Definition: SMatScalarMultExpr.h:307
Header file for the RowExprTrait class template.
Expression object for sparse matrix-scalar multiplications.The SMatScalarMult class represents the co...
Definition: Forward.h:92
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:333
Header file for the EnableIf class template.
SMatScalarMultExpr< MT, ST, SO > This
Type of this SMatScalarMultExpr instance.
Definition: SMatScalarMultExpr.h:149
Header file for the BaseElementType type trait.
LeftOperand matrix_
Left-hand side sparse matrix of the multiplication expression.
Definition: SMatScalarMultExpr.h:436
Header file for the IsNumeric type trait.
size_t rows() const
Returns the current number of rows of the matrix.
Definition: SMatScalarMultExpr.h:354
Header file for the IsSparseVector type trait.
Header file for the SubmatrixExprTrait class template.
const Type & ReturnType
Return type for expression template evaluations.
Definition: CompressedMatrix.h:2383
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:141
Header file for the division trait.
void addAssign(Matrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs)
Default implementation of the addition assignment of a matrix to a matrix.
Definition: Matrix.h:209
size_t nonZeros() const
Returns the number of non-zero elements in the sparse matrix.
Definition: SMatScalarMultExpr.h:374
bool operator!=(const ConstIterator &rhs) const
Inequality comparison between two ConstIterator objects.
Definition: SMatScalarMultExpr.h:272
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:261
#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:405
const Element operator*() const
Direct access to the sparse matrix element at the current iterator position.
Definition: SMatScalarMultExpr.h:220
void subAssign(Matrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs)
Default implementation of the subtraction assignment of a matrix to matrix.
Definition: Matrix.h:239
Iterator over the elements of the sparse matrix/scalar multiplication expression. ...
Definition: SMatScalarMultExpr.h:171
Evaluation of the base element type of a given data type.Via this type trait it is possible to evalua...
Definition: BaseElementType.h:75
Header file for the RemoveReference type trait.
ValueType * PointerType
Pointer return type.
Definition: SMatScalarMultExpr.h:183
ConstIterator & operator++()
Pre-increment operator.
Definition: SMatScalarMultExpr.h:209
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:320
ResultType::ElementType ElementType
Resulting element type.
Definition: SMatScalarMultExpr.h:153
ReferenceType reference
Reference return type.
Definition: SMatScalarMultExpr.h:191
ValueIndexPair< ElementType > Element
Element type of the sparse matrix expression.
Definition: SMatScalarMultExpr.h:176
ReturnType value() const
Access to the current value of the sparse element.
Definition: SMatScalarMultExpr.h:240
size_t nonZeros(size_t i) const
Returns the number of non-zero elements in the specified row.
Definition: SMatScalarMultExpr.h:385
Index-value-pair for sparse vectors and matrices.The ValueIndexPair class represents a single index-v...
Definition: ValueIndexPair.h:69
SelectType< IsExpression< MT >::value, const MT, const MT & >::Type LeftOperand
Composite data type of the sparse matrix expression.
Definition: SMatScalarMultExpr.h:162
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:230
Header file for the IsComputation type trait class.
ST RightOperand
Composite type of the right-hand side scalar value.
Definition: SMatScalarMultExpr.h:165
#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:2379
Header file for basic type definitions.
ConstIterator(IteratorType matrix, RightOperand scalar)
Constructor for the ConstIterator class.
Definition: SMatScalarMultExpr.h:198
size_t index() const
Access to the current index of the sparse element.
Definition: SMatScalarMultExpr.h:250
ResultType::OppositeType OppositeType
Result type with opposite storage order for expression template evaluations.
Definition: SMatScalarMultExpr.h:151
Header file for the IsColumnVector type trait.
DifferenceType difference_type
Difference between two iterators.
Definition: SMatScalarMultExpr.h:192
ValueType & ReferenceType
Reference return type.
Definition: SMatScalarMultExpr.h:184
MT::ReturnType RN
Return type of the sparse matrix expression.
Definition: SMatScalarMultExpr.h:111
MT::ResultType RT
Result type of the sparse matrix expression.
Definition: SMatScalarMultExpr.h:110
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:152
#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
LeftOperand leftOperand() const
Returns the left-hand side sparse matrix operand.
Definition: SMatScalarMultExpr.h:395
#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.