DMatScalarMultExpr.h
Go to the documentation of this file.
1 //=================================================================================================
33 //=================================================================================================
34 
35 #ifndef _BLAZE_MATH_EXPRESSIONS_DMATSCALARMULTEXPR_H_
36 #define _BLAZE_MATH_EXPRESSIONS_DMATSCALARMULTEXPR_H_
37 
38 
39 //*************************************************************************************************
40 // Includes
41 //*************************************************************************************************
42 
43 #include <iterator>
44 #include <blaze/math/Aliases.h>
48 #include <blaze/math/Exception.h>
55 #include <blaze/math/SIMD.h>
75 #include <blaze/system/Inline.h>
77 #include <blaze/util/Assert.h>
80 #include <blaze/util/EnableIf.h>
82 #include <blaze/util/mpl/And.h>
83 #include <blaze/util/mpl/If.h>
84 #include <blaze/util/mpl/Or.h>
85 #include <blaze/util/Types.h>
87 
88 
89 namespace blaze {
90 
91 //=================================================================================================
92 //
93 // CLASS DMATSCALARMULTEXPR
94 //
95 //=================================================================================================
96 
97 //*************************************************************************************************
104 template< typename MT // Type of the left-hand side dense matrix
105  , typename ST // Type of the right-hand side scalar value
106  , bool SO > // Storage order
108  : public MatScalarMultExpr< DenseMatrix< DMatScalarMultExpr<MT,ST,SO>, SO > >
109  , private Computation
110 {
111  private:
112  //**Type definitions****************************************************************************
113  using RT = ResultType_<MT>;
114  using RN = ReturnType_<MT>;
117  //**********************************************************************************************
118 
119  //**Return type evaluation**********************************************************************
121 
126  enum : bool { returnExpr = !IsTemporary<RN>::value };
127 
130  //**********************************************************************************************
131 
132  //**Serial evaluation strategy******************************************************************
134 
140  enum : bool { useAssign = IsComputation<MT>::value && RequiresEvaluation<MT>::value };
141 
143  template< typename MT2 >
145  struct UseAssign {
146  enum : bool { value = useAssign };
147  };
149  //**********************************************************************************************
150 
151  //**Parallel evaluation strategy****************************************************************
153 
159  template< typename MT2 >
160  struct UseSMPAssign {
161  enum : bool { value = ( !MT2::smpAssignable || !MT::smpAssignable ) && useAssign };
162  };
164  //**********************************************************************************************
165 
166  public:
167  //**Type definitions****************************************************************************
173 
176 
179 
181  using LeftOperand = If_< IsExpression<MT>, const MT, const MT& >;
182 
184  using RightOperand = ST;
185  //**********************************************************************************************
186 
187  //**ConstIterator class definition**************************************************************
191  {
192  public:
193  //**Type definitions*************************************************************************
194  using IteratorCategory = std::random_access_iterator_tag;
199 
200  // STL iterator requirements
206 
209  //*******************************************************************************************
210 
211  //**Constructor******************************************************************************
217  explicit inline ConstIterator( IteratorType iterator, RightOperand scalar )
218  : iterator_( iterator ) // Iterator to the current element
219  , scalar_ ( scalar ) // Scalar of the multiplication expression
220  {}
221  //*******************************************************************************************
222 
223  //**Addition assignment operator*************************************************************
229  inline ConstIterator& operator+=( size_t inc ) {
230  iterator_ += inc;
231  return *this;
232  }
233  //*******************************************************************************************
234 
235  //**Subtraction assignment operator**********************************************************
241  inline ConstIterator& operator-=( size_t dec ) {
242  iterator_ -= dec;
243  return *this;
244  }
245  //*******************************************************************************************
246 
247  //**Prefix increment operator****************************************************************
253  ++iterator_;
254  return *this;
255  }
256  //*******************************************************************************************
257 
258  //**Postfix increment operator***************************************************************
263  inline const ConstIterator operator++( int ) {
264  return ConstIterator( iterator_++ );
265  }
266  //*******************************************************************************************
267 
268  //**Prefix decrement operator****************************************************************
274  --iterator_;
275  return *this;
276  }
277  //*******************************************************************************************
278 
279  //**Postfix decrement operator***************************************************************
284  inline const ConstIterator operator--( int ) {
285  return ConstIterator( iterator_-- );
286  }
287  //*******************************************************************************************
288 
289  //**Element access operator******************************************************************
294  inline ReturnType operator*() const {
295  return *iterator_ * scalar_;
296  }
297  //*******************************************************************************************
298 
299  //**Load function****************************************************************************
304  inline auto load() const noexcept {
305  return iterator_.load() * set( scalar_ );
306  }
307  //*******************************************************************************************
308 
309  //**Equality operator************************************************************************
315  inline bool operator==( const ConstIterator& rhs ) const {
316  return iterator_ == rhs.iterator_;
317  }
318  //*******************************************************************************************
319 
320  //**Inequality operator**********************************************************************
326  inline bool operator!=( const ConstIterator& rhs ) const {
327  return iterator_ != rhs.iterator_;
328  }
329  //*******************************************************************************************
330 
331  //**Less-than operator***********************************************************************
337  inline bool operator<( const ConstIterator& rhs ) const {
338  return iterator_ < rhs.iterator_;
339  }
340  //*******************************************************************************************
341 
342  //**Greater-than operator********************************************************************
348  inline bool operator>( const ConstIterator& rhs ) const {
349  return iterator_ > rhs.iterator_;
350  }
351  //*******************************************************************************************
352 
353  //**Less-or-equal-than operator**************************************************************
359  inline bool operator<=( const ConstIterator& rhs ) const {
360  return iterator_ <= rhs.iterator_;
361  }
362  //*******************************************************************************************
363 
364  //**Greater-or-equal-than operator***********************************************************
370  inline bool operator>=( const ConstIterator& rhs ) const {
371  return iterator_ >= rhs.iterator_;
372  }
373  //*******************************************************************************************
374 
375  //**Subtraction operator*********************************************************************
381  inline DifferenceType operator-( const ConstIterator& rhs ) const {
382  return iterator_ - rhs.iterator_;
383  }
384  //*******************************************************************************************
385 
386  //**Addition operator************************************************************************
393  friend inline const ConstIterator operator+( const ConstIterator& it, size_t inc ) {
394  return ConstIterator( it.iterator_ + inc, it.scalar_ );
395  }
396  //*******************************************************************************************
397 
398  //**Addition operator************************************************************************
405  friend inline const ConstIterator operator+( size_t inc, const ConstIterator& it ) {
406  return ConstIterator( it.iterator_ + inc, it.scalar_ );
407  }
408  //*******************************************************************************************
409 
410  //**Subtraction operator*********************************************************************
417  friend inline const ConstIterator operator-( const ConstIterator& it, size_t dec ) {
418  return ConstIterator( it.iterator_ - dec, it.scalar_ );
419  }
420  //*******************************************************************************************
421 
422  private:
423  //**Member variables*************************************************************************
426  //*******************************************************************************************
427  };
428  //**********************************************************************************************
429 
430  //**Compilation flags***************************************************************************
432  enum : bool { simdEnabled = MT::simdEnabled &&
435  HasSIMDMult<UnderlyingElement_<ET>,ST>::value ) };
436 
438  enum : bool { smpAssignable = MT::smpAssignable };
439  //**********************************************************************************************
440 
441  //**SIMD properties*****************************************************************************
443  enum : size_t { SIMDSIZE = SIMDTrait<ElementType>::size };
444  //**********************************************************************************************
445 
446  //**Constructor*********************************************************************************
452  explicit inline DMatScalarMultExpr( const MT& matrix, ST scalar ) noexcept
453  : matrix_( matrix ) // Left-hand side dense matrix of the multiplication expression
454  , scalar_( scalar ) // Right-hand side scalar of the multiplication expression
455  {}
456  //**********************************************************************************************
457 
458  //**Access operator*****************************************************************************
465  inline ReturnType operator()( size_t i, size_t j ) const {
466  BLAZE_INTERNAL_ASSERT( i < matrix_.rows() , "Invalid row access index" );
467  BLAZE_INTERNAL_ASSERT( j < matrix_.columns(), "Invalid column access index" );
468  return matrix_(i,j) * scalar_;
469  }
470  //**********************************************************************************************
471 
472  //**At function*********************************************************************************
480  inline ReturnType at( size_t i, size_t j ) const {
481  if( i >= matrix_.rows() ) {
482  BLAZE_THROW_OUT_OF_RANGE( "Invalid row access index" );
483  }
484  if( j >= matrix_.columns() ) {
485  BLAZE_THROW_OUT_OF_RANGE( "Invalid column access index" );
486  }
487  return (*this)(i,j);
488  }
489  //**********************************************************************************************
490 
491  //**Load function*******************************************************************************
498  BLAZE_ALWAYS_INLINE auto load( size_t i, size_t j ) const noexcept {
499  BLAZE_INTERNAL_ASSERT( i < matrix_.rows() , "Invalid row access index" );
500  BLAZE_INTERNAL_ASSERT( j < matrix_.columns(), "Invalid column access index" );
501  BLAZE_INTERNAL_ASSERT( !SO || ( i % SIMDSIZE == 0UL ), "Invalid row access index" );
502  BLAZE_INTERNAL_ASSERT( SO || ( j % SIMDSIZE == 0UL ), "Invalid column access index" );
503  return matrix_.load(i,j) * set( scalar_ );
504  }
505  //**********************************************************************************************
506 
507  //**Begin function******************************************************************************
513  inline ConstIterator begin( size_t i ) const {
514  return ConstIterator( matrix_.begin(i), scalar_ );
515  }
516  //**********************************************************************************************
517 
518  //**End function********************************************************************************
524  inline ConstIterator end( size_t i ) const {
525  return ConstIterator( matrix_.end(i), scalar_ );
526  }
527  //**********************************************************************************************
528 
529  //**Rows function*******************************************************************************
534  inline size_t rows() const noexcept {
535  return matrix_.rows();
536  }
537  //**********************************************************************************************
538 
539  //**Columns function****************************************************************************
544  inline size_t columns() const noexcept {
545  return matrix_.columns();
546  }
547  //**********************************************************************************************
548 
549  //**Left operand access*************************************************************************
554  inline LeftOperand leftOperand() const noexcept {
555  return matrix_;
556  }
557  //**********************************************************************************************
558 
559  //**Right operand access************************************************************************
564  inline RightOperand rightOperand() const noexcept {
565  return scalar_;
566  }
567  //**********************************************************************************************
568 
569  //**********************************************************************************************
575  template< typename T >
576  inline bool canAlias( const T* alias ) const noexcept {
577  return IsExpression<MT>::value && matrix_.canAlias( alias );
578  }
579  //**********************************************************************************************
580 
581  //**********************************************************************************************
587  template< typename T >
588  inline bool isAliased( const T* alias ) const noexcept {
589  return matrix_.isAliased( alias );
590  }
591  //**********************************************************************************************
592 
593  //**********************************************************************************************
598  inline bool isAligned() const noexcept {
599  return matrix_.isAligned();
600  }
601  //**********************************************************************************************
602 
603  //**********************************************************************************************
608  inline bool canSMPAssign() const noexcept {
609  return matrix_.canSMPAssign() ||
610  ( rows() * columns() >= SMP_DMATSCALARMULT_THRESHOLD );
611  }
612  //**********************************************************************************************
613 
614  private:
615  //**Member variables****************************************************************************
618  //**********************************************************************************************
619 
620  //**Assignment to dense matrices****************************************************************
634  template< typename MT2 // Type of the target dense matrix
635  , bool SO2 > // Storage order of the target dense matrix
636  friend inline EnableIf_< UseAssign<MT2> >
637  assign( DenseMatrix<MT2,SO2>& lhs, const DMatScalarMultExpr& rhs )
638  {
640 
641  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
642  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
643 
644  assign( ~lhs, rhs.matrix_ );
645  assign( ~lhs, (~lhs) * rhs.scalar_ );
646  }
648  //**********************************************************************************************
649 
650  //**Assignment to sparse matrices***************************************************************
664  template< typename MT2 // Type of the target sparse matrix
665  , bool SO2 > // Storage order of the target sparse matrix
666  friend inline EnableIf_< UseAssign<MT2> >
667  assign( SparseMatrix<MT2,SO2>& lhs, const DMatScalarMultExpr& rhs )
668  {
670 
671  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
672  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
673 
674  assign( ~lhs, rhs.matrix_ );
675  (~lhs) *= rhs.scalar_;
676  }
678  //**********************************************************************************************
679 
680  //**Addition assignment to dense matrices*******************************************************
694  template< typename MT2 // Type of the target dense matrix
695  , bool SO2 > // Storage order of the target dense matrix
696  friend inline EnableIf_< UseAssign<MT2> >
697  addAssign( DenseMatrix<MT2,SO2>& lhs, const DMatScalarMultExpr& rhs )
698  {
700 
704 
705  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
706  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
707 
708  const ResultType tmp( serial( rhs ) );
709  addAssign( ~lhs, tmp );
710  }
712  //**********************************************************************************************
713 
714  //**Addition assignment to sparse matrices******************************************************
715  // No special implementation for the addition assignment to sparse matrices.
716  //**********************************************************************************************
717 
718  //**Subtraction assignment to dense matrices****************************************************
732  template< typename MT2 // Type of the target dense matrix
733  , bool SO2 > // Storage order of the target dense matrix
734  friend inline EnableIf_< UseAssign<MT2> >
735  subAssign( DenseMatrix<MT2,SO2>& lhs, const DMatScalarMultExpr& rhs )
736  {
738 
742 
743  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
744  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
745 
746  const ResultType tmp( serial( rhs ) );
747  subAssign( ~lhs, tmp );
748  }
750  //**********************************************************************************************
751 
752  //**Subtraction assignment to sparse matrices***************************************************
753  // No special implementation for the subtraction assignment to sparse matrices.
754  //**********************************************************************************************
755 
756  //**Schur product assignment to dense matrices**************************************************
770  template< typename MT2 // Type of the target dense matrix
771  , bool SO2 > // Storage order of the target dense matrix
772  friend inline EnableIf_< UseAssign<MT2> >
773  schurAssign( DenseMatrix<MT2,SO2>& lhs, const DMatScalarMultExpr& rhs )
774  {
776 
780 
781  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
782  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
783 
784  const ResultType tmp( serial( rhs ) );
785  schurAssign( ~lhs, tmp );
786  }
788  //**********************************************************************************************
789 
790  //**Schur product assignment to sparse matrices*************************************************
791  // No special implementation for the Schur product assignment to sparse matrices.
792  //**********************************************************************************************
793 
794  //**Multiplication assignment to dense matrices*************************************************
795  // No special implementation for the multiplication assignment to dense matrices.
796  //**********************************************************************************************
797 
798  //**Multiplication assignment to sparse matrices************************************************
799  // No special implementation for the multiplication assignment to sparse matrices.
800  //**********************************************************************************************
801 
802  //**SMP assignment to dense matrices************************************************************
816  template< typename MT2 // Type of the target dense matrix
817  , bool SO2 > // Storage order of the target dense matrix
818  friend inline EnableIf_< UseSMPAssign<MT2> >
820  {
822 
823  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
824  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
825 
826  smpAssign( ~lhs, rhs.matrix_ );
827  smpAssign( ~lhs, (~lhs) * rhs.scalar_ );
828  }
830  //**********************************************************************************************
831 
832  //**SMP assignment to sparse matrices***********************************************************
846  template< typename MT2 // Type of the target sparse matrix
847  , bool SO2 > // Storage order of the target sparse matrix
848  friend inline EnableIf_< UseSMPAssign<MT2> >
850  {
852 
853  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
854  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
855 
856  smpAssign( ~lhs, rhs.matrix_ );
857  (~lhs) *= rhs.scalar_;
858  }
860  //**********************************************************************************************
861 
862  //**SMP addition assignment to dense matrices***************************************************
876  template< typename MT2 // Type of the target dense matrix
877  , bool SO2 > // Storage order of the target dense matrix
878  friend inline EnableIf_< UseSMPAssign<MT2> >
880  {
882 
886 
887  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
888  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
889 
890  const ResultType tmp( rhs );
891  smpAddAssign( ~lhs, tmp );
892  }
894  //**********************************************************************************************
895 
896  //**SMP addition assignment to sparse matrices**************************************************
897  // No special implementation for the SMP addition assignment to sparse matrices.
898  //**********************************************************************************************
899 
900  //**SMP subtraction assignment to dense matrices************************************************
914  template< typename MT2 // Type of the target dense matrix
915  , bool SO2 > // Storage order of the target dense matrix
916  friend inline EnableIf_< UseSMPAssign<MT2> >
918  {
920 
924 
925  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
926  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
927 
928  const ResultType tmp( rhs );
929  smpSubAssign( ~lhs, tmp );
930  }
932  //**********************************************************************************************
933 
934  //**SMP subtraction assignment to sparse matrices***********************************************
935  // No special implementation for the SMP subtraction assignment to sparse matrices.
936  //**********************************************************************************************
937 
938  //**SMP Schur product assignment to dense matrices**********************************************
952  template< typename MT2 // Type of the target dense matrix
953  , bool SO2 > // Storage order of the target dense matrix
954  friend inline EnableIf_< UseSMPAssign<MT2> >
956  {
958 
962 
963  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
964  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
965 
966  const ResultType tmp( rhs );
967  smpSchurAssign( ~lhs, tmp );
968  }
970  //**********************************************************************************************
971 
972  //**SMP Schur product assignment to sparse matrices*********************************************
973  // No special implementation for the SMP Schur product assignment to sparse matrices.
974  //**********************************************************************************************
975 
976  //**SMP multiplication assignment to dense matrices*********************************************
977  // No special implementation for the SMP multiplication assignment to dense matrices.
978  //**********************************************************************************************
979 
980  //**SMP multiplication assignment to sparse matrices********************************************
981  // No special implementation for the SMP multiplication assignment to sparse matrices.
982  //**********************************************************************************************
983 
984  //**Compile time checks*************************************************************************
991  //**********************************************************************************************
992 };
993 //*************************************************************************************************
994 
995 
996 
997 
998 //=================================================================================================
999 //
1000 // GLOBAL UNARY ARITHMETIC OPERATORS
1001 //
1002 //=================================================================================================
1003 
1004 //*************************************************************************************************
1021 template< typename MT // Type of the dense matrix
1022  , bool SO > // Storage order
1023 inline decltype(auto) operator-( const DenseMatrix<MT,SO>& dm )
1024 {
1026 
1027  using ScalarType = UnderlyingBuiltin_<MT>;
1029  return ReturnType( ~dm, ScalarType(-1) );
1030 }
1031 //*************************************************************************************************
1032 
1033 
1034 
1035 
1036 //=================================================================================================
1037 //
1038 // GLOBAL BINARY ARITHMETIC OPERATORS
1039 //
1040 //=================================================================================================
1041 
1042 //*************************************************************************************************
1063 template< typename MT // Type of the left-hand side dense matrix
1064  , bool SO // Storage order of the left-hand side dense matrix
1065  , typename ST // Type of the right-hand side scalar
1066  , typename = EnableIf_< IsNumeric<ST> > >
1067 inline decltype(auto) operator*( const DenseMatrix<MT,SO>& mat, ST scalar )
1068 {
1070 
1071  using ScalarType = MultTrait_< UnderlyingBuiltin_<MT>, ST >;
1073  return ReturnType( ~mat, scalar );
1074 }
1075 //*************************************************************************************************
1076 
1077 
1078 //*************************************************************************************************
1099 template< typename ST // Type of the left-hand side scalar
1100  , typename MT // Type of the right-hand side dense matrix
1101  , bool SO // Storage order of the right-hand side dense matrix
1102  , typename = EnableIf_< IsNumeric<ST> > >
1103 inline decltype(auto) operator*( ST scalar, const DenseMatrix<MT,SO>& mat )
1104 {
1106 
1107  using ScalarType = MultTrait_< ST, UnderlyingBuiltin_<MT> >;
1109  return ReturnType( ~mat, scalar );
1110 }
1111 //*************************************************************************************************
1112 
1113 
1114 
1115 
1116 //=================================================================================================
1117 //
1118 // GLOBAL RESTRUCTURING UNARY ARITHMETIC OPERATORS
1119 //
1120 //=================================================================================================
1121 
1122 //*************************************************************************************************
1134 template< typename MT // Type of the dense matrix
1135  , typename ST // Type of the scalar
1136  , bool TF > // Transpose flag
1137 inline decltype(auto) operator-( const DMatScalarMultExpr<MT,ST,TF>& dm )
1138 {
1140 
1142  return ReturnType( dm.leftOperand(), -dm.rightOperand() );
1143 }
1145 //*************************************************************************************************
1146 
1147 
1148 
1149 
1150 //=================================================================================================
1151 //
1152 // GLOBAL RESTRUCTURING BINARY ARITHMETIC OPERATORS
1153 //
1154 //=================================================================================================
1155 
1156 //*************************************************************************************************
1169 template< typename MT // Type of the dense matrix of the left-hand side expression
1170  , typename ST1 // Type of the scalar of the left-hand side expression
1171  , bool SO // Storage order of the dense matrix
1172  , typename ST2 // Type of the right-hand side scalar
1173  , typename = EnableIf_< IsNumeric<ST2> > >
1174 inline decltype(auto) operator*( const DMatScalarMultExpr<MT,ST1,SO>& mat, ST2 scalar )
1175 {
1177 
1178  return mat.leftOperand() * ( mat.rightOperand() * scalar );
1179 }
1181 //*************************************************************************************************
1182 
1183 
1184 //*************************************************************************************************
1197 template< typename ST1 // Type of the left-hand side scalar
1198  , typename MT // Type of the dense matrix of the right-hand side expression
1199  , typename ST2 // Type of the scalar of the right-hand side expression
1200  , bool SO // Storage order of the dense matrix
1201  , typename = EnableIf_< IsNumeric<ST1> > >
1202 inline decltype(auto) operator*( ST1 scalar, const DMatScalarMultExpr<MT,ST2,SO>& mat )
1203 {
1205 
1206  return mat.leftOperand() * ( scalar * mat.rightOperand() );
1207 }
1209 //*************************************************************************************************
1210 
1211 
1212 //*************************************************************************************************
1225 template< typename MT // Type of the dense matrix of the left-hand side expression
1226  , typename ST1 // Type of the scalar of the left-hand side expression
1227  , bool SO // Storage order of the dense matrix
1228  , typename ST2 // Type of the right-hand side scalar
1230 inline decltype(auto) operator/( const DMatScalarMultExpr<MT,ST1,SO>& mat, ST2 scalar )
1231 {
1233 
1234  return mat.leftOperand() * ( mat.rightOperand() / scalar );
1235 }
1237 //*************************************************************************************************
1238 
1239 
1240 //*************************************************************************************************
1254 template< typename MT // Type of the dense matrix of the left-hand side expression
1255  , typename ST // Type of the scalar of the left-hand side expression
1256  , bool SO // Storage order of the left-hand side expression
1257  , typename VT > // Type of the right-hand side dense vector
1258 inline decltype(auto)
1260 {
1262 
1263  return ( mat.leftOperand() * (~vec) ) * mat.rightOperand();
1264 }
1266 //*************************************************************************************************
1267 
1268 
1269 //*************************************************************************************************
1283 template< typename VT // Type of the left-hand side dense vector
1284  , typename MT // Type of the dense matrix of the right-hand side expression
1285  , typename ST // Type of the scalar of the right-hand side expression
1286  , bool SO > // Storage order of the right-hand side expression
1287 inline decltype(auto)
1289 {
1291 
1292  return ( (~vec) * mat.leftOperand() ) * mat.rightOperand();
1293 }
1295 //*************************************************************************************************
1296 
1297 
1298 //*************************************************************************************************
1314 template< typename MT // Type of the dense matrix of the left-hand side expression
1315  , typename ST1 // Type of the scalar of the left-hand side expression
1316  , bool SO // Storage order of the left-hand side expression
1317  , typename VT // Type of the dense vector of the right-hand side expression
1318  , typename ST2 > // Type of the scalar of the right-hand side expression
1319 inline decltype(auto)
1321 {
1323 
1324  return ( mat.leftOperand() * vec.leftOperand() ) * ( mat.rightOperand() * vec.rightOperand() );
1325 }
1327 //*************************************************************************************************
1328 
1329 
1330 //*************************************************************************************************
1346 template< typename VT // Type of the dense vector of the left-hand side expression
1347  , typename ST1 // Type of the scalar of the left-hand side expression
1348  , typename MT // Type of the dense matrix of the right-hand side expression
1349  , typename ST2 // Type of the scalar of the right-hand side expression
1350  , bool SO > // Storage order of the right-hand side expression
1351 inline decltype(auto)
1353 {
1355 
1356  return ( vec.leftOperand() * mat.leftOperand() ) * ( vec.rightOperand() * mat.rightOperand() );
1357 }
1359 //*************************************************************************************************
1360 
1361 
1362 //*************************************************************************************************
1376 template< typename MT // Type of the dense matrix of the left-hand side expression
1377  , typename ST // Type of the scalar of the left-hand side expression
1378  , bool SO // Storage order of the left-hand side expression
1379  , typename VT > // Type of the right-hand side sparse vector
1380 inline decltype(auto)
1382 {
1384 
1385  return ( mat.leftOperand() * (~vec) ) * mat.rightOperand();
1386 }
1388 //*************************************************************************************************
1389 
1390 
1391 //*************************************************************************************************
1405 template< typename VT // Type of the left-hand side sparse vector
1406  , typename MT // Type of the dense matrix of the right-hand side expression
1407  , typename ST // Type of the scalar of the right-hand side expression
1408  , bool SO > // Storage order of the right-hand side expression
1409 inline decltype(auto)
1411 {
1413 
1414  return ( (~vec) * mat.leftOperand() ) * mat.rightOperand();
1415 }
1417 //*************************************************************************************************
1418 
1419 
1420 //*************************************************************************************************
1436 template< typename MT // Type of the dense matrix of the left-hand side expression
1437  , typename ST1 // Type of the scalar of the left-hand side expression
1438  , bool SO // Storage order of the left-hand side expression
1439  , typename VT // Type of the sparse vector of the right-hand side expression
1440  , typename ST2 > // Type of the scalar of the right-hand side expression
1441 inline decltype(auto)
1443 {
1445 
1446  return ( mat.leftOperand() * vec.leftOperand() ) * ( mat.rightOperand() * vec.rightOperand() );
1447 }
1449 //*************************************************************************************************
1450 
1451 
1452 //*************************************************************************************************
1468 template< typename VT // Type of the sparse vector of the left-hand side expression
1469  , typename ST1 // Type of the scalar of the left-hand side expression
1470  , typename MT // Type of the dense matrix of the right-hand side expression
1471  , typename ST2 // Type of the scalar of the right-hand side expression
1472  , bool SO > // Storage order of the right-hand side expression
1473 inline decltype(auto)
1475 {
1477 
1478  return ( vec.leftOperand() * mat.leftOperand() ) * ( vec.rightOperand() * mat.rightOperand() );
1479 }
1481 //*************************************************************************************************
1482 
1483 
1484 //*************************************************************************************************
1498 template< typename MT1 // Type of the dense matrix of the left-hand side expression
1499  , typename ST // Type of the scalar of the left-hand side expression
1500  , bool SO1 // Storage order of the left-hand side expression
1501  , typename MT2 // Type of the right-hand side dense matrix
1502  , bool SO2 > // Storage order of the right-hand side dense matrix
1503 inline decltype(auto)
1505 {
1507 
1508  return ( lhs.leftOperand() * (~rhs) ) * lhs.rightOperand();
1509 }
1511 //*************************************************************************************************
1512 
1513 
1514 //*************************************************************************************************
1528 template< typename MT1 // Type of the left-hand side dense matrix
1529  , bool SO1 // Storage order of the left-hand side dense matrix
1530  , typename MT2 // Type of the dense matrix of the right-hand side expression
1531  , typename ST // Type of the scalar of the right-hand side expression
1532  , bool SO2 > // Storage order of the right-hand side expression
1533 inline decltype(auto)
1535 {
1537 
1538  return ( (~lhs) * rhs.leftOperand() ) * rhs.rightOperand();
1539 }
1541 //*************************************************************************************************
1542 
1543 
1544 //*************************************************************************************************
1558 template< typename MT1 // Type of the dense matrix of the left-hand side expression
1559  , typename ST1 // Type of the scalar of the left-hand side expression
1560  , bool SO1 // Storage order of the left-hand side expression
1561  , typename MT2 // Type of the right-hand side dense matrix
1562  , typename ST2 // Type of the scalar of the right-hand side expression
1563  , bool SO2 > // Storage order of the right-hand side expression
1564 inline decltype(auto)
1566 {
1568 
1569  return ( lhs.leftOperand() * rhs.leftOperand() ) * ( lhs.rightOperand() * rhs.rightOperand() );
1570 }
1572 //*************************************************************************************************
1573 
1574 
1575 //*************************************************************************************************
1589 template< typename MT1 // Type of the dense matrix of the left-hand side expression
1590  , typename ST // Type of the scalar of the left-hand side expression
1591  , bool SO1 // Storage order of the left-hand side expression
1592  , typename MT2 // Type of the right-hand side sparse matrix
1593  , bool SO2 > // Storage order of the right-hand side sparse matrix
1594 inline decltype(auto)
1596 {
1598 
1599  return ( lhs.leftOperand() * (~rhs) ) * lhs.rightOperand();
1600 }
1602 //*************************************************************************************************
1603 
1604 
1605 //*************************************************************************************************
1619 template< typename MT1 // Type of the left-hand side sparse matrix
1620  , bool SO1 // Storage order of the left-hand side sparse matrix
1621  , typename MT2 // Type of the dense matrix of the right-hand side expression
1622  , typename ST // Type of the scalar of the right-hand side expression
1623  , bool SO2 > // Storage order of the right-hand side expression
1624 inline decltype(auto)
1626 {
1628 
1629  return ( (~lhs) * rhs.leftOperand() ) * rhs.rightOperand();
1630 }
1632 //*************************************************************************************************
1633 
1634 
1635 //*************************************************************************************************
1650 template< typename MT1 // Type of the dense matrix of the left-hand side expression
1651  , typename ST1 // Type of the scalar of the left-hand side expression
1652  , bool SO1 // Storage order of the left-hand side expression
1653  , typename MT2 // Type of the sparse matrix of the right-hand side expression
1654  , typename ST2 // Type of the scalar of the right-hand side expression
1655  , bool SO2 > // Storage order of the right-hand side expression
1656 inline decltype(auto)
1658 {
1660 
1661  return ( mat.leftOperand() * vec.leftOperand() ) * ( mat.rightOperand() * vec.rightOperand() );
1662 }
1664 //*************************************************************************************************
1665 
1666 
1667 //*************************************************************************************************
1682 template< typename MT1 // Type of the sparse matrix of the left-hand side expression
1683  , typename ST1 // Type of the scalar of the left-hand side expression
1684  , bool SO1 // Storage order of the left-hand side expression
1685  , typename MT2 // Type of the dense matrix of the right-hand side expression
1686  , typename ST2 // Type of the scalar of the right-hand side expression
1687  , bool SO2 > // Storage order of the right-hand side expression
1688 inline decltype(auto)
1690 {
1692 
1693  return ( mat.leftOperand() * vec.leftOperand() ) * ( mat.rightOperand() * vec.rightOperand() );
1694 }
1696 //*************************************************************************************************
1697 
1698 
1699 
1700 
1701 //=================================================================================================
1702 //
1703 // SIZE SPECIALIZATIONS
1704 //
1705 //=================================================================================================
1706 
1707 //*************************************************************************************************
1709 template< typename MT, typename ST, bool SO >
1710 struct Size< DMatScalarMultExpr<MT,ST,SO>, 0UL >
1711  : public Size<MT,0UL>
1712 {};
1713 
1714 template< typename MT, typename ST, bool SO >
1715 struct Size< DMatScalarMultExpr<MT,ST,SO>, 1UL >
1716  : public Size<MT,1UL>
1717 {};
1719 //*************************************************************************************************
1720 
1721 
1722 
1723 
1724 //=================================================================================================
1725 //
1726 // ISALIGNED SPECIALIZATIONS
1727 //
1728 //=================================================================================================
1729 
1730 //*************************************************************************************************
1732 template< typename MT, typename ST, bool SO >
1733 struct IsAligned< DMatScalarMultExpr<MT,ST,SO> >
1734  : public IsAligned<MT>
1735 {};
1737 //*************************************************************************************************
1738 
1739 
1740 
1741 
1742 //=================================================================================================
1743 //
1744 // ISPADDED SPECIALIZATIONS
1745 //
1746 //=================================================================================================
1747 
1748 //*************************************************************************************************
1750 template< typename MT, typename ST, bool SO >
1751 struct IsPadded< DMatScalarMultExpr<MT,ST,SO> >
1752  : public IsPadded<MT>
1753 {};
1755 //*************************************************************************************************
1756 
1757 
1758 
1759 
1760 //=================================================================================================
1761 //
1762 // ISSYMMETRIC SPECIALIZATIONS
1763 //
1764 //=================================================================================================
1765 
1766 //*************************************************************************************************
1768 template< typename MT, typename ST, bool SO >
1769 struct IsSymmetric< DMatScalarMultExpr<MT,ST,SO> >
1770  : public IsSymmetric<MT>
1771 {};
1773 //*************************************************************************************************
1774 
1775 
1776 
1777 
1778 //=================================================================================================
1779 //
1780 // ISHERMITIAN SPECIALIZATIONS
1781 //
1782 //=================================================================================================
1783 
1784 //*************************************************************************************************
1786 template< typename MT, typename ST, bool SO >
1787 struct IsHermitian< DMatScalarMultExpr<MT,ST,SO> >
1788  : public IsHermitian<MT>
1789 {};
1791 //*************************************************************************************************
1792 
1793 
1794 
1795 
1796 //=================================================================================================
1797 //
1798 // ISLOWER SPECIALIZATIONS
1799 //
1800 //=================================================================================================
1801 
1802 //*************************************************************************************************
1804 template< typename MT, typename ST, bool SO >
1805 struct IsLower< DMatScalarMultExpr<MT,ST,SO> >
1806  : public IsLower<MT>
1807 {};
1809 //*************************************************************************************************
1810 
1811 
1812 
1813 
1814 //=================================================================================================
1815 //
1816 // ISSTRICTLYLOWER SPECIALIZATIONS
1817 //
1818 //=================================================================================================
1819 
1820 //*************************************************************************************************
1822 template< typename MT, typename ST, bool SO >
1823 struct IsStrictlyLower< DMatScalarMultExpr<MT,ST,SO> >
1824  : public IsStrictlyLower<MT>
1825 {};
1827 //*************************************************************************************************
1828 
1829 
1830 
1831 
1832 //=================================================================================================
1833 //
1834 // ISUPPER SPECIALIZATIONS
1835 //
1836 //=================================================================================================
1837 
1838 //*************************************************************************************************
1840 template< typename MT, typename ST, bool SO >
1841 struct IsUpper< DMatScalarMultExpr<MT,ST,SO> >
1842  : public IsUpper<MT>
1843 {};
1845 //*************************************************************************************************
1846 
1847 
1848 
1849 
1850 //=================================================================================================
1851 //
1852 // ISSTRICTLYUPPER SPECIALIZATIONS
1853 //
1854 //=================================================================================================
1855 
1856 //*************************************************************************************************
1858 template< typename MT, typename ST, bool SO >
1859 struct IsStrictlyUpper< DMatScalarMultExpr<MT,ST,SO> >
1860  : public IsStrictlyUpper<MT>
1861 {};
1863 //*************************************************************************************************
1864 
1865 } // namespace blaze
1866 
1867 #endif
RightOperand rightOperand() const noexcept
Returns the right-hand side scalar operand.
Definition: SVecScalarMultExpr.h:437
Pointer difference type of the Blaze library.
LeftOperand leftOperand() const noexcept
Returns the left-hand side dense vector operand.
Definition: DVecScalarMultExpr.h:529
Header file for auxiliary alias declarations.
Data type constraint.
Compile time check whether the given type is a computational expression template.This type trait clas...
Definition: IsComputation.h:71
Compile time check for numeric types.This type trait tests whether or not the given template paramete...
Definition: IsNumeric.h:79
Constraint on the data type.
Compile time check whether the given type is a temporary vector or matrix type.This type trait class ...
Definition: IsTemporary.h:69
RightOperand scalar_
Scalar of the multiplication expression.
Definition: DMatScalarMultExpr.h:425
EnableIf_< IsDenseMatrix< MT1 > > smpSchurAssign(Matrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs)
Default implementation of the SMP Schur product assignment of a matrix to dense matrix.
Definition: DenseMatrix.h:196
RightOperand rightOperand() const noexcept
Returns the right-hand side scalar operand.
Definition: SMatScalarMultExpr.h:475
Header file for basic type definitions.
MultExprTrait_< RN, ST > ExprReturnType
Expression return type for the subscript operator.
Definition: DMatScalarMultExpr.h:129
OppositeType_< ResultType > OppositeType
Result type with opposite storage order for expression template evaluations.
Definition: DMatScalarMultExpr.h:170
RightOperand rightOperand() const noexcept
Returns the right-hand side scalar operand.
Definition: DVecScalarMultExpr.h:539
decltype(auto) operator/(const DenseMatrix< MT, SO > &mat, ST scalar)
Division operator for the division of a dense matrix by a scalar value ( ).
Definition: DMatScalarDivExpr.h:1070
ElementType * PointerType
Pointer return type.
Definition: DMatScalarMultExpr.h:196
EnableIf_< IsDenseMatrix< MT1 > > smpSubAssign(Matrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs)
Default implementation of the SMP subtraction assignment of a matrix to dense matrix.
Definition: DenseMatrix.h:164
ConstIterator & operator++()
Pre-increment operator.
Definition: DMatScalarMultExpr.h:252
const ConstIterator operator--(int)
Post-decrement operator.
Definition: DMatScalarMultExpr.h:284
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:544
#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:348
Availability of a SIMD multiplication for the given data types.Depending on the available instruction...
Definition: HasSIMDMult.h:172
RightOperand scalar_
Right-hand side scalar of the multiplication expression.
Definition: DMatScalarMultExpr.h:617
LeftOperand leftOperand() const noexcept
Returns the left-hand side sparse matrix operand.
Definition: SMatScalarMultExpr.h:465
size_t rows() const noexcept
Returns the current number of rows of the matrix.
Definition: DMatScalarMultExpr.h:534
Base class for all matrix/scalar multiplication expression templates.The MatScalarMultExpr class serv...
Definition: MatScalarMultExpr.h:67
Header file for the And class template.
Header file for the DenseVector base class.
Compile time check for lower triangular matrices.This type trait tests whether or not the given templ...
Definition: IsLower.h:87
bool canSMPAssign() const noexcept
Returns whether the expression can be used in SMP assignments.
Definition: DMatScalarMultExpr.h:608
ReferenceType reference
Reference return type.
Definition: DMatScalarMultExpr.h:204
typename MultTrait< T1, T2 >::Type MultTrait_
Auxiliary alias declaration for the MultTrait class template.The MultTrait_ alias declaration provide...
Definition: MultTrait.h:291
Header file for the Computation base class.
ReturnType operator*() const
Direct access to the element at the current iterator position.
Definition: DMatScalarMultExpr.h:294
Header file for the UnderlyingElement type trait.
Compile time check for upper triangular matrices.This type trait tests whether or not the given templ...
Definition: IsUpper.h:87
const DenseIterator< Type, AF > operator-(const DenseIterator< Type, AF > &it, ptrdiff_t inc) noexcept
Subtraction between a DenseIterator and an integral value.
Definition: DenseIterator.h:733
Header file for the RequiresEvaluation type trait.
typename T::ResultType ResultType_
Alias declaration for nested ResultType type definitions.The ResultType_ alias declaration provides a...
Definition: Aliases.h:343
EnableIf_< IsDenseMatrix< MT1 > > smpAddAssign(Matrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs)
Default implementation of the SMP addition assignment of a matrix to a dense matrix.
Definition: DenseMatrix.h:133
const IfTrue_< returnExpr, ExprReturnType, ElementType > ReturnType
Return type for expression template evaluations.
Definition: DMatScalarMultExpr.h:175
auto load() const noexcept
Access to the SIMD elements of the matrix.
Definition: DMatScalarMultExpr.h:304
typename UnderlyingBuiltin< T >::Type UnderlyingBuiltin_
Auxiliary alias declaration for the UnderlyingBuiltin type trait.The UnderlyingBuiltin_ alias declara...
Definition: UnderlyingBuiltin.h:133
Base class for dense matrices.The DenseMatrix class is a base class for all dense matrix classes...
Definition: DenseMatrix.h:80
Base class for sparse matrices.The SparseMatrix class is a base class for all sparse matrix classes...
Definition: Forward.h:129
typename IfTrue< Condition, T1, T2 >::Type IfTrue_
Auxiliary alias declaration for the IfTrue class template.The IfTrue_ alias declaration provides a co...
Definition: If.h:109
typename T::ReturnType ReturnType_
Alias declaration for nested ReturnType type definitions.The ReturnType_ alias declaration provides a...
Definition: Aliases.h:363
std::random_access_iterator_tag IteratorCategory
The iterator category.
Definition: DMatScalarMultExpr.h:194
Compile time check for the alignment of data types.This type trait tests whether the given data type ...
Definition: IsAligned.h:87
Constraint on the data type.
typename MultExprTrait< T1, T2 >::Type MultExprTrait_
Auxiliary alias declaration for the MultExprTrait class template.The MultExprTrait_ alias declaration...
Definition: MultExprTrait.h:112
Header file for the MultExprTrait class template.
Compile time check to query the requirement to evaluate an expression.Via this type trait it is possi...
Definition: RequiresEvaluation.h:71
typename T::CompositeType CompositeType_
Alias declaration for nested CompositeType type definitions.The CompositeType_ alias declaration prov...
Definition: Aliases.h:83
bool canAlias(const T *alias) const noexcept
Returns whether the expression can alias with the given address alias.
Definition: DMatScalarMultExpr.h:576
Header file for the IsTemporary type trait class.
Header file for the multiplication trait.
Header file for the IsStrictlyUpper type trait.
Header file for the IsSymmetric type trait.
Namespace of the Blaze C++ math library.
Definition: Blaze.h: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.
Compile time check for data types with padding.This type trait tests whether the given data type empl...
Definition: IsPadded.h:76
EnableIf_< IsDenseMatrix< MT1 > > smpAssign(Matrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs)
Default implementation of the SMP assignment of a matrix to a dense matrix.
Definition: DenseMatrix.h:102
Header file for the Or class template.
Expression object for dense matrix-scalar multiplications.The DMatScalarMultExpr class represents the...
Definition: DMatScalarMultExpr.h:107
ConstIterator & operator+=(size_t inc)
Addition assignment operator.
Definition: DMatScalarMultExpr.h:229
#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:424
Header file for the DenseMatrix base class.
const Element * ConstIterator
Iterator over constant elements.
Definition: CompressedMatrix.h:3085
typename T::ElementType ElementType_
Alias declaration for nested ElementType type definitions.The ElementType_ alias declaration provides...
Definition: Aliases.h:163
Header file for all SIMD functionality.
bool operator==(const ConstIterator &rhs) const
Equality comparison between two ConstIterator objects.
Definition: DMatScalarMultExpr.h:315
Base class for N-dimensional dense vectors.The DenseVector class is a base class for all arbitrarily ...
Definition: DenseVector.h:76
ValueType value_type
Type of the underlying elements.
Definition: DMatScalarMultExpr.h:202
#define BLAZE_CONSTRAINT_MUST_BE_SAME_TYPE(A, B)
Data type constraint.In case the two types A and B are not the same (ignoring all cv-qualifiers of bo...
Definition: SameType.h:71
Header file for the IsLower type trait.
Header file for the IsAligned type trait.
RightOperand rightOperand() const noexcept
Returns the right-hand side scalar operand.
Definition: DMatScalarMultExpr.h:564
ElementType_< ResultType > ElementType
Resulting element type.
Definition: DMatScalarMultExpr.h:172
BLAZE_ALWAYS_INLINE auto load(size_t i, size_t j) const noexcept
Access to the SIMD elements of the matrix.
Definition: DMatScalarMultExpr.h:498
Constraints on the storage order of matrix types.
Compile time check for symmetric matrices.This type trait tests whether or not the given template par...
Definition: IsSymmetric.h:85
Header file for the exception macros of the math module.
bool operator<=(const ConstIterator &rhs) const
Less-than comparison between two ConstIterator objects.
Definition: DMatScalarMultExpr.h:359
Compile time check for strictly upper triangular matrices.This type trait tests whether or not the gi...
Definition: IsStrictlyUpper.h:86
LeftOperand matrix_
Left-hand side dense matrix of the multiplication expression.
Definition: DMatScalarMultExpr.h:616
decltype(auto) operator*(const DenseMatrix< MT1, false > &lhs, const DenseMatrix< MT2, false > &rhs)
Multiplication operator for the multiplication of two row-major dense matrices ( ).
Definition: DMatDMatMultExpr.h:8893
Constraint on the data type.
Expression object for sparse matrix-scalar multiplications.The SMatScalarMult class represents the co...
Definition: Forward.h:114
Header file for all forward declarations for expression class templates.
DifferenceType operator-(const ConstIterator &rhs) const
Calculating the number of elements between two iterators.
Definition: DMatScalarMultExpr.h:381
ConstIterator_< MT > IteratorType
ConstIterator type of the dense matrix expression.
Definition: DMatScalarMultExpr.h:208
Header file for the EnableIf class template.
Header file for the IsStrictlyLower type trait.
friend const ConstIterator operator-(const ConstIterator &it, size_t dec)
Subtraction between a ConstIterator and an integral value.
Definition: DMatScalarMultExpr.h:417
Header file for the IsPadded type trait.
ResultType_< MT > RT
Result type of the dense matrix expression.
Definition: DMatScalarMultExpr.h:113
PointerType pointer
Pointer return type.
Definition: DMatScalarMultExpr.h:203
ConstIterator(IteratorType iterator, RightOperand scalar)
Constructor for the ConstIterator class.
Definition: DMatScalarMultExpr.h:217
friend const ConstIterator operator+(size_t inc, const ConstIterator &it)
Addition between an integral value and a ConstIterator.
Definition: DMatScalarMultExpr.h:405
ReturnType at(size_t i, size_t j) const
Checked access to the matrix elements.
Definition: DMatScalarMultExpr.h:480
Header file for the IsNumeric type trait.
Header file for the HasSIMDMult type trait.
Header file for the MatScalarMultExpr base class.
ST RightOperand
Composite type of the right-hand side scalar value.
Definition: DMatScalarMultExpr.h:184
ElementType & ReferenceType
Reference return type.
Definition: DMatScalarMultExpr.h:197
Header file for run time assertion macros.
TransposeType_< ResultType > TransposeType
Transpose type for expression template evaluations.
Definition: DMatScalarMultExpr.h:171
typename If< T1, T2, T3 >::Type If_
Auxiliary alias declaration for the If class template.The If_ alias declaration provides a convenient...
Definition: If.h:154
ConstIterator & operator-=(size_t dec)
Subtraction assignment operator.
Definition: DMatScalarMultExpr.h:241
#define BLAZE_CONSTRAINT_MUST_BE_NUMERIC_TYPE(T)
Constraint on the data type.In case the given data type T is not a numeric (integral or floating poin...
Definition: Numeric.h:61
SIMD characteristics of data types.The SIMDTrait class template provides the SIMD characteristics of ...
Definition: SIMDTrait.h:296
#define BLAZE_FUNCTION_TRACE
Function trace macro.This macro can be used to reliably trace function calls. In case function tracin...
Definition: FunctionTrace.h:94
IfTrue_< useAssign, const ResultType, const DMatScalarMultExpr &> CompositeType
Data type for composite expression templates.
Definition: DMatScalarMultExpr.h:178
ConstIterator begin(size_t i) const
Returns an iterator to the first non-zero element of row i.
Definition: DMatScalarMultExpr.h:513
Compile time check for Hermitian matrices.This type trait tests whether or not the given template par...
Definition: IsHermitian.h:85
Compile time check for data types.This type trait tests whether or not the given template parameter i...
Definition: IsInvertible.h:82
decltype(auto) serial(const DenseMatrix< MT, SO > &dm)
Forces the serial evaluation of the given dense matrix expression dm.
Definition: DMatSerialExpr.h:816
#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:524
const ConstIterator operator++(int)
Post-increment operator.
Definition: DMatScalarMultExpr.h:263
ElementType ValueType
Type of the underlying elements.
Definition: DMatScalarMultExpr.h:195
bool isAliased(const T *alias) const noexcept
Returns whether the expression is aliased with the given address alias.
Definition: DMatScalarMultExpr.h:588
friend const ConstIterator operator+(const ConstIterator &it, size_t inc)
Addition between a ConstIterator and an integral value.
Definition: DMatScalarMultExpr.h:393
Header file for the IsInvertible type trait.
typename EnableIf< Condition, T >::Type EnableIf_
Auxiliary alias declaration for the EnableIf class template.The EnableIf_ alias declaration provides ...
Definition: EnableIf.h:224
typename T::OppositeType OppositeType_
Alias declaration for nested OppositeType type definitions.The OppositeType_ alias declaration provid...
Definition: Aliases.h:263
bool operator>=(const ConstIterator &rhs) const
Greater-than comparison between two ConstIterator objects.
Definition: DMatScalarMultExpr.h:370
Compile time check for strictly lower triangular matrices.This type trait tests whether or not the gi...
Definition: IsStrictlyLower.h:86
MultTrait_< RT, ST > ResultType
Result type for expression template evaluations.
Definition: DMatScalarMultExpr.h:169
ConstIterator & operator--()
Pre-decrement operator.
Definition: DMatScalarMultExpr.h:273
const Type & ReturnType
Return type for expression template evaluations.
Definition: CompressedMatrix.h:3080
typename T::ConstIterator ConstIterator_
Alias declaration for nested ConstIterator type definitions.The ConstIterator_ alias declaration prov...
Definition: Aliases.h:103
Header file for the IsComputation type trait class.
Expression object for dense vector-scalar multiplications.The DVecScalarMultExpr class represents the...
Definition: DVecScalarMultExpr.h:104
Expression object for sparse vector-scalar multiplications.The SVecScalarMultExpr class represents th...
Definition: Forward.h:139
Base class for all compute expression templates.The Computation class serves as a tag for all computa...
Definition: Computation.h:66
ReturnType operator()(size_t i, size_t j) const
2D-access to the matrix elements.
Definition: DMatScalarMultExpr.h:465
Compile time logical &#39;or&#39; evaluation.The Or alias declaration performs at compile time a logical &#39;or&#39;...
Definition: Or.h:76
DMatScalarMultExpr(const MT &matrix, ST scalar) noexcept
Constructor for the DMatScalarMultExpr class.
Definition: DMatScalarMultExpr.h:452
CompositeType_< MT > CT
Composite type of the dense matrix expression.
Definition: DMatScalarMultExpr.h:116
Compile time evaluation of the size of vectors and matrices.The Size type trait evaluates the size of...
Definition: Size.h:80
Base class for sparse vectors.The SparseVector class is a base class for all arbitrarily sized (N-dim...
Definition: Forward.h:130
Iterator over the elements of the dense matrix.
Definition: DMatScalarMultExpr.h:190
bool operator<(const ConstIterator &rhs) const
Less-than comparison between two ConstIterator objects.
Definition: DMatScalarMultExpr.h:337
bool isAligned() const noexcept
Returns whether the operands of the expression are properly aligned in memory.
Definition: DMatScalarMultExpr.h:598
typename T::TransposeType TransposeType_
Alias declaration for nested TransposeType type definitions.The TransposeType_ alias declaration prov...
Definition: Aliases.h:423
Header file for the IsUpper type trait.
bool operator!=(const ConstIterator &rhs) const
Inequality comparison between two ConstIterator objects.
Definition: DMatScalarMultExpr.h:326
Header file for the IsHermitian type trait.
LeftOperand leftOperand() const noexcept
Returns the left-hand side dense matrix operand.
Definition: DMatScalarMultExpr.h:554
System settings for the inline keywords.
Header file for the Size type trait.
Header file for the thresholds for matrix/vector and matrix/matrix multiplications.
#define BLAZE_INTERNAL_ASSERT(expr, msg)
Run time assertion macro for internal checks.In case of an invalid run time expression, the program execution is terminated. The BLAZE_INTERNAL_ASSERT macro can be disabled by setting the BLAZE_USER_ASSERTION flag to zero or by defining NDEBUG during the compilation.
Definition: Assert.h:101
ReturnType_< MT > RN
Return type of the dense matrix expression.
Definition: DMatScalarMultExpr.h:114
LeftOperand leftOperand() const noexcept
Returns the left-hand side sparse vector operand.
Definition: SVecScalarMultExpr.h:427
If_< IsExpression< MT >, const MT, const MT &> LeftOperand
Composite type of the left-hand side dense matrix expression.
Definition: DMatScalarMultExpr.h:181
Compile time check whether the given type is an expression template.This type trait class tests wheth...
Definition: IsExpression.h:95
IteratorCategory iterator_category
The iterator category.
Definition: DMatScalarMultExpr.h:201
Header file for the IsExpression type trait class.
ElementType_< MT > ET
Element type of the dense matrix expression.
Definition: DMatScalarMultExpr.h:115
Header file for the function trace functionality.