DMatScalarMultExpr.h
Go to the documentation of this file.
1 //=================================================================================================
33 //=================================================================================================
34 
35 #ifndef _BLAZE_MATH_EXPRESSIONS_DMATSCALARMULTEXPR_H_
36 #define _BLAZE_MATH_EXPRESSIONS_DMATSCALARMULTEXPR_H_
37 
38 
39 //*************************************************************************************************
40 // Includes
41 //*************************************************************************************************
42 
43 #include <iterator>
44 #include <blaze/math/Aliases.h>
48 #include <blaze/math/Exception.h>
55 #include <blaze/math/SIMD.h>
76 #include <blaze/system/Inline.h>
78 #include <blaze/util/Assert.h>
81 #include <blaze/util/EnableIf.h>
84 #include <blaze/util/InvalidType.h>
85 #include <blaze/util/mpl/And.h>
86 #include <blaze/util/mpl/If.h>
87 #include <blaze/util/mpl/Or.h>
88 #include <blaze/util/Types.h>
90 
91 
92 namespace blaze {
93 
94 //=================================================================================================
95 //
96 // CLASS DMATSCALARMULTEXPR
97 //
98 //=================================================================================================
99 
100 //*************************************************************************************************
107 template< typename MT // Type of the left-hand side dense matrix
108  , typename ST // Type of the right-hand side scalar value
109  , bool SO > // Storage order
111  : public MatScalarMultExpr< DenseMatrix< DMatScalarMultExpr<MT,ST,SO>, SO > >
112  , private Computation
113 {
114  private:
115  //**Type definitions****************************************************************************
116  using RT = ResultType_<MT>;
117  using RN = ReturnType_<MT>;
120  //**********************************************************************************************
121 
122  //**Return type evaluation**********************************************************************
124 
129  enum : bool { returnExpr = !IsTemporary<RN>::value };
130 
133  //**********************************************************************************************
134 
135  //**Serial evaluation strategy******************************************************************
137 
143  enum : bool { useAssign = IsComputation<MT>::value && RequiresEvaluation<MT>::value };
144 
146  template< typename MT2 >
148  struct UseAssign {
149  enum : bool { value = useAssign };
150  };
152  //**********************************************************************************************
153 
154  //**Parallel evaluation strategy****************************************************************
156 
162  template< typename MT2 >
163  struct UseSMPAssign {
164  enum : bool { value = ( !MT2::smpAssignable || !MT::smpAssignable ) && useAssign };
165  };
167  //**********************************************************************************************
168 
169  public:
170  //**Type definitions****************************************************************************
176 
179 
182 
184  using LeftOperand = If_< IsExpression<MT>, const MT, const MT& >;
185 
187  using RightOperand = ST;
188  //**********************************************************************************************
189 
190  //**ConstIterator class definition**************************************************************
194  {
195  public:
196  //**Type definitions*************************************************************************
197  using IteratorCategory = std::random_access_iterator_tag;
202 
203  // STL iterator requirements
209 
212  //*******************************************************************************************
213 
214  //**Constructor******************************************************************************
220  explicit inline ConstIterator( IteratorType iterator, RightOperand scalar )
221  : iterator_( iterator ) // Iterator to the current element
222  , scalar_ ( scalar ) // Scalar of the multiplication expression
223  {}
224  //*******************************************************************************************
225 
226  //**Addition assignment operator*************************************************************
232  inline ConstIterator& operator+=( size_t inc ) {
233  iterator_ += inc;
234  return *this;
235  }
236  //*******************************************************************************************
237 
238  //**Subtraction assignment operator**********************************************************
244  inline ConstIterator& operator-=( size_t dec ) {
245  iterator_ -= dec;
246  return *this;
247  }
248  //*******************************************************************************************
249 
250  //**Prefix increment operator****************************************************************
256  ++iterator_;
257  return *this;
258  }
259  //*******************************************************************************************
260 
261  //**Postfix increment operator***************************************************************
266  inline const ConstIterator operator++( int ) {
267  return ConstIterator( iterator_++ );
268  }
269  //*******************************************************************************************
270 
271  //**Prefix decrement operator****************************************************************
277  --iterator_;
278  return *this;
279  }
280  //*******************************************************************************************
281 
282  //**Postfix decrement operator***************************************************************
287  inline const ConstIterator operator--( int ) {
288  return ConstIterator( iterator_-- );
289  }
290  //*******************************************************************************************
291 
292  //**Element access operator******************************************************************
297  inline ReturnType operator*() const {
298  return *iterator_ * scalar_;
299  }
300  //*******************************************************************************************
301 
302  //**Load function****************************************************************************
307  inline auto load() const noexcept {
308  return iterator_.load() * set( scalar_ );
309  }
310  //*******************************************************************************************
311 
312  //**Equality operator************************************************************************
318  inline bool operator==( const ConstIterator& rhs ) const {
319  return iterator_ == rhs.iterator_;
320  }
321  //*******************************************************************************************
322 
323  //**Inequality operator**********************************************************************
329  inline bool operator!=( const ConstIterator& rhs ) const {
330  return iterator_ != rhs.iterator_;
331  }
332  //*******************************************************************************************
333 
334  //**Less-than operator***********************************************************************
340  inline bool operator<( const ConstIterator& rhs ) const {
341  return iterator_ < rhs.iterator_;
342  }
343  //*******************************************************************************************
344 
345  //**Greater-than operator********************************************************************
351  inline bool operator>( const ConstIterator& rhs ) const {
352  return iterator_ > rhs.iterator_;
353  }
354  //*******************************************************************************************
355 
356  //**Less-or-equal-than operator**************************************************************
362  inline bool operator<=( const ConstIterator& rhs ) const {
363  return iterator_ <= rhs.iterator_;
364  }
365  //*******************************************************************************************
366 
367  //**Greater-or-equal-than operator***********************************************************
373  inline bool operator>=( const ConstIterator& rhs ) const {
374  return iterator_ >= rhs.iterator_;
375  }
376  //*******************************************************************************************
377 
378  //**Subtraction operator*********************************************************************
384  inline DifferenceType operator-( const ConstIterator& rhs ) const {
385  return iterator_ - rhs.iterator_;
386  }
387  //*******************************************************************************************
388 
389  //**Addition operator************************************************************************
396  friend inline const ConstIterator operator+( const ConstIterator& it, size_t inc ) {
397  return ConstIterator( it.iterator_ + inc, it.scalar_ );
398  }
399  //*******************************************************************************************
400 
401  //**Addition operator************************************************************************
408  friend inline const ConstIterator operator+( size_t inc, const ConstIterator& it ) {
409  return ConstIterator( it.iterator_ + inc, it.scalar_ );
410  }
411  //*******************************************************************************************
412 
413  //**Subtraction operator*********************************************************************
420  friend inline const ConstIterator operator-( const ConstIterator& it, size_t dec ) {
421  return ConstIterator( it.iterator_ - dec, it.scalar_ );
422  }
423  //*******************************************************************************************
424 
425  private:
426  //**Member variables*************************************************************************
429  //*******************************************************************************************
430  };
431  //**********************************************************************************************
432 
433  //**Compilation flags***************************************************************************
435  enum : bool { simdEnabled = MT::simdEnabled &&
438  HasSIMDMult<UnderlyingElement_<ET>,ST>::value ) };
439 
441  enum : bool { smpAssignable = MT::smpAssignable };
442  //**********************************************************************************************
443 
444  //**SIMD properties*****************************************************************************
446  enum : size_t { SIMDSIZE = SIMDTrait<ElementType>::size };
447  //**********************************************************************************************
448 
449  //**Constructor*********************************************************************************
455  explicit inline DMatScalarMultExpr( const MT& matrix, ST scalar ) noexcept
456  : matrix_( matrix ) // Left-hand side dense matrix of the multiplication expression
457  , scalar_( scalar ) // Right-hand side scalar of the multiplication expression
458  {}
459  //**********************************************************************************************
460 
461  //**Access operator*****************************************************************************
468  inline ReturnType operator()( size_t i, size_t j ) const {
469  BLAZE_INTERNAL_ASSERT( i < matrix_.rows() , "Invalid row access index" );
470  BLAZE_INTERNAL_ASSERT( j < matrix_.columns(), "Invalid column access index" );
471  return matrix_(i,j) * scalar_;
472  }
473  //**********************************************************************************************
474 
475  //**At function*********************************************************************************
483  inline ReturnType at( size_t i, size_t j ) const {
484  if( i >= matrix_.rows() ) {
485  BLAZE_THROW_OUT_OF_RANGE( "Invalid row access index" );
486  }
487  if( j >= matrix_.columns() ) {
488  BLAZE_THROW_OUT_OF_RANGE( "Invalid column access index" );
489  }
490  return (*this)(i,j);
491  }
492  //**********************************************************************************************
493 
494  //**Load function*******************************************************************************
501  BLAZE_ALWAYS_INLINE auto load( size_t i, size_t j ) const noexcept {
502  BLAZE_INTERNAL_ASSERT( i < matrix_.rows() , "Invalid row access index" );
503  BLAZE_INTERNAL_ASSERT( j < matrix_.columns(), "Invalid column access index" );
504  BLAZE_INTERNAL_ASSERT( !SO || ( i % SIMDSIZE == 0UL ), "Invalid row access index" );
505  BLAZE_INTERNAL_ASSERT( SO || ( j % SIMDSIZE == 0UL ), "Invalid column access index" );
506  return matrix_.load(i,j) * set( scalar_ );
507  }
508  //**********************************************************************************************
509 
510  //**Begin function******************************************************************************
516  inline ConstIterator begin( size_t i ) const {
517  return ConstIterator( matrix_.begin(i), scalar_ );
518  }
519  //**********************************************************************************************
520 
521  //**End function********************************************************************************
527  inline ConstIterator end( size_t i ) const {
528  return ConstIterator( matrix_.end(i), scalar_ );
529  }
530  //**********************************************************************************************
531 
532  //**Rows function*******************************************************************************
537  inline size_t rows() const noexcept {
538  return matrix_.rows();
539  }
540  //**********************************************************************************************
541 
542  //**Columns function****************************************************************************
547  inline size_t columns() const noexcept {
548  return matrix_.columns();
549  }
550  //**********************************************************************************************
551 
552  //**Left operand access*************************************************************************
557  inline LeftOperand leftOperand() const noexcept {
558  return matrix_;
559  }
560  //**********************************************************************************************
561 
562  //**Right operand access************************************************************************
567  inline RightOperand rightOperand() const noexcept {
568  return scalar_;
569  }
570  //**********************************************************************************************
571 
572  //**********************************************************************************************
578  template< typename T >
579  inline bool canAlias( const T* alias ) const noexcept {
580  return IsExpression<MT>::value && matrix_.canAlias( alias );
581  }
582  //**********************************************************************************************
583 
584  //**********************************************************************************************
590  template< typename T >
591  inline bool isAliased( const T* alias ) const noexcept {
592  return matrix_.isAliased( alias );
593  }
594  //**********************************************************************************************
595 
596  //**********************************************************************************************
601  inline bool isAligned() const noexcept {
602  return matrix_.isAligned();
603  }
604  //**********************************************************************************************
605 
606  //**********************************************************************************************
611  inline bool canSMPAssign() const noexcept {
612  return matrix_.canSMPAssign() ||
613  ( rows() * columns() >= SMP_DMATSCALARMULT_THRESHOLD );
614  }
615  //**********************************************************************************************
616 
617  private:
618  //**Member variables****************************************************************************
621  //**********************************************************************************************
622 
623  //**Assignment to dense matrices****************************************************************
637  template< typename MT2 // Type of the target dense matrix
638  , bool SO2 > // Storage order of the target dense matrix
639  friend inline EnableIf_< UseAssign<MT2> >
640  assign( DenseMatrix<MT2,SO2>& lhs, const DMatScalarMultExpr& rhs )
641  {
643 
644  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
645  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
646 
647  assign( ~lhs, rhs.matrix_ );
648  assign( ~lhs, (~lhs) * rhs.scalar_ );
649  }
651  //**********************************************************************************************
652 
653  //**Assignment to sparse matrices***************************************************************
667  template< typename MT2 // Type of the target sparse matrix
668  , bool SO2 > // Storage order of the target sparse matrix
669  friend inline EnableIf_< UseAssign<MT2> >
670  assign( SparseMatrix<MT2,SO2>& lhs, const DMatScalarMultExpr& rhs )
671  {
673 
674  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
675  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
676 
677  assign( ~lhs, rhs.matrix_ );
678  (~lhs) *= rhs.scalar_;
679  }
681  //**********************************************************************************************
682 
683  //**Addition assignment to dense matrices*******************************************************
697  template< typename MT2 // Type of the target dense matrix
698  , bool SO2 > // Storage order of the target dense matrix
699  friend inline EnableIf_< UseAssign<MT2> >
700  addAssign( DenseMatrix<MT2,SO2>& lhs, const DMatScalarMultExpr& rhs )
701  {
703 
707 
708  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
709  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
710 
711  const ResultType tmp( serial( rhs ) );
712  addAssign( ~lhs, tmp );
713  }
715  //**********************************************************************************************
716 
717  //**Addition assignment to sparse matrices******************************************************
718  // No special implementation for the addition assignment to sparse matrices.
719  //**********************************************************************************************
720 
721  //**Subtraction assignment to dense matrices****************************************************
735  template< typename MT2 // Type of the target dense matrix
736  , bool SO2 > // Storage order of the target dense matrix
737  friend inline EnableIf_< UseAssign<MT2> >
738  subAssign( DenseMatrix<MT2,SO2>& lhs, const DMatScalarMultExpr& rhs )
739  {
741 
745 
746  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
747  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
748 
749  const ResultType tmp( serial( rhs ) );
750  subAssign( ~lhs, tmp );
751  }
753  //**********************************************************************************************
754 
755  //**Subtraction assignment to sparse matrices***************************************************
756  // No special implementation for the subtraction assignment to sparse matrices.
757  //**********************************************************************************************
758 
759  //**Schur product assignment to dense matrices**************************************************
773  template< typename MT2 // Type of the target dense matrix
774  , bool SO2 > // Storage order of the target dense matrix
775  friend inline EnableIf_< UseAssign<MT2> >
776  schurAssign( DenseMatrix<MT2,SO2>& lhs, const DMatScalarMultExpr& rhs )
777  {
779 
783 
784  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
785  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
786 
787  const ResultType tmp( serial( rhs ) );
788  schurAssign( ~lhs, tmp );
789  }
791  //**********************************************************************************************
792 
793  //**Schur product assignment to sparse matrices*************************************************
794  // No special implementation for the Schur product assignment to sparse matrices.
795  //**********************************************************************************************
796 
797  //**Multiplication assignment to dense matrices*************************************************
798  // No special implementation for the multiplication assignment to dense matrices.
799  //**********************************************************************************************
800 
801  //**Multiplication assignment to sparse matrices************************************************
802  // No special implementation for the multiplication assignment to sparse matrices.
803  //**********************************************************************************************
804 
805  //**SMP assignment to dense matrices************************************************************
819  template< typename MT2 // Type of the target dense matrix
820  , bool SO2 > // Storage order of the target dense matrix
821  friend inline EnableIf_< UseSMPAssign<MT2> >
823  {
825 
826  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
827  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
828 
829  smpAssign( ~lhs, rhs.matrix_ );
830  smpAssign( ~lhs, (~lhs) * rhs.scalar_ );
831  }
833  //**********************************************************************************************
834 
835  //**SMP assignment to sparse matrices***********************************************************
849  template< typename MT2 // Type of the target sparse matrix
850  , bool SO2 > // Storage order of the target sparse matrix
851  friend inline EnableIf_< UseSMPAssign<MT2> >
853  {
855 
856  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
857  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
858 
859  smpAssign( ~lhs, rhs.matrix_ );
860  (~lhs) *= rhs.scalar_;
861  }
863  //**********************************************************************************************
864 
865  //**SMP addition assignment to dense matrices***************************************************
879  template< typename MT2 // Type of the target dense matrix
880  , bool SO2 > // Storage order of the target dense matrix
881  friend inline EnableIf_< UseSMPAssign<MT2> >
883  {
885 
889 
890  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
891  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
892 
893  const ResultType tmp( rhs );
894  smpAddAssign( ~lhs, tmp );
895  }
897  //**********************************************************************************************
898 
899  //**SMP addition assignment to sparse matrices**************************************************
900  // No special implementation for the SMP addition assignment to sparse matrices.
901  //**********************************************************************************************
902 
903  //**SMP subtraction assignment to dense matrices************************************************
917  template< typename MT2 // Type of the target dense matrix
918  , bool SO2 > // Storage order of the target dense matrix
919  friend inline EnableIf_< UseSMPAssign<MT2> >
921  {
923 
927 
928  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
929  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
930 
931  const ResultType tmp( rhs );
932  smpSubAssign( ~lhs, tmp );
933  }
935  //**********************************************************************************************
936 
937  //**SMP subtraction assignment to sparse matrices***********************************************
938  // No special implementation for the SMP subtraction assignment to sparse matrices.
939  //**********************************************************************************************
940 
941  //**SMP Schur product assignment to dense matrices**********************************************
955  template< typename MT2 // Type of the target dense matrix
956  , bool SO2 > // Storage order of the target dense matrix
957  friend inline EnableIf_< UseSMPAssign<MT2> >
959  {
961 
965 
966  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
967  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
968 
969  const ResultType tmp( rhs );
970  smpSchurAssign( ~lhs, tmp );
971  }
973  //**********************************************************************************************
974 
975  //**SMP Schur product assignment to sparse matrices*********************************************
976  // No special implementation for the SMP Schur product assignment to sparse matrices.
977  //**********************************************************************************************
978 
979  //**SMP multiplication assignment to dense matrices*********************************************
980  // No special implementation for the SMP multiplication assignment to dense matrices.
981  //**********************************************************************************************
982 
983  //**SMP multiplication assignment to sparse matrices********************************************
984  // No special implementation for the SMP multiplication assignment to sparse matrices.
985  //**********************************************************************************************
986 
987  //**Compile time checks*************************************************************************
994  //**********************************************************************************************
995 };
996 //*************************************************************************************************
997 
998 
999 
1000 
1001 //=================================================================================================
1002 //
1003 // GLOBAL UNARY ARITHMETIC OPERATORS
1004 //
1005 //=================================================================================================
1006 
1007 //*************************************************************************************************
1024 template< typename MT // Type of the dense matrix
1025  , bool SO > // Storage order
1026 inline decltype(auto) operator-( const DenseMatrix<MT,SO>& dm )
1027 {
1029 
1030  using ScalarType = UnderlyingBuiltin_<MT>;
1032  return ReturnType( ~dm, ScalarType(-1) );
1033 }
1034 //*************************************************************************************************
1035 
1036 
1037 
1038 
1039 //=================================================================================================
1040 //
1041 // GLOBAL BINARY ARITHMETIC OPERATORS
1042 //
1043 //=================================================================================================
1044 
1045 //*************************************************************************************************
1066 template< typename MT // Type of the left-hand side dense matrix
1067  , bool SO // Storage order of the left-hand side dense matrix
1068  , typename ST // Type of the right-hand side scalar
1069  , typename = EnableIf_< IsNumeric<ST> > >
1070 inline decltype(auto) operator*( const DenseMatrix<MT,SO>& mat, ST scalar )
1071 {
1073 
1074  using ScalarType = MultTrait_< UnderlyingBuiltin_<MT>, ST >;
1076  return ReturnType( ~mat, scalar );
1077 }
1078 //*************************************************************************************************
1079 
1080 
1081 //*************************************************************************************************
1102 template< typename ST // Type of the left-hand side scalar
1103  , typename MT // Type of the right-hand side dense matrix
1104  , bool SO // Storage order of the right-hand side dense matrix
1105  , typename = EnableIf_< IsNumeric<ST> > >
1106 inline decltype(auto) operator*( ST scalar, const DenseMatrix<MT,SO>& mat )
1107 {
1109 
1110  using ScalarType = MultTrait_< ST, UnderlyingBuiltin_<MT> >;
1112  return ReturnType( ~mat, scalar );
1113 }
1114 //*************************************************************************************************
1115 
1116 
1117 
1118 
1119 //=================================================================================================
1120 //
1121 // GLOBAL RESTRUCTURING UNARY ARITHMETIC OPERATORS
1122 //
1123 //=================================================================================================
1124 
1125 //*************************************************************************************************
1137 template< typename MT // Type of the dense matrix
1138  , typename ST // Type of the scalar
1139  , bool TF > // Transpose flag
1140 inline decltype(auto) operator-( const DMatScalarMultExpr<MT,ST,TF>& dm )
1141 {
1143 
1145  return ReturnType( dm.leftOperand(), -dm.rightOperand() );
1146 }
1148 //*************************************************************************************************
1149 
1150 
1151 
1152 
1153 //=================================================================================================
1154 //
1155 // GLOBAL RESTRUCTURING BINARY ARITHMETIC OPERATORS
1156 //
1157 //=================================================================================================
1158 
1159 //*************************************************************************************************
1172 template< typename MT // Type of the dense matrix of the left-hand side expression
1173  , typename ST1 // Type of the scalar of the left-hand side expression
1174  , bool SO // Storage order of the dense matrix
1175  , typename ST2 // Type of the right-hand side scalar
1176  , typename = EnableIf_< IsNumeric<ST2> > >
1177 inline decltype(auto) operator*( const DMatScalarMultExpr<MT,ST1,SO>& mat, ST2 scalar )
1178 {
1180 
1181  return mat.leftOperand() * ( mat.rightOperand() * scalar );
1182 }
1184 //*************************************************************************************************
1185 
1186 
1187 //*************************************************************************************************
1200 template< typename ST1 // Type of the left-hand side scalar
1201  , typename MT // Type of the dense matrix of the right-hand side expression
1202  , typename ST2 // Type of the scalar of the right-hand side expression
1203  , bool SO // Storage order of the dense matrix
1204  , typename = EnableIf_< IsNumeric<ST1> > >
1205 inline decltype(auto) operator*( ST1 scalar, const DMatScalarMultExpr<MT,ST2,SO>& mat )
1206 {
1208 
1209  return mat.leftOperand() * ( scalar * mat.rightOperand() );
1210 }
1212 //*************************************************************************************************
1213 
1214 
1215 //*************************************************************************************************
1228 template< typename MT // Type of the dense matrix of the left-hand side expression
1229  , typename ST1 // Type of the scalar of the left-hand side expression
1230  , bool SO // Storage order of the dense matrix
1231  , typename ST2 // Type of the right-hand side scalar
1233 inline decltype(auto) operator/( const DMatScalarMultExpr<MT,ST1,SO>& mat, ST2 scalar )
1234 {
1236 
1237  return mat.leftOperand() * ( mat.rightOperand() / scalar );
1238 }
1240 //*************************************************************************************************
1241 
1242 
1243 //*************************************************************************************************
1257 template< typename MT // Type of the dense matrix of the left-hand side expression
1258  , typename ST // Type of the scalar of the left-hand side expression
1259  , bool SO // Storage order of the left-hand side expression
1260  , typename VT > // Type of the right-hand side dense vector
1261 inline decltype(auto)
1263 {
1265 
1266  return ( mat.leftOperand() * (~vec) ) * mat.rightOperand();
1267 }
1269 //*************************************************************************************************
1270 
1271 
1272 //*************************************************************************************************
1286 template< typename VT // Type of the left-hand side dense vector
1287  , typename MT // Type of the dense matrix of the right-hand side expression
1288  , typename ST // Type of the scalar of the right-hand side expression
1289  , bool SO > // Storage order of the right-hand side expression
1290 inline decltype(auto)
1292 {
1294 
1295  return ( (~vec) * mat.leftOperand() ) * mat.rightOperand();
1296 }
1298 //*************************************************************************************************
1299 
1300 
1301 //*************************************************************************************************
1317 template< typename MT // Type of the dense matrix of the left-hand side expression
1318  , typename ST1 // Type of the scalar of the left-hand side expression
1319  , bool SO // Storage order of the left-hand side expression
1320  , typename VT // Type of the dense vector of the right-hand side expression
1321  , typename ST2 > // Type of the scalar of the right-hand side expression
1322 inline decltype(auto)
1324 {
1326 
1327  return ( mat.leftOperand() * vec.leftOperand() ) * ( mat.rightOperand() * vec.rightOperand() );
1328 }
1330 //*************************************************************************************************
1331 
1332 
1333 //*************************************************************************************************
1349 template< typename VT // Type of the dense vector of the left-hand side expression
1350  , typename ST1 // Type of the scalar of the left-hand side expression
1351  , typename MT // Type of the dense matrix of the right-hand side expression
1352  , typename ST2 // Type of the scalar of the right-hand side expression
1353  , bool SO > // Storage order of the right-hand side expression
1354 inline decltype(auto)
1356 {
1358 
1359  return ( vec.leftOperand() * mat.leftOperand() ) * ( vec.rightOperand() * mat.rightOperand() );
1360 }
1362 //*************************************************************************************************
1363 
1364 
1365 //*************************************************************************************************
1379 template< typename MT // Type of the dense matrix of the left-hand side expression
1380  , typename ST // Type of the scalar of the left-hand side expression
1381  , bool SO // Storage order of the left-hand side expression
1382  , typename VT > // Type of the right-hand side sparse vector
1383 inline decltype(auto)
1385 {
1387 
1388  return ( mat.leftOperand() * (~vec) ) * mat.rightOperand();
1389 }
1391 //*************************************************************************************************
1392 
1393 
1394 //*************************************************************************************************
1408 template< typename VT // Type of the left-hand side sparse vector
1409  , typename MT // Type of the dense matrix of the right-hand side expression
1410  , typename ST // Type of the scalar of the right-hand side expression
1411  , bool SO > // Storage order of the right-hand side expression
1412 inline decltype(auto)
1414 {
1416 
1417  return ( (~vec) * mat.leftOperand() ) * mat.rightOperand();
1418 }
1420 //*************************************************************************************************
1421 
1422 
1423 //*************************************************************************************************
1439 template< typename MT // Type of the dense matrix of the left-hand side expression
1440  , typename ST1 // Type of the scalar of the left-hand side expression
1441  , bool SO // Storage order of the left-hand side expression
1442  , typename VT // Type of the sparse vector of the right-hand side expression
1443  , typename ST2 > // Type of the scalar of the right-hand side expression
1444 inline decltype(auto)
1446 {
1448 
1449  return ( mat.leftOperand() * vec.leftOperand() ) * ( mat.rightOperand() * vec.rightOperand() );
1450 }
1452 //*************************************************************************************************
1453 
1454 
1455 //*************************************************************************************************
1471 template< typename VT // Type of the sparse vector of the left-hand side expression
1472  , typename ST1 // Type of the scalar of the left-hand side expression
1473  , typename MT // Type of the dense matrix of the right-hand side expression
1474  , typename ST2 // Type of the scalar of the right-hand side expression
1475  , bool SO > // Storage order of the right-hand side expression
1476 inline decltype(auto)
1478 {
1480 
1481  return ( vec.leftOperand() * mat.leftOperand() ) * ( vec.rightOperand() * mat.rightOperand() );
1482 }
1484 //*************************************************************************************************
1485 
1486 
1487 //*************************************************************************************************
1501 template< typename MT1 // Type of the dense matrix of the left-hand side expression
1502  , typename ST // Type of the scalar of the left-hand side expression
1503  , bool SO1 // Storage order of the left-hand side expression
1504  , typename MT2 // Type of the right-hand side dense matrix
1505  , bool SO2 > // Storage order of the right-hand side dense matrix
1506 inline decltype(auto)
1508 {
1510 
1511  return ( lhs.leftOperand() * (~rhs) ) * lhs.rightOperand();
1512 }
1514 //*************************************************************************************************
1515 
1516 
1517 //*************************************************************************************************
1531 template< typename MT1 // Type of the left-hand side dense matrix
1532  , bool SO1 // Storage order of the left-hand side dense matrix
1533  , typename MT2 // Type of the dense matrix of the right-hand side expression
1534  , typename ST // Type of the scalar of the right-hand side expression
1535  , bool SO2 > // Storage order of the right-hand side expression
1536 inline decltype(auto)
1538 {
1540 
1541  return ( (~lhs) * rhs.leftOperand() ) * rhs.rightOperand();
1542 }
1544 //*************************************************************************************************
1545 
1546 
1547 //*************************************************************************************************
1561 template< typename MT1 // Type of the dense matrix of the left-hand side expression
1562  , typename ST1 // Type of the scalar of the left-hand side expression
1563  , bool SO1 // Storage order of the left-hand side expression
1564  , typename MT2 // Type of the right-hand side dense matrix
1565  , typename ST2 // Type of the scalar of the right-hand side expression
1566  , bool SO2 > // Storage order of the right-hand side expression
1567 inline decltype(auto)
1569 {
1571 
1572  return ( lhs.leftOperand() * rhs.leftOperand() ) * ( lhs.rightOperand() * rhs.rightOperand() );
1573 }
1575 //*************************************************************************************************
1576 
1577 
1578 //*************************************************************************************************
1592 template< typename MT1 // Type of the dense matrix of the left-hand side expression
1593  , typename ST // Type of the scalar of the left-hand side expression
1594  , bool SO1 // Storage order of the left-hand side expression
1595  , typename MT2 // Type of the right-hand side sparse matrix
1596  , bool SO2 > // Storage order of the right-hand side sparse matrix
1597 inline decltype(auto)
1599 {
1601 
1602  return ( lhs.leftOperand() * (~rhs) ) * lhs.rightOperand();
1603 }
1605 //*************************************************************************************************
1606 
1607 
1608 //*************************************************************************************************
1622 template< typename MT1 // Type of the left-hand side sparse matrix
1623  , bool SO1 // Storage order of the left-hand side sparse matrix
1624  , typename MT2 // Type of the dense matrix of the right-hand side expression
1625  , typename ST // Type of the scalar of the right-hand side expression
1626  , bool SO2 > // Storage order of the right-hand side expression
1627 inline decltype(auto)
1629 {
1631 
1632  return ( (~lhs) * rhs.leftOperand() ) * rhs.rightOperand();
1633 }
1635 //*************************************************************************************************
1636 
1637 
1638 //*************************************************************************************************
1653 template< typename MT1 // Type of the dense matrix of the left-hand side expression
1654  , typename ST1 // Type of the scalar of the left-hand side expression
1655  , bool SO1 // Storage order of the left-hand side expression
1656  , typename MT2 // Type of the sparse matrix of the right-hand side expression
1657  , typename ST2 // Type of the scalar of the right-hand side expression
1658  , bool SO2 > // Storage order of the right-hand side expression
1659 inline decltype(auto)
1661 {
1663 
1664  return ( mat.leftOperand() * vec.leftOperand() ) * ( mat.rightOperand() * vec.rightOperand() );
1665 }
1667 //*************************************************************************************************
1668 
1669 
1670 //*************************************************************************************************
1685 template< typename MT1 // Type of the sparse matrix of the left-hand side expression
1686  , typename ST1 // Type of the scalar of the left-hand side expression
1687  , bool SO1 // Storage order of the left-hand side expression
1688  , typename MT2 // Type of the dense matrix of the right-hand side expression
1689  , typename ST2 // Type of the scalar of the right-hand side expression
1690  , bool SO2 > // Storage order of the right-hand side expression
1691 inline decltype(auto)
1693 {
1695 
1696  return ( mat.leftOperand() * vec.leftOperand() ) * ( mat.rightOperand() * vec.rightOperand() );
1697 }
1699 //*************************************************************************************************
1700 
1701 
1702 
1703 
1704 //=================================================================================================
1705 //
1706 // ROWS SPECIALIZATIONS
1707 //
1708 //=================================================================================================
1709 
1710 //*************************************************************************************************
1712 template< typename MT, typename ST, bool SO >
1713 struct Rows< DMatScalarMultExpr<MT,ST,SO> >
1714  : public Rows<MT>
1715 {};
1717 //*************************************************************************************************
1718 
1719 
1720 
1721 
1722 //=================================================================================================
1723 //
1724 // COLUMNS SPECIALIZATIONS
1725 //
1726 //=================================================================================================
1727 
1728 //*************************************************************************************************
1730 template< typename MT, typename ST, bool SO >
1731 struct Columns< DMatScalarMultExpr<MT,ST,SO> >
1732  : public Columns<MT>
1733 {};
1735 //*************************************************************************************************
1736 
1737 
1738 
1739 
1740 //=================================================================================================
1741 //
1742 // ISALIGNED SPECIALIZATIONS
1743 //
1744 //=================================================================================================
1745 
1746 //*************************************************************************************************
1748 template< typename MT, typename ST, bool SO >
1749 struct IsAligned< DMatScalarMultExpr<MT,ST,SO> >
1750  : public BoolConstant< IsAligned<MT>::value >
1751 {};
1753 //*************************************************************************************************
1754 
1755 
1756 
1757 
1758 //=================================================================================================
1759 //
1760 // ISPADDED SPECIALIZATIONS
1761 //
1762 //=================================================================================================
1763 
1764 //*************************************************************************************************
1766 template< typename MT, typename ST, bool SO >
1767 struct IsPadded< DMatScalarMultExpr<MT,ST,SO> >
1768  : public BoolConstant< IsPadded<MT>::value >
1769 {};
1771 //*************************************************************************************************
1772 
1773 
1774 
1775 
1776 //=================================================================================================
1777 //
1778 // ISSYMMETRIC SPECIALIZATIONS
1779 //
1780 //=================================================================================================
1781 
1782 //*************************************************************************************************
1784 template< typename MT, typename ST, bool SO >
1785 struct IsSymmetric< DMatScalarMultExpr<MT,ST,SO> >
1786  : public BoolConstant< IsSymmetric<MT>::value >
1787 {};
1789 //*************************************************************************************************
1790 
1791 
1792 
1793 
1794 //=================================================================================================
1795 //
1796 // ISHERMITIAN SPECIALIZATIONS
1797 //
1798 //=================================================================================================
1799 
1800 //*************************************************************************************************
1802 template< typename MT, typename ST, bool SO >
1803 struct IsHermitian< DMatScalarMultExpr<MT,ST,SO> >
1804  : public BoolConstant< IsHermitian<MT>::value >
1805 {};
1807 //*************************************************************************************************
1808 
1809 
1810 
1811 
1812 //=================================================================================================
1813 //
1814 // ISLOWER SPECIALIZATIONS
1815 //
1816 //=================================================================================================
1817 
1818 //*************************************************************************************************
1820 template< typename MT, typename ST, bool SO >
1821 struct IsLower< DMatScalarMultExpr<MT,ST,SO> >
1822  : public BoolConstant< IsLower<MT>::value >
1823 {};
1825 //*************************************************************************************************
1826 
1827 
1828 
1829 
1830 //=================================================================================================
1831 //
1832 // ISSTRICTLYLOWER SPECIALIZATIONS
1833 //
1834 //=================================================================================================
1835 
1836 //*************************************************************************************************
1838 template< typename MT, typename ST, bool SO >
1839 struct IsStrictlyLower< DMatScalarMultExpr<MT,ST,SO> >
1840  : public BoolConstant< IsStrictlyLower<MT>::value >
1841 {};
1843 //*************************************************************************************************
1844 
1845 
1846 
1847 
1848 //=================================================================================================
1849 //
1850 // ISUPPER SPECIALIZATIONS
1851 //
1852 //=================================================================================================
1853 
1854 //*************************************************************************************************
1856 template< typename MT, typename ST, bool SO >
1857 struct IsUpper< DMatScalarMultExpr<MT,ST,SO> >
1858  : public BoolConstant< IsUpper<MT>::value >
1859 {};
1861 //*************************************************************************************************
1862 
1863 
1864 
1865 
1866 //=================================================================================================
1867 //
1868 // ISSTRICTLYUPPER SPECIALIZATIONS
1869 //
1870 //=================================================================================================
1871 
1872 //*************************************************************************************************
1874 template< typename MT, typename ST, bool SO >
1875 struct IsStrictlyUpper< DMatScalarMultExpr<MT,ST,SO> >
1876  : public BoolConstant< IsStrictlyUpper<MT>::value >
1877 {};
1879 //*************************************************************************************************
1880 
1881 } // namespace blaze
1882 
1883 #endif
RightOperand rightOperand() const noexcept
Returns the right-hand side scalar operand.
Definition: SVecScalarMultExpr.h:438
Pointer difference type of the Blaze library.
LeftOperand leftOperand() const noexcept
Returns the left-hand side dense vector operand.
Definition: DVecScalarMultExpr.h:531
Header file for auxiliary alias declarations.
Data type constraint.
Compile time check whether the given type is a computational expression template.This type trait clas...
Definition: IsComputation.h:72
Compile time check for numeric types.This type trait tests whether or not the given template paramete...
Definition: IsNumeric.h:79
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:70
RightOperand scalar_
Scalar of the multiplication expression.
Definition: DMatScalarMultExpr.h:428
Header file for the Rows type trait.
EnableIf_< IsDenseMatrix< MT1 > > smpSchurAssign(Matrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs)
Default implementation of the SMP Schur product assignment of a matrix to dense matrix.
Definition: DenseMatrix.h:196
RightOperand rightOperand() const noexcept
Returns the right-hand side scalar operand.
Definition: SMatScalarMultExpr.h:478
Header file for basic type definitions.
MultExprTrait_< RN, ST > ExprReturnType
Expression return type for the subscript operator.
Definition: DMatScalarMultExpr.h:132
OppositeType_< ResultType > OppositeType
Result type with opposite storage order for expression template evaluations.
Definition: DMatScalarMultExpr.h:173
RightOperand rightOperand() const noexcept
Returns the right-hand side scalar operand.
Definition: DVecScalarMultExpr.h:541
decltype(auto) operator/(const DenseMatrix< MT, SO > &mat, ST scalar)
Division operator for the division of a dense matrix by a scalar value ( ).
Definition: DMatScalarDivExpr.h:1073
ElementType * PointerType
Pointer return type.
Definition: DMatScalarMultExpr.h:199
EnableIf_< IsDenseMatrix< MT1 > > smpSubAssign(Matrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs)
Default implementation of the SMP subtraction assignment of a matrix to dense matrix.
Definition: DenseMatrix.h:164
ConstIterator & operator++()
Pre-increment operator.
Definition: DMatScalarMultExpr.h:255
const ConstIterator operator--(int)
Post-decrement operator.
Definition: DMatScalarMultExpr.h:287
Header file for the serial shim.
#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:63
size_t columns() const noexcept
Returns the current number of columns of the matrix.
Definition: DMatScalarMultExpr.h:547
Generic wrapper for a compile time constant integral value.The IntegralConstant class template repres...
Definition: IntegralConstant.h:71
#define BLAZE_CONSTRAINT_MUST_BE_DENSE_MATRIX_TYPE(T)
Constraint on the data type.In case the given data type T is not a dense, N-dimensional matrix type...
Definition: DenseMatrix.h:61
bool operator>(const ConstIterator &rhs) const
Greater-than comparison between two ConstIterator objects.
Definition: DMatScalarMultExpr.h:351
Availability of a SIMD multiplication for the given data types.Depending on the available instruction...
Definition: HasSIMDMult.h:172
RightOperand scalar_
Right-hand side scalar of the multiplication expression.
Definition: DMatScalarMultExpr.h:620
LeftOperand leftOperand() const noexcept
Returns the left-hand side sparse matrix operand.
Definition: SMatScalarMultExpr.h:468
size_t rows() const noexcept
Returns the current number of rows of the matrix.
Definition: DMatScalarMultExpr.h:537
Base class for all matrix/scalar multiplication expression templates.The MatScalarMultExpr class serv...
Definition: MatScalarMultExpr.h:67
Header file for the And class template.
Header file for the DenseVector base class.
Compile time check for lower triangular matrices.This type trait tests whether or not the given templ...
Definition: IsLower.h:88
bool canSMPAssign() const noexcept
Returns whether the expression can be used in SMP assignments.
Definition: DMatScalarMultExpr.h:611
ReferenceType reference
Reference return type.
Definition: DMatScalarMultExpr.h:207
typename MultTrait< T1, T2 >::Type MultTrait_
Auxiliary alias declaration for the MultTrait class template.The MultTrait_ alias declaration provide...
Definition: MultTrait.h:250
Header file for the Computation base class.
ReturnType operator*() const
Direct access to the element at the current iterator position.
Definition: DMatScalarMultExpr.h:297
Header file for the UnderlyingElement type trait.
Compile time check for upper triangular matrices.This type trait tests whether or not the given templ...
Definition: IsUpper.h:88
const DenseIterator< Type, AF > operator-(const DenseIterator< Type, AF > &it, ptrdiff_t inc) noexcept
Subtraction between a DenseIterator and an integral value.
Definition: DenseIterator.h:731
Header file for the RequiresEvaluation type trait.
typename T::ResultType ResultType_
Alias declaration for nested ResultType type definitions.The ResultType_ alias declaration provides a...
Definition: Aliases.h:343
EnableIf_< IsDenseMatrix< MT1 > > smpAddAssign(Matrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs)
Default implementation of the SMP addition assignment of a matrix to a dense matrix.
Definition: DenseMatrix.h:133
const IfTrue_< returnExpr, ExprReturnType, ElementType > ReturnType
Return type for expression template evaluations.
Definition: DMatScalarMultExpr.h:178
auto load() const noexcept
Access to the SIMD elements of the matrix.
Definition: DMatScalarMultExpr.h:307
typename UnderlyingBuiltin< T >::Type UnderlyingBuiltin_
Auxiliary alias declaration for the UnderlyingBuiltin type trait.The UnderlyingBuiltin_ alias declara...
Definition: UnderlyingBuiltin.h:133
Base class for dense matrices.The DenseMatrix class is a base class for all dense matrix classes...
Definition: DenseMatrix.h:78
Base class for sparse matrices.The SparseMatrix class is a base class for all sparse matrix classes...
Definition: Forward.h:129
typename IfTrue< Condition, T1, T2 >::Type IfTrue_
Auxiliary alias declaration for the IfTrue class template.The IfTrue_ alias declaration provides a co...
Definition: If.h:109
typename T::ReturnType ReturnType_
Alias declaration for nested ReturnType type definitions.The ReturnType_ alias declaration provides a...
Definition: Aliases.h:363
std::random_access_iterator_tag IteratorCategory
The iterator category.
Definition: DMatScalarMultExpr.h:197
Compile time check for the alignment of data types.This type trait tests whether the given data type ...
Definition: IsAligned.h:87
Constraint on the data type.
typename MultExprTrait< T1, T2 >::Type MultExprTrait_
Auxiliary alias declaration for the MultExprTrait class template.The MultExprTrait_ alias declaration...
Definition: MultExprTrait.h:112
Header file for the MultExprTrait class template.
Compile time check to query the requirement to evaluate an expression.Via this type trait it is possi...
Definition: RequiresEvaluation.h:72
typename T::CompositeType CompositeType_
Alias declaration for nested CompositeType type definitions.The CompositeType_ alias declaration prov...
Definition: Aliases.h:83
bool canAlias(const T *alias) const noexcept
Returns whether the expression can alias with the given address alias.
Definition: DMatScalarMultExpr.h:579
Header file for the IsTemporary type trait class.
Header file for the multiplication trait.
Header file for the IsStrictlyUpper type trait.
Header file for the IsSymmetric type trait.
Namespace of the Blaze C++ math library.
Definition: Blaze.h:57
#define BLAZE_ALWAYS_INLINE
Platform dependent setup of an enforced inline keyword.
Definition: Inline.h:85
Header file for the If class template.
Header file for the UnderlyingBuiltin type trait.
Compile time check for data types with padding.This type trait tests whether the given data type empl...
Definition: IsPadded.h:76
EnableIf_< IsDenseMatrix< MT1 > > smpAssign(Matrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs)
Default implementation of the SMP assignment of a matrix to a dense matrix.
Definition: DenseMatrix.h:102
Header file for the Or class template.
Expression object for dense matrix-scalar multiplications.The DMatScalarMultExpr class represents the...
Definition: DMatScalarMultExpr.h:110
ConstIterator & operator+=(size_t inc)
Addition assignment operator.
Definition: DMatScalarMultExpr.h:232
#define BLAZE_THROW_OUT_OF_RANGE(MESSAGE)
Macro for the emission of a std::out_of_range exception.This macro encapsulates the default way of Bl...
Definition: Exception.h:331
IteratorType iterator_
Iterator to the current element.
Definition: DMatScalarMultExpr.h:427
Header file for the DenseMatrix base class.
Header file for the Columns type trait.
const Element * ConstIterator
Iterator over constant elements.
Definition: CompressedMatrix.h:3087
typename T::ElementType ElementType_
Alias declaration for nested ElementType type definitions.The ElementType_ alias declaration provides...
Definition: Aliases.h:163
Header file for all SIMD functionality.
bool operator==(const ConstIterator &rhs) const
Equality comparison between two ConstIterator objects.
Definition: DMatScalarMultExpr.h:318
Base class for N-dimensional dense vectors.The DenseVector class is a base class for all arbitrarily ...
Definition: DenseVector.h:70
ValueType value_type
Type of the underlying elements.
Definition: DMatScalarMultExpr.h:205
#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:71
Header file for the IsLower type trait.
Header file for the IsAligned type trait.
RightOperand rightOperand() const noexcept
Returns the right-hand side scalar operand.
Definition: DMatScalarMultExpr.h:567
ElementType_< ResultType > ElementType
Resulting element type.
Definition: DMatScalarMultExpr.h:175
BLAZE_ALWAYS_INLINE auto load(size_t i, size_t j) const noexcept
Access to the SIMD elements of the matrix.
Definition: DMatScalarMultExpr.h:501
Constraints on the storage order of matrix types.
Compile time check for symmetric matrices.This type trait tests whether or not the given template par...
Definition: IsSymmetric.h:85
Header file for the exception macros of the math module.
bool operator<=(const ConstIterator &rhs) const
Less-than comparison between two ConstIterator objects.
Definition: DMatScalarMultExpr.h:362
Compile time check for strictly upper triangular matrices.This type trait tests whether or not the gi...
Definition: IsStrictlyUpper.h:86
LeftOperand matrix_
Left-hand side dense matrix of the multiplication expression.
Definition: DMatScalarMultExpr.h:619
decltype(auto) operator*(const DenseMatrix< MT1, false > &lhs, const DenseMatrix< MT2, false > &rhs)
Multiplication operator for the multiplication of two row-major dense matrices ( ).
Definition: DMatDMatMultExpr.h:8893
Constraint on the data type.
Expression object for sparse matrix-scalar multiplications.The SMatScalarMult class represents the co...
Definition: Forward.h:114
Header file for all forward declarations for expression class templates.
DifferenceType operator-(const ConstIterator &rhs) const
Calculating the number of elements between two iterators.
Definition: DMatScalarMultExpr.h:384
ConstIterator_< MT > IteratorType
ConstIterator type of the dense matrix expression.
Definition: DMatScalarMultExpr.h:211
Header file for the EnableIf class template.
Header file for the IsStrictlyLower type trait.
friend const ConstIterator operator-(const ConstIterator &it, size_t dec)
Subtraction between a ConstIterator and an integral value.
Definition: DMatScalarMultExpr.h:420
Header file for the IsPadded type trait.
ResultType_< MT > RT
Result type of the dense matrix expression.
Definition: DMatScalarMultExpr.h:116
PointerType pointer
Pointer return type.
Definition: DMatScalarMultExpr.h:206
ConstIterator(IteratorType iterator, RightOperand scalar)
Constructor for the ConstIterator class.
Definition: DMatScalarMultExpr.h:220
friend const ConstIterator operator+(size_t inc, const ConstIterator &it)
Addition between an integral value and a ConstIterator.
Definition: DMatScalarMultExpr.h:408
ReturnType at(size_t i, size_t j) const
Checked access to the matrix elements.
Definition: DMatScalarMultExpr.h:483
Header file for the IsNumeric type trait.
Header file for the HasSIMDMult type trait.
Header file for the MatScalarMultExpr base class.
ST RightOperand
Composite type of the right-hand side scalar value.
Definition: DMatScalarMultExpr.h:187
ElementType & ReferenceType
Reference return type.
Definition: DMatScalarMultExpr.h:200
Header file for run time assertion macros.
Utility type for generic codes.
TransposeType_< ResultType > TransposeType
Transpose type for expression template evaluations.
Definition: DMatScalarMultExpr.h:174
typename If< T1, T2, T3 >::Type If_
Auxiliary alias declaration for the If class template.The If_ alias declaration provides a convenient...
Definition: If.h:154
ConstIterator & operator-=(size_t dec)
Subtraction assignment operator.
Definition: DMatScalarMultExpr.h:244
#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:61
SIMD characteristics of data types.The SIMDTrait class template provides the SIMD characteristics of ...
Definition: SIMDTrait.h:296
#define BLAZE_FUNCTION_TRACE
Function trace macro.This macro can be used to reliably trace function calls. In case function tracin...
Definition: FunctionTrace.h:94
IfTrue_< useAssign, const ResultType, const DMatScalarMultExpr &> CompositeType
Data type for composite expression templates.
Definition: DMatScalarMultExpr.h:181
ConstIterator begin(size_t i) const
Returns an iterator to the first non-zero element of row i.
Definition: DMatScalarMultExpr.h:516
Compile time check for Hermitian matrices.This type trait tests whether or not the given template par...
Definition: IsHermitian.h:85
Compile time check for data types.This type trait tests whether or not the given template parameter i...
Definition: IsInvertible.h:83
decltype(auto) serial(const DenseMatrix< MT, SO > &dm)
Forces the serial evaluation of the given dense matrix expression dm.
Definition: DMatSerialExpr.h:819
#define BLAZE_CONSTRAINT_MUST_NOT_REQUIRE_EVALUATION(T)
Constraint on the data type.In case the given data type T requires an intermediate evaluation within ...
Definition: RequiresEvaluation.h:81
ConstIterator end(size_t i) const
Returns an iterator just past the last non-zero element of row i.
Definition: DMatScalarMultExpr.h:527
const ConstIterator operator++(int)
Post-increment operator.
Definition: DMatScalarMultExpr.h:266
ElementType ValueType
Type of the underlying elements.
Definition: DMatScalarMultExpr.h:198
bool isAliased(const T *alias) const noexcept
Returns whether the expression is aliased with the given address alias.
Definition: DMatScalarMultExpr.h:591
friend const ConstIterator operator+(const ConstIterator &it, size_t inc)
Addition between a ConstIterator and an integral value.
Definition: DMatScalarMultExpr.h:396
Header file for the IsInvertible type trait.
typename EnableIf< Condition, T >::Type EnableIf_
Auxiliary alias declaration for the EnableIf class template.The EnableIf_ alias declaration provides ...
Definition: EnableIf.h:224
typename T::OppositeType OppositeType_
Alias declaration for nested OppositeType type definitions.The OppositeType_ alias declaration provid...
Definition: Aliases.h:263
bool operator>=(const ConstIterator &rhs) const
Greater-than comparison between two ConstIterator objects.
Definition: DMatScalarMultExpr.h:373
Compile time check for strictly lower triangular matrices.This type trait tests whether or not the gi...
Definition: IsStrictlyLower.h:86
MultTrait_< RT, ST > ResultType
Result type for expression template evaluations.
Definition: DMatScalarMultExpr.h:172
ConstIterator & operator--()
Pre-decrement operator.
Definition: DMatScalarMultExpr.h:276
const Type & ReturnType
Return type for expression template evaluations.
Definition: CompressedMatrix.h:3082
typename T::ConstIterator ConstIterator_
Alias declaration for nested ConstIterator type definitions.The ConstIterator_ alias declaration prov...
Definition: Aliases.h:103
Header file for the IsComputation type trait class.
Expression object for dense vector-scalar multiplications.The DVecScalarMultExpr class represents the...
Definition: DVecScalarMultExpr.h:106
Expression object for sparse vector-scalar multiplications.The SVecScalarMultExpr class represents th...
Definition: Forward.h:139
Base class for all compute expression templates.The Computation class serves as a tag for all computa...
Definition: Computation.h:66
ReturnType operator()(size_t i, size_t j) const
2D-access to the matrix elements.
Definition: DMatScalarMultExpr.h:468
Compile time logical or evaluation.The Or alias declaration performs at compile time a logical or (&#39;&&&#3...
Definition: Or.h:76
DMatScalarMultExpr(const MT &matrix, ST scalar) noexcept
Constructor for the DMatScalarMultExpr class.
Definition: DMatScalarMultExpr.h:455
CompositeType_< MT > CT
Composite type of the dense matrix expression.
Definition: DMatScalarMultExpr.h:119
Base class for sparse vectors.The SparseVector class is a base class for all arbitrarily sized (N-dim...
Definition: Forward.h:130
Header file for the IntegralConstant class template.
Compile time evaluation of the number of columns of a matrix.The Columns type trait evaluates the num...
Definition: Columns.h:75
Compile time evaluation of the number of rows of a matrix.The Rows type trait evaluates the number of...
Definition: Rows.h:75
Iterator over the elements of the dense matrix.
Definition: DMatScalarMultExpr.h:193
bool operator<(const ConstIterator &rhs) const
Less-than comparison between two ConstIterator objects.
Definition: DMatScalarMultExpr.h:340
bool isAligned() const noexcept
Returns whether the operands of the expression are properly aligned in memory.
Definition: DMatScalarMultExpr.h:601
typename T::TransposeType TransposeType_
Alias declaration for nested TransposeType type definitions.The TransposeType_ alias declaration prov...
Definition: Aliases.h:423
Header file for the IsUpper type trait.
bool operator!=(const ConstIterator &rhs) const
Inequality comparison between two ConstIterator objects.
Definition: DMatScalarMultExpr.h:329
Header file for the IsHermitian type trait.
LeftOperand leftOperand() const noexcept
Returns the left-hand side dense matrix operand.
Definition: DMatScalarMultExpr.h:557
System settings for the inline keywords.
Header file for the thresholds for matrix/vector and matrix/matrix multiplications.
#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
ReturnType_< MT > RN
Return type of the dense matrix expression.
Definition: DMatScalarMultExpr.h:117
LeftOperand leftOperand() const noexcept
Returns the left-hand side sparse vector operand.
Definition: SVecScalarMultExpr.h:428
If_< IsExpression< MT >, const MT, const MT &> LeftOperand
Composite type of the left-hand side dense matrix expression.
Definition: DMatScalarMultExpr.h:184
Compile time check whether the given type is an expression template.This type trait class tests wheth...
Definition: IsExpression.h:95
IteratorCategory iterator_category
The iterator category.
Definition: DMatScalarMultExpr.h:204
Header file for the IsExpression type trait class.
ElementType_< MT > ET
Element type of the dense matrix expression.
Definition: DMatScalarMultExpr.h:118
Header file for the function trace functionality.