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 <utility>
45 #include <blaze/math/Aliases.h>
49 #include <blaze/math/Exception.h>
56 #include <blaze/math/SIMD.h>
68 #include <blaze/system/Inline.h>
70 #include <blaze/util/Assert.h>
73 #include <blaze/util/EnableIf.h>
75 #include <blaze/util/mpl/If.h>
76 #include <blaze/util/Types.h>
78 
79 
80 namespace blaze {
81 
82 //=================================================================================================
83 //
84 // CLASS DMATSCALARMULTEXPR
85 //
86 //=================================================================================================
87 
88 //*************************************************************************************************
95 template< typename MT // Type of the left-hand side dense matrix
96  , typename ST // Type of the right-hand side scalar value
97  , bool SO > // Storage order
99  : public MatScalarMultExpr< DenseMatrix< DMatScalarMultExpr<MT,ST,SO>, SO > >
100  , private Computation
101 {
102  private:
103  //**Type definitions****************************************************************************
108  //**********************************************************************************************
109 
110  //**Return type evaluation**********************************************************************
112 
117  static constexpr bool returnExpr = !IsTemporary_v<RN>;
118 
120  using ExprReturnType = decltype( std::declval<RN>() * std::declval<ST>() );
121  //**********************************************************************************************
122 
123  //**Serial evaluation strategy******************************************************************
125 
131  static constexpr bool useAssign = ( IsComputation_v<MT> && RequiresEvaluation_v<MT> );
132 
134  template< typename MT2 >
136  static constexpr bool UseAssign_v = useAssign;
138  //**********************************************************************************************
139 
140  //**Parallel evaluation strategy****************************************************************
142 
148  template< typename MT2 >
149  static constexpr bool UseSMPAssign_v =
152  //**********************************************************************************************
153 
154  public:
155  //**Type definitions****************************************************************************
162 
165 
168 
170  using LeftOperand = If_t< IsExpression_v<MT>, const MT, const MT& >;
171 
173  using RightOperand = ST;
174  //**********************************************************************************************
175 
176  //**ConstIterator class definition**************************************************************
180  {
181  public:
182  //**Type definitions*************************************************************************
183  using IteratorCategory = std::random_access_iterator_tag;
188 
189  // STL iterator requirements
195 
198  //*******************************************************************************************
199 
200  //**Constructor******************************************************************************
206  explicit inline ConstIterator( IteratorType iterator, RightOperand scalar )
207  : iterator_( iterator ) // Iterator to the current element
208  , scalar_ ( scalar ) // Scalar of the multiplication expression
209  {}
210  //*******************************************************************************************
211 
212  //**Addition assignment operator*************************************************************
218  inline ConstIterator& operator+=( size_t inc ) {
219  iterator_ += inc;
220  return *this;
221  }
222  //*******************************************************************************************
223 
224  //**Subtraction assignment operator**********************************************************
230  inline ConstIterator& operator-=( size_t dec ) {
231  iterator_ -= dec;
232  return *this;
233  }
234  //*******************************************************************************************
235 
236  //**Prefix increment operator****************************************************************
242  ++iterator_;
243  return *this;
244  }
245  //*******************************************************************************************
246 
247  //**Postfix increment operator***************************************************************
252  inline const ConstIterator operator++( int ) {
253  return ConstIterator( iterator_++ );
254  }
255  //*******************************************************************************************
256 
257  //**Prefix decrement operator****************************************************************
263  --iterator_;
264  return *this;
265  }
266  //*******************************************************************************************
267 
268  //**Postfix decrement operator***************************************************************
273  inline const ConstIterator operator--( int ) {
274  return ConstIterator( iterator_-- );
275  }
276  //*******************************************************************************************
277 
278  //**Element access operator******************************************************************
283  inline ReturnType operator*() const {
284  return *iterator_ * scalar_;
285  }
286  //*******************************************************************************************
287 
288  //**Load function****************************************************************************
293  inline auto load() const noexcept {
294  return iterator_.load() * set( scalar_ );
295  }
296  //*******************************************************************************************
297 
298  //**Equality operator************************************************************************
304  inline bool operator==( const ConstIterator& rhs ) const {
305  return iterator_ == rhs.iterator_;
306  }
307  //*******************************************************************************************
308 
309  //**Inequality operator**********************************************************************
315  inline bool operator!=( const ConstIterator& rhs ) const {
316  return iterator_ != rhs.iterator_;
317  }
318  //*******************************************************************************************
319 
320  //**Less-than operator***********************************************************************
326  inline bool operator<( const ConstIterator& rhs ) const {
327  return iterator_ < rhs.iterator_;
328  }
329  //*******************************************************************************************
330 
331  //**Greater-than operator********************************************************************
337  inline bool operator>( const ConstIterator& rhs ) const {
338  return iterator_ > rhs.iterator_;
339  }
340  //*******************************************************************************************
341 
342  //**Less-or-equal-than operator**************************************************************
348  inline bool operator<=( const ConstIterator& rhs ) const {
349  return iterator_ <= rhs.iterator_;
350  }
351  //*******************************************************************************************
352 
353  //**Greater-or-equal-than operator***********************************************************
359  inline bool operator>=( const ConstIterator& rhs ) const {
360  return iterator_ >= rhs.iterator_;
361  }
362  //*******************************************************************************************
363 
364  //**Subtraction operator*********************************************************************
370  inline DifferenceType operator-( const ConstIterator& rhs ) const {
371  return iterator_ - rhs.iterator_;
372  }
373  //*******************************************************************************************
374 
375  //**Addition operator************************************************************************
382  friend inline const ConstIterator operator+( const ConstIterator& it, size_t inc ) {
383  return ConstIterator( it.iterator_ + inc, it.scalar_ );
384  }
385  //*******************************************************************************************
386 
387  //**Addition operator************************************************************************
394  friend inline const ConstIterator operator+( size_t inc, const ConstIterator& it ) {
395  return ConstIterator( it.iterator_ + inc, it.scalar_ );
396  }
397  //*******************************************************************************************
398 
399  //**Subtraction operator*********************************************************************
406  friend inline const ConstIterator operator-( const ConstIterator& it, size_t dec ) {
407  return ConstIterator( it.iterator_ - dec, it.scalar_ );
408  }
409  //*******************************************************************************************
410 
411  private:
412  //**Member variables*************************************************************************
415  //*******************************************************************************************
416  };
417  //**********************************************************************************************
418 
419  //**Compilation flags***************************************************************************
421  static constexpr bool simdEnabled =
422  ( MT::simdEnabled && IsNumeric_v<ET> &&
423  ( HasSIMDMult_v<ET,ST> || HasSIMDMult_v<UnderlyingElement_t<ET>,ST> ) );
424 
426  static constexpr bool smpAssignable = MT::smpAssignable;
427  //**********************************************************************************************
428 
429  //**SIMD properties*****************************************************************************
431  static constexpr size_t SIMDSIZE = SIMDTrait<ElementType>::size;
432  //**********************************************************************************************
433 
434  //**Constructor*********************************************************************************
440  explicit inline DMatScalarMultExpr( const MT& matrix, ST scalar ) noexcept
441  : matrix_( matrix ) // Left-hand side dense matrix of the multiplication expression
442  , scalar_( scalar ) // Right-hand side scalar of the multiplication expression
443  {}
444  //**********************************************************************************************
445 
446  //**Access operator*****************************************************************************
453  inline ReturnType operator()( size_t i, size_t j ) const {
454  BLAZE_INTERNAL_ASSERT( i < matrix_.rows() , "Invalid row access index" );
455  BLAZE_INTERNAL_ASSERT( j < matrix_.columns(), "Invalid column access index" );
456  return matrix_(i,j) * scalar_;
457  }
458  //**********************************************************************************************
459 
460  //**At function*********************************************************************************
468  inline ReturnType at( size_t i, size_t j ) const {
469  if( i >= matrix_.rows() ) {
470  BLAZE_THROW_OUT_OF_RANGE( "Invalid row access index" );
471  }
472  if( j >= matrix_.columns() ) {
473  BLAZE_THROW_OUT_OF_RANGE( "Invalid column access index" );
474  }
475  return (*this)(i,j);
476  }
477  //**********************************************************************************************
478 
479  //**Load function*******************************************************************************
486  BLAZE_ALWAYS_INLINE auto load( size_t i, size_t j ) const noexcept {
487  BLAZE_INTERNAL_ASSERT( i < matrix_.rows() , "Invalid row access index" );
488  BLAZE_INTERNAL_ASSERT( j < matrix_.columns(), "Invalid column access index" );
489  BLAZE_INTERNAL_ASSERT( !SO || ( i % SIMDSIZE == 0UL ), "Invalid row access index" );
490  BLAZE_INTERNAL_ASSERT( SO || ( j % SIMDSIZE == 0UL ), "Invalid column access index" );
491  return matrix_.load(i,j) * set( scalar_ );
492  }
493  //**********************************************************************************************
494 
495  //**Begin function******************************************************************************
501  inline ConstIterator begin( size_t i ) const {
502  return ConstIterator( matrix_.begin(i), scalar_ );
503  }
504  //**********************************************************************************************
505 
506  //**End function********************************************************************************
512  inline ConstIterator end( size_t i ) const {
513  return ConstIterator( matrix_.end(i), scalar_ );
514  }
515  //**********************************************************************************************
516 
517  //**Rows function*******************************************************************************
522  inline size_t rows() const noexcept {
523  return matrix_.rows();
524  }
525  //**********************************************************************************************
526 
527  //**Columns function****************************************************************************
532  inline size_t columns() const noexcept {
533  return matrix_.columns();
534  }
535  //**********************************************************************************************
536 
537  //**Left operand access*************************************************************************
542  inline LeftOperand leftOperand() const noexcept {
543  return matrix_;
544  }
545  //**********************************************************************************************
546 
547  //**Right operand access************************************************************************
552  inline RightOperand rightOperand() const noexcept {
553  return scalar_;
554  }
555  //**********************************************************************************************
556 
557  //**********************************************************************************************
563  template< typename T >
564  inline bool canAlias( const T* alias ) const noexcept {
565  return IsExpression_v<MT> && matrix_.canAlias( alias );
566  }
567  //**********************************************************************************************
568 
569  //**********************************************************************************************
575  template< typename T >
576  inline bool isAliased( const T* alias ) const noexcept {
577  return matrix_.isAliased( alias );
578  }
579  //**********************************************************************************************
580 
581  //**********************************************************************************************
586  inline bool isAligned() const noexcept {
587  return matrix_.isAligned();
588  }
589  //**********************************************************************************************
590 
591  //**********************************************************************************************
596  inline bool canSMPAssign() const noexcept {
597  return matrix_.canSMPAssign() ||
598  ( rows() * columns() >= SMP_DMATSCALARMULT_THRESHOLD );
599  }
600  //**********************************************************************************************
601 
602  private:
603  //**Member variables****************************************************************************
606  //**********************************************************************************************
607 
608  //**Assignment to dense matrices****************************************************************
622  template< typename MT2 // Type of the target dense matrix
623  , bool SO2 > // Storage order of the target dense matrix
624  friend inline auto assign( DenseMatrix<MT2,SO2>& lhs, const DMatScalarMultExpr& rhs )
626  {
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  assign( ~lhs, rhs.matrix_ );
633  assign( ~lhs, (~lhs) * rhs.scalar_ );
634  }
636  //**********************************************************************************************
637 
638  //**Assignment to sparse matrices***************************************************************
652  template< typename MT2 // Type of the target sparse matrix
653  , bool SO2 > // Storage order of the target sparse matrix
654  friend inline auto assign( SparseMatrix<MT2,SO2>& lhs, const DMatScalarMultExpr& rhs )
656  {
658 
659  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
660  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
661 
662  assign( ~lhs, rhs.matrix_ );
663  (~lhs) *= rhs.scalar_;
664  }
666  //**********************************************************************************************
667 
668  //**Addition assignment to dense matrices*******************************************************
682  template< typename MT2 // Type of the target dense matrix
683  , bool SO2 > // Storage order of the target dense matrix
684  friend inline auto addAssign( DenseMatrix<MT2,SO2>& lhs, const DMatScalarMultExpr& rhs )
685  -> EnableIf_t< UseAssign_v<MT2> >
686  {
688 
692 
693  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
694  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
695 
696  const ResultType tmp( serial( rhs ) );
697  addAssign( ~lhs, tmp );
698  }
700  //**********************************************************************************************
701 
702  //**Addition assignment to sparse matrices******************************************************
703  // No special implementation for the addition assignment to sparse matrices.
704  //**********************************************************************************************
705 
706  //**Subtraction assignment to dense matrices****************************************************
720  template< typename MT2 // Type of the target dense matrix
721  , bool SO2 > // Storage order of the target dense matrix
722  friend inline auto subAssign( DenseMatrix<MT2,SO2>& lhs, const DMatScalarMultExpr& rhs )
723  -> EnableIf_t< UseAssign_v<MT2> >
724  {
726 
730 
731  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
732  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
733 
734  const ResultType tmp( serial( rhs ) );
735  subAssign( ~lhs, tmp );
736  }
738  //**********************************************************************************************
739 
740  //**Subtraction assignment to sparse matrices***************************************************
741  // No special implementation for the subtraction assignment to sparse matrices.
742  //**********************************************************************************************
743 
744  //**Schur product assignment to dense matrices**************************************************
758  template< typename MT2 // Type of the target dense matrix
759  , bool SO2 > // Storage order of the target dense matrix
760  friend inline auto schurAssign( DenseMatrix<MT2,SO2>& lhs, const DMatScalarMultExpr& rhs )
761  -> EnableIf_t< UseAssign_v<MT2> >
762  {
764 
768 
769  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
770  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
771 
772  const ResultType tmp( serial( rhs ) );
773  schurAssign( ~lhs, tmp );
774  }
776  //**********************************************************************************************
777 
778  //**Schur product assignment to sparse matrices*************************************************
779  // No special implementation for the Schur product assignment to sparse matrices.
780  //**********************************************************************************************
781 
782  //**Multiplication assignment to dense matrices*************************************************
783  // No special implementation for the multiplication assignment to dense matrices.
784  //**********************************************************************************************
785 
786  //**Multiplication assignment to sparse matrices************************************************
787  // No special implementation for the multiplication assignment to sparse matrices.
788  //**********************************************************************************************
789 
790  //**SMP assignment to dense matrices************************************************************
804  template< typename MT2 // Type of the target dense matrix
805  , bool SO2 > // Storage order of the target dense matrix
806  friend inline auto smpAssign( DenseMatrix<MT2,SO2>& lhs, const DMatScalarMultExpr& rhs )
807  -> EnableIf_t< UseSMPAssign_v<MT2> >
808  {
810 
811  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
812  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
813 
814  smpAssign( ~lhs, rhs.matrix_ );
815  smpAssign( ~lhs, (~lhs) * rhs.scalar_ );
816  }
818  //**********************************************************************************************
819 
820  //**SMP assignment to sparse matrices***********************************************************
834  template< typename MT2 // Type of the target sparse matrix
835  , bool SO2 > // Storage order of the target sparse matrix
836  friend inline auto smpAssign( SparseMatrix<MT2,SO2>& lhs, const DMatScalarMultExpr& rhs )
837  -> EnableIf_t< UseSMPAssign_v<MT2> >
838  {
840 
841  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
842  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
843 
844  smpAssign( ~lhs, rhs.matrix_ );
845  (~lhs) *= rhs.scalar_;
846  }
848  //**********************************************************************************************
849 
850  //**SMP addition assignment to dense matrices***************************************************
864  template< typename MT2 // Type of the target dense matrix
865  , bool SO2 > // Storage order of the target dense matrix
866  friend inline auto smpAddAssign( DenseMatrix<MT2,SO2>& lhs, const DMatScalarMultExpr& rhs )
867  -> EnableIf_t< UseSMPAssign_v<MT2> >
868  {
870 
874 
875  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
876  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
877 
878  const ResultType tmp( rhs );
879  smpAddAssign( ~lhs, tmp );
880  }
882  //**********************************************************************************************
883 
884  //**SMP addition assignment to sparse matrices**************************************************
885  // No special implementation for the SMP addition assignment to sparse matrices.
886  //**********************************************************************************************
887 
888  //**SMP subtraction assignment to dense matrices************************************************
902  template< typename MT2 // Type of the target dense matrix
903  , bool SO2 > // Storage order of the target dense matrix
904  friend inline auto smpSubAssign( DenseMatrix<MT2,SO2>& lhs, const DMatScalarMultExpr& rhs )
905  -> EnableIf_t< UseSMPAssign_v<MT2> >
906  {
908 
912 
913  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
914  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
915 
916  const ResultType tmp( rhs );
917  smpSubAssign( ~lhs, tmp );
918  }
920  //**********************************************************************************************
921 
922  //**SMP subtraction assignment to sparse matrices***********************************************
923  // No special implementation for the SMP subtraction assignment to sparse matrices.
924  //**********************************************************************************************
925 
926  //**SMP Schur product assignment to dense matrices**********************************************
940  template< typename MT2 // Type of the target dense matrix
941  , bool SO2 > // Storage order of the target dense matrix
942  friend inline auto smpSchurAssign( DenseMatrix<MT2,SO2>& lhs, const DMatScalarMultExpr& rhs )
943  -> EnableIf_t< UseSMPAssign_v<MT2> >
944  {
946 
950 
951  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
952  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
953 
954  const ResultType tmp( rhs );
955  smpSchurAssign( ~lhs, tmp );
956  }
958  //**********************************************************************************************
959 
960  //**SMP Schur product assignment to sparse matrices*********************************************
961  // No special implementation for the SMP Schur product assignment to sparse matrices.
962  //**********************************************************************************************
963 
964  //**SMP multiplication assignment to dense matrices*********************************************
965  // No special implementation for the SMP multiplication assignment to dense matrices.
966  //**********************************************************************************************
967 
968  //**SMP multiplication assignment to sparse matrices********************************************
969  // No special implementation for the SMP multiplication assignment to sparse matrices.
970  //**********************************************************************************************
971 
972  //**Compile time checks*************************************************************************
979  //**********************************************************************************************
980 };
981 //*************************************************************************************************
982 
983 
984 
985 
986 //=================================================================================================
987 //
988 // GLOBAL UNARY ARITHMETIC OPERATORS
989 //
990 //=================================================================================================
991 
992 //*************************************************************************************************
1009 template< typename MT // Type of the dense matrix
1010  , bool SO > // Storage order
1011 inline decltype(auto) operator-( const DenseMatrix<MT,SO>& dm )
1012 {
1014 
1015  using ScalarType = UnderlyingBuiltin_t<MT>;
1017  return ReturnType( ~dm, ScalarType(-1) );
1018 }
1019 //*************************************************************************************************
1020 
1021 
1022 
1023 
1024 //=================================================================================================
1025 //
1026 // GLOBAL BINARY ARITHMETIC OPERATORS
1027 //
1028 //=================================================================================================
1029 
1030 //*************************************************************************************************
1051 template< typename MT // Type of the left-hand side dense matrix
1052  , bool SO // Storage order of the left-hand side dense matrix
1053  , typename ST // Type of the right-hand side scalar
1054  , EnableIf_t< IsNumeric_v<ST> >* = nullptr >
1055 inline decltype(auto) operator*( const DenseMatrix<MT,SO>& mat, ST scalar )
1056 {
1058 
1059  using ScalarType = MultTrait_t< UnderlyingBuiltin_t<MT>, ST >;
1061  return ReturnType( ~mat, scalar );
1062 }
1063 //*************************************************************************************************
1064 
1065 
1066 //*************************************************************************************************
1087 template< typename ST // Type of the left-hand side scalar
1088  , typename MT // Type of the right-hand side dense matrix
1089  , bool SO // Storage order of the right-hand side dense matrix
1090  , EnableIf_t< IsNumeric_v<ST> >* = nullptr >
1091 inline decltype(auto) operator*( ST scalar, const DenseMatrix<MT,SO>& mat )
1092 {
1094 
1095  using ScalarType = MultTrait_t< ST, UnderlyingBuiltin_t<MT> >;
1097  return ReturnType( ~mat, scalar );
1098 }
1099 //*************************************************************************************************
1100 
1101 
1102 
1103 
1104 //=================================================================================================
1105 //
1106 // GLOBAL RESTRUCTURING UNARY ARITHMETIC OPERATORS
1107 //
1108 //=================================================================================================
1109 
1110 //*************************************************************************************************
1122 template< typename MT // Type of the dense matrix
1123  , typename ST // Type of the scalar
1124  , bool TF > // Transpose flag
1125 inline decltype(auto) operator-( const DMatScalarMultExpr<MT,ST,TF>& dm )
1126 {
1128 
1129  using ReturnType = const DMatScalarMultExpr<MT,ST,TF>;
1130  return ReturnType( dm.leftOperand(), -dm.rightOperand() );
1131 }
1133 //*************************************************************************************************
1134 
1135 
1136 
1137 
1138 //=================================================================================================
1139 //
1140 // GLOBAL RESTRUCTURING BINARY ARITHMETIC OPERATORS
1141 //
1142 //=================================================================================================
1143 
1144 //*************************************************************************************************
1157 template< typename MT // Type of the dense matrix of the left-hand side expression
1158  , typename ST1 // Type of the scalar of the left-hand side expression
1159  , bool SO // Storage order of the dense matrix
1160  , typename ST2 // Type of the right-hand side scalar
1161  , EnableIf_t< IsNumeric_v<ST2> >* = nullptr >
1162 inline decltype(auto) operator*( const DMatScalarMultExpr<MT,ST1,SO>& mat, ST2 scalar )
1163 {
1165 
1166  return mat.leftOperand() * ( mat.rightOperand() * scalar );
1167 }
1169 //*************************************************************************************************
1170 
1171 
1172 //*************************************************************************************************
1185 template< typename ST1 // Type of the left-hand side scalar
1186  , typename MT // Type of the dense matrix of the right-hand side expression
1187  , typename ST2 // Type of the scalar of the right-hand side expression
1188  , bool SO // Storage order of the dense matrix
1189  , EnableIf_t< IsNumeric_v<ST1> >* = nullptr >
1190 inline decltype(auto) operator*( ST1 scalar, const DMatScalarMultExpr<MT,ST2,SO>& mat )
1191 {
1193 
1194  return mat.leftOperand() * ( scalar * mat.rightOperand() );
1195 }
1197 //*************************************************************************************************
1198 
1199 
1200 //*************************************************************************************************
1213 template< typename MT // Type of the dense matrix of the left-hand side expression
1214  , typename ST1 // Type of the scalar of the left-hand side expression
1215  , bool SO // Storage order of the dense matrix
1216  , typename ST2 // Type of the right-hand side scalar
1217  , EnableIf_t< IsNumeric_v<ST2> && ( IsInvertible_v<ST1> || IsInvertible_v<ST2> ) >* = nullptr >
1218 inline decltype(auto) operator/( const DMatScalarMultExpr<MT,ST1,SO>& mat, ST2 scalar )
1219 {
1221 
1222  return mat.leftOperand() * ( mat.rightOperand() / scalar );
1223 }
1225 //*************************************************************************************************
1226 
1227 
1228 //*************************************************************************************************
1242 template< typename MT // Type of the dense matrix of the left-hand side expression
1243  , typename ST // Type of the scalar of the left-hand side expression
1244  , bool SO // Storage order of the left-hand side expression
1245  , typename VT > // Type of the right-hand side dense vector
1246 inline decltype(auto)
1247  operator*( const DMatScalarMultExpr<MT,ST,SO>& mat, const DenseVector<VT,false>& vec )
1248 {
1250 
1251  return ( mat.leftOperand() * (~vec) ) * mat.rightOperand();
1252 }
1254 //*************************************************************************************************
1255 
1256 
1257 //*************************************************************************************************
1271 template< typename VT // Type of the left-hand side dense vector
1272  , typename MT // Type of the dense matrix of the right-hand side expression
1273  , typename ST // Type of the scalar of the right-hand side expression
1274  , bool SO > // Storage order of the right-hand side expression
1275 inline decltype(auto)
1276  operator*( const DenseVector<VT,true>& vec, const DMatScalarMultExpr<MT,ST,SO>& mat )
1277 {
1279 
1280  return ( (~vec) * mat.leftOperand() ) * mat.rightOperand();
1281 }
1283 //*************************************************************************************************
1284 
1285 
1286 //*************************************************************************************************
1302 template< typename MT // Type of the dense matrix of the left-hand side expression
1303  , typename ST1 // Type of the scalar of the left-hand side expression
1304  , bool SO // Storage order of the left-hand side expression
1305  , typename VT // Type of the dense vector of the right-hand side expression
1306  , typename ST2 > // Type of the scalar of the right-hand side expression
1307 inline decltype(auto)
1308  operator*( const DMatScalarMultExpr<MT,ST1,SO>& mat, const DVecScalarMultExpr<VT,ST2,false>& vec )
1309 {
1311 
1312  return ( mat.leftOperand() * vec.leftOperand() ) * ( mat.rightOperand() * vec.rightOperand() );
1313 }
1315 //*************************************************************************************************
1316 
1317 
1318 //*************************************************************************************************
1334 template< typename VT // Type of the dense vector of the left-hand side expression
1335  , typename ST1 // Type of the scalar of the left-hand side expression
1336  , typename MT // Type of the dense matrix of the right-hand side expression
1337  , typename ST2 // Type of the scalar of the right-hand side expression
1338  , bool SO > // Storage order of the right-hand side expression
1339 inline decltype(auto)
1340  operator*( const DVecScalarMultExpr<VT,ST1,true>& vec, const DMatScalarMultExpr<MT,ST2,SO>& mat )
1341 {
1343 
1344  return ( vec.leftOperand() * mat.leftOperand() ) * ( vec.rightOperand() * mat.rightOperand() );
1345 }
1347 //*************************************************************************************************
1348 
1349 
1350 //*************************************************************************************************
1364 template< typename MT // Type of the dense matrix of the left-hand side expression
1365  , typename ST // Type of the scalar of the left-hand side expression
1366  , bool SO // Storage order of the left-hand side expression
1367  , typename VT > // Type of the right-hand side sparse vector
1368 inline decltype(auto)
1369  operator*( const DMatScalarMultExpr<MT,ST,SO>& mat, const SparseVector<VT,false>& vec )
1370 {
1372 
1373  return ( mat.leftOperand() * (~vec) ) * mat.rightOperand();
1374 }
1376 //*************************************************************************************************
1377 
1378 
1379 //*************************************************************************************************
1393 template< typename VT // Type of the left-hand side sparse vector
1394  , typename MT // Type of the dense matrix of the right-hand side expression
1395  , typename ST // Type of the scalar of the right-hand side expression
1396  , bool SO > // Storage order of the right-hand side expression
1397 inline decltype(auto)
1398  operator*( const SparseVector<VT,true>& vec, const DMatScalarMultExpr<MT,ST,SO>& mat )
1399 {
1401 
1402  return ( (~vec) * mat.leftOperand() ) * mat.rightOperand();
1403 }
1405 //*************************************************************************************************
1406 
1407 
1408 //*************************************************************************************************
1424 template< typename MT // Type of the dense matrix of the left-hand side expression
1425  , typename ST1 // Type of the scalar of the left-hand side expression
1426  , bool SO // Storage order of the left-hand side expression
1427  , typename VT // Type of the sparse vector of the right-hand side expression
1428  , typename ST2 > // Type of the scalar of the right-hand side expression
1429 inline decltype(auto)
1430  operator*( const DMatScalarMultExpr<MT,ST1,SO>& mat, const SVecScalarMultExpr<VT,ST2,false>& vec )
1431 {
1433 
1434  return ( mat.leftOperand() * vec.leftOperand() ) * ( mat.rightOperand() * vec.rightOperand() );
1435 }
1437 //*************************************************************************************************
1438 
1439 
1440 //*************************************************************************************************
1456 template< typename VT // Type of the sparse vector of the left-hand side expression
1457  , typename ST1 // Type of the scalar of the left-hand side expression
1458  , typename MT // Type of the dense matrix of the right-hand side expression
1459  , typename ST2 // Type of the scalar of the right-hand side expression
1460  , bool SO > // Storage order of the right-hand side expression
1461 inline decltype(auto)
1462  operator*( const SVecScalarMultExpr<VT,ST1,true>& vec, const DMatScalarMultExpr<MT,ST2,SO>& mat )
1463 {
1465 
1466  return ( vec.leftOperand() * mat.leftOperand() ) * ( vec.rightOperand() * mat.rightOperand() );
1467 }
1469 //*************************************************************************************************
1470 
1471 
1472 //*************************************************************************************************
1486 template< typename MT1 // Type of the dense matrix of the left-hand side expression
1487  , typename ST // Type of the scalar of the left-hand side expression
1488  , bool SO1 // Storage order of the left-hand side expression
1489  , typename MT2 // Type of the right-hand side dense matrix
1490  , bool SO2 > // Storage order of the right-hand side dense matrix
1491 inline decltype(auto)
1492  operator*( const DMatScalarMultExpr<MT1,ST,SO1>& lhs, const DenseMatrix<MT2,SO2>& rhs )
1493 {
1495 
1496  return ( lhs.leftOperand() * (~rhs) ) * lhs.rightOperand();
1497 }
1499 //*************************************************************************************************
1500 
1501 
1502 //*************************************************************************************************
1516 template< typename MT1 // Type of the left-hand side dense matrix
1517  , bool SO1 // Storage order of the left-hand side dense matrix
1518  , typename MT2 // Type of the dense matrix of the right-hand side expression
1519  , typename ST // Type of the scalar of the right-hand side expression
1520  , bool SO2 > // Storage order of the right-hand side expression
1521 inline decltype(auto)
1522  operator*( const DenseMatrix<MT1,SO1>& lhs, const DMatScalarMultExpr<MT2,ST,SO2>& rhs )
1523 {
1525 
1526  return ( (~lhs) * rhs.leftOperand() ) * rhs.rightOperand();
1527 }
1529 //*************************************************************************************************
1530 
1531 
1532 //*************************************************************************************************
1546 template< typename MT1 // Type of the dense matrix of the left-hand side expression
1547  , typename ST1 // Type of the scalar of the left-hand side expression
1548  , bool SO1 // Storage order of the left-hand side expression
1549  , typename MT2 // Type of the right-hand side dense matrix
1550  , typename ST2 // Type of the scalar of the right-hand side expression
1551  , bool SO2 > // Storage order of the right-hand side expression
1552 inline decltype(auto)
1553  operator*( const DMatScalarMultExpr<MT1,ST1,SO1>& lhs, const DMatScalarMultExpr<MT2,ST2,SO2>& rhs )
1554 {
1556 
1557  return ( lhs.leftOperand() * rhs.leftOperand() ) * ( lhs.rightOperand() * rhs.rightOperand() );
1558 }
1560 //*************************************************************************************************
1561 
1562 
1563 //*************************************************************************************************
1577 template< typename MT1 // Type of the dense matrix of the left-hand side expression
1578  , typename ST // Type of the scalar of the left-hand side expression
1579  , bool SO1 // Storage order of the left-hand side expression
1580  , typename MT2 // Type of the right-hand side sparse matrix
1581  , bool SO2 > // Storage order of the right-hand side sparse matrix
1582 inline decltype(auto)
1583  operator*( const DMatScalarMultExpr<MT1,ST,SO1>& lhs, const SparseMatrix<MT2,SO2>& rhs )
1584 {
1586 
1587  return ( lhs.leftOperand() * (~rhs) ) * lhs.rightOperand();
1588 }
1590 //*************************************************************************************************
1591 
1592 
1593 //*************************************************************************************************
1607 template< typename MT1 // Type of the left-hand side sparse matrix
1608  , bool SO1 // Storage order of the left-hand side sparse matrix
1609  , typename MT2 // Type of the dense matrix of the right-hand side expression
1610  , typename ST // Type of the scalar of the right-hand side expression
1611  , bool SO2 > // Storage order of the right-hand side expression
1612 inline decltype(auto)
1613  operator*( const SparseMatrix<MT1,SO1>& lhs, const DMatScalarMultExpr<MT2,ST,SO2>& rhs )
1614 {
1616 
1617  return ( (~lhs) * rhs.leftOperand() ) * rhs.rightOperand();
1618 }
1620 //*************************************************************************************************
1621 
1622 
1623 //*************************************************************************************************
1638 template< typename MT1 // Type of the dense matrix of the left-hand side expression
1639  , typename ST1 // Type of the scalar of the left-hand side expression
1640  , bool SO1 // Storage order of the left-hand side expression
1641  , typename MT2 // Type of the sparse matrix of the right-hand side expression
1642  , typename ST2 // Type of the scalar of the right-hand side expression
1643  , bool SO2 > // Storage order of the right-hand side expression
1644 inline decltype(auto)
1645  operator*( const DMatScalarMultExpr<MT1,ST1,SO1>& mat, const SMatScalarMultExpr<MT2,ST2,SO2>& vec )
1646 {
1648 
1649  return ( mat.leftOperand() * vec.leftOperand() ) * ( mat.rightOperand() * vec.rightOperand() );
1650 }
1652 //*************************************************************************************************
1653 
1654 
1655 //*************************************************************************************************
1670 template< typename MT1 // Type of the sparse matrix of the left-hand side expression
1671  , typename ST1 // Type of the scalar of the left-hand side expression
1672  , bool SO1 // Storage order of the left-hand side expression
1673  , typename MT2 // Type of the dense matrix of the right-hand side expression
1674  , typename ST2 // Type of the scalar of the right-hand side expression
1675  , bool SO2 > // Storage order of the right-hand side expression
1676 inline decltype(auto)
1677  operator*( const SMatScalarMultExpr<MT1,ST1,SO1>& mat, const DMatScalarMultExpr<MT2,ST2,SO2>& vec )
1678 {
1680 
1681  return ( mat.leftOperand() * vec.leftOperand() ) * ( mat.rightOperand() * vec.rightOperand() );
1682 }
1684 //*************************************************************************************************
1685 
1686 
1687 
1688 
1689 //=================================================================================================
1690 //
1691 // ISALIGNED SPECIALIZATIONS
1692 //
1693 //=================================================================================================
1694 
1695 //*************************************************************************************************
1697 template< typename MT, typename ST, bool SO >
1698 struct IsAligned< DMatScalarMultExpr<MT,ST,SO> >
1699  : public IsAligned<MT>
1700 {};
1702 //*************************************************************************************************
1703 
1704 
1705 
1706 
1707 //=================================================================================================
1708 //
1709 // ISPADDED SPECIALIZATIONS
1710 //
1711 //=================================================================================================
1712 
1713 //*************************************************************************************************
1715 template< typename MT, typename ST, bool SO >
1716 struct IsPadded< DMatScalarMultExpr<MT,ST,SO> >
1717  : public IsPadded<MT>
1718 {};
1720 //*************************************************************************************************
1721 
1722 } // namespace blaze
1723 
1724 #endif
Pointer difference type of the Blaze library.
Header file for auxiliary alias declarations.
static constexpr bool smpAssignable
Compilation switch for the expression template assignment strategy.
Definition: DMatScalarMultExpr.h:426
Data type constraint.
Constraint on the data type.
RightOperand scalar_
Scalar of the multiplication expression.
Definition: DMatScalarMultExpr.h:414
Header file for basic type definitions.
typename If< Condition, T1, T2 >::Type If_t
Auxiliary alias declaration for the If class template.The If_t alias declaration provides a convenien...
Definition: If.h:109
ElementType * PointerType
Pointer return type.
Definition: DMatScalarMultExpr.h:185
typename T::ResultType ResultType_t
Alias declaration for nested ResultType type definitions.The ResultType_t alias declaration provides ...
Definition: Aliases.h:390
ConstIterator & operator++()
Pre-increment operator.
Definition: DMatScalarMultExpr.h:241
const ConstIterator operator--(int)
Post-decrement operator.
Definition: DMatScalarMultExpr.h:273
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:532
#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:337
RightOperand scalar_
Right-hand side scalar of the multiplication expression.
Definition: DMatScalarMultExpr.h:605
static constexpr bool smpAssignable
Compilation flag for SMP assignments.
Definition: CompressedMatrix.h:3113
size_t rows() const noexcept
Returns the current number of rows of the matrix.
Definition: DMatScalarMultExpr.h:522
Base class for all matrix/scalar multiplication expression templates.The MatScalarMultExpr class serv...
Definition: MatScalarMultExpr.h:67
Header file for the DenseVector base class.
bool canSMPAssign() const noexcept
Returns whether the expression can be used in SMP assignments.
Definition: DMatScalarMultExpr.h:596
ReferenceType reference
Reference return type.
Definition: DMatScalarMultExpr.h:193
static constexpr bool returnExpr
Compilation switch for the selection of the subscript operator return type.
Definition: DMatScalarMultExpr.h:117
MultTrait_t< RT, ST > ResultType
Result type for expression template evaluations.
Definition: DMatScalarMultExpr.h:158
Header file for the Computation base class.
ReturnType operator*() const
Direct access to the element at the current iterator position.
Definition: DMatScalarMultExpr.h:283
Header file for the UnderlyingElement type trait.
Header file for the RequiresEvaluation type trait.
static constexpr size_t SIMDSIZE
The number of elements packed within a single SIMD element.
Definition: DMatScalarMultExpr.h:431
typename T::ReturnType ReturnType_t
Alias declaration for nested ReturnType type definitions.The ReturnType_t alias declaration provides ...
Definition: Aliases.h:410
auto load() const noexcept
Access to the SIMD elements of the matrix.
Definition: DMatScalarMultExpr.h:293
Base class for dense matrices.The DenseMatrix class is a base class for all dense matrix classes...
Definition: DenseMatrix.h:80
Base class for sparse matrices.The SparseMatrix class is a base class for all sparse matrix classes...
Definition: Forward.h:137
typename T::ElementType ElementType_t
Alias declaration for nested ElementType type definitions.The ElementType_t alias declaration provide...
Definition: Aliases.h:170
std::random_access_iterator_tag IteratorCategory
The iterator category.
Definition: DMatScalarMultExpr.h:183
Constraint on the data type.
typename EnableIf< Condition, T >::Type EnableIf_t
Auxiliary type for the EnableIf class template.The EnableIf_t alias declaration provides a convenient...
Definition: EnableIf.h:138
bool canAlias(const T *alias) const noexcept
Returns whether the expression can alias with the given address alias.
Definition: DMatScalarMultExpr.h:564
Header file for the IsTemporary type trait class.
Header file for the multiplication trait.
Namespace of the Blaze C++ math library.
Definition: Blaze.h:58
#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.
Expression object for dense matrix-scalar multiplications.The DMatScalarMultExpr class represents the...
Definition: DMatScalarMultExpr.h:98
ConstIterator & operator+=(size_t inc)
Addition assignment operator.
Definition: DMatScalarMultExpr.h:218
#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:413
Header file for the DenseMatrix base class.
const If_t< returnExpr, ExprReturnType, ElementType > ReturnType
Return type for expression template evaluations.
Definition: DMatScalarMultExpr.h:164
const Element * ConstIterator
Iterator over constant elements.
Definition: CompressedMatrix.h:3086
Header file for all SIMD functionality.
bool operator==(const ConstIterator &rhs) const
Equality comparison between two ConstIterator objects.
Definition: DMatScalarMultExpr.h:304
If_t< useAssign, const ResultType, const DMatScalarMultExpr &> CompositeType
Data type for composite expression templates.
Definition: DMatScalarMultExpr.h:167
ValueType value_type
Type of the underlying elements.
Definition: DMatScalarMultExpr.h:191
#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 IsAligned type trait.
RightOperand rightOperand() const noexcept
Returns the right-hand side scalar operand.
Definition: DMatScalarMultExpr.h:552
BLAZE_ALWAYS_INLINE auto load(size_t i, size_t j) const noexcept
Access to the SIMD elements of the matrix.
Definition: DMatScalarMultExpr.h:486
ElementType_t< ResultType > ElementType
Resulting element type.
Definition: DMatScalarMultExpr.h:161
Constraints on the storage order of matrix types.
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:348
LeftOperand matrix_
Left-hand side dense matrix of the multiplication expression.
Definition: DMatScalarMultExpr.h:604
ConstIterator_t< MT > IteratorType
ConstIterator type of the dense matrix expression.
Definition: DMatScalarMultExpr.h:197
Constraint on the data type.
decltype(std::declval< RN >() *std::declval< ST >()) ExprReturnType
Expression return type for the subscript operator.
Definition: DMatScalarMultExpr.h:120
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:370
typename UnderlyingBuiltin< T >::Type UnderlyingBuiltin_t
Auxiliary alias declaration for the UnderlyingBuiltin type trait.The UnderlyingBuiltin_t alias declar...
Definition: UnderlyingBuiltin.h:133
Header file for the EnableIf class template.
friend const ConstIterator operator-(const ConstIterator &it, size_t dec)
Subtraction between a ConstIterator and an integral value.
Definition: DMatScalarMultExpr.h:406
Header file for the IsPadded type trait.
OppositeType_t< ResultType > OppositeType
Result type with opposite storage order for expression template evaluations.
Definition: DMatScalarMultExpr.h:159
typename MultTrait< T1, T2 >::Type MultTrait_t
Auxiliary alias declaration for the MultTrait class template.The MultTrait_t alias declaration provid...
Definition: MultTrait.h:240
typename T::OppositeType OppositeType_t
Alias declaration for nested OppositeType type definitions.The OppositeType_t alias declaration provi...
Definition: Aliases.h:270
PointerType pointer
Pointer return type.
Definition: DMatScalarMultExpr.h:192
ConstIterator(IteratorType iterator, RightOperand scalar)
Constructor for the ConstIterator class.
Definition: DMatScalarMultExpr.h:206
friend const ConstIterator operator+(size_t inc, const ConstIterator &it)
Addition between an integral value and a ConstIterator.
Definition: DMatScalarMultExpr.h:394
ReturnType at(size_t i, size_t j) const
Checked access to the matrix elements.
Definition: DMatScalarMultExpr.h:468
Header file for the IsNumeric type trait.
Header file for the HasSIMDMult type trait.
TransposeType_t< ResultType > TransposeType
Transpose type for expression template evaluations.
Definition: DMatScalarMultExpr.h:160
Header file for the MatScalarMultExpr base class.
ST RightOperand
Composite type of the right-hand side scalar value.
Definition: DMatScalarMultExpr.h:173
ElementType & ReferenceType
Reference return type.
Definition: DMatScalarMultExpr.h:186
typename T::TransposeType TransposeType_t
Alias declaration for nested TransposeType type definitions.The TransposeType_t alias declaration pro...
Definition: Aliases.h:470
Header file for run time assertion macros.
typename T::CompositeType CompositeType_t
Alias declaration for nested CompositeType type definitions.The CompositeType_t alias declaration pro...
Definition: Aliases.h:90
auto smpAddAssign(Matrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs) -> EnableIf_t< IsDenseMatrix_v< MT1 > >
Default implementation of the SMP addition assignment of a matrix to a dense matrix.
Definition: DenseMatrix.h:131
ptrdiff_t DifferenceType
Difference between two iterators.
Definition: DMatScalarMultExpr.h:187
static constexpr bool simdEnabled
Compilation switch for the expression template evaluation strategy.
Definition: DMatScalarMultExpr.h:421
ConstIterator & operator-=(size_t dec)
Subtraction assignment operator.
Definition: DMatScalarMultExpr.h:230
#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:295
#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
ConstIterator begin(size_t i) const
Returns an iterator to the first non-zero element of row i.
Definition: DMatScalarMultExpr.h:501
auto smpAssign(Matrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs) -> EnableIf_t< IsDenseMatrix_v< MT1 > >
Default implementation of the SMP assignment of a matrix to a dense matrix.
Definition: DenseMatrix.h:100
decltype(auto) serial(const DenseMatrix< MT, SO > &dm)
Forces the serial evaluation of the given dense matrix expression dm.
Definition: DMatSerialExpr.h:808
ResultType_t< MT > RT
Result type of the dense matrix expression.
Definition: DMatScalarMultExpr.h:104
#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:512
const ConstIterator operator++(int)
Post-increment operator.
Definition: DMatScalarMultExpr.h:252
auto smpSchurAssign(Matrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs) -> EnableIf_t< IsDenseMatrix_v< MT1 > >
Default implementation of the SMP Schur product assignment of a matrix to dense matrix.
Definition: DenseMatrix.h:194
ElementType ValueType
Type of the underlying elements.
Definition: DMatScalarMultExpr.h:184
bool isAliased(const T *alias) const noexcept
Returns whether the expression is aliased with the given address alias.
Definition: DMatScalarMultExpr.h:576
friend const ConstIterator operator+(const ConstIterator &it, size_t inc)
Addition between a ConstIterator and an integral value.
Definition: DMatScalarMultExpr.h:382
Header file for the IsInvertible type trait.
bool operator>=(const ConstIterator &rhs) const
Greater-than comparison between two ConstIterator objects.
Definition: DMatScalarMultExpr.h:359
typename T::ConstIterator ConstIterator_t
Alias declaration for nested ConstIterator type definitions.The ConstIterator_t alias declaration pro...
Definition: Aliases.h:110
ConstIterator & operator--()
Pre-decrement operator.
Definition: DMatScalarMultExpr.h:262
ReturnType_t< MT > RN
Return type of the dense matrix expression.
Definition: DMatScalarMultExpr.h:105
const Type & ReturnType
Return type for expression template evaluations.
Definition: CompressedMatrix.h:3081
static constexpr bool useAssign
Compilation switch for the serial evaluation strategy of the multiplication expression.
Definition: DMatScalarMultExpr.h:131
Header file for the IsComputation type trait class.
auto smpSubAssign(Matrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs) -> EnableIf_t< IsDenseMatrix_v< MT1 > >
Default implementation of the SMP subtraction assignment of a matrix to dense matrix.
Definition: DenseMatrix.h:162
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:453
DMatScalarMultExpr(const MT &matrix, ST scalar) noexcept
Constructor for the DMatScalarMultExpr class.
Definition: DMatScalarMultExpr.h:440
Iterator over the elements of the dense matrix.
Definition: DMatScalarMultExpr.h:179
bool operator<(const ConstIterator &rhs) const
Less-than comparison between two ConstIterator objects.
Definition: DMatScalarMultExpr.h:326
bool isAligned() const noexcept
Returns whether the operands of the expression are properly aligned in memory.
Definition: DMatScalarMultExpr.h:586
ElementType_t< MT > ET
Element type of the dense matrix expression.
Definition: DMatScalarMultExpr.h:106
bool operator!=(const ConstIterator &rhs) const
Inequality comparison between two ConstIterator objects.
Definition: DMatScalarMultExpr.h:315
LeftOperand leftOperand() const noexcept
Returns the left-hand side dense matrix operand.
Definition: DMatScalarMultExpr.h:542
If_t< IsExpression_v< MT >, const MT, const MT &> LeftOperand
Composite type of the left-hand side dense matrix expression.
Definition: DMatScalarMultExpr.h:170
System settings for the inline keywords.
Header file for the thresholds for matrix/vector and matrix/matrix multiplications.
CompositeType_t< MT > CT
Composite type of the dense matrix expression.
Definition: DMatScalarMultExpr.h:107
#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
IteratorCategory iterator_category
The iterator category.
Definition: DMatScalarMultExpr.h:190
Header file for the IsExpression type trait class.
Header file for the function trace functionality.