Blaze  3.6
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>
69 #include <blaze/system/Inline.h>
71 #include <blaze/util/Assert.h>
74 #include <blaze/util/EnableIf.h>
76 #include <blaze/util/mpl/If.h>
77 #include <blaze/util/Types.h>
79 
80 
81 namespace blaze {
82 
83 //=================================================================================================
84 //
85 // CLASS DMATSCALARMULTEXPR
86 //
87 //=================================================================================================
88 
89 //*************************************************************************************************
96 template< typename MT // Type of the left-hand side dense matrix
97  , typename ST // Type of the right-hand side scalar value
98  , bool SO > // Storage order
100  : public MatScalarMultExpr< DenseMatrix< DMatScalarMultExpr<MT,ST,SO>, SO > >
101  , private Computation
102 {
103  private:
104  //**Type definitions****************************************************************************
109  //**********************************************************************************************
110 
111  //**Return type evaluation**********************************************************************
113 
118  static constexpr bool returnExpr = !IsTemporary_v<RN>;
119 
121  using ExprReturnType = decltype( std::declval<RN>() * std::declval<ST>() );
122  //**********************************************************************************************
123 
124  //**Serial evaluation strategy******************************************************************
126 
132  static constexpr bool useAssign = ( IsComputation_v<MT> && RequiresEvaluation_v<MT> );
133 
135  template< typename MT2 >
137  static constexpr bool UseAssign_v = useAssign;
139  //**********************************************************************************************
140 
141  //**Parallel evaluation strategy****************************************************************
143 
149  template< typename MT2 >
150  static constexpr bool UseSMPAssign_v =
151  ( ( !MT2::smpAssignable || !MT::smpAssignable ) && useAssign );
153  //**********************************************************************************************
154 
155  public:
156  //**Type definitions****************************************************************************
163 
166 
169 
171  using LeftOperand = If_t< IsExpression_v<MT>, const MT, const MT& >;
172 
174  using RightOperand = ST;
175  //**********************************************************************************************
176 
177  //**ConstIterator class definition**************************************************************
181  {
182  public:
183  //**Type definitions*************************************************************************
184  using IteratorCategory = std::random_access_iterator_tag;
189 
190  // STL iterator requirements
196 
199  //*******************************************************************************************
200 
201  //**Constructor******************************************************************************
207  explicit inline ConstIterator( IteratorType iterator, RightOperand scalar )
208  : iterator_( iterator ) // Iterator to the current element
209  , scalar_ ( scalar ) // Scalar of the multiplication expression
210  {}
211  //*******************************************************************************************
212 
213  //**Addition assignment operator*************************************************************
220  iterator_ += inc;
221  return *this;
222  }
223  //*******************************************************************************************
224 
225  //**Subtraction assignment operator**********************************************************
232  iterator_ -= dec;
233  return *this;
234  }
235  //*******************************************************************************************
236 
237  //**Prefix increment operator****************************************************************
243  ++iterator_;
244  return *this;
245  }
246  //*******************************************************************************************
247 
248  //**Postfix increment operator***************************************************************
254  return ConstIterator( iterator_++, scalar_ );
255  }
256  //*******************************************************************************************
257 
258  //**Prefix decrement operator****************************************************************
264  --iterator_;
265  return *this;
266  }
267  //*******************************************************************************************
268 
269  //**Postfix decrement operator***************************************************************
275  return ConstIterator( iterator_--, scalar_ );
276  }
277  //*******************************************************************************************
278 
279  //**Element access operator******************************************************************
284  inline ReturnType operator*() const {
285  return *iterator_ * scalar_;
286  }
287  //*******************************************************************************************
288 
289  //**Load function****************************************************************************
294  inline auto load() const noexcept {
295  return iterator_.load() * set( scalar_ );
296  }
297  //*******************************************************************************************
298 
299  //**Equality operator************************************************************************
305  inline bool operator==( const ConstIterator& rhs ) const {
306  return iterator_ == rhs.iterator_;
307  }
308  //*******************************************************************************************
309 
310  //**Inequality operator**********************************************************************
316  inline bool operator!=( const ConstIterator& rhs ) const {
317  return iterator_ != rhs.iterator_;
318  }
319  //*******************************************************************************************
320 
321  //**Less-than operator***********************************************************************
327  inline bool operator<( const ConstIterator& rhs ) const {
328  return iterator_ < rhs.iterator_;
329  }
330  //*******************************************************************************************
331 
332  //**Greater-than operator********************************************************************
338  inline bool operator>( const ConstIterator& rhs ) const {
339  return iterator_ > rhs.iterator_;
340  }
341  //*******************************************************************************************
342 
343  //**Less-or-equal-than operator**************************************************************
349  inline bool operator<=( const ConstIterator& rhs ) const {
350  return iterator_ <= rhs.iterator_;
351  }
352  //*******************************************************************************************
353 
354  //**Greater-or-equal-than operator***********************************************************
360  inline bool operator>=( const ConstIterator& rhs ) const {
361  return iterator_ >= rhs.iterator_;
362  }
363  //*******************************************************************************************
364 
365  //**Subtraction operator*********************************************************************
371  inline DifferenceType operator-( const ConstIterator& rhs ) const {
372  return iterator_ - rhs.iterator_;
373  }
374  //*******************************************************************************************
375 
376  //**Addition operator************************************************************************
383  friend inline const ConstIterator operator+( const ConstIterator& it, size_t inc ) {
384  return ConstIterator( it.iterator_ + inc, it.scalar_ );
385  }
386  //*******************************************************************************************
387 
388  //**Addition operator************************************************************************
395  friend inline const ConstIterator operator+( size_t inc, const ConstIterator& it ) {
396  return ConstIterator( it.iterator_ + inc, it.scalar_ );
397  }
398  //*******************************************************************************************
399 
400  //**Subtraction operator*********************************************************************
407  friend inline const ConstIterator operator-( const ConstIterator& it, size_t dec ) {
408  return ConstIterator( it.iterator_ - dec, it.scalar_ );
409  }
410  //*******************************************************************************************
411 
412  private:
413  //**Member variables*************************************************************************
416  //*******************************************************************************************
417  };
418  //**********************************************************************************************
419 
420  //**Compilation flags***************************************************************************
422  static constexpr bool simdEnabled =
423  ( MT::simdEnabled && IsNumeric_v<ET> &&
424  ( HasSIMDMult_v<ET,ST> || HasSIMDMult_v<UnderlyingElement_t<ET>,ST> ) );
425 
427  static constexpr bool smpAssignable = MT::smpAssignable;
428  //**********************************************************************************************
429 
430  //**SIMD properties*****************************************************************************
432  static constexpr size_t SIMDSIZE = SIMDTrait<ElementType>::size;
433  //**********************************************************************************************
434 
435  //**Constructor*********************************************************************************
441  explicit inline DMatScalarMultExpr( const MT& matrix, ST scalar ) noexcept
442  : matrix_( matrix ) // Left-hand side dense matrix of the multiplication expression
443  , scalar_( scalar ) // Right-hand side scalar of the multiplication expression
444  {}
445  //**********************************************************************************************
446 
447  //**Access operator*****************************************************************************
454  inline ReturnType operator()( size_t i, size_t j ) const {
455  BLAZE_INTERNAL_ASSERT( i < matrix_.rows() , "Invalid row access index" );
456  BLAZE_INTERNAL_ASSERT( j < matrix_.columns(), "Invalid column access index" );
457  return matrix_(i,j) * scalar_;
458  }
459  //**********************************************************************************************
460 
461  //**At function*********************************************************************************
469  inline ReturnType at( size_t i, size_t j ) const {
470  if( i >= matrix_.rows() ) {
471  BLAZE_THROW_OUT_OF_RANGE( "Invalid row access index" );
472  }
473  if( j >= matrix_.columns() ) {
474  BLAZE_THROW_OUT_OF_RANGE( "Invalid column access index" );
475  }
476  return (*this)(i,j);
477  }
478  //**********************************************************************************************
479 
480  //**Load function*******************************************************************************
487  BLAZE_ALWAYS_INLINE auto load( size_t i, size_t j ) const noexcept {
488  BLAZE_INTERNAL_ASSERT( i < matrix_.rows() , "Invalid row access index" );
489  BLAZE_INTERNAL_ASSERT( j < matrix_.columns(), "Invalid column access index" );
490  BLAZE_INTERNAL_ASSERT( !SO || ( i % SIMDSIZE == 0UL ), "Invalid row access index" );
491  BLAZE_INTERNAL_ASSERT( SO || ( j % SIMDSIZE == 0UL ), "Invalid column access index" );
492  return matrix_.load(i,j) * set( scalar_ );
493  }
494  //**********************************************************************************************
495 
496  //**Begin function******************************************************************************
502  inline ConstIterator begin( size_t i ) const {
503  return ConstIterator( matrix_.begin(i), scalar_ );
504  }
505  //**********************************************************************************************
506 
507  //**End function********************************************************************************
513  inline ConstIterator end( size_t i ) const {
514  return ConstIterator( matrix_.end(i), scalar_ );
515  }
516  //**********************************************************************************************
517 
518  //**Rows function*******************************************************************************
523  inline size_t rows() const noexcept {
524  return matrix_.rows();
525  }
526  //**********************************************************************************************
527 
528  //**Columns function****************************************************************************
533  inline size_t columns() const noexcept {
534  return matrix_.columns();
535  }
536  //**********************************************************************************************
537 
538  //**Left operand access*************************************************************************
543  inline LeftOperand leftOperand() const noexcept {
544  return matrix_;
545  }
546  //**********************************************************************************************
547 
548  //**Right operand access************************************************************************
553  inline RightOperand rightOperand() const noexcept {
554  return scalar_;
555  }
556  //**********************************************************************************************
557 
558  //**********************************************************************************************
564  template< typename T >
565  inline bool canAlias( const T* alias ) const noexcept {
566  return IsExpression_v<MT> && matrix_.canAlias( alias );
567  }
568  //**********************************************************************************************
569 
570  //**********************************************************************************************
576  template< typename T >
577  inline bool isAliased( const T* alias ) const noexcept {
578  return matrix_.isAliased( alias );
579  }
580  //**********************************************************************************************
581 
582  //**********************************************************************************************
587  inline bool isAligned() const noexcept {
588  return matrix_.isAligned();
589  }
590  //**********************************************************************************************
591 
592  //**********************************************************************************************
597  inline bool canSMPAssign() const noexcept {
598  return matrix_.canSMPAssign() ||
599  ( rows() * columns() >= SMP_DMATSCALARMULT_THRESHOLD );
600  }
601  //**********************************************************************************************
602 
603  private:
604  //**Member variables****************************************************************************
607  //**********************************************************************************************
608 
609  //**Assignment to dense matrices****************************************************************
623  template< typename MT2 // Type of the target dense matrix
624  , bool SO2 > // Storage order of the target dense matrix
625  friend inline auto assign( DenseMatrix<MT2,SO2>& lhs, const DMatScalarMultExpr& rhs )
627  {
629 
630  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
631  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
632 
633  assign( ~lhs, rhs.matrix_ );
634  assign( ~lhs, (~lhs) * rhs.scalar_ );
635  }
637  //**********************************************************************************************
638 
639  //**Assignment to sparse matrices***************************************************************
653  template< typename MT2 // Type of the target sparse matrix
654  , bool SO2 > // Storage order of the target sparse matrix
655  friend inline auto assign( SparseMatrix<MT2,SO2>& lhs, const DMatScalarMultExpr& rhs )
657  {
659 
660  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
661  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
662 
663  assign( ~lhs, rhs.matrix_ );
664  (~lhs) *= rhs.scalar_;
665  }
667  //**********************************************************************************************
668 
669  //**Addition assignment to dense matrices*******************************************************
683  template< typename MT2 // Type of the target dense matrix
684  , bool SO2 > // Storage order of the target dense matrix
685  friend inline auto addAssign( DenseMatrix<MT2,SO2>& lhs, const DMatScalarMultExpr& rhs )
686  -> EnableIf_t< UseAssign_v<MT2> >
687  {
689 
693 
694  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
695  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
696 
697  const ResultType tmp( serial( rhs ) );
698  addAssign( ~lhs, tmp );
699  }
701  //**********************************************************************************************
702 
703  //**Addition assignment to sparse matrices******************************************************
704  // No special implementation for the addition assignment to sparse matrices.
705  //**********************************************************************************************
706 
707  //**Subtraction assignment to dense matrices****************************************************
721  template< typename MT2 // Type of the target dense matrix
722  , bool SO2 > // Storage order of the target dense matrix
723  friend inline auto subAssign( DenseMatrix<MT2,SO2>& lhs, const DMatScalarMultExpr& rhs )
724  -> EnableIf_t< UseAssign_v<MT2> >
725  {
727 
731 
732  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
733  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
734 
735  const ResultType tmp( serial( rhs ) );
736  subAssign( ~lhs, tmp );
737  }
739  //**********************************************************************************************
740 
741  //**Subtraction assignment to sparse matrices***************************************************
742  // No special implementation for the subtraction assignment to sparse matrices.
743  //**********************************************************************************************
744 
745  //**Schur product assignment to dense matrices**************************************************
759  template< typename MT2 // Type of the target dense matrix
760  , bool SO2 > // Storage order of the target dense matrix
761  friend inline auto schurAssign( DenseMatrix<MT2,SO2>& lhs, const DMatScalarMultExpr& rhs )
762  -> EnableIf_t< UseAssign_v<MT2> >
763  {
765 
769 
770  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
771  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
772 
773  const ResultType tmp( serial( rhs ) );
774  schurAssign( ~lhs, tmp );
775  }
777  //**********************************************************************************************
778 
779  //**Schur product assignment to sparse matrices*************************************************
780  // No special implementation for the Schur product assignment to sparse matrices.
781  //**********************************************************************************************
782 
783  //**Multiplication assignment to dense matrices*************************************************
784  // No special implementation for the multiplication assignment to dense matrices.
785  //**********************************************************************************************
786 
787  //**Multiplication assignment to sparse matrices************************************************
788  // No special implementation for the multiplication assignment to sparse matrices.
789  //**********************************************************************************************
790 
791  //**SMP assignment to dense matrices************************************************************
805  template< typename MT2 // Type of the target dense matrix
806  , bool SO2 > // Storage order of the target dense matrix
807  friend inline auto smpAssign( DenseMatrix<MT2,SO2>& lhs, const DMatScalarMultExpr& rhs )
808  -> EnableIf_t< UseSMPAssign_v<MT2> >
809  {
811 
812  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
813  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
814 
815  smpAssign( ~lhs, rhs.matrix_ );
816  smpAssign( ~lhs, (~lhs) * rhs.scalar_ );
817  }
819  //**********************************************************************************************
820 
821  //**SMP assignment to sparse matrices***********************************************************
835  template< typename MT2 // Type of the target sparse matrix
836  , bool SO2 > // Storage order of the target sparse matrix
837  friend inline auto smpAssign( SparseMatrix<MT2,SO2>& lhs, const DMatScalarMultExpr& rhs )
838  -> EnableIf_t< UseSMPAssign_v<MT2> >
839  {
841 
842  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
843  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
844 
845  smpAssign( ~lhs, rhs.matrix_ );
846  (~lhs) *= rhs.scalar_;
847  }
849  //**********************************************************************************************
850 
851  //**SMP addition assignment to dense matrices***************************************************
865  template< typename MT2 // Type of the target dense matrix
866  , bool SO2 > // Storage order of the target dense matrix
867  friend inline auto smpAddAssign( DenseMatrix<MT2,SO2>& lhs, const DMatScalarMultExpr& rhs )
868  -> EnableIf_t< UseSMPAssign_v<MT2> >
869  {
871 
875 
876  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
877  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
878 
879  const ResultType tmp( rhs );
880  smpAddAssign( ~lhs, tmp );
881  }
883  //**********************************************************************************************
884 
885  //**SMP addition assignment to sparse matrices**************************************************
886  // No special implementation for the SMP addition assignment to sparse matrices.
887  //**********************************************************************************************
888 
889  //**SMP subtraction assignment to dense matrices************************************************
903  template< typename MT2 // Type of the target dense matrix
904  , bool SO2 > // Storage order of the target dense matrix
905  friend inline auto smpSubAssign( DenseMatrix<MT2,SO2>& lhs, const DMatScalarMultExpr& rhs )
906  -> EnableIf_t< UseSMPAssign_v<MT2> >
907  {
909 
913 
914  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
915  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
916 
917  const ResultType tmp( rhs );
918  smpSubAssign( ~lhs, tmp );
919  }
921  //**********************************************************************************************
922 
923  //**SMP subtraction assignment to sparse matrices***********************************************
924  // No special implementation for the SMP subtraction assignment to sparse matrices.
925  //**********************************************************************************************
926 
927  //**SMP Schur product assignment to dense matrices**********************************************
941  template< typename MT2 // Type of the target dense matrix
942  , bool SO2 > // Storage order of the target dense matrix
943  friend inline auto smpSchurAssign( DenseMatrix<MT2,SO2>& lhs, const DMatScalarMultExpr& rhs )
944  -> EnableIf_t< UseSMPAssign_v<MT2> >
945  {
947 
951 
952  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
953  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
954 
955  const ResultType tmp( rhs );
956  smpSchurAssign( ~lhs, tmp );
957  }
959  //**********************************************************************************************
960 
961  //**SMP Schur product assignment to sparse matrices*********************************************
962  // No special implementation for the SMP Schur product assignment to sparse matrices.
963  //**********************************************************************************************
964 
965  //**SMP multiplication assignment to dense matrices*********************************************
966  // No special implementation for the SMP multiplication assignment to dense matrices.
967  //**********************************************************************************************
968 
969  //**SMP multiplication assignment to sparse matrices********************************************
970  // No special implementation for the SMP multiplication assignment to sparse matrices.
971  //**********************************************************************************************
972 
973  //**Compile time checks*************************************************************************
980  //**********************************************************************************************
981 };
982 //*************************************************************************************************
983 
984 
985 
986 
987 //=================================================================================================
988 //
989 // GLOBAL UNARY ARITHMETIC OPERATORS
990 //
991 //=================================================================================================
992 
993 //*************************************************************************************************
1010 template< typename MT // Type of the dense matrix
1011  , bool SO > // Storage order
1012 inline decltype(auto) operator-( const DenseMatrix<MT,SO>& dm )
1013 {
1015 
1016  using ScalarType = UnderlyingBuiltin_t<MT>;
1017  using ReturnType = const DMatScalarMultExpr<MT,ScalarType,SO>;
1018  return ReturnType( ~dm, ScalarType(-1) );
1019 }
1020 //*************************************************************************************************
1021 
1022 
1023 
1024 
1025 //=================================================================================================
1026 //
1027 // GLOBAL BINARY ARITHMETIC OPERATORS
1028 //
1029 //=================================================================================================
1030 
1031 //*************************************************************************************************
1052 template< typename MT // Type of the left-hand side dense matrix
1053  , bool SO // Storage order of the left-hand side dense matrix
1054  , typename ST // Type of the right-hand side scalar
1055  , EnableIf_t< IsNumeric_v<ST> >* = nullptr >
1056 inline decltype(auto) operator*( const DenseMatrix<MT,SO>& mat, ST scalar )
1057 {
1059 
1060  using ScalarType = MultTrait_t< UnderlyingBuiltin_t<MT>, ST >;
1061  using ReturnType = const DMatScalarMultExpr<MT,ScalarType,SO>;
1062  return ReturnType( ~mat, scalar );
1063 }
1064 //*************************************************************************************************
1065 
1066 
1067 //*************************************************************************************************
1088 template< typename ST // Type of the left-hand side scalar
1089  , typename MT // Type of the right-hand side dense matrix
1090  , bool SO // Storage order of the right-hand side dense matrix
1091  , EnableIf_t< IsNumeric_v<ST> >* = nullptr >
1092 inline decltype(auto) operator*( ST scalar, const DenseMatrix<MT,SO>& mat )
1093 {
1095 
1096  using ScalarType = MultTrait_t< ST, UnderlyingBuiltin_t<MT> >;
1097  using ReturnType = const DMatScalarMultExpr<MT,ScalarType,SO>;
1098  return ReturnType( ~mat, scalar );
1099 }
1100 //*************************************************************************************************
1101 
1102 
1103 
1104 
1105 //=================================================================================================
1106 //
1107 // GLOBAL RESTRUCTURING UNARY ARITHMETIC OPERATORS
1108 //
1109 //=================================================================================================
1110 
1111 //*************************************************************************************************
1123 template< typename MT // Type of the dense matrix
1124  , typename ST // Type of the scalar
1125  , bool TF > // Transpose flag
1126 inline decltype(auto) operator-( const DMatScalarMultExpr<MT,ST,TF>& dm )
1127 {
1129 
1130  using ReturnType = const DMatScalarMultExpr<MT,ST,TF>;
1131  return ReturnType( dm.leftOperand(), -dm.rightOperand() );
1132 }
1134 //*************************************************************************************************
1135 
1136 
1137 
1138 
1139 //=================================================================================================
1140 //
1141 // GLOBAL RESTRUCTURING BINARY ARITHMETIC OPERATORS
1142 //
1143 //=================================================================================================
1144 
1145 //*************************************************************************************************
1158 template< typename MT // Type of the dense matrix of the left-hand side expression
1159  , typename ST1 // Type of the scalar of the left-hand side expression
1160  , bool SO // Storage order of the dense matrix
1161  , typename ST2 // Type of the right-hand side scalar
1162  , EnableIf_t< IsNumeric_v<ST2> >* = nullptr >
1163 inline decltype(auto) operator*( const DMatScalarMultExpr<MT,ST1,SO>& mat, ST2 scalar )
1164 {
1166 
1167  return mat.leftOperand() * ( mat.rightOperand() * scalar );
1168 }
1170 //*************************************************************************************************
1171 
1172 
1173 //*************************************************************************************************
1186 template< typename ST1 // Type of the left-hand side scalar
1187  , typename MT // Type of the dense matrix of the right-hand side expression
1188  , typename ST2 // Type of the scalar of the right-hand side expression
1189  , bool SO // Storage order of the dense matrix
1190  , EnableIf_t< IsNumeric_v<ST1> >* = nullptr >
1191 inline decltype(auto) operator*( ST1 scalar, const DMatScalarMultExpr<MT,ST2,SO>& mat )
1192 {
1194 
1195  return mat.leftOperand() * ( scalar * mat.rightOperand() );
1196 }
1198 //*************************************************************************************************
1199 
1200 
1201 //*************************************************************************************************
1214 template< typename MT // Type of the dense matrix of the left-hand side expression
1215  , typename ST1 // Type of the scalar of the left-hand side expression
1216  , bool SO // Storage order of the dense matrix
1217  , typename ST2 // Type of the right-hand side scalar
1218  , EnableIf_t< IsNumeric_v<ST2> && ( IsInvertible_v<ST1> || IsInvertible_v<ST2> ) >* = nullptr >
1219 inline decltype(auto) operator/( const DMatScalarMultExpr<MT,ST1,SO>& mat, ST2 scalar )
1220 {
1222 
1223  return mat.leftOperand() * ( mat.rightOperand() / scalar );
1224 }
1226 //*************************************************************************************************
1227 
1228 
1229 //*************************************************************************************************
1243 template< typename MT // Type of the dense matrix of the left-hand side expression
1244  , typename ST // Type of the scalar of the left-hand side expression
1245  , bool SO // Storage order of the left-hand side expression
1246  , typename VT > // Type of the right-hand side dense vector
1247 inline decltype(auto)
1248  operator*( const DMatScalarMultExpr<MT,ST,SO>& mat, const DenseVector<VT,false>& vec )
1249 {
1251 
1252  return ( mat.leftOperand() * (~vec) ) * mat.rightOperand();
1253 }
1255 //*************************************************************************************************
1256 
1257 
1258 //*************************************************************************************************
1272 template< typename VT // Type of the left-hand side dense vector
1273  , typename MT // Type of the dense matrix of the right-hand side expression
1274  , typename ST // Type of the scalar of the right-hand side expression
1275  , bool SO > // Storage order of the right-hand side expression
1276 inline decltype(auto)
1277  operator*( const DenseVector<VT,true>& vec, const DMatScalarMultExpr<MT,ST,SO>& mat )
1278 {
1280 
1281  return ( (~vec) * mat.leftOperand() ) * mat.rightOperand();
1282 }
1284 //*************************************************************************************************
1285 
1286 
1287 //*************************************************************************************************
1303 template< typename MT // Type of the dense matrix of the left-hand side expression
1304  , typename ST1 // Type of the scalar of the left-hand side expression
1305  , bool SO // Storage order of the left-hand side expression
1306  , typename VT // Type of the dense vector of the right-hand side expression
1307  , typename ST2 > // Type of the scalar of the right-hand side expression
1308 inline decltype(auto)
1309  operator*( const DMatScalarMultExpr<MT,ST1,SO>& mat, const DVecScalarMultExpr<VT,ST2,false>& vec )
1310 {
1312 
1313  return ( mat.leftOperand() * vec.leftOperand() ) * ( mat.rightOperand() * vec.rightOperand() );
1314 }
1316 //*************************************************************************************************
1317 
1318 
1319 //*************************************************************************************************
1335 template< typename VT // Type of the dense vector of the left-hand side expression
1336  , typename ST1 // Type of the scalar of the left-hand side expression
1337  , typename MT // Type of the dense matrix of the right-hand side expression
1338  , typename ST2 // Type of the scalar of the right-hand side expression
1339  , bool SO > // Storage order of the right-hand side expression
1340 inline decltype(auto)
1341  operator*( const DVecScalarMultExpr<VT,ST1,true>& vec, const DMatScalarMultExpr<MT,ST2,SO>& mat )
1342 {
1344 
1345  return ( vec.leftOperand() * mat.leftOperand() ) * ( vec.rightOperand() * mat.rightOperand() );
1346 }
1348 //*************************************************************************************************
1349 
1350 
1351 //*************************************************************************************************
1365 template< typename MT // Type of the dense matrix of the left-hand side expression
1366  , typename ST // Type of the scalar of the left-hand side expression
1367  , bool SO // Storage order of the left-hand side expression
1368  , typename VT > // Type of the right-hand side sparse vector
1369 inline decltype(auto)
1370  operator*( const DMatScalarMultExpr<MT,ST,SO>& mat, const SparseVector<VT,false>& vec )
1371 {
1373 
1374  return ( mat.leftOperand() * (~vec) ) * mat.rightOperand();
1375 }
1377 //*************************************************************************************************
1378 
1379 
1380 //*************************************************************************************************
1394 template< typename VT // Type of the left-hand side sparse vector
1395  , typename MT // Type of the dense matrix of the right-hand side expression
1396  , typename ST // Type of the scalar of the right-hand side expression
1397  , bool SO > // Storage order of the right-hand side expression
1398 inline decltype(auto)
1399  operator*( const SparseVector<VT,true>& vec, const DMatScalarMultExpr<MT,ST,SO>& mat )
1400 {
1402 
1403  return ( (~vec) * mat.leftOperand() ) * mat.rightOperand();
1404 }
1406 //*************************************************************************************************
1407 
1408 
1409 //*************************************************************************************************
1425 template< typename MT // Type of the dense matrix of the left-hand side expression
1426  , typename ST1 // Type of the scalar of the left-hand side expression
1427  , bool SO // Storage order of the left-hand side expression
1428  , typename VT // Type of the sparse vector of the right-hand side expression
1429  , typename ST2 > // Type of the scalar of the right-hand side expression
1430 inline decltype(auto)
1431  operator*( const DMatScalarMultExpr<MT,ST1,SO>& mat, const SVecScalarMultExpr<VT,ST2,false>& vec )
1432 {
1434 
1435  return ( mat.leftOperand() * vec.leftOperand() ) * ( mat.rightOperand() * vec.rightOperand() );
1436 }
1438 //*************************************************************************************************
1439 
1440 
1441 //*************************************************************************************************
1457 template< typename VT // Type of the sparse vector of the left-hand side expression
1458  , typename ST1 // Type of the scalar of the left-hand side expression
1459  , typename MT // Type of the dense matrix of the right-hand side expression
1460  , typename ST2 // Type of the scalar of the right-hand side expression
1461  , bool SO > // Storage order of the right-hand side expression
1462 inline decltype(auto)
1463  operator*( const SVecScalarMultExpr<VT,ST1,true>& vec, const DMatScalarMultExpr<MT,ST2,SO>& mat )
1464 {
1466 
1467  return ( vec.leftOperand() * mat.leftOperand() ) * ( vec.rightOperand() * mat.rightOperand() );
1468 }
1470 //*************************************************************************************************
1471 
1472 
1473 //*************************************************************************************************
1487 template< typename MT1 // Type of the dense matrix of the left-hand side expression
1488  , typename ST // Type of the scalar of the left-hand side expression
1489  , bool SO1 // Storage order of the left-hand side expression
1490  , typename MT2 // Type of the right-hand side dense matrix
1491  , bool SO2 > // Storage order of the right-hand side dense matrix
1492 inline decltype(auto)
1493  operator*( const DMatScalarMultExpr<MT1,ST,SO1>& lhs, const DenseMatrix<MT2,SO2>& rhs )
1494 {
1496 
1497  return ( lhs.leftOperand() * (~rhs) ) * lhs.rightOperand();
1498 }
1500 //*************************************************************************************************
1501 
1502 
1503 //*************************************************************************************************
1517 template< typename MT1 // Type of the left-hand side dense matrix
1518  , bool SO1 // Storage order of the left-hand side dense matrix
1519  , typename MT2 // Type of the dense matrix of the right-hand side expression
1520  , typename ST // Type of the scalar of the right-hand side expression
1521  , bool SO2 > // Storage order of the right-hand side expression
1522 inline decltype(auto)
1523  operator*( const DenseMatrix<MT1,SO1>& lhs, const DMatScalarMultExpr<MT2,ST,SO2>& rhs )
1524 {
1526 
1527  return ( (~lhs) * rhs.leftOperand() ) * rhs.rightOperand();
1528 }
1530 //*************************************************************************************************
1531 
1532 
1533 //*************************************************************************************************
1547 template< typename MT1 // Type of the dense matrix of the left-hand side expression
1548  , typename ST1 // Type of the scalar of the left-hand side expression
1549  , bool SO1 // Storage order of the left-hand side expression
1550  , typename MT2 // Type of the right-hand side dense matrix
1551  , typename ST2 // Type of the scalar of the right-hand side expression
1552  , bool SO2 > // Storage order of the right-hand side expression
1553 inline decltype(auto)
1554  operator*( const DMatScalarMultExpr<MT1,ST1,SO1>& lhs, const DMatScalarMultExpr<MT2,ST2,SO2>& rhs )
1555 {
1557 
1558  return ( lhs.leftOperand() * rhs.leftOperand() ) * ( lhs.rightOperand() * rhs.rightOperand() );
1559 }
1561 //*************************************************************************************************
1562 
1563 
1564 //*************************************************************************************************
1578 template< typename MT1 // Type of the dense matrix of the left-hand side expression
1579  , typename ST // Type of the scalar of the left-hand side expression
1580  , bool SO1 // Storage order of the left-hand side expression
1581  , typename MT2 // Type of the right-hand side sparse matrix
1582  , bool SO2 > // Storage order of the right-hand side sparse matrix
1583 inline decltype(auto)
1584  operator*( const DMatScalarMultExpr<MT1,ST,SO1>& lhs, const SparseMatrix<MT2,SO2>& rhs )
1585 {
1587 
1588  return ( lhs.leftOperand() * (~rhs) ) * lhs.rightOperand();
1589 }
1591 //*************************************************************************************************
1592 
1593 
1594 //*************************************************************************************************
1608 template< typename MT1 // Type of the left-hand side sparse matrix
1609  , bool SO1 // Storage order of the left-hand side sparse matrix
1610  , typename MT2 // Type of the dense matrix of the right-hand side expression
1611  , typename ST // Type of the scalar of the right-hand side expression
1612  , bool SO2 > // Storage order of the right-hand side expression
1613 inline decltype(auto)
1614  operator*( const SparseMatrix<MT1,SO1>& lhs, const DMatScalarMultExpr<MT2,ST,SO2>& rhs )
1615 {
1617 
1618  return ( (~lhs) * rhs.leftOperand() ) * rhs.rightOperand();
1619 }
1621 //*************************************************************************************************
1622 
1623 
1624 //*************************************************************************************************
1639 template< typename MT1 // Type of the dense matrix of the left-hand side expression
1640  , typename ST1 // Type of the scalar of the left-hand side expression
1641  , bool SO1 // Storage order of the left-hand side expression
1642  , typename MT2 // Type of the sparse matrix of the right-hand side expression
1643  , typename ST2 // Type of the scalar of the right-hand side expression
1644  , bool SO2 > // Storage order of the right-hand side expression
1645 inline decltype(auto)
1646  operator*( const DMatScalarMultExpr<MT1,ST1,SO1>& mat, const SMatScalarMultExpr<MT2,ST2,SO2>& vec )
1647 {
1649 
1650  return ( mat.leftOperand() * vec.leftOperand() ) * ( mat.rightOperand() * vec.rightOperand() );
1651 }
1653 //*************************************************************************************************
1654 
1655 
1656 //*************************************************************************************************
1671 template< typename MT1 // Type of the sparse matrix of the left-hand side expression
1672  , typename ST1 // Type of the scalar of the left-hand side expression
1673  , bool SO1 // Storage order of the left-hand side expression
1674  , typename MT2 // Type of the dense matrix of the right-hand side expression
1675  , typename ST2 // Type of the scalar of the right-hand side expression
1676  , bool SO2 > // Storage order of the right-hand side expression
1677 inline decltype(auto)
1678  operator*( const SMatScalarMultExpr<MT1,ST1,SO1>& mat, const DMatScalarMultExpr<MT2,ST2,SO2>& vec )
1679 {
1681 
1682  return ( mat.leftOperand() * vec.leftOperand() ) * ( mat.rightOperand() * vec.rightOperand() );
1683 }
1685 //*************************************************************************************************
1686 
1687 
1688 
1689 
1690 //=================================================================================================
1691 //
1692 // ISALIGNED SPECIALIZATIONS
1693 //
1694 //=================================================================================================
1695 
1696 //*************************************************************************************************
1698 template< typename MT, typename ST, bool SO >
1699 struct IsAligned< DMatScalarMultExpr<MT,ST,SO> >
1700  : public IsAligned<MT>
1701 {};
1703 //*************************************************************************************************
1704 
1705 
1706 
1707 
1708 //=================================================================================================
1709 //
1710 // ISPADDED SPECIALIZATIONS
1711 //
1712 //=================================================================================================
1713 
1714 //*************************************************************************************************
1716 template< typename MT, typename ST, bool SO >
1717 struct IsPadded< DMatScalarMultExpr<MT,ST,SO> >
1718  : public IsPadded<MT>
1719 {};
1721 //*************************************************************************************************
1722 
1723 } // namespace blaze
1724 
1725 #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:427
Data type constraint.
Constraint on the data type.
RightOperand scalar_
Scalar of the multiplication expression.
Definition: DMatScalarMultExpr.h:415
Header file for basic type definitions.
typename If< Condition, T1, T2 >::Type If_t
Auxiliary alias template for the If class template.The If_t alias template provides a convenient shor...
Definition: If.h:109
ElementType * PointerType
Pointer return type.
Definition: DMatScalarMultExpr.h:186
typename T::ResultType ResultType_t
Alias declaration for nested ResultType type definitions.The ResultType_t alias declaration provides ...
Definition: Aliases.h:390
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:533
#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:338
RightOperand scalar_
Right-hand side scalar of the multiplication expression.
Definition: DMatScalarMultExpr.h:606
size_t rows() const noexcept
Returns the current number of rows of the matrix.
Definition: DMatScalarMultExpr.h:523
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:597
ReferenceType reference
Reference return type.
Definition: DMatScalarMultExpr.h:194
static constexpr bool returnExpr
Compilation switch for the selection of the subscript operator return type.
Definition: DMatScalarMultExpr.h:118
MultTrait_t< RT, ST > ResultType
Result type for expression template evaluations.
Definition: DMatScalarMultExpr.h:159
Header file for the Computation base class.
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:432
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:294
Base class for dense matrices.The DenseMatrix class is a base class for all dense matrix classes....
Definition: DenseMatrix.h:81
Base class for sparse matrices.The SparseMatrix class is a base class for all sparse matrix classes....
Definition: Forward.h:145
typename T::ElementType ElementType_t
Alias declaration for nested ElementType type definitions.The ElementType_t alias declaration provide...
Definition: Aliases.h:170
ReturnType operator *() const
Direct access to the element at the current iterator position.
Definition: DMatScalarMultExpr.h:284
std::random_access_iterator_tag IteratorCategory
The iterator category.
Definition: DMatScalarMultExpr.h:184
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:565
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:99
#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:414
Header file for the DenseMatrix base class.
const If_t< returnExpr, ExprReturnType, ElementType > ReturnType
Return type for expression template evaluations.
Definition: DMatScalarMultExpr.h:165
Header file for all SIMD functionality.
bool operator==(const ConstIterator &rhs) const
Equality comparison between two ConstIterator objects.
Definition: DMatScalarMultExpr.h:305
If_t< useAssign, const ResultType, const DMatScalarMultExpr & > CompositeType
Data type for composite expression templates.
Definition: DMatScalarMultExpr.h:168
ValueType value_type
Type of the underlying elements.
Definition: DMatScalarMultExpr.h:192
#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:553
BLAZE_ALWAYS_INLINE auto load(size_t i, size_t j) const noexcept
Access to the SIMD elements of the matrix.
Definition: DMatScalarMultExpr.h:487
ElementType_t< ResultType > ElementType
Resulting element type.
Definition: DMatScalarMultExpr.h:162
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:349
BLAZE_DEVICE_CALLABLE ConstIterator & operator-=(size_t dec)
Subtraction assignment operator.
Definition: DMatScalarMultExpr.h:231
LeftOperand matrix_
Left-hand side dense matrix of the multiplication expression.
Definition: DMatScalarMultExpr.h:605
ConstIterator_t< MT > IteratorType
ConstIterator type of the dense matrix expression.
Definition: DMatScalarMultExpr.h:198
Constraint on the data type.
decltype(std::declval< RN >() *std::declval< ST >()) ExprReturnType
Expression return type for the subscript operator.
Definition: DMatScalarMultExpr.h:121
DifferenceType operator-(const ConstIterator &rhs) const
Calculating the number of elements between two iterators.
Definition: DMatScalarMultExpr.h:371
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:407
Header file for the IsPadded type trait.
OppositeType_t< ResultType > OppositeType
Result type with opposite storage order for expression template evaluations.
Definition: DMatScalarMultExpr.h:160
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:193
ConstIterator(IteratorType iterator, RightOperand scalar)
Constructor for the ConstIterator class.
Definition: DMatScalarMultExpr.h:207
friend const ConstIterator operator+(size_t inc, const ConstIterator &it)
Addition between an integral value and a ConstIterator.
Definition: DMatScalarMultExpr.h:395
ReturnType at(size_t i, size_t j) const
Checked access to the matrix elements.
Definition: DMatScalarMultExpr.h:469
Header file for the IsNumeric type trait.
BLAZE_DEVICE_CALLABLE const ConstIterator operator--(int)
Post-decrement operator.
Definition: DMatScalarMultExpr.h:274
Header file for the HasSIMDMult type trait.
TransposeType_t< ResultType > TransposeType
Transpose type for expression template evaluations.
Definition: DMatScalarMultExpr.h:161
Header file for the MatScalarMultExpr base class.
ST RightOperand
Composite type of the right-hand side scalar value.
Definition: DMatScalarMultExpr.h:174
ElementType & ReferenceType
Reference return type.
Definition: DMatScalarMultExpr.h:187
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:188
static constexpr bool simdEnabled
Compilation switch for the expression template evaluation strategy.
Definition: DMatScalarMultExpr.h:422
typename UnderlyingBuiltin< T >::Type UnderlyingBuiltin_t
Auxiliary alias declaration for the UnderlyingBuiltin type trait.The UnderlyingBuiltin_t alias declar...
Definition: UnderlyingBuiltin.h:116
BLAZE_DEVICE_CALLABLE ConstIterator & operator+=(size_t inc)
Addition assignment operator.
Definition: DMatScalarMultExpr.h:219
#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
Header file for all forward declarations for expression class templates.
ConstIterator begin(size_t i) const
Returns an iterator to the first non-zero element of row i.
Definition: DMatScalarMultExpr.h:502
BLAZE_ALWAYS_INLINE const EnableIf_t< IsIntegral_v< T > &&HasSize_v< T, 1UL >, If_t< IsSigned_v< T >, SIMDint8, SIMDuint8 > > set(T value) noexcept
Sets all values in the vector to the given 1-byte integral value.
Definition: Set.h:75
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:105
#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:513
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:185
bool isAliased(const T *alias) const noexcept
Returns whether the expression is aliased with the given address alias.
Definition: DMatScalarMultExpr.h:577
friend const ConstIterator operator+(const ConstIterator &it, size_t inc)
Addition between a ConstIterator and an integral value.
Definition: DMatScalarMultExpr.h:383
Header file for the IsInvertible type trait.
BLAZE_DEVICE_CALLABLE ConstIterator & operator--()
Pre-decrement operator.
Definition: DMatScalarMultExpr.h:263
bool operator>=(const ConstIterator &rhs) const
Greater-than comparison between two ConstIterator objects.
Definition: DMatScalarMultExpr.h:360
typename T::ConstIterator ConstIterator_t
Alias declaration for nested ConstIterator type definitions.The ConstIterator_t alias declaration pro...
Definition: Aliases.h:110
ReturnType_t< MT > RN
Return type of the dense matrix expression.
Definition: DMatScalarMultExpr.h:106
static constexpr bool useAssign
Compilation switch for the serial evaluation strategy of the multiplication expression.
Definition: DMatScalarMultExpr.h:132
Macro for CUDA compatibility.
BLAZE_DEVICE_CALLABLE ConstIterator & operator++()
Pre-increment operator.
Definition: DMatScalarMultExpr.h:242
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:454
DMatScalarMultExpr(const MT &matrix, ST scalar) noexcept
Constructor for the DMatScalarMultExpr class.
Definition: DMatScalarMultExpr.h:441
BLAZE_DEVICE_CALLABLE const ConstIterator operator++(int)
Post-increment operator.
Definition: DMatScalarMultExpr.h:253
Iterator over the elements of the dense matrix.
Definition: DMatScalarMultExpr.h:180
bool operator<(const ConstIterator &rhs) const
Less-than comparison between two ConstIterator objects.
Definition: DMatScalarMultExpr.h:327
bool isAligned() const noexcept
Returns whether the operands of the expression are properly aligned in memory.
Definition: DMatScalarMultExpr.h:587
ElementType_t< MT > ET
Element type of the dense matrix expression.
Definition: DMatScalarMultExpr.h:107
#define BLAZE_DEVICE_CALLABLE
Conditional macro that sets host and device attributes when compiled with CUDA.
Definition: HostDevice.h:94
bool operator!=(const ConstIterator &rhs) const
Inequality comparison between two ConstIterator objects.
Definition: DMatScalarMultExpr.h:316
LeftOperand leftOperand() const noexcept
Returns the left-hand side dense matrix operand.
Definition: DMatScalarMultExpr.h:543
If_t< IsExpression_v< MT >, const MT, const MT & > LeftOperand
Composite type of the left-hand side dense matrix expression.
Definition: DMatScalarMultExpr.h:171
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:108
#define BLAZE_INTERNAL_ASSERT(expr, msg)
Run time assertion macro for internal checks.In case of an invalid run time expression,...
Definition: Assert.h:101
IteratorCategory iterator_category
The iterator category.
Definition: DMatScalarMultExpr.h:191
Header file for the IsExpression type trait class.
Header file for the function trace functionality.