All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
SMatScalarMultExpr.h
Go to the documentation of this file.
1 //=================================================================================================
33 //=================================================================================================
34 
35 #ifndef _BLAZE_MATH_EXPRESSIONS_SMATSCALARMULTEXPR_H_
36 #define _BLAZE_MATH_EXPRESSIONS_SMATSCALARMULTEXPR_H_
37 
38 
39 //*************************************************************************************************
40 // Includes
41 //*************************************************************************************************
42 
43 #include <iterator>
72 #include <blaze/util/Assert.h>
76 #include <blaze/util/EnableIf.h>
77 #include <blaze/util/InvalidType.h>
79 #include <blaze/util/SelectType.h>
80 #include <blaze/util/Types.h>
84 
85 
86 namespace blaze {
87 
88 //=================================================================================================
89 //
90 // CLASS SMATSCALARMULTEXPR
91 //
92 //=================================================================================================
93 
94 //*************************************************************************************************
101 template< typename MT // Type of the left-hand side sparse matrix
102  , typename ST // Type of the right-hand side scalar value
103  , bool SO > // Storage order
104 class SMatScalarMultExpr : public SparseMatrix< SMatScalarMultExpr<MT,ST,SO>, SO >
105  , private MatScalarMultExpr
106  , private Computation
107 {
108  private:
109  //**Type definitions****************************************************************************
110  typedef typename MT::ResultType RT;
111  typedef typename MT::ReturnType RN;
112  typedef typename MT::CompositeType CT;
113  //**********************************************************************************************
114 
115  //**Return type evaluation**********************************************************************
117 
122  enum { returnExpr = !IsTemporary<RN>::value };
123 
126  //**********************************************************************************************
127 
128  //**Serial evaluation strategy******************************************************************
130 
136  enum { useAssign = RequiresEvaluation<MT>::value };
137 
139  template< typename MT2 >
141  struct UseAssign {
142  enum { value = useAssign };
143  };
145  //**********************************************************************************************
146 
147  //**Parallel evaluation strategy****************************************************************
149 
155  template< typename MT2 >
156  struct UseSMPAssign {
157  enum { value = ( !MT2::smpAssignable || !MT::smpAssignable ) && useAssign };
158  };
160  //**********************************************************************************************
161 
162  public:
163  //**Type definitions****************************************************************************
169 
172 
175 
177  typedef typename SelectType< IsExpression<MT>::value, const MT, const MT& >::Type LeftOperand;
178 
180  typedef ST RightOperand;
181  //**********************************************************************************************
182 
183  //**ConstIterator class definition**************************************************************
187  {
188  public:
189  //**Type definitions*************************************************************************
192 
195 
196  typedef std::forward_iterator_tag IteratorCategory;
197  typedef Element ValueType;
201 
202  // STL iterator requirements
208  //*******************************************************************************************
209 
210  //**Constructor******************************************************************************
213  inline ConstIterator( IteratorType matrix, RightOperand scalar )
214  : matrix_( matrix ) // Iterator over the elements of the left-hand side sparse matrix expression
215  , scalar_( scalar ) // Right-hand side scalar of the multiplication expression
216  {}
217  //*******************************************************************************************
218 
219  //**Prefix increment operator****************************************************************
225  ++matrix_;
226  return *this;
227  }
228  //*******************************************************************************************
229 
230  //**Element access operator******************************************************************
235  inline const Element operator*() const {
236  return Element( matrix_->value() * scalar_, matrix_->index() );
237  }
238  //*******************************************************************************************
239 
240  //**Element access operator******************************************************************
245  inline const ConstIterator* operator->() const {
246  return this;
247  }
248  //*******************************************************************************************
249 
250  //**Value function***************************************************************************
255  inline ReturnType value() const {
256  return matrix_->value() * scalar_;
257  }
258  //*******************************************************************************************
259 
260  //**Index function***************************************************************************
265  inline size_t index() const {
266  return matrix_->index();
267  }
268  //*******************************************************************************************
269 
270  //**Equality operator************************************************************************
276  inline bool operator==( const ConstIterator& rhs ) const {
277  return matrix_ == rhs.matrix_;
278  }
279  //*******************************************************************************************
280 
281  //**Inequality operator**********************************************************************
287  inline bool operator!=( const ConstIterator& rhs ) const {
288  return matrix_ != rhs.matrix_;
289  }
290  //*******************************************************************************************
291 
292  //**Subtraction operator*********************************************************************
298  inline DifferenceType operator-( const ConstIterator& rhs ) const {
299  return matrix_ - rhs.matrix_;
300  }
301  //*******************************************************************************************
302 
303  private:
304  //**Member variables*************************************************************************
307  //*******************************************************************************************
308  };
309  //**********************************************************************************************
310 
311  //**Compilation flags***************************************************************************
313  enum { smpAssignable = 0 };
314  //**********************************************************************************************
315 
316  //**Constructor*********************************************************************************
322  explicit inline SMatScalarMultExpr( const MT& matrix, ST scalar )
323  : matrix_( matrix ) // Left-hand side sparse matrix of the multiplication expression
324  , scalar_( scalar ) // Right-hand side scalar of the multiplication expression
325  {}
326  //**********************************************************************************************
327 
328  //**Access operator*****************************************************************************
335  inline ReturnType operator()( size_t i, size_t j ) const {
336  BLAZE_INTERNAL_ASSERT( i < matrix_.rows() , "Invalid row access index" );
337  BLAZE_INTERNAL_ASSERT( j < matrix_.columns(), "Invalid column access index" );
338  return matrix_(i,j) * scalar_;
339  }
340  //**********************************************************************************************
341 
342  //**Begin function******************************************************************************
348  inline ConstIterator begin( size_t i ) const {
349  return ConstIterator( matrix_.begin(i), scalar_ );
350  }
351  //**********************************************************************************************
352 
353  //**End function********************************************************************************
359  inline ConstIterator end( size_t i ) const {
360  return ConstIterator( matrix_.end(i), scalar_ );
361  }
362  //**********************************************************************************************
363 
364  //**Rows function*******************************************************************************
369  inline size_t rows() const {
370  return matrix_.rows();
371  }
372  //**********************************************************************************************
373 
374  //**Columns function****************************************************************************
379  inline size_t columns() const {
380  return matrix_.columns();
381  }
382  //**********************************************************************************************
383 
384  //**NonZeros function***************************************************************************
389  inline size_t nonZeros() const {
390  return matrix_.nonZeros();
391  }
392  //**********************************************************************************************
393 
394  //**NonZeros function***************************************************************************
400  inline size_t nonZeros( size_t i ) const {
401  return matrix_.nonZeros(i);
402  }
403  //**********************************************************************************************
404 
405  //**Left operand access*************************************************************************
410  inline LeftOperand leftOperand() const {
411  return matrix_;
412  }
413  //**********************************************************************************************
414 
415  //**Right operand access************************************************************************
420  inline RightOperand rightOperand() const {
421  return scalar_;
422  }
423  //**********************************************************************************************
424 
425  //**********************************************************************************************
431  template< typename T >
432  inline bool canAlias( const T* alias ) const {
433  return matrix_.canAlias( alias );
434  }
435  //**********************************************************************************************
436 
437  //**********************************************************************************************
443  template< typename T >
444  inline bool isAliased( const T* alias ) const {
445  return matrix_.isAliased( alias );
446  }
447  //**********************************************************************************************
448 
449  private:
450  //**Member variables****************************************************************************
453  //**********************************************************************************************
454 
455  //**Assignment to dense matrices****************************************************************
469  template< typename MT2 // Type of the target dense matrix
470  , bool SO2 > // Storage order of the target dense matrix
471  friend inline typename EnableIf< UseAssign<MT2> >::Type
473  {
475 
476  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
477  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
478 
479  assign( ~lhs, rhs.matrix_ );
480  (~lhs) *= rhs.scalar_;
481  }
483  //**********************************************************************************************
484 
485  //**Assignment to sparse matrices***************************************************************
499  template< typename MT2 // Type of the target sparse matrix
500  , bool SO2 > // Storage order of the target sparse matrix
501  friend inline typename EnableIf< UseAssign<MT2> >::Type
503  {
505 
506  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
507  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
508 
509  assign( ~lhs, rhs.matrix_ );
510  (~lhs) *= rhs.scalar_;
511  }
513  //**********************************************************************************************
514 
515  //**Addition assignment to dense matrices*******************************************************
529  template< typename MT2 // Type of the target dense matrix
530  , bool SO2 > // Storage order of the target dense matrix
531  friend inline typename EnableIf< UseAssign<MT2> >::Type
532  addAssign( DenseMatrix<MT2,SO2>& lhs, const SMatScalarMultExpr& rhs )
533  {
535 
538 
539  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
540  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
541 
542  const ResultType tmp( serial( rhs ) );
543  addAssign( ~lhs, tmp );
544  }
546  //**********************************************************************************************
547 
548  //**Addition assignment to sparse matrices******************************************************
549  // No special implementation for the addition assignment to sparse matrices.
550  //**********************************************************************************************
551 
552  //**Subtraction assignment to dense matrices****************************************************
566  template< typename MT2 // Type of the target dense matrix
567  , bool SO2 > // Storage order of the target dense matrix
568  friend inline typename EnableIf< UseAssign<MT2> >::Type
569  subAssign( DenseMatrix<MT2,SO2>& lhs, const SMatScalarMultExpr& rhs )
570  {
572 
575 
576  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
577  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
578 
579  const ResultType tmp( serial( rhs ) );
580  subAssign( ~lhs, tmp );
581  }
583  //**********************************************************************************************
584 
585  //**Subtraction assignment to sparse matrices***************************************************
586  // No special implementation for the subtraction assignment to sparse matrices.
587  //**********************************************************************************************
588 
589  //**Multiplication assignment to dense matrices*************************************************
590  // No special implementation for the multiplication assignment to dense matrices.
591  //**********************************************************************************************
592 
593  //**Multiplication assignment to sparse matrices************************************************
594  // No special implementation for the multiplication assignment to sparse matrices.
595  //**********************************************************************************************
596 
597  //**SMP assignment to dense matrices************************************************************
598  // No special implementation for the SMP assignment to dense matrices.
599  //**********************************************************************************************
600 
601  //**SMP assignment to sparse matrices***********************************************************
602  // No special implementation for the SMP assignment to sparse matrices.
603  //**********************************************************************************************
604 
605  //**SMP addition assignment to dense matrices***************************************************
619  template< typename MT2 // Type of the target dense matrix
620  , bool SO2 > // Storage order of the target dense matrix
621  friend inline typename EnableIf< UseSMPAssign<MT2> >::Type
622  smpAddAssign( DenseMatrix<MT2,SO2>& lhs, const SMatScalarMultExpr& rhs )
623  {
625 
628 
629  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
630  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
631 
632  const ResultType tmp( rhs );
633  smpAddAssign( ~lhs, tmp );
634  }
636  //**********************************************************************************************
637 
638  //**SMP addition assignment to sparse matrices**************************************************
639  // No special implementation for the SMP addition assignment to sparse matrices.
640  //**********************************************************************************************
641 
642  //**SMP subtraction assignment to dense matrices************************************************
656  template< typename MT2 // Type of the target dense matrix
657  , bool SO2 > // Storage order of the target dense matrix
658  friend inline typename EnableIf< UseSMPAssign<MT2> >::Type
659  smpSubAssign( DenseMatrix<MT2,SO2>& lhs, const SMatScalarMultExpr& rhs )
660  {
662 
665 
666  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
667  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
668 
669  const ResultType tmp( rhs );
670  smpSubAssign( ~lhs, tmp );
671  }
673  //**********************************************************************************************
674 
675  //**SMP subtraction assignment to sparse matrices***********************************************
676  // No special implementation for the SMP subtraction assignment to sparse matrices.
677  //**********************************************************************************************
678 
679  //**SMP multiplication assignment to dense matrices*********************************************
680  // No special implementation for the SMP multiplication assignment to dense matrices.
681  //**********************************************************************************************
682 
683  //**SMP multiplication assignment to sparse matrices********************************************
684  // No special implementation for the SMP multiplication assignment to sparse matrices.
685  //**********************************************************************************************
686 
687  //**Compile time checks*************************************************************************
694  //**********************************************************************************************
695 };
696 //*************************************************************************************************
697 
698 
699 
700 
701 //=================================================================================================
702 //
703 // GLOBAL UNARY ARITHMETIC OPERATORS
704 //
705 //=================================================================================================
706 
707 //*************************************************************************************************
724 template< typename MT // Data type of the sparse matrix
725  , bool SO > // Storage order
726 inline const SMatScalarMultExpr<MT,typename BaseElementType<MT>::Type,SO>
728 {
730 
731  typedef typename BaseElementType<MT>::Type ElementType;
733 }
734 //*************************************************************************************************
735 
736 
737 
738 
739 //=================================================================================================
740 //
741 // GLOBAL BINARY ARITHMETIC OPERATORS
742 //
743 //=================================================================================================
744 
745 //*************************************************************************************************
766 template< typename T1 // Type of the left-hand side sparse matrix
767  , bool SO // Storage order of the left-hand side sparse matrix
768  , typename T2 > // Type of the right-hand side scalar
769 inline const typename EnableIf< IsNumeric<T2>, typename MultExprTrait<T1,T2>::Type >::Type
770  operator*( const SparseMatrix<T1,SO>& mat, T2 scalar )
771 {
773 
774  typedef typename MultExprTrait<T1,T2>::Type Type;
775  return Type( ~mat, scalar );
776 }
777 //*************************************************************************************************
778 
779 
780 //*************************************************************************************************
801 template< typename T1 // Type of the left-hand side scalar
802  , typename T2 // Type of the right-hand side sparse matrix
803  , bool SO > // Storage order of the right-hand side sparse matrix
804 inline const typename EnableIf< IsNumeric<T1>, typename MultExprTrait<T1,T2>::Type >::Type
805  operator*( T1 scalar, const SparseMatrix<T2,SO>& mat )
806 {
808 
809  typedef typename MultExprTrait<T1,T2>::Type Type;
810  return Type( ~mat, scalar );
811 }
812 //*************************************************************************************************
813 
814 
815 
816 
817 //=================================================================================================
818 //
819 // GLOBAL RESTRUCTURING UNARY ARITHMETIC OPERATORS
820 //
821 //=================================================================================================
822 
823 //*************************************************************************************************
835 template< typename VT // Type of the sparse matrix
836  , typename ST // Type of the scalar
837  , bool TF > // Transpose flag
838 inline const SMatScalarMultExpr<VT,ST,TF>
839  operator-( const SMatScalarMultExpr<VT,ST,TF>& sm )
840 {
842 
843  return SMatScalarMultExpr<VT,ST,TF>( sm.leftOperand(), -sm.rightOperand() );
844 }
846 //*************************************************************************************************
847 
848 
849 
850 
851 //=================================================================================================
852 //
853 // GLOBAL RESTRUCTURING BINARY ARITHMETIC OPERATORS
854 //
855 //=================================================================================================
856 
857 //*************************************************************************************************
870 template< typename MT // Type of the sparse matrix
871  , typename ST1 // Type of the first scalar
872  , bool SO // Storage order of the sparse matrix
873  , typename ST2 > // Type of the second scalar
874 inline const typename EnableIf< IsNumeric<ST2>
875  , typename MultExprTrait< SMatScalarMultExpr<MT,ST1,SO>, ST2 >::Type >::Type
876  operator*( const SMatScalarMultExpr<MT,ST1,SO>& mat, ST2 scalar )
877 {
879 
880  return mat.leftOperand() * ( mat.rightOperand() * scalar );
881 }
883 //*************************************************************************************************
884 
885 
886 //*************************************************************************************************
899 template< typename ST1 // Type of the first scalar
900  , typename MT // Type of the sparse matrix
901  , typename ST2 // Type of the second scalar
902  , bool SO > // Storage order of the sparse matrix
903 inline const typename EnableIf< IsNumeric<ST1>
904  , typename MultExprTrait< ST1, SMatScalarMultExpr<MT,ST2,SO> >::Type >::Type
905  operator*( ST1 scalar, const SMatScalarMultExpr<MT,ST2,SO>& mat )
906 {
908 
909  return mat.leftOperand() * ( scalar * mat.rightOperand() );
910 }
912 //*************************************************************************************************
913 
914 
915 //*************************************************************************************************
928 template< typename MT // Type of the sparse matrix
929  , typename ST1 // Type of the first scalar
930  , bool SO // Storage order of the sparse matrix
931  , typename ST2 > // Type of the second scalar
932 inline const typename EnableIf< IsFloatingPoint<typename DivTrait<ST1,ST2>::Type>
933  , typename DivExprTrait< SMatScalarMultExpr<MT,ST1,SO>, ST2 >::Type >::Type
934  operator/( const SMatScalarMultExpr<MT,ST1,SO>& mat, ST2 scalar )
935 {
937 
938  return mat.leftOperand() * ( mat.rightOperand() / scalar );
939 }
941 //*************************************************************************************************
942 
943 
944 //*************************************************************************************************
958 template< typename MT // Type of the sparse matrix of the left-hand side expression
959  , typename ST // Type of the scalar of the left-hand side expression
960  , bool SO // Storage order of the left-hand side expression
961  , typename VT > // Type of the right-hand side dense vector
962 inline const typename MultExprTrait< SMatScalarMultExpr<MT,ST,SO>, VT >::Type
963  operator*( const SMatScalarMultExpr<MT,ST,SO>& mat, const DenseVector<VT,false>& vec )
964 {
966 
967  return ( mat.leftOperand() * (~vec) ) * mat.rightOperand();
968 }
970 //*************************************************************************************************
971 
972 
973 //*************************************************************************************************
987 template< typename VT // Type of the left-hand side dense vector
988  , typename MT // Type of the sparse matrix of the right-hand side expression
989  , typename ST // Type of the scalar of the right-hand side expression
990  , bool SO > // Storage order of the right-hand side expression
991 inline const typename MultExprTrait< VT, SMatScalarMultExpr<MT,ST,SO> >::Type
992  operator*( const DenseVector<VT,true>& vec, const SMatScalarMultExpr<MT,ST,SO>& mat )
993 {
995 
996  return ( (~vec) * mat.leftOperand() ) * mat.rightOperand();
997 }
999 //*************************************************************************************************
1000 
1001 
1002 //*************************************************************************************************
1018 template< typename MT // Type of the sparse matrix of the left-hand side expression
1019  , typename ST1 // Type of the scalar of the left-hand side expression
1020  , bool SO // Storage order of the left-hand side expression
1021  , typename VT // Type of the dense vector of the right-hand side expression
1022  , typename ST2 > // Type of the scalar of the right-hand side expression
1023 inline const typename MultExprTrait< SMatScalarMultExpr<MT,ST1,SO>, DVecScalarMultExpr<VT,ST2,false> >::Type
1024  operator*( const SMatScalarMultExpr<MT,ST1,SO>& mat, const DVecScalarMultExpr<VT,ST2,false>& vec )
1025 {
1027 
1028  return ( mat.leftOperand() * vec.leftOperand() ) * ( mat.rightOperand() * vec.rightOperand() );
1029 }
1031 //*************************************************************************************************
1032 
1033 
1034 //*************************************************************************************************
1050 template< typename VT // Type of the dense vector of the left-hand side expression
1051  , typename ST1 // Type of the scalar of the left-hand side expression
1052  , typename MT // Type of the sparse matrix of the right-hand side expression
1053  , typename ST2 // Type of the scalar of the right-hand side expression
1054  , bool SO > // Storage order of the right-hand side expression
1055 inline const typename MultExprTrait< DVecScalarMultExpr<VT,ST1,true>, SMatScalarMultExpr<MT,ST2,SO> >::Type
1056  operator*( const DVecScalarMultExpr<VT,ST1,true>& vec, const SMatScalarMultExpr<MT,ST2,SO>& mat )
1057 {
1059 
1060  return ( vec.leftOperand() * mat.leftOperand() ) * ( vec.rightOperand() * mat.rightOperand() );
1061 }
1063 //*************************************************************************************************
1064 
1065 
1066 //*************************************************************************************************
1080 template< typename MT // Type of the sparse matrix of the left-hand side expression
1081  , typename ST // Type of the scalar of the left-hand side expression
1082  , bool SO // Storage order of the left-hand side expression
1083  , typename VT > // Type of the right-hand side sparse vector
1084 inline const typename MultExprTrait< SMatScalarMultExpr<MT,ST,SO>, VT >::Type
1085  operator*( const SMatScalarMultExpr<MT,ST,SO>& mat, const SparseVector<VT,false>& vec )
1086 {
1088 
1089  return ( mat.leftOperand() * (~vec) ) * mat.rightOperand();
1090 }
1092 //*************************************************************************************************
1093 
1094 
1095 //*************************************************************************************************
1109 template< typename VT // Type of the left-hand side sparse vector
1110  , typename MT // Type of the sparse matrix of the right-hand side expression
1111  , typename ST // Type of the scalar of the right-hand side expression
1112  , bool SO > // Storage order of the right-hand side expression
1113 inline const typename MultExprTrait< VT, SMatScalarMultExpr<MT,ST,SO> >::Type
1114  operator*( const SparseVector<VT,true>& vec, const SMatScalarMultExpr<MT,ST,SO>& mat )
1115 {
1117 
1118  return ( (~vec) * mat.leftOperand() ) * mat.rightOperand();
1119 }
1121 //*************************************************************************************************
1122 
1123 
1124 //*************************************************************************************************
1140 template< typename MT // Type of the sparse matrix of the left-hand side expression
1141  , typename ST1 // Type of the scalar of the left-hand side expression
1142  , bool SO // Storage order of the left-hand side expression
1143  , typename VT // Type of the sparse vector of the right-hand side expression
1144  , typename ST2 > // Type of the scalar of the right-hand side expression
1145 inline const typename MultExprTrait< SMatScalarMultExpr<MT,ST1,SO>, SVecScalarMultExpr<VT,ST2,false> >::Type
1146  operator*( const SMatScalarMultExpr<MT,ST1,SO>& mat, const SVecScalarMultExpr<VT,ST2,false>& vec )
1147 {
1149 
1150  return ( mat.leftOperand() * vec.leftOperand() ) * ( mat.rightOperand() * vec.rightOperand() );
1151 }
1153 //*************************************************************************************************
1154 
1155 
1156 //*************************************************************************************************
1172 template< typename VT // Type of the sparse vector of the left-hand side expression
1173  , typename ST1 // Type of the scalar of the left-hand side expression
1174  , typename MT // Type of the sparse matrix of the right-hand side expression
1175  , typename ST2 // Type of the scalar of the right-hand side expression
1176  , bool SO > // Storage order of the right-hand side expression
1177 inline const typename MultExprTrait< SVecScalarMultExpr<VT,ST1,true>, SMatScalarMultExpr<MT,ST2,SO> >::Type
1178  operator*( const SVecScalarMultExpr<VT,ST1,true>& vec, const SMatScalarMultExpr<MT,ST2,SO>& mat )
1179 {
1181 
1182  return ( vec.leftOperand() * mat.leftOperand() ) * ( vec.rightOperand() * mat.rightOperand() );
1183 }
1185 //*************************************************************************************************
1186 
1187 
1188 //*************************************************************************************************
1202 template< typename MT1 // Type of the sparse matrix of the left-hand side expression
1203  , typename ST // Type of the scalar of the left-hand side expression
1204  , bool SO1 // Storage order of the left-hand side expression
1205  , typename MT2 // Type of the right-hand side dense matrix
1206  , bool SO2 > // Storage order of the right-hand side dense matrix
1207 inline const typename MultExprTrait< SMatScalarMultExpr<MT1,ST,SO1>, MT2 >::Type
1208  operator*( const SMatScalarMultExpr<MT1,ST,SO1>& lhs, const DenseMatrix<MT2,SO2>& rhs )
1209 {
1211 
1212  return ( lhs.leftOperand() * (~rhs) ) * lhs.rightOperand();
1213 }
1215 //*************************************************************************************************
1216 
1217 
1218 //*************************************************************************************************
1232 template< typename MT1 // Type of the left-hand side dense matrix
1233  , bool SO1 // Storage order of the left-hand side dense matrix
1234  , typename MT2 // Type of the sparse matrix of the right-hand side expression
1235  , typename ST // Type of the scalar of the right-hand side expression
1236  , bool SO2 > // Storage order of the right-hand side expression
1237 inline const typename MultExprTrait< MT1, SMatScalarMultExpr<MT2,ST,SO2> >::Type
1238  operator*( const DenseMatrix<MT1,SO1>& lhs, const SMatScalarMultExpr<MT2,ST,SO2>& rhs )
1239 {
1241 
1242  return ( (~lhs) * rhs.leftOperand() ) * rhs.rightOperand();
1243 }
1245 //*************************************************************************************************
1246 
1247 
1248 //*************************************************************************************************
1262 template< typename MT1 // Type of the sparse matrix of the left-hand side expression
1263  , typename ST // Type of the scalar of the left-hand side expression
1264  , bool SO1 // Storage order of the left-hand side expression
1265  , typename MT2 // Type of the right-hand side sparse matrix
1266  , bool SO2 > // Storage order of the right-hand side sparse matrix
1267 inline const typename MultExprTrait< SMatScalarMultExpr<MT1,ST,SO1>, MT2 >::Type
1268  operator*( const SMatScalarMultExpr<MT1,ST,SO1>& lhs, const SparseMatrix<MT2,SO2>& rhs )
1269 {
1271 
1272  return ( lhs.leftOperand() * (~rhs) ) * lhs.rightOperand();
1273 }
1275 //*************************************************************************************************
1276 
1277 
1278 //*************************************************************************************************
1292 template< typename MT1 // Type of the left-hand side sparse matrix
1293  , bool SO1 // Storage order of the left-hand side sparse matrix
1294  , typename MT2 // Type of the sparse matrix of the right-hand side expression
1295  , typename ST // Type of the scalar of the right-hand side expression
1296  , bool SO2 > // Storage order of the right-hand side expression
1297 inline const typename MultExprTrait< MT1, SMatScalarMultExpr<MT2,ST,SO2> >::Type
1298  operator*( const SparseMatrix<MT1,SO1>& lhs, const SMatScalarMultExpr<MT2,ST,SO2>& rhs )
1299 {
1301 
1302  return ( (~lhs) * rhs.leftOperand() ) * rhs.rightOperand();
1303 }
1305 //*************************************************************************************************
1306 
1307 
1308 //*************************************************************************************************
1322 template< typename MT1 // Type of the sparse matrix of the left-hand side expression
1323  , typename ST1 // Type of the scalar of the left-hand side expression
1324  , bool SO1 // Storage order of the left-hand side expression
1325  , typename MT2 // Type of the right-hand side sparse matrix
1326  , typename ST2 // Type of the scalar of the right-hand side expression
1327  , bool SO2 > // Storage order of the right-hand side expression
1328 inline const typename MultExprTrait< SMatScalarMultExpr<MT1,ST1,SO1>, SMatScalarMultExpr<MT2,ST2,SO2> >::Type
1329  operator*( const SMatScalarMultExpr<MT1,ST1,SO1>& lhs, const SMatScalarMultExpr<MT2,ST2,SO2>& rhs )
1330 {
1332 
1333  return ( lhs.leftOperand() * rhs.leftOperand() ) * ( lhs.rightOperand() * rhs.rightOperand() );
1334 }
1336 //*************************************************************************************************
1337 
1338 
1339 
1340 
1341 //=================================================================================================
1342 //
1343 // SMATSCALARMULTEXPRTRAIT SPECIALIZATIONS
1344 //
1345 //=================================================================================================
1346 
1347 //*************************************************************************************************
1349 template< typename MT, typename ST1, typename ST2 >
1350 struct SMatScalarMultExprTrait< SMatScalarMultExpr<MT,ST1,false>, ST2 >
1351 {
1352  public:
1353  //**********************************************************************************************
1354  typedef typename SelectType< IsSparseMatrix<MT>::value && IsRowMajorMatrix<MT>::value &&
1355  IsNumeric<ST1>::value && IsNumeric<ST2>::value
1356  , typename SMatScalarMultExprTrait<MT,typename MultTrait<ST1,ST2>::Type>::Type
1357  , INVALID_TYPE >::Type Type;
1358  //**********************************************************************************************
1359 };
1361 //*************************************************************************************************
1362 
1363 
1364 
1365 
1366 //=================================================================================================
1367 //
1368 // TSMATSCALARMULTEXPRTRAIT SPECIALIZATIONS
1369 //
1370 //=================================================================================================
1371 
1372 //*************************************************************************************************
1374 template< typename MT, typename ST1, typename ST2 >
1375 struct TSMatScalarMultExprTrait< SMatScalarMultExpr<MT,ST1,true>, ST2 >
1376 {
1377  public:
1378  //**********************************************************************************************
1379  typedef typename SelectType< IsSparseMatrix<MT>::value && IsColumnMajorMatrix<MT>::value &&
1380  IsNumeric<ST1>::value && IsNumeric<ST2>::value
1381  , typename TSMatScalarMultExprTrait<MT,typename MultTrait<ST1,ST2>::Type>::Type
1382  , INVALID_TYPE >::Type Type;
1383  //**********************************************************************************************
1384 };
1386 //*************************************************************************************************
1387 
1388 
1389 
1390 
1391 //=================================================================================================
1392 //
1393 // SMATSCALARDIVEXPRTRAIT SPECIALIZATIONS
1394 //
1395 //=================================================================================================
1396 
1397 //*************************************************************************************************
1399 template< typename MT, typename ST1, typename ST2 >
1400 struct SMatScalarDivExprTrait< SMatScalarMultExpr<MT,ST1,false>, ST2 >
1401 {
1402  private:
1403  //**********************************************************************************************
1404  enum { condition = IsFloatingPoint<typename DivTrait<ST1,ST2>::Type>::value };
1405  //**********************************************************************************************
1406 
1407  //**********************************************************************************************
1408  typedef typename SMatScalarMultExprTrait<MT,typename DivTrait<ST1,ST2>::Type>::Type T1;
1409  typedef typename SMatScalarDivExprTrait<MT,typename DivTrait<ST1,ST2>::Type>::Type T2;
1410  //**********************************************************************************************
1411 
1412  public:
1413  //**********************************************************************************************
1414  typedef typename SelectType< IsSparseMatrix<MT>::value && IsRowMajorMatrix<MT>::value &&
1415  IsNumeric<ST1>::value && IsNumeric<ST2>::value
1416  , typename SelectType<condition,T1,T2>::Type
1417  , INVALID_TYPE >::Type Type;
1418  //**********************************************************************************************
1419 };
1421 //*************************************************************************************************
1422 
1423 
1424 
1425 
1426 //=================================================================================================
1427 //
1428 // TSMATSCALARDIVEXPRTRAIT SPECIALIZATIONS
1429 //
1430 //=================================================================================================
1431 
1432 //*************************************************************************************************
1434 template< typename MT, typename ST1, typename ST2 >
1435 struct TSMatScalarDivExprTrait< SMatScalarMultExpr<MT,ST1,true>, ST2 >
1436 {
1437  private:
1438  //**********************************************************************************************
1439  enum { condition = IsFloatingPoint<typename DivTrait<ST1,ST2>::Type>::value };
1440  //**********************************************************************************************
1441 
1442  //**********************************************************************************************
1443  typedef typename TSMatScalarMultExprTrait<MT,typename DivTrait<ST1,ST2>::Type>::Type T1;
1444  typedef typename TSMatScalarDivExprTrait<MT,typename DivTrait<ST1,ST2>::Type>::Type T2;
1445  //**********************************************************************************************
1446 
1447  public:
1448  //**********************************************************************************************
1449  typedef typename SelectType< IsSparseMatrix<MT>::value && IsColumnMajorMatrix<MT>::value &&
1450  IsNumeric<ST1>::value && IsNumeric<ST2>::value
1451  , typename SelectType<condition,T1,T2>::Type
1452  , INVALID_TYPE >::Type Type;
1453  //**********************************************************************************************
1454 };
1456 //*************************************************************************************************
1457 
1458 
1459 
1460 
1461 //=================================================================================================
1462 //
1463 // SMATDVECMULTEXPRTRAIT SPECIALIZATIONS
1464 //
1465 //=================================================================================================
1466 
1467 //*************************************************************************************************
1469 template< typename MT, typename ST, typename VT >
1470 struct SMatDVecMultExprTrait< SMatScalarMultExpr<MT,ST,false>, VT >
1471 {
1472  public:
1473  //**********************************************************************************************
1474  typedef typename SelectType< IsSparseMatrix<MT>::value && IsRowMajorMatrix<MT>::value &&
1475  IsDenseVector<VT>::value && IsColumnVector<VT>::value &&
1476  IsNumeric<ST>::value
1477  , typename DVecScalarMultExprTrait<typename SMatDVecMultExprTrait<MT,VT>::Type,ST>::Type
1478  , INVALID_TYPE >::Type Type;
1479  //**********************************************************************************************
1480 };
1482 //*************************************************************************************************
1483 
1484 
1485 //*************************************************************************************************
1487 template< typename MT, typename ST1, typename VT, typename ST2 >
1488 struct SMatDVecMultExprTrait< SMatScalarMultExpr<MT,ST1,false>, DVecScalarMultExpr<VT,ST2,false> >
1489 {
1490  public:
1491  //**********************************************************************************************
1492  typedef typename SelectType< IsSparseMatrix<MT>::value && IsRowMajorMatrix<MT>::value &&
1493  IsDenseVector<VT>::value && IsColumnVector<VT>::value &&
1494  IsNumeric<ST1>::value && IsNumeric<ST2>::value
1495  , typename DVecScalarMultExprTrait<typename SMatDVecMultExprTrait<MT,VT>::Type,typename MultTrait<ST1,ST2>::Type>::Type
1496  , INVALID_TYPE >::Type Type;
1497  //**********************************************************************************************
1498 };
1500 //*************************************************************************************************
1501 
1502 
1503 
1504 
1505 //=================================================================================================
1506 //
1507 // TSMATDVECMULTEXPRTRAIT SPECIALIZATIONS
1508 //
1509 //=================================================================================================
1510 
1511 //*************************************************************************************************
1513 template< typename MT, typename ST, typename VT >
1514 struct TSMatDVecMultExprTrait< SMatScalarMultExpr<MT,ST,true>, VT >
1515 {
1516  public:
1517  //**********************************************************************************************
1518  typedef typename SelectType< IsSparseMatrix<MT>::value && IsColumnMajorMatrix<MT>::value &&
1519  IsDenseVector<VT>::value && IsColumnVector<VT>::value &&
1520  IsNumeric<ST>::value
1521  , typename DVecScalarMultExprTrait<typename TSMatDVecMultExprTrait<MT,VT>::Type,ST>::Type
1522  , INVALID_TYPE >::Type Type;
1523  //**********************************************************************************************
1524 };
1526 //*************************************************************************************************
1527 
1528 
1529 //*************************************************************************************************
1531 template< typename MT, typename ST1, typename VT, typename ST2 >
1532 struct TSMatDVecMultExprTrait< SMatScalarMultExpr<MT,ST1,true>, DVecScalarMultExpr<VT,ST2,false> >
1533 {
1534  public:
1535  //**********************************************************************************************
1536  typedef typename SelectType< IsSparseMatrix<MT>::value && IsColumnMajorMatrix<MT>::value &&
1537  IsDenseVector<VT>::value && IsColumnVector<VT>::value &&
1538  IsNumeric<ST1>::value && IsNumeric<ST2>::value
1539  , typename DVecScalarMultExprTrait<typename TSMatDVecMultExprTrait<MT,VT>::Type,typename MultTrait<ST1,ST2>::Type>::Type
1540  , INVALID_TYPE >::Type Type;
1541  //**********************************************************************************************
1542 };
1544 //*************************************************************************************************
1545 
1546 
1547 
1548 
1549 //=================================================================================================
1550 //
1551 // TDVECSMATMULTEXPRTRAIT SPECIALIZATIONS
1552 //
1553 //=================================================================================================
1554 
1555 //*************************************************************************************************
1557 template< typename VT, typename MT, typename ST >
1558 struct TDVecSMatMultExprTrait< VT, SMatScalarMultExpr<MT,ST,false> >
1559 {
1560  public:
1561  //**********************************************************************************************
1562  typedef typename SelectType< IsDenseVector<VT>::value && IsRowVector<VT>::value &&
1563  IsSparseMatrix<MT>::value && IsRowMajorMatrix<MT>::value &&
1564  IsNumeric<ST>::value
1565  , typename TDVecScalarMultExprTrait<typename TDVecSMatMultExprTrait<VT,MT>::Type,ST>::Type
1566  , INVALID_TYPE >::Type Type;
1567  //**********************************************************************************************
1568 };
1570 //*************************************************************************************************
1571 
1572 
1573 //*************************************************************************************************
1575 template< typename VT, typename ST1, typename MT, typename ST2 >
1576 struct TDVecSMatMultExprTrait< DVecScalarMultExpr<VT,ST1,true>, SMatScalarMultExpr<MT,ST2,false> >
1577 {
1578  public:
1579  //**********************************************************************************************
1580  typedef typename SelectType< IsDenseVector<VT>::value && IsRowVector<VT>::value &&
1581  IsSparseMatrix<MT>::value && IsRowMajorMatrix<MT>::value &&
1582  IsNumeric<ST1>::value && IsNumeric<ST2>::value
1583  , typename TDVecScalarMultExprTrait<typename TDVecSMatMultExprTrait<VT,MT>::Type,typename MultTrait<ST1,ST2>::Type>::Type
1584  , INVALID_TYPE >::Type Type;
1585  //**********************************************************************************************
1586 };
1588 //*************************************************************************************************
1589 
1590 
1591 
1592 
1593 //=================================================================================================
1594 //
1595 // TDVECTSMATMULTEXPRTRAIT SPECIALIZATIONS
1596 //
1597 //=================================================================================================
1598 
1599 //*************************************************************************************************
1601 template< typename VT, typename MT, typename ST >
1602 struct TDVecTSMatMultExprTrait< VT, SMatScalarMultExpr<MT,ST,true> >
1603 {
1604  public:
1605  //**********************************************************************************************
1606  typedef typename SelectType< IsDenseVector<VT>::value && IsRowVector<VT>::value &&
1607  IsSparseMatrix<MT>::value && IsColumnMajorMatrix<MT>::value &&
1608  IsNumeric<ST>::value
1609  , typename TDVecScalarMultExprTrait<typename TDVecTSMatMultExprTrait<VT,MT>::Type,ST>::Type
1610  , INVALID_TYPE >::Type Type;
1611  //**********************************************************************************************
1612 };
1614 //*************************************************************************************************
1615 
1616 
1617 //*************************************************************************************************
1619 template< typename VT, typename ST1, typename MT, typename ST2 >
1620 struct TDVecTSMatMultExprTrait< DVecScalarMultExpr<VT,ST1,true>, SMatScalarMultExpr<MT,ST2,true> >
1621 {
1622  public:
1623  //**********************************************************************************************
1624  typedef typename SelectType< IsDenseVector<VT>::value && IsRowVector<VT>::value &&
1625  IsSparseMatrix<MT>::value && IsColumnMajorMatrix<MT>::value &&
1626  IsNumeric<ST1>::value && IsNumeric<ST2>::value
1627  , typename TDVecScalarMultExprTrait<typename TDVecTSMatMultExprTrait<VT,MT>::Type,typename MultTrait<ST1,ST2>::Type>::Type
1628  , INVALID_TYPE >::Type Type;
1629  //**********************************************************************************************
1630 };
1632 //*************************************************************************************************
1633 
1634 
1635 
1636 
1637 //=================================================================================================
1638 //
1639 // SMATSVECMULTEXPRTRAIT SPECIALIZATIONS
1640 //
1641 //=================================================================================================
1642 
1643 //*************************************************************************************************
1645 template< typename MT, typename ST, typename VT >
1646 struct SMatSVecMultExprTrait< SMatScalarMultExpr<MT,ST,false>, VT >
1647 {
1648  public:
1649  //**********************************************************************************************
1650  typedef typename SelectType< IsSparseMatrix<MT>::value && IsRowMajorMatrix<MT>::value &&
1651  IsSparseVector<VT>::value && IsColumnVector<VT>::value &&
1652  IsNumeric<ST>::value
1653  , typename SVecScalarMultExprTrait<typename SMatSVecMultExprTrait<MT,VT>::Type,ST>::Type
1654  , INVALID_TYPE >::Type Type;
1655  //**********************************************************************************************
1656 };
1658 //*************************************************************************************************
1659 
1660 
1661 //*************************************************************************************************
1663 template< typename MT, typename ST1, typename VT, typename ST2 >
1664 struct SMatSVecMultExprTrait< SMatScalarMultExpr<MT,ST1,false>, SVecScalarMultExpr<VT,ST2,false> >
1665 {
1666  public:
1667  //**********************************************************************************************
1668  typedef typename SelectType< IsSparseMatrix<MT>::value && IsRowMajorMatrix<MT>::value &&
1669  IsSparseVector<VT>::value && IsColumnVector<VT>::value &&
1670  IsNumeric<ST1>::value && IsNumeric<ST2>::value
1671  , typename SVecScalarMultExprTrait<typename SMatSVecMultExprTrait<MT,VT>::Type,typename MultTrait<ST1,ST2>::Type>::Type
1672  , INVALID_TYPE >::Type Type;
1673  //**********************************************************************************************
1674 };
1676 //*************************************************************************************************
1677 
1678 
1679 
1680 
1681 //=================================================================================================
1682 //
1683 // TSMATSVECMULTEXPRTRAIT SPECIALIZATIONS
1684 //
1685 //=================================================================================================
1686 
1687 //*************************************************************************************************
1689 template< typename MT, typename ST, typename VT >
1690 struct TSMatSVecMultExprTrait< SMatScalarMultExpr<MT,ST,true>, VT >
1691 {
1692  public:
1693  //**********************************************************************************************
1694  typedef typename SelectType< IsSparseMatrix<MT>::value && IsColumnMajorMatrix<MT>::value &&
1695  IsSparseVector<VT>::value && IsColumnVector<VT>::value &&
1696  IsNumeric<ST>::value
1697  , typename SVecScalarMultExprTrait<typename TSMatSVecMultExprTrait<MT,VT>::Type,ST>::Type
1698  , INVALID_TYPE >::Type Type;
1699  //**********************************************************************************************
1700 };
1702 //*************************************************************************************************
1703 
1704 
1705 //*************************************************************************************************
1707 template< typename MT, typename ST1, typename VT, typename ST2 >
1708 struct TSMatSVecMultExprTrait< SMatScalarMultExpr<MT,ST1,true>, SVecScalarMultExpr<VT,ST2,false> >
1709 {
1710  public:
1711  //**********************************************************************************************
1712  typedef typename SelectType< IsSparseMatrix<MT>::value && IsColumnMajorMatrix<MT>::value &&
1713  IsSparseVector<VT>::value && IsColumnVector<VT>::value &&
1714  IsNumeric<ST1>::value && IsNumeric<ST2>::value
1715  , typename SVecScalarMultExprTrait<typename TSMatSVecMultExprTrait<MT,VT>::Type,typename MultTrait<ST1,ST2>::Type>::Type
1716  , INVALID_TYPE >::Type Type;
1717  //**********************************************************************************************
1718 };
1720 //*************************************************************************************************
1721 
1722 
1723 
1724 
1725 //=================================================================================================
1726 //
1727 // TSVECSMATMULTEXPRTRAIT SPECIALIZATIONS
1728 //
1729 //=================================================================================================
1730 
1731 //*************************************************************************************************
1733 template< typename VT, typename MT, typename ST >
1734 struct TSVecSMatMultExprTrait< VT, SMatScalarMultExpr<MT,ST,false> >
1735 {
1736  public:
1737  //**********************************************************************************************
1738  typedef typename SelectType< IsSparseVector<VT>::value && IsRowVector<VT>::value &&
1739  IsSparseMatrix<MT>::value && IsRowMajorMatrix<MT>::value &&
1740  IsNumeric<ST>::value
1741  , typename TSVecScalarMultExprTrait<typename TSVecSMatMultExprTrait<VT,MT>::Type,ST>::Type
1742  , INVALID_TYPE >::Type Type;
1743  //**********************************************************************************************
1744 };
1746 //*************************************************************************************************
1747 
1748 
1749 //*************************************************************************************************
1751 template< typename VT, typename ST1, typename MT, typename ST2 >
1752 struct TSVecSMatMultExprTrait< SVecScalarMultExpr<VT,ST1,true>, SMatScalarMultExpr<MT,ST2,false> >
1753 {
1754  public:
1755  //**********************************************************************************************
1756  typedef typename SelectType< IsSparseVector<VT>::value && IsRowVector<VT>::value &&
1757  IsSparseMatrix<MT>::value && IsRowMajorMatrix<MT>::value &&
1758  IsNumeric<ST1>::value && IsNumeric<ST2>::value
1759  , typename TSVecScalarMultExprTrait<typename TSVecSMatMultExprTrait<VT,MT>::Type,typename MultTrait<ST1,ST2>::Type>::Type
1760  , INVALID_TYPE >::Type Type;
1761  //**********************************************************************************************
1762 };
1764 //*************************************************************************************************
1765 
1766 
1767 
1768 
1769 //=================================================================================================
1770 //
1771 // TSVECTSMATMULTEXPRTRAIT SPECIALIZATIONS
1772 //
1773 //=================================================================================================
1774 
1775 //*************************************************************************************************
1777 template< typename VT, typename MT, typename ST >
1778 struct TSVecTSMatMultExprTrait< VT, SMatScalarMultExpr<MT,ST,true> >
1779 {
1780  public:
1781  //**********************************************************************************************
1782  typedef typename SelectType< IsSparseVector<VT>::value && IsRowVector<VT>::value &&
1783  IsSparseMatrix<MT>::value && IsColumnMajorMatrix<MT>::value &&
1784  IsNumeric<ST>::value
1785  , typename TSVecScalarMultExprTrait<typename TSVecTSMatMultExprTrait<VT,MT>::Type,ST>::Type
1786  , INVALID_TYPE >::Type Type;
1787  //**********************************************************************************************
1788 };
1790 //*************************************************************************************************
1791 
1792 
1793 //*************************************************************************************************
1795 template< typename VT, typename ST1, typename MT, typename ST2 >
1796 struct TSVecTSMatMultExprTrait< SVecScalarMultExpr<VT,ST1,true>, SMatScalarMultExpr<MT,ST2,true> >
1797 {
1798  public:
1799  //**********************************************************************************************
1800  typedef typename SelectType< IsSparseVector<VT>::value && IsRowVector<VT>::value &&
1801  IsSparseMatrix<MT>::value && IsColumnMajorMatrix<MT>::value &&
1802  IsNumeric<ST1>::value && IsNumeric<ST2>::value
1803  , typename TSVecScalarMultExprTrait<typename TSVecTSMatMultExprTrait<VT,MT>::Type,typename MultTrait<ST1,ST2>::Type>::Type
1804  , INVALID_TYPE >::Type Type;
1805  //**********************************************************************************************
1806 };
1808 //*************************************************************************************************
1809 
1810 
1811 
1812 
1813 //=================================================================================================
1814 //
1815 // DMATSMATMULTEXPRTRAIT SPECIALIZATIONS
1816 //
1817 //=================================================================================================
1818 
1819 //*************************************************************************************************
1821 template< typename MT1, typename MT2, typename ST >
1822 struct DMatSMatMultExprTrait< MT1, SMatScalarMultExpr<MT2,ST,false> >
1823 {
1824  public:
1825  //**********************************************************************************************
1826  typedef typename SelectType< IsDenseMatrix<MT1>::value && IsRowMajorMatrix<MT1>::value &&
1827  IsSparseMatrix<MT2>::value && IsRowMajorMatrix<MT2>::value &&
1828  IsNumeric<ST>::value
1829  , typename DMatScalarMultExprTrait<typename DMatSMatMultExprTrait<MT1,MT2>::Type,ST>::Type
1830  , INVALID_TYPE >::Type Type;
1831  //**********************************************************************************************
1832 };
1834 //*************************************************************************************************
1835 
1836 
1837 
1838 
1839 //=================================================================================================
1840 //
1841 // DMATTSMATMULTEXPRTRAIT SPECIALIZATIONS
1842 //
1843 //=================================================================================================
1844 
1845 //*************************************************************************************************
1847 template< typename MT1, typename MT2, typename ST >
1848 struct DMatTSMatMultExprTrait< MT1, SMatScalarMultExpr<MT2,ST,true> >
1849 {
1850  public:
1851  //**********************************************************************************************
1852  typedef typename SelectType< IsDenseMatrix<MT1>::value && IsRowMajorMatrix<MT1>::value &&
1853  IsSparseMatrix<MT2>::value && IsColumnMajorMatrix<MT2>::value &&
1854  IsNumeric<ST>::value
1855  , typename DMatScalarMultExprTrait<typename DMatTSMatMultExprTrait<MT1,MT2>::Type,ST>::Type
1856  , INVALID_TYPE >::Type Type;
1857  //**********************************************************************************************
1858 };
1860 //*************************************************************************************************
1861 
1862 
1863 
1864 
1865 //=================================================================================================
1866 //
1867 // TDMATSMATMULTEXPRTRAIT SPECIALIZATIONS
1868 //
1869 //=================================================================================================
1870 
1871 //*************************************************************************************************
1873 template< typename MT1, typename MT2, typename ST >
1874 struct TDMatSMatMultExprTrait< MT1, SMatScalarMultExpr<MT2,ST,false> >
1875 {
1876  public:
1877  //**********************************************************************************************
1878  typedef typename SelectType< IsDenseMatrix<MT1>::value && IsColumnMajorMatrix<MT1>::value &&
1879  IsSparseMatrix<MT2>::value && IsRowMajorMatrix<MT2>::value &&
1880  IsNumeric<ST>::value
1881  , typename TDMatScalarMultExprTrait<typename TDMatSMatMultExprTrait<MT1,MT2>::Type,ST>::Type
1882  , INVALID_TYPE >::Type Type;
1883  //**********************************************************************************************
1884 };
1886 //*************************************************************************************************
1887 
1888 
1889 
1890 
1891 //=================================================================================================
1892 //
1893 // TDMATTSMATMULTEXPRTRAIT SPECIALIZATIONS
1894 //
1895 //=================================================================================================
1896 
1897 //*************************************************************************************************
1899 template< typename MT1, typename MT2, typename ST >
1900 struct TDMatTSMatMultExprTrait< MT1, SMatScalarMultExpr<MT2,ST,true> >
1901 {
1902  public:
1903  //**********************************************************************************************
1904  typedef typename SelectType< IsDenseMatrix<MT1>::value && IsColumnMajorMatrix<MT1>::value &&
1905  IsSparseMatrix<MT2>::value && IsColumnMajorMatrix<MT2>::value &&
1906  IsNumeric<ST>::value
1907  , typename TDMatScalarMultExprTrait<typename TDMatTSMatMultExprTrait<MT1,MT2>::Type,ST>::Type
1908  , INVALID_TYPE >::Type Type;
1909  //**********************************************************************************************
1910 };
1912 //*************************************************************************************************
1913 
1914 
1915 
1916 
1917 //=================================================================================================
1918 //
1919 // SMATDMATMULTEXPRTRAIT SPECIALIZATIONS
1920 //
1921 //=================================================================================================
1922 
1923 //*************************************************************************************************
1925 template< typename MT1, typename ST, typename MT2 >
1926 struct SMatDMatMultExprTrait< SMatScalarMultExpr<MT1,ST,false>, MT2 >
1927 {
1928  public:
1929  //**********************************************************************************************
1930  typedef typename SelectType< IsSparseMatrix<MT1>::value && IsRowMajorMatrix<MT1>::value &&
1931  IsDenseMatrix<MT2>::value && IsRowMajorMatrix<MT2>::value &&
1932  IsNumeric<ST>::value
1933  , typename DMatScalarMultExprTrait<typename SMatDMatMultExprTrait<MT1,MT2>::Type,ST>::Type
1934  , INVALID_TYPE >::Type Type;
1935  //**********************************************************************************************
1936 };
1938 //*************************************************************************************************
1939 
1940 
1941 
1942 
1943 //=================================================================================================
1944 //
1945 // SMATTDMATMULTEXPRTRAIT SPECIALIZATIONS
1946 //
1947 //=================================================================================================
1948 
1949 //*************************************************************************************************
1951 template< typename MT1, typename ST, typename MT2 >
1952 struct SMatTDMatMultExprTrait< SMatScalarMultExpr<MT1,ST,false>, MT2 >
1953 {
1954  public:
1955  //**********************************************************************************************
1956  typedef typename SelectType< IsSparseMatrix<MT1>::value && IsRowMajorMatrix<MT1>::value &&
1957  IsDenseMatrix<MT2>::value && IsColumnMajorMatrix<MT2>::value &&
1958  IsNumeric<ST>::value
1959  , typename DMatScalarMultExprTrait<typename SMatTDMatMultExprTrait<MT1,MT2>::Type,ST>::Type
1960  , INVALID_TYPE >::Type Type;
1961  //**********************************************************************************************
1962 };
1964 //*************************************************************************************************
1965 
1966 
1967 
1968 
1969 //=================================================================================================
1970 //
1971 // TSMATDMATMULTEXPRTRAIT SPECIALIZATIONS
1972 //
1973 //=================================================================================================
1974 
1975 //*************************************************************************************************
1977 template< typename MT1, typename ST, typename MT2 >
1978 struct TSMatDMatMultExprTrait< SMatScalarMultExpr<MT1,ST,true>, MT2 >
1979 {
1980  public:
1981  //**********************************************************************************************
1982  typedef typename SelectType< IsSparseMatrix<MT1>::value && IsColumnMajorMatrix<MT1>::value &&
1983  IsDenseMatrix<MT2>::value && IsRowMajorMatrix<MT2>::value &&
1984  IsNumeric<ST>::value
1985  , typename TDMatScalarMultExprTrait<typename TSMatDMatMultExprTrait<MT1,MT2>::Type,ST>::Type
1986  , INVALID_TYPE >::Type Type;
1987  //**********************************************************************************************
1988 };
1990 //*************************************************************************************************
1991 
1992 
1993 
1994 
1995 //=================================================================================================
1996 //
1997 // TSMATTDMATMULTEXPRTRAIT SPECIALIZATIONS
1998 //
1999 //=================================================================================================
2000 
2001 //*************************************************************************************************
2003 template< typename MT1, typename ST, typename MT2 >
2004 struct TSMatTDMatMultExprTrait< SMatScalarMultExpr<MT1,ST,true>, MT2 >
2005 {
2006  public:
2007  //**********************************************************************************************
2008  typedef typename SelectType< IsSparseMatrix<MT1>::value && IsColumnMajorMatrix<MT1>::value &&
2009  IsDenseMatrix<MT2>::value && IsColumnMajorMatrix<MT2>::value &&
2010  IsNumeric<ST>::value
2011  , typename TDMatScalarMultExprTrait<typename TSMatTDMatMultExprTrait<MT1,MT2>::Type,ST>::Type
2012  , INVALID_TYPE >::Type Type;
2013  //**********************************************************************************************
2014 };
2016 //*************************************************************************************************
2017 
2018 
2019 
2020 
2021 //=================================================================================================
2022 //
2023 // SMATSMATMULTEXPRTRAIT SPECIALIZATIONS
2024 //
2025 //=================================================================================================
2026 
2027 //*************************************************************************************************
2029 template< typename MT1, typename ST, typename MT2 >
2030 struct SMatSMatMultExprTrait< SMatScalarMultExpr<MT1,ST,false>, MT2 >
2031 {
2032  public:
2033  //**********************************************************************************************
2034  typedef typename SelectType< IsSparseMatrix<MT1>::value && IsRowMajorMatrix<MT1>::value &&
2035  IsSparseMatrix<MT2>::value && IsRowMajorMatrix<MT2>::value &&
2036  IsNumeric<ST>::value
2037  , typename SMatScalarMultExprTrait<typename SMatSMatMultExprTrait<MT1,MT2>::Type,ST>::Type
2038  , INVALID_TYPE >::Type Type;
2039  //**********************************************************************************************
2040 };
2042 //*************************************************************************************************
2043 
2044 
2045 //*************************************************************************************************
2047 template< typename MT1, typename MT2, typename ST >
2048 struct SMatSMatMultExprTrait< MT1, SMatScalarMultExpr<MT2,ST,false> >
2049 {
2050  public:
2051  //**********************************************************************************************
2052  typedef typename SelectType< IsSparseMatrix<MT1>::value && IsRowMajorMatrix<MT1>::value &&
2053  IsSparseMatrix<MT2>::value && IsRowMajorMatrix<MT2>::value &&
2054  IsNumeric<ST>::value
2055  , typename SMatScalarMultExprTrait<typename SMatSMatMultExprTrait<MT1,MT2>::Type,ST>::Type
2056  , INVALID_TYPE >::Type Type;
2057  //**********************************************************************************************
2058 };
2060 //*************************************************************************************************
2061 
2062 
2063 //*************************************************************************************************
2065 template< typename MT1, typename ST1, typename MT2, typename ST2 >
2066 struct SMatSMatMultExprTrait< SMatScalarMultExpr<MT1,ST1,false>, SMatScalarMultExpr<MT2,ST2,false> >
2067 {
2068  public:
2069  //**********************************************************************************************
2070  typedef typename SelectType< IsSparseMatrix<MT1>::value && IsRowMajorMatrix<MT1>::value &&
2071  IsSparseMatrix<MT2>::value && IsRowMajorMatrix<MT2>::value &&
2072  IsNumeric<ST1>::value && IsNumeric<ST2>::value
2073  , typename SMatScalarMultExprTrait<typename SMatSMatMultExprTrait<MT1,MT2>::Type,typename MultTrait<ST1,ST2>::Type>::Type
2074  , INVALID_TYPE >::Type Type;
2075  //**********************************************************************************************
2076 };
2078 //*************************************************************************************************
2079 
2080 
2081 
2082 
2083 //=================================================================================================
2084 //
2085 // SMATTSMATMULTEXPRTRAIT SPECIALIZATIONS
2086 //
2087 //=================================================================================================
2088 
2089 //*************************************************************************************************
2091 template< typename MT1, typename ST, typename MT2 >
2092 struct SMatTSMatMultExprTrait< SMatScalarMultExpr<MT1,ST,false>, MT2 >
2093 {
2094  public:
2095  //**********************************************************************************************
2096  typedef typename SelectType< IsSparseMatrix<MT1>::value && IsRowMajorMatrix<MT1>::value &&
2097  IsSparseMatrix<MT2>::value && IsColumnMajorMatrix<MT2>::value &&
2098  IsNumeric<ST>::value
2099  , typename SMatScalarMultExprTrait<typename SMatTSMatMultExprTrait<MT1,MT2>::Type,ST>::Type
2100  , INVALID_TYPE >::Type Type;
2101  //**********************************************************************************************
2102 };
2104 //*************************************************************************************************
2105 
2106 
2107 //*************************************************************************************************
2109 template< typename MT1, typename MT2, typename ST >
2110 struct SMatTSMatMultExprTrait< MT1, SMatScalarMultExpr<MT2,ST,true> >
2111 {
2112  public:
2113  //**********************************************************************************************
2114  typedef typename SelectType< IsSparseMatrix<MT1>::value && IsRowMajorMatrix<MT1>::value &&
2115  IsSparseMatrix<MT2>::value && IsColumnMajorMatrix<MT2>::value &&
2116  IsNumeric<ST>::value
2117  , typename SMatScalarMultExprTrait<typename SMatTSMatMultExprTrait<MT1,MT2>::Type,ST>::Type
2118  , INVALID_TYPE >::Type Type;
2119  //**********************************************************************************************
2120 };
2122 //*************************************************************************************************
2123 
2124 
2125 //*************************************************************************************************
2127 template< typename MT1, typename ST1, typename MT2, typename ST2 >
2128 struct SMatTSMatMultExprTrait< SMatScalarMultExpr<MT1,ST1,false>, SMatScalarMultExpr<MT2,ST2,true> >
2129 {
2130  public:
2131  //**********************************************************************************************
2132  typedef typename SelectType< IsSparseMatrix<MT1>::value && IsRowMajorMatrix<MT1>::value &&
2133  IsSparseMatrix<MT2>::value && IsColumnMajorMatrix<MT2>::value &&
2134  IsNumeric<ST1>::value && IsNumeric<ST2>::value
2135  , typename SMatScalarMultExprTrait<typename SMatTSMatMultExprTrait<MT1,MT2>::Type,typename MultTrait<ST1,ST2>::Type>::Type
2136  , INVALID_TYPE >::Type Type;
2137  //**********************************************************************************************
2138 };
2140 //*************************************************************************************************
2141 
2142 
2143 
2144 
2145 //=================================================================================================
2146 //
2147 // TSMATSMATMULTEXPRTRAIT SPECIALIZATIONS
2148 //
2149 //=================================================================================================
2150 
2151 //*************************************************************************************************
2153 template< typename MT1, typename ST, typename MT2 >
2154 struct TSMatSMatMultExprTrait< SMatScalarMultExpr<MT1,ST,true>, MT2 >
2155 {
2156  public:
2157  //**********************************************************************************************
2158  typedef typename SelectType< IsSparseMatrix<MT1>::value && IsColumnMajorMatrix<MT1>::value &&
2159  IsSparseMatrix<MT2>::value && IsRowMajorMatrix<MT2>::value &&
2160  IsNumeric<ST>::value
2161  , typename TSMatScalarMultExprTrait<typename TSMatSMatMultExprTrait<MT1,MT2>::Type,ST>::Type
2162  , INVALID_TYPE >::Type Type;
2163  //**********************************************************************************************
2164 };
2166 //*************************************************************************************************
2167 
2168 
2169 //*************************************************************************************************
2171 template< typename MT1, typename MT2, typename ST >
2172 struct TSMatSMatMultExprTrait< MT1, SMatScalarMultExpr<MT2,ST,false> >
2173 {
2174  public:
2175  //**********************************************************************************************
2176  typedef typename SelectType< IsSparseMatrix<MT1>::value && IsColumnMajorMatrix<MT1>::value &&
2177  IsSparseMatrix<MT2>::value && IsRowMajorMatrix<MT2>::value &&
2178  IsNumeric<ST>::value
2179  , typename TSMatScalarMultExprTrait<typename TSMatSMatMultExprTrait<MT1,MT2>::Type,ST>::Type
2180  , INVALID_TYPE >::Type Type;
2181  //**********************************************************************************************
2182 };
2184 //*************************************************************************************************
2185 
2186 
2187 //*************************************************************************************************
2189 template< typename MT1, typename ST1, typename MT2, typename ST2 >
2190 struct TSMatSMatMultExprTrait< SMatScalarMultExpr<MT1,ST1,true>, SMatScalarMultExpr<MT2,ST2,false> >
2191 {
2192  public:
2193  //**********************************************************************************************
2194  typedef typename SelectType< IsSparseMatrix<MT1>::value && IsColumnMajorMatrix<MT1>::value &&
2195  IsSparseMatrix<MT2>::value && IsRowMajorMatrix<MT2>::value &&
2196  IsNumeric<ST1>::value && IsNumeric<ST2>::value
2197  , typename TSMatScalarMultExprTrait<typename TSMatSMatMultExprTrait<MT1,MT2>::Type,typename MultTrait<ST1,ST2>::Type>::Type
2198  , INVALID_TYPE >::Type Type;
2199  //**********************************************************************************************
2200 };
2202 //*************************************************************************************************
2203 
2204 
2205 
2206 
2207 //=================================================================================================
2208 //
2209 // TSMATSMATMULTEXPRTRAIT SPECIALIZATIONS
2210 //
2211 //=================================================================================================
2212 
2213 //*************************************************************************************************
2215 template< typename MT1, typename ST, typename MT2 >
2216 struct TSMatTSMatMultExprTrait< SMatScalarMultExpr<MT1,ST,true>, MT2 >
2217 {
2218  public:
2219  //**********************************************************************************************
2220  typedef typename SelectType< IsSparseMatrix<MT1>::value && IsColumnMajorMatrix<MT1>::value &&
2221  IsSparseMatrix<MT2>::value && IsColumnMajorMatrix<MT2>::value &&
2222  IsNumeric<ST>::value
2223  , typename TSMatScalarMultExprTrait<typename TSMatTSMatMultExprTrait<MT1,MT2>::Type,ST>::Type
2224  , INVALID_TYPE >::Type Type;
2225  //**********************************************************************************************
2226 };
2228 //*************************************************************************************************
2229 
2230 
2231 //*************************************************************************************************
2233 template< typename MT1, typename MT2, typename ST >
2234 struct TSMatTSMatMultExprTrait< MT1, SMatScalarMultExpr<MT2,ST,true> >
2235 {
2236  public:
2237  //**********************************************************************************************
2238  typedef typename SelectType< IsSparseMatrix<MT1>::value && IsColumnMajorMatrix<MT1>::value &&
2239  IsSparseMatrix<MT2>::value && IsColumnMajorMatrix<MT2>::value &&
2240  IsNumeric<ST>::value
2241  , typename TSMatScalarMultExprTrait<typename TSMatTSMatMultExprTrait<MT1,MT2>::Type,ST>::Type
2242  , INVALID_TYPE >::Type Type;
2243  //**********************************************************************************************
2244 };
2246 //*************************************************************************************************
2247 
2248 
2249 //*************************************************************************************************
2251 template< typename MT1, typename ST1, typename MT2, typename ST2 >
2252 struct TSMatTSMatMultExprTrait< SMatScalarMultExpr<MT1,ST1,true>, SMatScalarMultExpr<MT2,ST2,true> >
2253 {
2254  public:
2255  //**********************************************************************************************
2256  typedef typename SelectType< IsSparseMatrix<MT1>::value && IsColumnMajorMatrix<MT1>::value &&
2257  IsSparseMatrix<MT2>::value && IsColumnMajorMatrix<MT2>::value &&
2258  IsNumeric<ST1>::value && IsNumeric<ST2>::value
2259  , typename TSMatScalarMultExprTrait<typename TSMatTSMatMultExprTrait<MT1,MT2>::Type,typename MultTrait<ST1,ST2>::Type>::Type
2260  , INVALID_TYPE >::Type Type;
2261  //**********************************************************************************************
2262 };
2264 //*************************************************************************************************
2265 
2266 
2267 
2268 
2269 //=================================================================================================
2270 //
2271 // SUBMATRIXEXPRTRAIT SPECIALIZATIONS
2272 //
2273 //=================================================================================================
2274 
2275 //*************************************************************************************************
2277 template< typename MT, typename ST, bool SO, bool AF >
2278 struct SubmatrixExprTrait< SMatScalarMultExpr<MT,ST,SO>, AF >
2279 {
2280  public:
2281  //**********************************************************************************************
2282  typedef typename MultExprTrait< typename SubmatrixExprTrait<const MT,AF>::Type, ST >::Type Type;
2283  //**********************************************************************************************
2284 };
2286 //*************************************************************************************************
2287 
2288 
2289 
2290 
2291 //=================================================================================================
2292 //
2293 // ROWEXPRTRAIT SPECIALIZATIONS
2294 //
2295 //=================================================================================================
2296 
2297 //*************************************************************************************************
2299 template< typename MT, typename ST, bool SO >
2300 struct RowExprTrait< SMatScalarMultExpr<MT,ST,SO> >
2301 {
2302  public:
2303  //**********************************************************************************************
2304  typedef typename MultExprTrait< typename RowExprTrait<const MT>::Type, ST >::Type Type;
2305  //**********************************************************************************************
2306 };
2308 //*************************************************************************************************
2309 
2310 
2311 
2312 
2313 //=================================================================================================
2314 //
2315 // COLUMNEXPRTRAIT SPECIALIZATIONS
2316 //
2317 //=================================================================================================
2318 
2319 //*************************************************************************************************
2321 template< typename MT, typename ST, bool SO >
2322 struct ColumnExprTrait< SMatScalarMultExpr<MT,ST,SO> >
2323 {
2324  public:
2325  //**********************************************************************************************
2326  typedef typename MultExprTrait< typename ColumnExprTrait<const MT>::Type, ST >::Type Type;
2327  //**********************************************************************************************
2328 };
2330 //*************************************************************************************************
2331 
2332 } // namespace blaze
2333 
2334 #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:4329
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:930
PointerType pointer
Pointer return type.
Definition: SMatScalarMultExpr.h:205
IteratorCategory iterator_category
The iterator category.
Definition: SMatScalarMultExpr.h:203
MT::CompositeType CT
Composite type of the sparse matrix expression.
Definition: SMatScalarMultExpr.h:112
void smpSubAssign(DenseMatrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs)
Default implementation of the SMP subtraction assignment of a matrix to dense matrix.
Definition: DenseMatrix.h:152
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:199
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:194
DifferenceType operator-(const ConstIterator &rhs) const
Calculating the number of elements between two expression iterators.
Definition: SMatScalarMultExpr.h:298
const This & CompositeType
Data type for composite expression templates.
Definition: CompressedMatrix.h:2408
Header file for the IsRowVector type trait.
Type ElementType
Type of the sparse matrix elements.
Definition: CompressedMatrix.h:251
ptrdiff_t DifferenceType
Difference between two iterators.
Definition: SMatScalarMultExpr.h:200
size_t columns() const
Returns the current number of columns of the matrix.
Definition: SMatScalarMultExpr.h:379
ValueType value_type
Type of the underlying pointers.
Definition: SMatScalarMultExpr.h:204
const DMatSerialExpr< MT, SO > serial(const DenseMatrix< MT, SO > &dm)
Forces the serial evaluation of the given dense matrix expression dm.
Definition: DMatSerialExpr.h:690
Header file for the Computation base class.
IteratorType matrix_
Iterator over the elements of the left-hand side sparse matrix expression.
Definition: SMatScalarMultExpr.h:305
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:444
ConstIterator end(size_t i) const
Returns an iterator just past the last non-zero element of row i.
Definition: SMatScalarMultExpr.h:359
Base class for dense matrices.The DenseMatrix class is a base class for all dense matrix classes...
Definition: DenseMatrix.h:70
Base class for sparse matrices.The SparseMatrix class is a base class for all sparse matrix classes...
Definition: Forward.h:107
std::forward_iterator_tag IteratorCategory
The iterator category.
Definition: SMatScalarMultExpr.h:196
Constraint on the data type.
SelectType< useAssign, const ResultType, const SMatScalarMultExpr & >::Type CompositeType
Data type for composite expression templates.
Definition: SMatScalarMultExpr.h:174
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:432
Constraint on the data type.
Header file for the MultExprTrait class template.
void smpAddAssign(DenseMatrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs)
Default implementation of the SMP addition assignment of a matrix to a dense matrix.
Definition: DenseMatrix.h:122
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:253
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:452
Header file for the IsFloatingPoint type trait.
const Element * ConstIterator
Iterator over constant elements.
Definition: CompressedMatrix.h:2412
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:271
Element ValueType
Type of the underlying pointers.
Definition: SMatScalarMultExpr.h:197
#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:171
#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:165
RightOperand scalar_
Right-hand side scalar of the multiplication expression.
Definition: SMatScalarMultExpr.h:306
MultExprTrait< RN, ST >::Type ExprReturnType
Expression return type for the subscript operator.
Definition: SMatScalarMultExpr.h:125
Header file for the SelectType class template.
SMatScalarMultExpr(const MT &matrix, ST scalar)
Constructor for the SMatScalarMultExpr class.
Definition: SMatScalarMultExpr.h:322
Header file for the RowExprTrait class template.
Expression object for sparse matrix-scalar multiplications.The SMatScalarMult class represents the co...
Definition: Forward.h:94
Header file for all forward declarations for expression class templates.
Header file for the IsDenseMatrix type trait.
ConstIterator begin(size_t i) const
Returns an iterator to the first non-zero element of row i.
Definition: SMatScalarMultExpr.h:348
Header file for the EnableIf class template.
SMatScalarMultExpr< MT, ST, SO > This
Type of this SMatScalarMultExpr instance.
Definition: SMatScalarMultExpr.h:164
Header file for the serial shim.
Header file for the BaseElementType type trait.
LeftOperand matrix_
Left-hand side sparse matrix of the multiplication expression.
Definition: SMatScalarMultExpr.h:451
Header file for the IsNumeric type trait.
size_t rows() const
Returns the current number of rows of the matrix.
Definition: SMatScalarMultExpr.h:369
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:2407
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:301
size_t nonZeros() const
Returns the number of non-zero elements in the sparse matrix.
Definition: SMatScalarMultExpr.h:389
bool operator!=(const ConstIterator &rhs) const
Inequality comparison between two ConstIterator objects.
Definition: SMatScalarMultExpr.h:287
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:276
#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:420
const Element operator*() const
Direct access to the sparse matrix element at the current iterator position.
Definition: SMatScalarMultExpr.h:235
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:331
Iterator over the elements of the sparse matrix/scalar multiplication expression. ...
Definition: SMatScalarMultExpr.h:186
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:198
ConstIterator & operator++()
Pre-increment operator.
Definition: SMatScalarMultExpr.h:224
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:335
ResultType::ElementType ElementType
Resulting element type.
Definition: SMatScalarMultExpr.h:168
ReferenceType reference
Reference return type.
Definition: SMatScalarMultExpr.h:206
ValueIndexPair< ElementType > Element
Element type of the sparse matrix expression.
Definition: SMatScalarMultExpr.h:191
ReturnType value() const
Access to the current value of the sparse element.
Definition: SMatScalarMultExpr.h:255
size_t nonZeros(size_t i) const
Returns the number of non-zero elements in the specified row.
Definition: SMatScalarMultExpr.h:400
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:177
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:245
Header file for the IsComputation type trait class.
ST RightOperand
Composite type of the right-hand side scalar value.
Definition: SMatScalarMultExpr.h:180
#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:2403
Header file for basic type definitions.
ConstIterator(IteratorType matrix, RightOperand scalar)
Constructor for the ConstIterator class.
Definition: SMatScalarMultExpr.h:213
size_t index() const
Access to the current index of the sparse element.
Definition: SMatScalarMultExpr.h:265
ResultType::OppositeType OppositeType
Result type with opposite storage order for expression template evaluations.
Definition: SMatScalarMultExpr.h:166
Header file for the IsColumnVector type trait.
DifferenceType difference_type
Difference between two iterators.
Definition: SMatScalarMultExpr.h:207
ValueType & ReferenceType
Reference return type.
Definition: SMatScalarMultExpr.h:199
MT::ReturnType RN
Return type of the sparse matrix expression.
Definition: SMatScalarMultExpr.h:111
MT::ResultType RT
Result type of the sparse matrix expression.
Definition: SMatScalarMultExpr.h:110
Evaluation of the resulting expression type of a multiplication.Via this type trait it is possible to...
Definition: MultExprTrait.h:137
ResultType::TransposeType TransposeType
Transpose type for expression template evaluations.
Definition: SMatScalarMultExpr.h:167
#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:410
#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.