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>
71 #include <blaze/util/Assert.h>
75 #include <blaze/util/EnableIf.h>
76 #include <blaze/util/InvalidType.h>
78 #include <blaze/util/SelectType.h>
79 #include <blaze/util/Types.h>
83 
84 
85 namespace blaze {
86 
87 //=================================================================================================
88 //
89 // CLASS SMATSCALARMULTEXPR
90 //
91 //=================================================================================================
92 
93 //*************************************************************************************************
100 template< typename MT // Type of the left-hand side sparse matrix
101  , typename ST // Type of the right-hand side scalar value
102  , bool SO > // Storage order
103 class SMatScalarMultExpr : public SparseMatrix< SMatScalarMultExpr<MT,ST,SO>, SO >
104  , private MatScalarMultExpr
105  , private Computation
106 {
107  private:
108  //**Type definitions****************************************************************************
109  typedef typename MT::ResultType RT;
110  typedef typename MT::ReturnType RN;
111  typedef typename MT::CompositeType CT;
112  //**********************************************************************************************
113 
114  //**Return type evaluation**********************************************************************
116 
121  enum { returnExpr = !IsTemporary<RN>::value };
122 
125  //**********************************************************************************************
126 
127  //**Evaluation strategy*************************************************************************
129 
135  enum { useAssign = RequiresEvaluation<MT>::value };
136 
138  template< typename MT2 >
140  struct UseAssign {
141  enum { value = useAssign };
142  };
144  //**********************************************************************************************
145 
146  public:
147  //**Type definitions****************************************************************************
153 
156 
159 
161  typedef typename SelectType< IsExpression<MT>::value, const MT, const MT& >::Type LeftOperand;
162 
164  typedef ST RightOperand;
165  //**********************************************************************************************
166 
167  //**ConstIterator class definition**************************************************************
171  {
172  public:
173  //**Type definitions*************************************************************************
176 
179 
180  typedef std::forward_iterator_tag IteratorCategory;
181  typedef Element ValueType;
185 
186  // STL iterator requirements
192  //*******************************************************************************************
193 
194  //**Constructor******************************************************************************
197  inline ConstIterator( IteratorType matrix, RightOperand scalar )
198  : matrix_( matrix ) // Iterator over the elements of the left-hand side sparse matrix expression
199  , scalar_( scalar ) // Right-hand side scalar of the multiplication expression
200  {}
201  //*******************************************************************************************
202 
203  //**Prefix increment operator****************************************************************
209  ++matrix_;
210  return *this;
211  }
212  //*******************************************************************************************
213 
214  //**Element access operator******************************************************************
219  inline const Element operator*() const {
220  return Element( matrix_->value() * scalar_, matrix_->index() );
221  }
222  //*******************************************************************************************
223 
224  //**Element access operator******************************************************************
229  inline const ConstIterator* operator->() const {
230  return this;
231  }
232  //*******************************************************************************************
233 
234  //**Value function***************************************************************************
239  inline ReturnType value() const {
240  return matrix_->value() * scalar_;
241  }
242  //*******************************************************************************************
243 
244  //**Index function***************************************************************************
249  inline size_t index() const {
250  return matrix_->index();
251  }
252  //*******************************************************************************************
253 
254  //**Equality operator************************************************************************
260  inline bool operator==( const ConstIterator& rhs ) const {
261  return matrix_ == rhs.matrix_;
262  }
263  //*******************************************************************************************
264 
265  //**Inequality operator**********************************************************************
271  inline bool operator!=( const ConstIterator& rhs ) const {
272  return matrix_ != rhs.matrix_;
273  }
274  //*******************************************************************************************
275 
276  //**Subtraction operator*********************************************************************
282  inline DifferenceType operator-( const ConstIterator& rhs ) const {
283  return matrix_ - rhs.matrix_;
284  }
285  //*******************************************************************************************
286 
287  private:
288  //**Member variables*************************************************************************
291  //*******************************************************************************************
292  };
293  //**********************************************************************************************
294 
295  //**Constructor*********************************************************************************
301  explicit inline SMatScalarMultExpr( const MT& matrix, ST scalar )
302  : matrix_( matrix ) // Left-hand side sparse matrix of the multiplication expression
303  , scalar_( scalar ) // Right-hand side scalar of the multiplication expression
304  {}
305  //**********************************************************************************************
306 
307  //**Access operator*****************************************************************************
314  inline ReturnType operator()( size_t i, size_t j ) const {
315  BLAZE_INTERNAL_ASSERT( i < matrix_.rows() , "Invalid row access index" );
316  BLAZE_INTERNAL_ASSERT( j < matrix_.columns(), "Invalid column access index" );
317  return matrix_(i,j) * scalar_;
318  }
319  //**********************************************************************************************
320 
321  //**Begin function******************************************************************************
327  inline ConstIterator begin( size_t i ) const {
328  return ConstIterator( matrix_.begin(i), scalar_ );
329  }
330  //**********************************************************************************************
331 
332  //**End function********************************************************************************
338  inline ConstIterator end( size_t i ) const {
339  return ConstIterator( matrix_.end(i), scalar_ );
340  }
341  //**********************************************************************************************
342 
343  //**Rows function*******************************************************************************
348  inline size_t rows() const {
349  return matrix_.rows();
350  }
351  //**********************************************************************************************
352 
353  //**Columns function****************************************************************************
358  inline size_t columns() const {
359  return matrix_.columns();
360  }
361  //**********************************************************************************************
362 
363  //**NonZeros function***************************************************************************
368  inline size_t nonZeros() const {
369  return matrix_.nonZeros();
370  }
371  //**********************************************************************************************
372 
373  //**NonZeros function***************************************************************************
379  inline size_t nonZeros( size_t i ) const {
380  return matrix_.nonZeros(i);
381  }
382  //**********************************************************************************************
383 
384  //**Left operand access*************************************************************************
389  inline LeftOperand leftOperand() const {
390  return matrix_;
391  }
392  //**********************************************************************************************
393 
394  //**Right operand access************************************************************************
399  inline RightOperand rightOperand() const {
400  return scalar_;
401  }
402  //**********************************************************************************************
403 
404  //**********************************************************************************************
410  template< typename T >
411  inline bool canAlias( const T* alias ) const {
412  return matrix_.canAlias( alias );
413  }
414  //**********************************************************************************************
415 
416  //**********************************************************************************************
422  template< typename T >
423  inline bool isAliased( const T* alias ) const {
424  return matrix_.isAliased( alias );
425  }
426  //**********************************************************************************************
427 
428  private:
429  //**Member variables****************************************************************************
432  //**********************************************************************************************
433 
434  //**Assignment to dense matrices****************************************************************
448  template< typename MT2 // Type of the target dense matrix
449  , bool SO2 > // Storage order of the target dense matrix
450  friend inline typename EnableIf< UseAssign<MT2> >::Type
452  {
454 
455  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
456  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
457 
458  assign( ~lhs, rhs.matrix_ );
459  (~lhs) *= rhs.scalar_;
460  }
462  //**********************************************************************************************
463 
464  //**Assignment to sparse matrices***************************************************************
478  template< typename MT2 // Type of the target sparse matrix
479  , bool SO2 > // Storage order of the target sparse matrix
480  friend inline typename EnableIf< UseAssign<MT2> >::Type
482  {
484 
485  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
486  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
487 
488  assign( ~lhs, rhs.matrix_ );
489  (~lhs) *= rhs.scalar_;
490  }
492  //**********************************************************************************************
493 
494  //**Addition assignment to dense matrices*******************************************************
508  template< typename MT2 // Type of the target dense matrix
509  , bool SO2 > // Storage order of the target dense matrix
510  friend inline typename EnableIf< UseAssign<MT2> >::Type
511  addAssign( DenseMatrix<MT2,SO2>& lhs, const SMatScalarMultExpr& rhs )
512  {
514 
517 
518  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
519  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
520 
521  const ResultType tmp( rhs );
522  addAssign( ~lhs, tmp );
523  }
525  //**********************************************************************************************
526 
527  //**Addition assignment to sparse matrices******************************************************
528  // No special implementation for the addition assignment to sparse matrices.
529  //**********************************************************************************************
530 
531  //**Subtraction assignment to dense matrices****************************************************
545  template< typename MT2 // Type of the target dense matrix
546  , bool SO2 > // Storage order of the target dense matrix
547  friend inline typename EnableIf< UseAssign<MT2> >::Type
548  subAssign( DenseMatrix<MT2,SO2>& lhs, const SMatScalarMultExpr& rhs )
549  {
551 
554 
555  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
556  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
557 
558  const ResultType tmp( rhs );
559  subAssign( ~lhs, tmp );
560  }
562  //**********************************************************************************************
563 
564  //**Subtraction assignment to sparse matrices***************************************************
565  // No special implementation for the subtraction assignment to sparse matrices.
566  //**********************************************************************************************
567 
568  //**Multiplication assignment to dense matrices*************************************************
569  // No special implementation for the multiplication assignment to dense matrices.
570  //**********************************************************************************************
571 
572  //**Multiplication assignment to sparse matrices************************************************
573  // No special implementation for the multiplication assignment to sparse matrices.
574  //**********************************************************************************************
575 
576  //**Compile time checks*************************************************************************
583  //**********************************************************************************************
584 };
585 //*************************************************************************************************
586 
587 
588 
589 
590 //=================================================================================================
591 //
592 // GLOBAL UNARY ARITHMETIC OPERATORS
593 //
594 //=================================================================================================
595 
596 //*************************************************************************************************
613 template< typename MT // Data type of the sparse matrix
614  , bool SO > // Storage order
615 inline const SMatScalarMultExpr<MT,typename BaseElementType<MT>::Type,SO>
617 {
619 
620  typedef typename BaseElementType<MT>::Type ElementType;
622 }
623 //*************************************************************************************************
624 
625 
626 
627 
628 //=================================================================================================
629 //
630 // GLOBAL BINARY ARITHMETIC OPERATORS
631 //
632 //=================================================================================================
633 
634 //*************************************************************************************************
655 template< typename T1 // Type of the left-hand side sparse matrix
656  , bool SO // Storage order of the left-hand side sparse matrix
657  , typename T2 > // Type of the right-hand side scalar
658 inline const typename EnableIf< IsNumeric<T2>, typename MultExprTrait<T1,T2>::Type >::Type
659  operator*( const SparseMatrix<T1,SO>& mat, T2 scalar )
660 {
662 
663  typedef typename MultExprTrait<T1,T2>::Type Type;
664  return Type( ~mat, scalar );
665 }
666 //*************************************************************************************************
667 
668 
669 //*************************************************************************************************
690 template< typename T1 // Type of the left-hand side scalar
691  , typename T2 // Type of the right-hand side sparse matrix
692  , bool SO > // Storage order of the right-hand side sparse matrix
693 inline const typename EnableIf< IsNumeric<T1>, typename MultExprTrait<T1,T2>::Type >::Type
694  operator*( T1 scalar, const SparseMatrix<T2,SO>& mat )
695 {
697 
698  typedef typename MultExprTrait<T1,T2>::Type Type;
699  return Type( ~mat, scalar );
700 }
701 //*************************************************************************************************
702 
703 
704 
705 
706 //=================================================================================================
707 //
708 // GLOBAL RESTRUCTURING UNARY ARITHMETIC OPERATORS
709 //
710 //=================================================================================================
711 
712 //*************************************************************************************************
724 template< typename VT // Type of the sparse matrix
725  , typename ST // Type of the scalar
726  , bool TF > // Transpose flag
727 inline const SMatScalarMultExpr<VT,ST,TF>
728  operator-( const SMatScalarMultExpr<VT,ST,TF>& sm )
729 {
731 
732  return SMatScalarMultExpr<VT,ST,TF>( sm.leftOperand(), -sm.rightOperand() );
733 }
735 //*************************************************************************************************
736 
737 
738 
739 
740 //=================================================================================================
741 //
742 // GLOBAL RESTRUCTURING BINARY ARITHMETIC OPERATORS
743 //
744 //=================================================================================================
745 
746 //*************************************************************************************************
759 template< typename MT // Type of the sparse matrix
760  , typename ST1 // Type of the first scalar
761  , bool SO // Storage order of the sparse matrix
762  , typename ST2 > // Type of the second scalar
763 inline const typename EnableIf< IsNumeric<ST2>
764  , typename MultExprTrait< SMatScalarMultExpr<MT,ST1,SO>, ST2 >::Type >::Type
765  operator*( const SMatScalarMultExpr<MT,ST1,SO>& mat, ST2 scalar )
766 {
768 
769  return mat.leftOperand() * ( mat.rightOperand() * scalar );
770 }
772 //*************************************************************************************************
773 
774 
775 //*************************************************************************************************
788 template< typename ST1 // Type of the first scalar
789  , typename MT // Type of the sparse matrix
790  , typename ST2 // Type of the second scalar
791  , bool SO > // Storage order of the sparse matrix
792 inline const typename EnableIf< IsNumeric<ST1>
793  , typename MultExprTrait< ST1, SMatScalarMultExpr<MT,ST2,SO> >::Type >::Type
794  operator*( ST1 scalar, const SMatScalarMultExpr<MT,ST2,SO>& mat )
795 {
797 
798  return mat.leftOperand() * ( scalar * mat.rightOperand() );
799 }
801 //*************************************************************************************************
802 
803 
804 //*************************************************************************************************
817 template< typename MT // Type of the sparse matrix
818  , typename ST1 // Type of the first scalar
819  , bool SO // Storage order of the sparse matrix
820  , typename ST2 > // Type of the second scalar
821 inline const typename EnableIf< IsFloatingPoint<typename DivTrait<ST1,ST2>::Type>
822  , typename DivExprTrait< SMatScalarMultExpr<MT,ST1,SO>, ST2 >::Type >::Type
823  operator/( const SMatScalarMultExpr<MT,ST1,SO>& mat, ST2 scalar )
824 {
826 
827  return mat.leftOperand() * ( mat.rightOperand() / scalar );
828 }
830 //*************************************************************************************************
831 
832 
833 //*************************************************************************************************
847 template< typename MT // Type of the sparse matrix of the left-hand side expression
848  , typename ST // Type of the scalar of the left-hand side expression
849  , bool SO // Storage order of the left-hand side expression
850  , typename VT > // Type of the right-hand side dense vector
851 inline const typename MultExprTrait< SMatScalarMultExpr<MT,ST,SO>, VT >::Type
852  operator*( const SMatScalarMultExpr<MT,ST,SO>& mat, const DenseVector<VT,false>& vec )
853 {
855 
856  return ( mat.leftOperand() * (~vec) ) * mat.rightOperand();
857 }
859 //*************************************************************************************************
860 
861 
862 //*************************************************************************************************
876 template< typename VT // Type of the left-hand side dense vector
877  , typename MT // Type of the sparse matrix of the right-hand side expression
878  , typename ST // Type of the scalar of the right-hand side expression
879  , bool SO > // Storage order of the right-hand side expression
880 inline const typename MultExprTrait< VT, SMatScalarMultExpr<MT,ST,SO> >::Type
881  operator*( const DenseVector<VT,true>& vec, const SMatScalarMultExpr<MT,ST,SO>& mat )
882 {
884 
885  return ( (~vec) * mat.leftOperand() ) * mat.rightOperand();
886 }
888 //*************************************************************************************************
889 
890 
891 //*************************************************************************************************
907 template< typename MT // Type of the sparse matrix of the left-hand side expression
908  , typename ST1 // Type of the scalar of the left-hand side expression
909  , bool SO // Storage order of the left-hand side expression
910  , typename VT // Type of the dense vector of the right-hand side expression
911  , typename ST2 > // Type of the scalar of the right-hand side expression
912 inline const typename MultExprTrait< SMatScalarMultExpr<MT,ST1,SO>, DVecScalarMultExpr<VT,ST2,false> >::Type
913  operator*( const SMatScalarMultExpr<MT,ST1,SO>& mat, const DVecScalarMultExpr<VT,ST2,false>& vec )
914 {
916 
917  return ( mat.leftOperand() * vec.leftOperand() ) * ( mat.rightOperand() * vec.rightOperand() );
918 }
920 //*************************************************************************************************
921 
922 
923 //*************************************************************************************************
939 template< typename VT // Type of the dense vector of the left-hand side expression
940  , typename ST1 // Type of the scalar of the left-hand side expression
941  , typename MT // Type of the sparse matrix of the right-hand side expression
942  , typename ST2 // Type of the scalar of the right-hand side expression
943  , bool SO > // Storage order of the right-hand side expression
944 inline const typename MultExprTrait< DVecScalarMultExpr<VT,ST1,true>, SMatScalarMultExpr<MT,ST2,SO> >::Type
945  operator*( const DVecScalarMultExpr<VT,ST1,true>& vec, const SMatScalarMultExpr<MT,ST2,SO>& mat )
946 {
948 
949  return ( vec.leftOperand() * mat.leftOperand() ) * ( vec.rightOperand() * mat.rightOperand() );
950 }
952 //*************************************************************************************************
953 
954 
955 //*************************************************************************************************
969 template< typename MT // Type of the sparse matrix of the left-hand side expression
970  , typename ST // Type of the scalar of the left-hand side expression
971  , bool SO // Storage order of the left-hand side expression
972  , typename VT > // Type of the right-hand side sparse vector
973 inline const typename MultExprTrait< SMatScalarMultExpr<MT,ST,SO>, VT >::Type
974  operator*( const SMatScalarMultExpr<MT,ST,SO>& mat, const SparseVector<VT,false>& vec )
975 {
977 
978  return ( mat.leftOperand() * (~vec) ) * mat.rightOperand();
979 }
981 //*************************************************************************************************
982 
983 
984 //*************************************************************************************************
998 template< typename VT // Type of the left-hand side sparse vector
999  , typename MT // Type of the sparse matrix of the right-hand side expression
1000  , typename ST // Type of the scalar of the right-hand side expression
1001  , bool SO > // Storage order of the right-hand side expression
1002 inline const typename MultExprTrait< VT, SMatScalarMultExpr<MT,ST,SO> >::Type
1003  operator*( const SparseVector<VT,true>& vec, const SMatScalarMultExpr<MT,ST,SO>& mat )
1004 {
1006 
1007  return ( (~vec) * mat.leftOperand() ) * mat.rightOperand();
1008 }
1010 //*************************************************************************************************
1011 
1012 
1013 //*************************************************************************************************
1029 template< typename MT // Type of the sparse matrix of the left-hand side expression
1030  , typename ST1 // Type of the scalar of the left-hand side expression
1031  , bool SO // Storage order of the left-hand side expression
1032  , typename VT // Type of the sparse vector of the right-hand side expression
1033  , typename ST2 > // Type of the scalar of the right-hand side expression
1034 inline const typename MultExprTrait< SMatScalarMultExpr<MT,ST1,SO>, SVecScalarMultExpr<VT,ST2,false> >::Type
1035  operator*( const SMatScalarMultExpr<MT,ST1,SO>& mat, const SVecScalarMultExpr<VT,ST2,false>& vec )
1036 {
1038 
1039  return ( mat.leftOperand() * vec.leftOperand() ) * ( mat.rightOperand() * vec.rightOperand() );
1040 }
1042 //*************************************************************************************************
1043 
1044 
1045 //*************************************************************************************************
1061 template< typename VT // Type of the sparse vector of the left-hand side expression
1062  , typename ST1 // Type of the scalar of the left-hand side expression
1063  , typename MT // Type of the sparse matrix of the right-hand side expression
1064  , typename ST2 // Type of the scalar of the right-hand side expression
1065  , bool SO > // Storage order of the right-hand side expression
1066 inline const typename MultExprTrait< SVecScalarMultExpr<VT,ST1,true>, SMatScalarMultExpr<MT,ST2,SO> >::Type
1067  operator*( const SVecScalarMultExpr<VT,ST1,true>& vec, const SMatScalarMultExpr<MT,ST2,SO>& mat )
1068 {
1070 
1071  return ( vec.leftOperand() * mat.leftOperand() ) * ( vec.rightOperand() * mat.rightOperand() );
1072 }
1074 //*************************************************************************************************
1075 
1076 
1077 //*************************************************************************************************
1091 template< typename MT1 // Type of the sparse matrix of the left-hand side expression
1092  , typename ST // Type of the scalar of the left-hand side expression
1093  , bool SO1 // Storage order of the left-hand side expression
1094  , typename MT2 // Type of the right-hand side dense matrix
1095  , bool SO2 > // Storage order of the right-hand side dense matrix
1096 inline const typename MultExprTrait< SMatScalarMultExpr<MT1,ST,SO1>, MT2 >::Type
1097  operator*( const SMatScalarMultExpr<MT1,ST,SO1>& lhs, const DenseMatrix<MT2,SO2>& rhs )
1098 {
1100 
1101  return ( lhs.leftOperand() * (~rhs) ) * lhs.rightOperand();
1102 }
1104 //*************************************************************************************************
1105 
1106 
1107 //*************************************************************************************************
1121 template< typename MT1 // Type of the left-hand side dense matrix
1122  , bool SO1 // Storage order of the left-hand side dense matrix
1123  , typename MT2 // Type of the sparse matrix of the right-hand side expression
1124  , typename ST // Type of the scalar of the right-hand side expression
1125  , bool SO2 > // Storage order of the right-hand side expression
1126 inline const typename MultExprTrait< MT1, SMatScalarMultExpr<MT2,ST,SO2> >::Type
1127  operator*( const DenseMatrix<MT1,SO1>& lhs, const SMatScalarMultExpr<MT2,ST,SO2>& rhs )
1128 {
1130 
1131  return ( (~lhs) * rhs.leftOperand() ) * rhs.rightOperand();
1132 }
1134 //*************************************************************************************************
1135 
1136 
1137 //*************************************************************************************************
1151 template< typename MT1 // Type of the sparse matrix of the left-hand side expression
1152  , typename ST // Type of the scalar of the left-hand side expression
1153  , bool SO1 // Storage order of the left-hand side expression
1154  , typename MT2 // Type of the right-hand side sparse matrix
1155  , bool SO2 > // Storage order of the right-hand side sparse matrix
1156 inline const typename MultExprTrait< SMatScalarMultExpr<MT1,ST,SO1>, MT2 >::Type
1157  operator*( const SMatScalarMultExpr<MT1,ST,SO1>& lhs, const SparseMatrix<MT2,SO2>& rhs )
1158 {
1160 
1161  return ( lhs.leftOperand() * (~rhs) ) * lhs.rightOperand();
1162 }
1164 //*************************************************************************************************
1165 
1166 
1167 //*************************************************************************************************
1181 template< typename MT1 // Type of the left-hand side sparse matrix
1182  , bool SO1 // Storage order of the left-hand side sparse matrix
1183  , typename MT2 // Type of the sparse matrix of the right-hand side expression
1184  , typename ST // Type of the scalar of the right-hand side expression
1185  , bool SO2 > // Storage order of the right-hand side expression
1186 inline const typename MultExprTrait< MT1, SMatScalarMultExpr<MT2,ST,SO2> >::Type
1187  operator*( const SparseMatrix<MT1,SO1>& lhs, const SMatScalarMultExpr<MT2,ST,SO2>& rhs )
1188 {
1190 
1191  return ( (~lhs) * rhs.leftOperand() ) * rhs.rightOperand();
1192 }
1194 //*************************************************************************************************
1195 
1196 
1197 //*************************************************************************************************
1211 template< typename MT1 // Type of the sparse matrix of the left-hand side expression
1212  , typename ST1 // Type of the scalar of the left-hand side expression
1213  , bool SO1 // Storage order of the left-hand side expression
1214  , typename MT2 // Type of the right-hand side sparse matrix
1215  , typename ST2 // Type of the scalar of the right-hand side expression
1216  , bool SO2 > // Storage order of the right-hand side expression
1217 inline const typename MultExprTrait< SMatScalarMultExpr<MT1,ST1,SO1>, SMatScalarMultExpr<MT2,ST2,SO2> >::Type
1218  operator*( const SMatScalarMultExpr<MT1,ST1,SO1>& lhs, const SMatScalarMultExpr<MT2,ST2,SO2>& rhs )
1219 {
1221 
1222  return ( lhs.leftOperand() * rhs.leftOperand() ) * ( lhs.rightOperand() * rhs.rightOperand() );
1223 }
1225 //*************************************************************************************************
1226 
1227 
1228 
1229 
1230 //=================================================================================================
1231 //
1232 // SMATSCALARMULTEXPRTRAIT SPECIALIZATIONS
1233 //
1234 //=================================================================================================
1235 
1236 //*************************************************************************************************
1238 template< typename MT, typename ST1, typename ST2 >
1239 struct SMatScalarMultExprTrait< SMatScalarMultExpr<MT,ST1,false>, ST2 >
1240 {
1241  public:
1242  //**********************************************************************************************
1243  typedef typename SelectType< IsSparseMatrix<MT>::value && IsRowMajorMatrix<MT>::value &&
1244  IsNumeric<ST1>::value && IsNumeric<ST2>::value
1245  , typename SMatScalarMultExprTrait<MT,typename MultTrait<ST1,ST2>::Type>::Type
1246  , INVALID_TYPE >::Type Type;
1247  //**********************************************************************************************
1248 };
1250 //*************************************************************************************************
1251 
1252 
1253 
1254 
1255 //=================================================================================================
1256 //
1257 // TSMATSCALARMULTEXPRTRAIT SPECIALIZATIONS
1258 //
1259 //=================================================================================================
1260 
1261 //*************************************************************************************************
1263 template< typename MT, typename ST1, typename ST2 >
1264 struct TSMatScalarMultExprTrait< SMatScalarMultExpr<MT,ST1,true>, ST2 >
1265 {
1266  public:
1267  //**********************************************************************************************
1268  typedef typename SelectType< IsSparseMatrix<MT>::value && IsColumnMajorMatrix<MT>::value &&
1269  IsNumeric<ST1>::value && IsNumeric<ST2>::value
1270  , typename TSMatScalarMultExprTrait<MT,typename MultTrait<ST1,ST2>::Type>::Type
1271  , INVALID_TYPE >::Type Type;
1272  //**********************************************************************************************
1273 };
1275 //*************************************************************************************************
1276 
1277 
1278 
1279 
1280 //=================================================================================================
1281 //
1282 // SMATSCALARDIVEXPRTRAIT SPECIALIZATIONS
1283 //
1284 //=================================================================================================
1285 
1286 //*************************************************************************************************
1288 template< typename MT, typename ST1, typename ST2 >
1289 struct SMatScalarDivExprTrait< SMatScalarMultExpr<MT,ST1,false>, ST2 >
1290 {
1291  private:
1292  //**********************************************************************************************
1293  enum { condition = IsFloatingPoint<typename DivTrait<ST1,ST2>::Type>::value };
1294  //**********************************************************************************************
1295 
1296  //**********************************************************************************************
1297  typedef typename SMatScalarMultExprTrait<MT,typename DivTrait<ST1,ST2>::Type>::Type T1;
1298  typedef typename SMatScalarDivExprTrait<MT,typename DivTrait<ST1,ST2>::Type>::Type T2;
1299  //**********************************************************************************************
1300 
1301  public:
1302  //**********************************************************************************************
1303  typedef typename SelectType< IsSparseMatrix<MT>::value && IsRowMajorMatrix<MT>::value &&
1304  IsNumeric<ST1>::value && IsNumeric<ST2>::value
1305  , typename SelectType<condition,T1,T2>::Type
1306  , INVALID_TYPE >::Type Type;
1307  //**********************************************************************************************
1308 };
1310 //*************************************************************************************************
1311 
1312 
1313 
1314 
1315 //=================================================================================================
1316 //
1317 // TSMATSCALARDIVEXPRTRAIT SPECIALIZATIONS
1318 //
1319 //=================================================================================================
1320 
1321 //*************************************************************************************************
1323 template< typename MT, typename ST1, typename ST2 >
1324 struct TSMatScalarDivExprTrait< SMatScalarMultExpr<MT,ST1,true>, ST2 >
1325 {
1326  private:
1327  //**********************************************************************************************
1328  enum { condition = IsFloatingPoint<typename DivTrait<ST1,ST2>::Type>::value };
1329  //**********************************************************************************************
1330 
1331  //**********************************************************************************************
1332  typedef typename TSMatScalarMultExprTrait<MT,typename DivTrait<ST1,ST2>::Type>::Type T1;
1333  typedef typename TSMatScalarDivExprTrait<MT,typename DivTrait<ST1,ST2>::Type>::Type T2;
1334  //**********************************************************************************************
1335 
1336  public:
1337  //**********************************************************************************************
1338  typedef typename SelectType< IsSparseMatrix<MT>::value && IsColumnMajorMatrix<MT>::value &&
1339  IsNumeric<ST1>::value && IsNumeric<ST2>::value
1340  , typename SelectType<condition,T1,T2>::Type
1341  , INVALID_TYPE >::Type Type;
1342  //**********************************************************************************************
1343 };
1345 //*************************************************************************************************
1346 
1347 
1348 
1349 
1350 //=================================================================================================
1351 //
1352 // SMATDVECMULTEXPRTRAIT SPECIALIZATIONS
1353 //
1354 //=================================================================================================
1355 
1356 //*************************************************************************************************
1358 template< typename MT, typename ST, typename VT >
1359 struct SMatDVecMultExprTrait< SMatScalarMultExpr<MT,ST,false>, VT >
1360 {
1361  public:
1362  //**********************************************************************************************
1363  typedef typename SelectType< IsSparseMatrix<MT>::value && IsRowMajorMatrix<MT>::value &&
1364  IsDenseVector<VT>::value && IsColumnVector<VT>::value &&
1365  IsNumeric<ST>::value
1366  , typename DVecScalarMultExprTrait<typename SMatDVecMultExprTrait<MT,VT>::Type,ST>::Type
1367  , INVALID_TYPE >::Type Type;
1368  //**********************************************************************************************
1369 };
1371 //*************************************************************************************************
1372 
1373 
1374 //*************************************************************************************************
1376 template< typename MT, typename ST1, typename VT, typename ST2 >
1377 struct SMatDVecMultExprTrait< SMatScalarMultExpr<MT,ST1,false>, DVecScalarMultExpr<VT,ST2,false> >
1378 {
1379  public:
1380  //**********************************************************************************************
1381  typedef typename SelectType< IsSparseMatrix<MT>::value && IsRowMajorMatrix<MT>::value &&
1382  IsDenseVector<VT>::value && IsColumnVector<VT>::value &&
1383  IsNumeric<ST1>::value && IsNumeric<ST2>::value
1384  , typename DVecScalarMultExprTrait<typename SMatDVecMultExprTrait<MT,VT>::Type,typename MultTrait<ST1,ST2>::Type>::Type
1385  , INVALID_TYPE >::Type Type;
1386  //**********************************************************************************************
1387 };
1389 //*************************************************************************************************
1390 
1391 
1392 
1393 
1394 //=================================================================================================
1395 //
1396 // TSMATDVECMULTEXPRTRAIT SPECIALIZATIONS
1397 //
1398 //=================================================================================================
1399 
1400 //*************************************************************************************************
1402 template< typename MT, typename ST, typename VT >
1403 struct TSMatDVecMultExprTrait< SMatScalarMultExpr<MT,ST,true>, VT >
1404 {
1405  public:
1406  //**********************************************************************************************
1407  typedef typename SelectType< IsSparseMatrix<MT>::value && IsColumnMajorMatrix<MT>::value &&
1408  IsDenseVector<VT>::value && IsColumnVector<VT>::value &&
1409  IsNumeric<ST>::value
1410  , typename DVecScalarMultExprTrait<typename TSMatDVecMultExprTrait<MT,VT>::Type,ST>::Type
1411  , INVALID_TYPE >::Type Type;
1412  //**********************************************************************************************
1413 };
1415 //*************************************************************************************************
1416 
1417 
1418 //*************************************************************************************************
1420 template< typename MT, typename ST1, typename VT, typename ST2 >
1421 struct TSMatDVecMultExprTrait< SMatScalarMultExpr<MT,ST1,true>, DVecScalarMultExpr<VT,ST2,false> >
1422 {
1423  public:
1424  //**********************************************************************************************
1425  typedef typename SelectType< IsSparseMatrix<MT>::value && IsColumnMajorMatrix<MT>::value &&
1426  IsDenseVector<VT>::value && IsColumnVector<VT>::value &&
1427  IsNumeric<ST1>::value && IsNumeric<ST2>::value
1428  , typename DVecScalarMultExprTrait<typename TSMatDVecMultExprTrait<MT,VT>::Type,typename MultTrait<ST1,ST2>::Type>::Type
1429  , INVALID_TYPE >::Type Type;
1430  //**********************************************************************************************
1431 };
1433 //*************************************************************************************************
1434 
1435 
1436 
1437 
1438 //=================================================================================================
1439 //
1440 // TDVECSMATMULTEXPRTRAIT SPECIALIZATIONS
1441 //
1442 //=================================================================================================
1443 
1444 //*************************************************************************************************
1446 template< typename VT, typename MT, typename ST >
1447 struct TDVecSMatMultExprTrait< VT, SMatScalarMultExpr<MT,ST,false> >
1448 {
1449  public:
1450  //**********************************************************************************************
1451  typedef typename SelectType< IsDenseVector<VT>::value && IsRowVector<VT>::value &&
1452  IsSparseMatrix<MT>::value && IsRowMajorMatrix<MT>::value &&
1453  IsNumeric<ST>::value
1454  , typename TDVecScalarMultExprTrait<typename TDVecSMatMultExprTrait<VT,MT>::Type,ST>::Type
1455  , INVALID_TYPE >::Type Type;
1456  //**********************************************************************************************
1457 };
1459 //*************************************************************************************************
1460 
1461 
1462 //*************************************************************************************************
1464 template< typename VT, typename ST1, typename MT, typename ST2 >
1465 struct TDVecSMatMultExprTrait< DVecScalarMultExpr<VT,ST1,true>, SMatScalarMultExpr<MT,ST2,false> >
1466 {
1467  public:
1468  //**********************************************************************************************
1469  typedef typename SelectType< IsDenseVector<VT>::value && IsRowVector<VT>::value &&
1470  IsSparseMatrix<MT>::value && IsRowMajorMatrix<MT>::value &&
1471  IsNumeric<ST1>::value && IsNumeric<ST2>::value
1472  , typename TDVecScalarMultExprTrait<typename TDVecSMatMultExprTrait<VT,MT>::Type,typename MultTrait<ST1,ST2>::Type>::Type
1473  , INVALID_TYPE >::Type Type;
1474  //**********************************************************************************************
1475 };
1477 //*************************************************************************************************
1478 
1479 
1480 
1481 
1482 //=================================================================================================
1483 //
1484 // TDVECTSMATMULTEXPRTRAIT SPECIALIZATIONS
1485 //
1486 //=================================================================================================
1487 
1488 //*************************************************************************************************
1490 template< typename VT, typename MT, typename ST >
1491 struct TDVecTSMatMultExprTrait< VT, SMatScalarMultExpr<MT,ST,true> >
1492 {
1493  public:
1494  //**********************************************************************************************
1495  typedef typename SelectType< IsDenseVector<VT>::value && IsRowVector<VT>::value &&
1496  IsSparseMatrix<MT>::value && IsColumnMajorMatrix<MT>::value &&
1497  IsNumeric<ST>::value
1498  , typename TDVecScalarMultExprTrait<typename TDVecTSMatMultExprTrait<VT,MT>::Type,ST>::Type
1499  , INVALID_TYPE >::Type Type;
1500  //**********************************************************************************************
1501 };
1503 //*************************************************************************************************
1504 
1505 
1506 //*************************************************************************************************
1508 template< typename VT, typename ST1, typename MT, typename ST2 >
1509 struct TDVecTSMatMultExprTrait< DVecScalarMultExpr<VT,ST1,true>, SMatScalarMultExpr<MT,ST2,true> >
1510 {
1511  public:
1512  //**********************************************************************************************
1513  typedef typename SelectType< IsDenseVector<VT>::value && IsRowVector<VT>::value &&
1514  IsSparseMatrix<MT>::value && IsColumnMajorMatrix<MT>::value &&
1515  IsNumeric<ST1>::value && IsNumeric<ST2>::value
1516  , typename TDVecScalarMultExprTrait<typename TDVecTSMatMultExprTrait<VT,MT>::Type,typename MultTrait<ST1,ST2>::Type>::Type
1517  , INVALID_TYPE >::Type Type;
1518  //**********************************************************************************************
1519 };
1521 //*************************************************************************************************
1522 
1523 
1524 
1525 
1526 //=================================================================================================
1527 //
1528 // SMATSVECMULTEXPRTRAIT SPECIALIZATIONS
1529 //
1530 //=================================================================================================
1531 
1532 //*************************************************************************************************
1534 template< typename MT, typename ST, typename VT >
1535 struct SMatSVecMultExprTrait< SMatScalarMultExpr<MT,ST,false>, VT >
1536 {
1537  public:
1538  //**********************************************************************************************
1539  typedef typename SelectType< IsSparseMatrix<MT>::value && IsRowMajorMatrix<MT>::value &&
1540  IsSparseVector<VT>::value && IsColumnVector<VT>::value &&
1541  IsNumeric<ST>::value
1542  , typename SVecScalarMultExprTrait<typename SMatSVecMultExprTrait<MT,VT>::Type,ST>::Type
1543  , INVALID_TYPE >::Type Type;
1544  //**********************************************************************************************
1545 };
1547 //*************************************************************************************************
1548 
1549 
1550 //*************************************************************************************************
1552 template< typename MT, typename ST1, typename VT, typename ST2 >
1553 struct SMatSVecMultExprTrait< SMatScalarMultExpr<MT,ST1,false>, SVecScalarMultExpr<VT,ST2,false> >
1554 {
1555  public:
1556  //**********************************************************************************************
1557  typedef typename SelectType< IsSparseMatrix<MT>::value && IsRowMajorMatrix<MT>::value &&
1558  IsSparseVector<VT>::value && IsColumnVector<VT>::value &&
1559  IsNumeric<ST1>::value && IsNumeric<ST2>::value
1560  , typename SVecScalarMultExprTrait<typename SMatSVecMultExprTrait<MT,VT>::Type,typename MultTrait<ST1,ST2>::Type>::Type
1561  , INVALID_TYPE >::Type Type;
1562  //**********************************************************************************************
1563 };
1565 //*************************************************************************************************
1566 
1567 
1568 
1569 
1570 //=================================================================================================
1571 //
1572 // TSMATSVECMULTEXPRTRAIT SPECIALIZATIONS
1573 //
1574 //=================================================================================================
1575 
1576 //*************************************************************************************************
1578 template< typename MT, typename ST, typename VT >
1579 struct TSMatSVecMultExprTrait< SMatScalarMultExpr<MT,ST,true>, VT >
1580 {
1581  public:
1582  //**********************************************************************************************
1583  typedef typename SelectType< IsSparseMatrix<MT>::value && IsColumnMajorMatrix<MT>::value &&
1584  IsSparseVector<VT>::value && IsColumnVector<VT>::value &&
1585  IsNumeric<ST>::value
1586  , typename SVecScalarMultExprTrait<typename TSMatSVecMultExprTrait<MT,VT>::Type,ST>::Type
1587  , INVALID_TYPE >::Type Type;
1588  //**********************************************************************************************
1589 };
1591 //*************************************************************************************************
1592 
1593 
1594 //*************************************************************************************************
1596 template< typename MT, typename ST1, typename VT, typename ST2 >
1597 struct TSMatSVecMultExprTrait< SMatScalarMultExpr<MT,ST1,true>, SVecScalarMultExpr<VT,ST2,false> >
1598 {
1599  public:
1600  //**********************************************************************************************
1601  typedef typename SelectType< IsSparseMatrix<MT>::value && IsColumnMajorMatrix<MT>::value &&
1602  IsSparseVector<VT>::value && IsColumnVector<VT>::value &&
1603  IsNumeric<ST1>::value && IsNumeric<ST2>::value
1604  , typename SVecScalarMultExprTrait<typename TSMatSVecMultExprTrait<MT,VT>::Type,typename MultTrait<ST1,ST2>::Type>::Type
1605  , INVALID_TYPE >::Type Type;
1606  //**********************************************************************************************
1607 };
1609 //*************************************************************************************************
1610 
1611 
1612 
1613 
1614 //=================================================================================================
1615 //
1616 // TSVECSMATMULTEXPRTRAIT SPECIALIZATIONS
1617 //
1618 //=================================================================================================
1619 
1620 //*************************************************************************************************
1622 template< typename VT, typename MT, typename ST >
1623 struct TSVecSMatMultExprTrait< VT, SMatScalarMultExpr<MT,ST,false> >
1624 {
1625  public:
1626  //**********************************************************************************************
1627  typedef typename SelectType< IsSparseVector<VT>::value && IsRowVector<VT>::value &&
1628  IsSparseMatrix<MT>::value && IsRowMajorMatrix<MT>::value &&
1629  IsNumeric<ST>::value
1630  , typename TSVecScalarMultExprTrait<typename TSVecSMatMultExprTrait<VT,MT>::Type,ST>::Type
1631  , INVALID_TYPE >::Type Type;
1632  //**********************************************************************************************
1633 };
1635 //*************************************************************************************************
1636 
1637 
1638 //*************************************************************************************************
1640 template< typename VT, typename ST1, typename MT, typename ST2 >
1641 struct TSVecSMatMultExprTrait< SVecScalarMultExpr<VT,ST1,true>, SMatScalarMultExpr<MT,ST2,false> >
1642 {
1643  public:
1644  //**********************************************************************************************
1645  typedef typename SelectType< IsSparseVector<VT>::value && IsRowVector<VT>::value &&
1646  IsSparseMatrix<MT>::value && IsRowMajorMatrix<MT>::value &&
1647  IsNumeric<ST1>::value && IsNumeric<ST2>::value
1648  , typename TSVecScalarMultExprTrait<typename TSVecSMatMultExprTrait<VT,MT>::Type,typename MultTrait<ST1,ST2>::Type>::Type
1649  , INVALID_TYPE >::Type Type;
1650  //**********************************************************************************************
1651 };
1653 //*************************************************************************************************
1654 
1655 
1656 
1657 
1658 //=================================================================================================
1659 //
1660 // TSVECTSMATMULTEXPRTRAIT SPECIALIZATIONS
1661 //
1662 //=================================================================================================
1663 
1664 //*************************************************************************************************
1666 template< typename VT, typename MT, typename ST >
1667 struct TSVecTSMatMultExprTrait< VT, SMatScalarMultExpr<MT,ST,true> >
1668 {
1669  public:
1670  //**********************************************************************************************
1671  typedef typename SelectType< IsSparseVector<VT>::value && IsRowVector<VT>::value &&
1672  IsSparseMatrix<MT>::value && IsColumnMajorMatrix<MT>::value &&
1673  IsNumeric<ST>::value
1674  , typename TSVecScalarMultExprTrait<typename TSVecTSMatMultExprTrait<VT,MT>::Type,ST>::Type
1675  , INVALID_TYPE >::Type Type;
1676  //**********************************************************************************************
1677 };
1679 //*************************************************************************************************
1680 
1681 
1682 //*************************************************************************************************
1684 template< typename VT, typename ST1, typename MT, typename ST2 >
1685 struct TSVecTSMatMultExprTrait< SVecScalarMultExpr<VT,ST1,true>, SMatScalarMultExpr<MT,ST2,true> >
1686 {
1687  public:
1688  //**********************************************************************************************
1689  typedef typename SelectType< IsSparseVector<VT>::value && IsRowVector<VT>::value &&
1690  IsSparseMatrix<MT>::value && IsColumnMajorMatrix<MT>::value &&
1691  IsNumeric<ST1>::value && IsNumeric<ST2>::value
1692  , typename TSVecScalarMultExprTrait<typename TSVecTSMatMultExprTrait<VT,MT>::Type,typename MultTrait<ST1,ST2>::Type>::Type
1693  , INVALID_TYPE >::Type Type;
1694  //**********************************************************************************************
1695 };
1697 //*************************************************************************************************
1698 
1699 
1700 
1701 
1702 //=================================================================================================
1703 //
1704 // DMATSMATMULTEXPRTRAIT SPECIALIZATIONS
1705 //
1706 //=================================================================================================
1707 
1708 //*************************************************************************************************
1710 template< typename MT1, typename MT2, typename ST >
1711 struct DMatSMatMultExprTrait< MT1, SMatScalarMultExpr<MT2,ST,false> >
1712 {
1713  public:
1714  //**********************************************************************************************
1715  typedef typename SelectType< IsDenseMatrix<MT1>::value && IsRowMajorMatrix<MT1>::value &&
1716  IsSparseMatrix<MT2>::value && IsRowMajorMatrix<MT2>::value &&
1717  IsNumeric<ST>::value
1718  , typename DMatScalarMultExprTrait<typename DMatSMatMultExprTrait<MT1,MT2>::Type,ST>::Type
1719  , INVALID_TYPE >::Type Type;
1720  //**********************************************************************************************
1721 };
1723 //*************************************************************************************************
1724 
1725 
1726 
1727 
1728 //=================================================================================================
1729 //
1730 // DMATTSMATMULTEXPRTRAIT SPECIALIZATIONS
1731 //
1732 //=================================================================================================
1733 
1734 //*************************************************************************************************
1736 template< typename MT1, typename MT2, typename ST >
1737 struct DMatTSMatMultExprTrait< MT1, SMatScalarMultExpr<MT2,ST,true> >
1738 {
1739  public:
1740  //**********************************************************************************************
1741  typedef typename SelectType< IsDenseMatrix<MT1>::value && IsRowMajorMatrix<MT1>::value &&
1742  IsSparseMatrix<MT2>::value && IsColumnMajorMatrix<MT2>::value &&
1743  IsNumeric<ST>::value
1744  , typename DMatScalarMultExprTrait<typename DMatTSMatMultExprTrait<MT1,MT2>::Type,ST>::Type
1745  , INVALID_TYPE >::Type Type;
1746  //**********************************************************************************************
1747 };
1749 //*************************************************************************************************
1750 
1751 
1752 
1753 
1754 //=================================================================================================
1755 //
1756 // TDMATSMATMULTEXPRTRAIT SPECIALIZATIONS
1757 //
1758 //=================================================================================================
1759 
1760 //*************************************************************************************************
1762 template< typename MT1, typename MT2, typename ST >
1763 struct TDMatSMatMultExprTrait< MT1, SMatScalarMultExpr<MT2,ST,false> >
1764 {
1765  public:
1766  //**********************************************************************************************
1767  typedef typename SelectType< IsDenseMatrix<MT1>::value && IsColumnMajorMatrix<MT1>::value &&
1768  IsSparseMatrix<MT2>::value && IsRowMajorMatrix<MT2>::value &&
1769  IsNumeric<ST>::value
1770  , typename TDMatScalarMultExprTrait<typename TDMatSMatMultExprTrait<MT1,MT2>::Type,ST>::Type
1771  , INVALID_TYPE >::Type Type;
1772  //**********************************************************************************************
1773 };
1775 //*************************************************************************************************
1776 
1777 
1778 
1779 
1780 //=================================================================================================
1781 //
1782 // TDMATTSMATMULTEXPRTRAIT SPECIALIZATIONS
1783 //
1784 //=================================================================================================
1785 
1786 //*************************************************************************************************
1788 template< typename MT1, typename MT2, typename ST >
1789 struct TDMatTSMatMultExprTrait< MT1, SMatScalarMultExpr<MT2,ST,true> >
1790 {
1791  public:
1792  //**********************************************************************************************
1793  typedef typename SelectType< IsDenseMatrix<MT1>::value && IsColumnMajorMatrix<MT1>::value &&
1794  IsSparseMatrix<MT2>::value && IsColumnMajorMatrix<MT2>::value &&
1795  IsNumeric<ST>::value
1796  , typename TDMatScalarMultExprTrait<typename TDMatTSMatMultExprTrait<MT1,MT2>::Type,ST>::Type
1797  , INVALID_TYPE >::Type Type;
1798  //**********************************************************************************************
1799 };
1801 //*************************************************************************************************
1802 
1803 
1804 
1805 
1806 //=================================================================================================
1807 //
1808 // SMATDMATMULTEXPRTRAIT SPECIALIZATIONS
1809 //
1810 //=================================================================================================
1811 
1812 //*************************************************************************************************
1814 template< typename MT1, typename ST, typename MT2 >
1815 struct SMatDMatMultExprTrait< SMatScalarMultExpr<MT1,ST,false>, MT2 >
1816 {
1817  public:
1818  //**********************************************************************************************
1819  typedef typename SelectType< IsSparseMatrix<MT1>::value && IsRowMajorMatrix<MT1>::value &&
1820  IsDenseMatrix<MT2>::value && IsRowMajorMatrix<MT2>::value &&
1821  IsNumeric<ST>::value
1822  , typename DMatScalarMultExprTrait<typename SMatDMatMultExprTrait<MT1,MT2>::Type,ST>::Type
1823  , INVALID_TYPE >::Type Type;
1824  //**********************************************************************************************
1825 };
1827 //*************************************************************************************************
1828 
1829 
1830 
1831 
1832 //=================================================================================================
1833 //
1834 // SMATTDMATMULTEXPRTRAIT SPECIALIZATIONS
1835 //
1836 //=================================================================================================
1837 
1838 //*************************************************************************************************
1840 template< typename MT1, typename ST, typename MT2 >
1841 struct SMatTDMatMultExprTrait< SMatScalarMultExpr<MT1,ST,false>, MT2 >
1842 {
1843  public:
1844  //**********************************************************************************************
1845  typedef typename SelectType< IsSparseMatrix<MT1>::value && IsRowMajorMatrix<MT1>::value &&
1846  IsDenseMatrix<MT2>::value && IsColumnMajorMatrix<MT2>::value &&
1847  IsNumeric<ST>::value
1848  , typename DMatScalarMultExprTrait<typename SMatTDMatMultExprTrait<MT1,MT2>::Type,ST>::Type
1849  , INVALID_TYPE >::Type Type;
1850  //**********************************************************************************************
1851 };
1853 //*************************************************************************************************
1854 
1855 
1856 
1857 
1858 //=================================================================================================
1859 //
1860 // TSMATDMATMULTEXPRTRAIT SPECIALIZATIONS
1861 //
1862 //=================================================================================================
1863 
1864 //*************************************************************************************************
1866 template< typename MT1, typename ST, typename MT2 >
1867 struct TSMatDMatMultExprTrait< SMatScalarMultExpr<MT1,ST,true>, MT2 >
1868 {
1869  public:
1870  //**********************************************************************************************
1871  typedef typename SelectType< IsSparseMatrix<MT1>::value && IsColumnMajorMatrix<MT1>::value &&
1872  IsDenseMatrix<MT2>::value && IsRowMajorMatrix<MT2>::value &&
1873  IsNumeric<ST>::value
1874  , typename TDMatScalarMultExprTrait<typename TSMatDMatMultExprTrait<MT1,MT2>::Type,ST>::Type
1875  , INVALID_TYPE >::Type Type;
1876  //**********************************************************************************************
1877 };
1879 //*************************************************************************************************
1880 
1881 
1882 
1883 
1884 //=================================================================================================
1885 //
1886 // TSMATTDMATMULTEXPRTRAIT SPECIALIZATIONS
1887 //
1888 //=================================================================================================
1889 
1890 //*************************************************************************************************
1892 template< typename MT1, typename ST, typename MT2 >
1893 struct TSMatTDMatMultExprTrait< SMatScalarMultExpr<MT1,ST,true>, MT2 >
1894 {
1895  public:
1896  //**********************************************************************************************
1897  typedef typename SelectType< IsSparseMatrix<MT1>::value && IsColumnMajorMatrix<MT1>::value &&
1898  IsDenseMatrix<MT2>::value && IsColumnMajorMatrix<MT2>::value &&
1899  IsNumeric<ST>::value
1900  , typename TDMatScalarMultExprTrait<typename TSMatTDMatMultExprTrait<MT1,MT2>::Type,ST>::Type
1901  , INVALID_TYPE >::Type Type;
1902  //**********************************************************************************************
1903 };
1905 //*************************************************************************************************
1906 
1907 
1908 
1909 
1910 //=================================================================================================
1911 //
1912 // SMATSMATMULTEXPRTRAIT SPECIALIZATIONS
1913 //
1914 //=================================================================================================
1915 
1916 //*************************************************************************************************
1918 template< typename MT1, typename ST, typename MT2 >
1919 struct SMatSMatMultExprTrait< SMatScalarMultExpr<MT1,ST,false>, MT2 >
1920 {
1921  public:
1922  //**********************************************************************************************
1923  typedef typename SelectType< IsSparseMatrix<MT1>::value && IsRowMajorMatrix<MT1>::value &&
1924  IsSparseMatrix<MT2>::value && IsRowMajorMatrix<MT2>::value &&
1925  IsNumeric<ST>::value
1926  , typename SMatScalarMultExprTrait<typename SMatSMatMultExprTrait<MT1,MT2>::Type,ST>::Type
1927  , INVALID_TYPE >::Type Type;
1928  //**********************************************************************************************
1929 };
1931 //*************************************************************************************************
1932 
1933 
1934 //*************************************************************************************************
1936 template< typename MT1, typename MT2, typename ST >
1937 struct SMatSMatMultExprTrait< MT1, SMatScalarMultExpr<MT2,ST,false> >
1938 {
1939  public:
1940  //**********************************************************************************************
1941  typedef typename SelectType< IsSparseMatrix<MT1>::value && IsRowMajorMatrix<MT1>::value &&
1942  IsSparseMatrix<MT2>::value && IsRowMajorMatrix<MT2>::value &&
1943  IsNumeric<ST>::value
1944  , typename SMatScalarMultExprTrait<typename SMatSMatMultExprTrait<MT1,MT2>::Type,ST>::Type
1945  , INVALID_TYPE >::Type Type;
1946  //**********************************************************************************************
1947 };
1949 //*************************************************************************************************
1950 
1951 
1952 //*************************************************************************************************
1954 template< typename MT1, typename ST1, typename MT2, typename ST2 >
1955 struct SMatSMatMultExprTrait< SMatScalarMultExpr<MT1,ST1,false>, SMatScalarMultExpr<MT2,ST2,false> >
1956 {
1957  public:
1958  //**********************************************************************************************
1959  typedef typename SelectType< IsSparseMatrix<MT1>::value && IsRowMajorMatrix<MT1>::value &&
1960  IsSparseMatrix<MT2>::value && IsRowMajorMatrix<MT2>::value &&
1961  IsNumeric<ST1>::value && IsNumeric<ST2>::value
1962  , typename SMatScalarMultExprTrait<typename SMatSMatMultExprTrait<MT1,MT2>::Type,typename MultTrait<ST1,ST2>::Type>::Type
1963  , INVALID_TYPE >::Type Type;
1964  //**********************************************************************************************
1965 };
1967 //*************************************************************************************************
1968 
1969 
1970 
1971 
1972 //=================================================================================================
1973 //
1974 // SMATTSMATMULTEXPRTRAIT SPECIALIZATIONS
1975 //
1976 //=================================================================================================
1977 
1978 //*************************************************************************************************
1980 template< typename MT1, typename ST, typename MT2 >
1981 struct SMatTSMatMultExprTrait< SMatScalarMultExpr<MT1,ST,false>, MT2 >
1982 {
1983  public:
1984  //**********************************************************************************************
1985  typedef typename SelectType< IsSparseMatrix<MT1>::value && IsRowMajorMatrix<MT1>::value &&
1986  IsSparseMatrix<MT2>::value && IsColumnMajorMatrix<MT2>::value &&
1987  IsNumeric<ST>::value
1988  , typename SMatScalarMultExprTrait<typename SMatTSMatMultExprTrait<MT1,MT2>::Type,ST>::Type
1989  , INVALID_TYPE >::Type Type;
1990  //**********************************************************************************************
1991 };
1993 //*************************************************************************************************
1994 
1995 
1996 //*************************************************************************************************
1998 template< typename MT1, typename MT2, typename ST >
1999 struct SMatTSMatMultExprTrait< MT1, SMatScalarMultExpr<MT2,ST,true> >
2000 {
2001  public:
2002  //**********************************************************************************************
2003  typedef typename SelectType< IsSparseMatrix<MT1>::value && IsRowMajorMatrix<MT1>::value &&
2004  IsSparseMatrix<MT2>::value && IsColumnMajorMatrix<MT2>::value &&
2005  IsNumeric<ST>::value
2006  , typename SMatScalarMultExprTrait<typename SMatTSMatMultExprTrait<MT1,MT2>::Type,ST>::Type
2007  , INVALID_TYPE >::Type Type;
2008  //**********************************************************************************************
2009 };
2011 //*************************************************************************************************
2012 
2013 
2014 //*************************************************************************************************
2016 template< typename MT1, typename ST1, typename MT2, typename ST2 >
2017 struct SMatTSMatMultExprTrait< SMatScalarMultExpr<MT1,ST1,false>, SMatScalarMultExpr<MT2,ST2,true> >
2018 {
2019  public:
2020  //**********************************************************************************************
2021  typedef typename SelectType< IsSparseMatrix<MT1>::value && IsRowMajorMatrix<MT1>::value &&
2022  IsSparseMatrix<MT2>::value && IsColumnMajorMatrix<MT2>::value &&
2023  IsNumeric<ST1>::value && IsNumeric<ST2>::value
2024  , typename SMatScalarMultExprTrait<typename SMatTSMatMultExprTrait<MT1,MT2>::Type,typename MultTrait<ST1,ST2>::Type>::Type
2025  , INVALID_TYPE >::Type Type;
2026  //**********************************************************************************************
2027 };
2029 //*************************************************************************************************
2030 
2031 
2032 
2033 
2034 //=================================================================================================
2035 //
2036 // TSMATSMATMULTEXPRTRAIT SPECIALIZATIONS
2037 //
2038 //=================================================================================================
2039 
2040 //*************************************************************************************************
2042 template< typename MT1, typename ST, typename MT2 >
2043 struct TSMatSMatMultExprTrait< SMatScalarMultExpr<MT1,ST,true>, MT2 >
2044 {
2045  public:
2046  //**********************************************************************************************
2047  typedef typename SelectType< IsSparseMatrix<MT1>::value && IsColumnMajorMatrix<MT1>::value &&
2048  IsSparseMatrix<MT2>::value && IsRowMajorMatrix<MT2>::value &&
2049  IsNumeric<ST>::value
2050  , typename TSMatScalarMultExprTrait<typename TSMatSMatMultExprTrait<MT1,MT2>::Type,ST>::Type
2051  , INVALID_TYPE >::Type Type;
2052  //**********************************************************************************************
2053 };
2055 //*************************************************************************************************
2056 
2057 
2058 //*************************************************************************************************
2060 template< typename MT1, typename MT2, typename ST >
2061 struct TSMatSMatMultExprTrait< MT1, SMatScalarMultExpr<MT2,ST,false> >
2062 {
2063  public:
2064  //**********************************************************************************************
2065  typedef typename SelectType< IsSparseMatrix<MT1>::value && IsColumnMajorMatrix<MT1>::value &&
2066  IsSparseMatrix<MT2>::value && IsRowMajorMatrix<MT2>::value &&
2067  IsNumeric<ST>::value
2068  , typename TSMatScalarMultExprTrait<typename TSMatSMatMultExprTrait<MT1,MT2>::Type,ST>::Type
2069  , INVALID_TYPE >::Type Type;
2070  //**********************************************************************************************
2071 };
2073 //*************************************************************************************************
2074 
2075 
2076 //*************************************************************************************************
2078 template< typename MT1, typename ST1, typename MT2, typename ST2 >
2079 struct TSMatSMatMultExprTrait< SMatScalarMultExpr<MT1,ST1,true>, SMatScalarMultExpr<MT2,ST2,false> >
2080 {
2081  public:
2082  //**********************************************************************************************
2083  typedef typename SelectType< IsSparseMatrix<MT1>::value && IsColumnMajorMatrix<MT1>::value &&
2084  IsSparseMatrix<MT2>::value && IsRowMajorMatrix<MT2>::value &&
2085  IsNumeric<ST1>::value && IsNumeric<ST2>::value
2086  , typename TSMatScalarMultExprTrait<typename TSMatSMatMultExprTrait<MT1,MT2>::Type,typename MultTrait<ST1,ST2>::Type>::Type
2087  , INVALID_TYPE >::Type Type;
2088  //**********************************************************************************************
2089 };
2091 //*************************************************************************************************
2092 
2093 
2094 
2095 
2096 //=================================================================================================
2097 //
2098 // TSMATSMATMULTEXPRTRAIT SPECIALIZATIONS
2099 //
2100 //=================================================================================================
2101 
2102 //*************************************************************************************************
2104 template< typename MT1, typename ST, typename MT2 >
2105 struct TSMatTSMatMultExprTrait< SMatScalarMultExpr<MT1,ST,true>, MT2 >
2106 {
2107  public:
2108  //**********************************************************************************************
2109  typedef typename SelectType< IsSparseMatrix<MT1>::value && IsColumnMajorMatrix<MT1>::value &&
2110  IsSparseMatrix<MT2>::value && IsColumnMajorMatrix<MT2>::value &&
2111  IsNumeric<ST>::value
2112  , typename TSMatScalarMultExprTrait<typename TSMatTSMatMultExprTrait<MT1,MT2>::Type,ST>::Type
2113  , INVALID_TYPE >::Type Type;
2114  //**********************************************************************************************
2115 };
2117 //*************************************************************************************************
2118 
2119 
2120 //*************************************************************************************************
2122 template< typename MT1, typename MT2, typename ST >
2123 struct TSMatTSMatMultExprTrait< MT1, SMatScalarMultExpr<MT2,ST,true> >
2124 {
2125  public:
2126  //**********************************************************************************************
2127  typedef typename SelectType< IsSparseMatrix<MT1>::value && IsColumnMajorMatrix<MT1>::value &&
2128  IsSparseMatrix<MT2>::value && IsColumnMajorMatrix<MT2>::value &&
2129  IsNumeric<ST>::value
2130  , typename TSMatScalarMultExprTrait<typename TSMatTSMatMultExprTrait<MT1,MT2>::Type,ST>::Type
2131  , INVALID_TYPE >::Type Type;
2132  //**********************************************************************************************
2133 };
2135 //*************************************************************************************************
2136 
2137 
2138 //*************************************************************************************************
2140 template< typename MT1, typename ST1, typename MT2, typename ST2 >
2141 struct TSMatTSMatMultExprTrait< SMatScalarMultExpr<MT1,ST1,true>, SMatScalarMultExpr<MT2,ST2,true> >
2142 {
2143  public:
2144  //**********************************************************************************************
2145  typedef typename SelectType< IsSparseMatrix<MT1>::value && IsColumnMajorMatrix<MT1>::value &&
2146  IsSparseMatrix<MT2>::value && IsColumnMajorMatrix<MT2>::value &&
2147  IsNumeric<ST1>::value && IsNumeric<ST2>::value
2148  , typename TSMatScalarMultExprTrait<typename TSMatTSMatMultExprTrait<MT1,MT2>::Type,typename MultTrait<ST1,ST2>::Type>::Type
2149  , INVALID_TYPE >::Type Type;
2150  //**********************************************************************************************
2151 };
2153 //*************************************************************************************************
2154 
2155 
2156 
2157 
2158 //=================================================================================================
2159 //
2160 // SUBMATRIXEXPRTRAIT SPECIALIZATIONS
2161 //
2162 //=================================================================================================
2163 
2164 //*************************************************************************************************
2166 template< typename MT, typename ST, bool SO >
2167 struct SubmatrixExprTrait< SMatScalarMultExpr<MT,ST,SO> >
2168 {
2169  public:
2170  //**********************************************************************************************
2171  typedef typename MultExprTrait< typename SubmatrixExprTrait<const MT>::Type, ST >::Type Type;
2172  //**********************************************************************************************
2173 };
2175 //*************************************************************************************************
2176 
2177 
2178 
2179 
2180 //=================================================================================================
2181 //
2182 // ROWEXPRTRAIT SPECIALIZATIONS
2183 //
2184 //=================================================================================================
2185 
2186 //*************************************************************************************************
2188 template< typename MT, typename ST, bool SO >
2189 struct RowExprTrait< SMatScalarMultExpr<MT,ST,SO> >
2190 {
2191  public:
2192  //**********************************************************************************************
2193  typedef typename MultExprTrait< typename RowExprTrait<const MT>::Type, ST >::Type Type;
2194  //**********************************************************************************************
2195 };
2197 //*************************************************************************************************
2198 
2199 
2200 
2201 
2202 //=================================================================================================
2203 //
2204 // COLUMNEXPRTRAIT SPECIALIZATIONS
2205 //
2206 //=================================================================================================
2207 
2208 //*************************************************************************************************
2210 template< typename MT, typename ST, bool SO >
2211 struct ColumnExprTrait< SMatScalarMultExpr<MT,ST,SO> >
2212 {
2213  public:
2214  //**********************************************************************************************
2215  typedef typename MultExprTrait< typename ColumnExprTrait<const MT>::Type, ST >::Type Type;
2216  //**********************************************************************************************
2217 };
2219 //*************************************************************************************************
2220 
2221 } // namespace blaze
2222 
2223 #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:3703
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:745
PointerType pointer
Pointer return type.
Definition: SMatScalarMultExpr.h:189
IteratorCategory iterator_category
The iterator category.
Definition: SMatScalarMultExpr.h:187
MT::CompositeType CT
Composite type of the sparse matrix expression.
Definition: SMatScalarMultExpr.h:111
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:196
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:178
DifferenceType operator-(const ConstIterator &rhs) const
Calculating the number of elements between two expression iterators.
Definition: SMatScalarMultExpr.h:282
const This & CompositeType
Data type for composite expression templates.
Definition: CompressedMatrix.h:2375
Header file for the IsRowVector type trait.
Type ElementType
Type of the sparse matrix elements.
Definition: CompressedMatrix.h:248
ptrdiff_t DifferenceType
Difference between two iterators.
Definition: SMatScalarMultExpr.h:184
size_t columns() const
Returns the current number of columns of the matrix.
Definition: SMatScalarMultExpr.h:358
ValueType value_type
Type of the underlying pointers.
Definition: SMatScalarMultExpr.h:188
Header file for the Computation base class.
IteratorType matrix_
Iterator over the elements of the left-hand side sparse matrix expression.
Definition: SMatScalarMultExpr.h:289
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:423
ConstIterator end(size_t i) const
Returns an iterator just past the last non-zero element of row i.
Definition: SMatScalarMultExpr.h:338
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:180
Constraint on the data type.
SelectType< useAssign, const ResultType, const SMatScalarMultExpr & >::Type CompositeType
Data type for composite expression templates.
Definition: SMatScalarMultExpr.h:158
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:411
Constraint on the data type.
Header file for the MultExprTrait class template.
Compile time check to query the requirement to evaluate an expression.Via this type trait it is possi...
Definition: RequiresEvaluation.h:90
const This & CompositeType
Data type for composite expression templates.
Definition: CompressedMatrix.h:250
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:431
Header file for the IsFloatingPoint type trait.
const Element * ConstIterator
Iterator over constant elements.
Definition: CompressedMatrix.h:2379
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:181
#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:155
#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:149
RightOperand scalar_
Right-hand side scalar of the multiplication expression.
Definition: SMatScalarMultExpr.h:290
MultExprTrait< RN, ST >::Type ExprReturnType
Expression return type for the subscript operator.
Definition: SMatScalarMultExpr.h:124
Type ElementType
Type of the sparse matrix elements.
Definition: CompressedMatrix.h:2373
Header file for the SelectType class template.
SMatScalarMultExpr(const MT &matrix, ST scalar)
Constructor for the SMatScalarMultExpr class.
Definition: SMatScalarMultExpr.h:301
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:327
Header file for the EnableIf class template.
SMatScalarMultExpr< MT, ST, SO > This
Type of this SMatScalarMultExpr instance.
Definition: SMatScalarMultExpr.h:148
Header file for the BaseElementType type trait.
LeftOperand matrix_
Left-hand side sparse matrix of the multiplication expression.
Definition: SMatScalarMultExpr.h:430
Header file for the IsNumeric type trait.
size_t rows() const
Returns the current number of rows of the matrix.
Definition: SMatScalarMultExpr.h:348
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:2374
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:368
bool operator!=(const ConstIterator &rhs) const
Inequality comparison between two ConstIterator objects.
Definition: SMatScalarMultExpr.h:271
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:260
#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:399
const Element operator*() const
Direct access to the sparse matrix element at the current iterator position.
Definition: SMatScalarMultExpr.h:219
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:170
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:182
ConstIterator & operator++()
Pre-increment operator.
Definition: SMatScalarMultExpr.h:208
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:314
ResultType::ElementType ElementType
Resulting element type.
Definition: SMatScalarMultExpr.h:152
ReferenceType reference
Reference return type.
Definition: SMatScalarMultExpr.h:190
ValueIndexPair< ElementType > Element
Element type of the sparse matrix expression.
Definition: SMatScalarMultExpr.h:175
ReturnType value() const
Access to the current value of the sparse element.
Definition: SMatScalarMultExpr.h:239
size_t nonZeros(size_t i) const
Returns the number of non-zero elements in the specified row.
Definition: SMatScalarMultExpr.h:379
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:161
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:229
Header file for the IsComputation type trait class.
ST RightOperand
Composite type of the right-hand side scalar value.
Definition: SMatScalarMultExpr.h:164
#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:2370
Header file for basic type definitions.
ConstIterator(IteratorType matrix, RightOperand scalar)
Constructor for the ConstIterator class.
Definition: SMatScalarMultExpr.h:197
size_t index() const
Access to the current index of the sparse element.
Definition: SMatScalarMultExpr.h:249
ResultType::OppositeType OppositeType
Result type with opposite storage order for expression template evaluations.
Definition: SMatScalarMultExpr.h:150
Header file for the IsColumnVector type trait.
DifferenceType difference_type
Difference between two iterators.
Definition: SMatScalarMultExpr.h:191
ValueType & ReferenceType
Reference return type.
Definition: SMatScalarMultExpr.h:183
MT::ReturnType RN
Return type of the sparse matrix expression.
Definition: SMatScalarMultExpr.h:110
MT::ResultType RT
Result type of the sparse matrix expression.
Definition: SMatScalarMultExpr.h:109
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:151
#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:389
#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.