Blaze  3.6
SMatDMatSubExpr.h
Go to the documentation of this file.
1 //=================================================================================================
33 //=================================================================================================
34 
35 #ifndef _BLAZE_MATH_EXPRESSIONS_SMATDMATSUBEXPR_H_
36 #define _BLAZE_MATH_EXPRESSIONS_SMATDMATSUBEXPR_H_
37 
38 
39 //*************************************************************************************************
40 // Includes
41 //*************************************************************************************************
42 
43 #include <utility>
44 #include <blaze/math/Aliases.h>
50 #include <blaze/math/Exception.h>
60 #include <blaze/util/Assert.h>
61 #include <blaze/util/DisableIf.h>
62 #include <blaze/util/EnableIf.h>
65 #include <blaze/util/MaybeUnused.h>
66 #include <blaze/util/mpl/If.h>
67 #include <blaze/util/Types.h>
69 
70 
71 namespace blaze {
72 
73 //=================================================================================================
74 //
75 // CLASS SMATDMATSUBEXPR
76 //
77 //=================================================================================================
78 
79 //*************************************************************************************************
86 template< typename MT1 // Type of the left-hand side sparse matrix
87  , typename MT2 // Type of the right-hand side dense matrix
88  , bool SO > // Storage order
89 class SMatDMatSubExpr
90  : public MatMatSubExpr< DenseMatrix< SMatDMatSubExpr<MT1,MT2,SO>, SO > >
91  , private Computation
92 {
93  private:
94  //**Type definitions****************************************************************************
99  //**********************************************************************************************
100 
101  //**Return type evaluation**********************************************************************
103 
108  static constexpr bool returnExpr = !IsTemporary_v<RN1> && !IsTemporary_v<RN2>;
109 
111  using ExprReturnType = decltype( std::declval<RN1>() - std::declval<RN2>() );
112  //**********************************************************************************************
113 
114  //**Parallel evaluation strategy****************************************************************
116 
121  template< typename MT >
122  static constexpr bool UseSMPAssign_v = ( !MT1::smpAssignable || !MT2::smpAssignable );
124  //**********************************************************************************************
125 
126  public:
127  //**Type definitions****************************************************************************
134 
137 
139  using CompositeType = const ResultType;
140 
142  using LeftOperand = If_t< IsExpression_v<MT1>, const MT1, const MT1& >;
143 
145  using RightOperand = If_t< IsExpression_v<MT2>, const MT2, const MT2& >;
146  //**********************************************************************************************
147 
148  //**Compilation flags***************************************************************************
150  static constexpr bool simdEnabled = false;
151 
153  static constexpr bool smpAssignable = false;
154  //**********************************************************************************************
155 
156  //**Constructor*********************************************************************************
162  explicit inline SMatDMatSubExpr( const MT1& lhs, const MT2& rhs ) noexcept
163  : lhs_( lhs ) // Left-hand side sparse matrix of the subtraction expression
164  , rhs_( rhs ) // Right-hand side dense matrix of the subtraction expression
165  {
166  BLAZE_INTERNAL_ASSERT( lhs.rows() == rhs.rows() , "Invalid number of rows" );
167  BLAZE_INTERNAL_ASSERT( lhs.columns() == rhs.columns(), "Invalid number of columns" );
168  }
169  //**********************************************************************************************
170 
171  //**Access operator*****************************************************************************
178  inline ReturnType operator()( size_t i, size_t j ) const {
179  BLAZE_INTERNAL_ASSERT( i < lhs_.rows() , "Invalid row access index" );
180  BLAZE_INTERNAL_ASSERT( j < lhs_.columns(), "Invalid column access index" );
181  return lhs_(i,j) - rhs_(i,j);
182  }
183  //**********************************************************************************************
184 
185  //**At function*********************************************************************************
193  inline ReturnType at( size_t i, size_t j ) const {
194  if( i >= lhs_.rows() ) {
195  BLAZE_THROW_OUT_OF_RANGE( "Invalid row access index" );
196  }
197  if( j >= lhs_.columns() ) {
198  BLAZE_THROW_OUT_OF_RANGE( "Invalid column access index" );
199  }
200  return (*this)(i,j);
201  }
202  //**********************************************************************************************
203 
204  //**Rows function*******************************************************************************
209  inline size_t rows() const noexcept {
210  return lhs_.rows();
211  }
212  //**********************************************************************************************
213 
214  //**Columns function****************************************************************************
219  inline size_t columns() const noexcept {
220  return lhs_.columns();
221  }
222  //**********************************************************************************************
223 
224  //**Left operand access*************************************************************************
229  inline LeftOperand leftOperand() const noexcept {
230  return lhs_;
231  }
232  //**********************************************************************************************
233 
234  //**Right operand access************************************************************************
239  inline RightOperand rightOperand() const noexcept {
240  return rhs_;
241  }
242  //**********************************************************************************************
243 
244  //**********************************************************************************************
250  template< typename T >
251  inline bool canAlias( const T* alias ) const noexcept {
252  return ( lhs_.canAlias( alias ) ) ||
253  ( IsExpression_v<MT2> && rhs_.canAlias( alias ) );
254  }
255  //**********************************************************************************************
256 
257  //**********************************************************************************************
263  template< typename T >
264  inline bool isAliased( const T* alias ) const noexcept {
265  return lhs_.isAliased( alias ) || rhs_.isAliased( alias );
266  }
267  //**********************************************************************************************
268 
269  private:
270  //**Member variables****************************************************************************
273  //**********************************************************************************************
274 
275  //**Assignment to dense matrices****************************************************************
287  template< typename MT // Type of the target dense matrix
288  , bool SO2 > // Storage order of the target dense matrix
289  friend inline void assign( DenseMatrix<MT,SO2>& lhs, const SMatDMatSubExpr& rhs )
290  {
292 
293  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
294  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
295 
296  assign ( ~lhs, -rhs.rhs_ );
297  addAssign( ~lhs, rhs.lhs_ );
298  }
300  //**********************************************************************************************
301 
302  //**Assignment to sparse matrices***************************************************************
314  template< typename MT // Type of the target sparse matrix
315  , bool SO2 > // Storage order of the target sparse matrix
316  friend inline void assign( SparseMatrix<MT,SO2>& lhs, const SMatDMatSubExpr& rhs )
317  {
319 
321 
328 
329  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
330  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
331 
332  const TmpType tmp( serial( rhs ) );
333  assign( ~lhs, tmp );
334  }
336  //**********************************************************************************************
337 
338  //**Addition assignment to dense matrices*******************************************************
350  template< typename MT // Type of the target dense matrix
351  , bool SO2 > // Storage order of the target dense matrix
352  friend inline void addAssign( DenseMatrix<MT,SO2>& lhs, const SMatDMatSubExpr& rhs )
353  {
355 
356  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
357  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
358 
359  subAssign( ~lhs, rhs.rhs_ );
360  addAssign( ~lhs, rhs.lhs_ );
361  }
363  //**********************************************************************************************
364 
365  //**Addition assignment to sparse matrices******************************************************
366  // No special implementation for the addition assignment to sparse matrices.
367  //**********************************************************************************************
368 
369  //**Subtraction assignment to dense matrices****************************************************
381  template< typename MT // Type of the target dense matrix
382  , bool SO2 > // Storage order of the target dense matrix
383  friend inline void subAssign( DenseMatrix<MT,SO2>& lhs, const SMatDMatSubExpr& rhs )
384  {
386 
387  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
388  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
389 
390  addAssign( ~lhs, rhs.rhs_ );
391  subAssign( ~lhs, rhs.lhs_ );
392  }
394  //**********************************************************************************************
395 
396  //**Subtraction assignment to sparse matrices***************************************************
397  // No special implementation for the subtraction assignment to sparse matrices.
398  //**********************************************************************************************
399 
400  //**Schur product assignment to dense matrices**************************************************
413  template< typename MT // Type of the target dense matrix
414  , bool SO2 > // Storage order of the target dense matrix
415  friend inline void schurAssign( DenseMatrix<MT,SO2>& lhs, const SMatDMatSubExpr& rhs )
416  {
418 
422 
423  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
424  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
425 
426  const ResultType tmp( serial( rhs ) );
427  schurAssign( ~lhs, tmp );
428  }
430  //**********************************************************************************************
431 
432  //**Schur product assignment to sparse matrices*************************************************
433  // No special implementation for the Schur product assignment to sparse matrices.
434  //**********************************************************************************************
435 
436  //**Multiplication assignment to dense matrices*************************************************
437  // No special implementation for the multiplication assignment to dense matrices.
438  //**********************************************************************************************
439 
440  //**Multiplication assignment to sparse matrices************************************************
441  // No special implementation for the multiplication assignment to sparse matrices.
442  //**********************************************************************************************
443 
444  //**SMP assignment to dense matrices*************************************************************
458  template< typename MT // Type of the target dense matrix
459  , bool SO2 > // Storage order of the target dense matrix
460  friend inline auto smpAssign( DenseMatrix<MT,SO2>& lhs, const SMatDMatSubExpr& rhs )
461  -> EnableIf_t< UseSMPAssign_v<MT> >
462  {
464 
465  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
466  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
467 
468  smpAssign ( ~lhs, -rhs.rhs_ );
469  smpAddAssign( ~lhs, rhs.lhs_ );
470  }
472  //**********************************************************************************************
473 
474  //**SMP assignment to sparse matrices***********************************************************
488  template< typename MT // Type of the target sparse matrix
489  , bool SO2 > // Storage order of the target sparse matrix
490  friend inline auto smpAssign( SparseMatrix<MT,SO2>& lhs, const SMatDMatSubExpr& rhs )
491  -> EnableIf_t< UseSMPAssign_v<MT> >
492  {
494 
495  using TmpType = If_t< SO == SO2, ResultType, OppositeType >;
496 
503 
504  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
505  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
506 
507  const TmpType tmp( rhs );
508  smpAssign( ~lhs, tmp );
509  }
511  //**********************************************************************************************
512 
513  //**SMP addition assignment to dense matrices***************************************************
527  template< typename MT // Type of the target dense matrix
528  , bool SO2 > // Storage order of the target dense matrix
529  friend inline auto smpAddAssign( DenseMatrix<MT,SO2>& lhs, const SMatDMatSubExpr& rhs )
530  -> EnableIf_t< UseSMPAssign_v<MT> >
531  {
533 
534  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
535  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
536 
537  smpSubAssign( ~lhs, rhs.rhs_ );
538  smpAddAssign( ~lhs, rhs.lhs_ );
539  }
541  //**********************************************************************************************
542 
543  //**SMP addition assignment to sparse matrices**************************************************
544  // No special implementation for the SMP addition assignment to sparse matrices.
545  //**********************************************************************************************
546 
547  //**SMP subtraction assignment to dense matrices************************************************
561  template< typename MT // Type of the target dense matrix
562  , bool SO2 > // Storage order of the target dense matrix
563  friend inline auto smpSubAssign( DenseMatrix<MT,SO2>& lhs, const SMatDMatSubExpr& rhs )
564  -> EnableIf_t< UseSMPAssign_v<MT> >
565  {
567 
568  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
569  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
570 
571  smpAddAssign( ~lhs, rhs.rhs_ );
572  smpSubAssign( ~lhs, rhs.lhs_ );
573  }
575  //**********************************************************************************************
576 
577  //**SMP subtraction assignment to sparse matrices***********************************************
578  // No special implementation for the SMP subtraction assignment to sparse matrices.
579  //**********************************************************************************************
580 
581  //**SMP Schur product assignment to dense matrices**********************************************
596  template< typename MT // Type of the target dense matrix
597  , bool SO2 > // Storage order of the target dense matrix
598  friend inline auto smpSchurAssign( DenseMatrix<MT,SO2>& lhs, const SMatDMatSubExpr& rhs )
599  -> EnableIf_t< UseSMPAssign_v<MT> >
600  {
602 
606 
607  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
608  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
609 
610  const ResultType tmp( rhs );
611  smpSchurAssign( ~lhs, tmp );
612  }
614  //**********************************************************************************************
615 
616  //**SMP Schur product assignment to sparse matrices*********************************************
617  // No special implementation for the SMP Schur product assignment to sparse matrices.
618  //**********************************************************************************************
619 
620  //**SMP multiplication assignment to dense matrices*********************************************
621  // No special implementation for the SMP multiplication assignment to dense matrices.
622  //**********************************************************************************************
623 
624  //**SMP multiplication assignment to sparse matrices********************************************
625  // No special implementation for the SMP multiplication assignment to sparse matrices.
626  //**********************************************************************************************
627 
628  //**Compile time checks*************************************************************************
635  //**********************************************************************************************
636 };
637 //*************************************************************************************************
638 
639 
640 
641 
642 //=================================================================================================
643 //
644 // GLOBAL BINARY ARITHMETIC OPERATORS
645 //
646 //=================================================================================================
647 
648 //*************************************************************************************************
661 template< typename MT1 // Type of the left-hand side sparse matrix
662  , typename MT2 // Type of the right-hand side dense matrix
663  , bool SO // Storage order
664  , DisableIf_t< IsZero_v<MT1> &&
665  IsSame_v< ElementType_t<MT1>, ElementType_t<MT2> > >* = nullptr >
666 inline const SMatDMatSubExpr<MT1,MT2,SO>
667  smatdmatsub( const SparseMatrix<MT1,SO>& lhs, const DenseMatrix<MT2,SO>& 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  return SMatDMatSubExpr<MT1,MT2,SO>( ~lhs, ~rhs );
675 }
677 //*************************************************************************************************
678 
679 
680 //*************************************************************************************************
693 template< typename MT1 // Type of the left-hand side sparse matrix
694  , typename MT2 // Type of the right-hand side dense matrix
695  , bool SO // Storage order
696  , EnableIf_t< IsZero_v<MT1> &&
697  IsSame_v< ElementType_t<MT1>, ElementType_t<MT2> > >* = nullptr >
698 inline decltype(auto)
699  smatdmatsub( const SparseMatrix<MT1,SO>& lhs, const DenseMatrix<MT2,SO>& rhs )
700 {
702 
703  MAYBE_UNUSED( lhs );
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  return -(~rhs);
709 }
711 //*************************************************************************************************
712 
713 
714 //*************************************************************************************************
743 template< typename MT1 // Type of the left-hand side sparse matrix
744  , typename MT2 // Type of the right-hand side dense matrix
745  , bool SO > // Storage order
746 inline decltype(auto)
747  operator-( const SparseMatrix<MT1,SO>& lhs, const DenseMatrix<MT2,SO>& rhs )
748 {
750 
751  if( (~lhs).rows() != (~rhs).rows() || (~lhs).columns() != (~rhs).columns() ) {
752  BLAZE_THROW_INVALID_ARGUMENT( "Matrix sizes do not match" );
753  }
754 
755  return smatdmatsub( ~lhs, ~rhs );
756 }
757 //*************************************************************************************************
758 
759 
760 
761 
762 //=================================================================================================
763 //
764 // GLOBAL RESTRUCTURING BINARY ARITHMETIC OPERATORS
765 //
766 //=================================================================================================
767 
768 //*************************************************************************************************
781 template< typename MT1 // Type of the sparse matrix of the left-hand side expression
782  , typename MT2 // Type of the dense matrix of the left-hand side expression
783  , bool SO1 // Storage order of the left-hand side expression
784  , typename MT3 // Type of the right-hand side dense matrix
785  , bool SO2 > // Storage order of the right-hand side dense matrix
786 inline decltype(auto)
787  operator+( const SMatDMatSubExpr<MT1,MT2,SO1>& lhs, const DenseMatrix<MT3,SO2>& rhs )
788 {
790 
791  return ( (~rhs) - lhs.rightOperand() ) + lhs.leftOperand();
792 }
794 //*************************************************************************************************
795 
796 
797 //*************************************************************************************************
810 template< typename MT1 // Type of the sparse matrix of the left-hand side expression
811  , typename MT2 // Type of the dense matrix of the left-hand side expression
812  , bool SO1 // Storage order of the left-hand side expression
813  , typename MT3 // Type of the right-hand side dense matrix
814  , bool SO2 > // Storage order of the right-hand side dense matrix
815 inline decltype(auto)
816  operator-( const SMatDMatSubExpr<MT1,MT2,SO1>& lhs, const DenseMatrix<MT3,SO2>& rhs )
817 {
819 
820  return lhs.leftOperand() - ( lhs.rightOperand() + (~rhs) );
821 }
823 //*************************************************************************************************
824 
825 } // namespace blaze
826 
827 #endif
Constraint on the data type.
#define BLAZE_THROW_INVALID_ARGUMENT(MESSAGE)
Macro for the emission of a std::invalid_argument exception.This macro encapsulates the default way o...
Definition: Exception.h:235
Header file for auxiliary alias declarations.
SMatDMatSubExpr(const MT1 &lhs, const MT2 &rhs) noexcept
Constructor for the SMatDMatSubExpr class.
Definition: SMatDMatSubExpr.h:162
typename SubTrait< T1, T2 >::Type SubTrait_t
Auxiliary alias declaration for the SubTrait class template.The SubTrait_t alias declaration provides...
Definition: SubTrait.h:238
Header file for the subtraction trait.
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
const If_t< returnExpr, ExprReturnType, ElementType > ReturnType
Return type for expression template evaluations.
Definition: SMatDMatSubExpr.h:136
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
#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
Header file for the IsSame and IsStrictlySame type traits.
ReturnType at(size_t i, size_t j) const
Checked access to the matrix elements.
Definition: SMatDMatSubExpr.h:193
ResultType_t< MT2 > RT2
Result type of the right-hand side dense matrix expression.
Definition: SMatDMatSubExpr.h:96
bool canAlias(const T *alias) const noexcept
Returns whether the expression can alias with the given address alias.
Definition: SMatDMatSubExpr.h:251
TransposeType_t< ResultType > TransposeType
Transpose type for expression template evaluations.
Definition: SMatDMatSubExpr.h:132
LeftOperand lhs_
Left-hand side sparse matrix of the subtraction expression.
Definition: SMatDMatSubExpr.h:271
Header file for the MAYBE_UNUSED function template.
size_t columns() const noexcept
Returns the current number of columns of the matrix.
Definition: SMatDMatSubExpr.h:219
RightOperand rhs_
Right-hand side dense matrix of the subtraction expression.
Definition: SMatDMatSubExpr.h:272
Header file for the Computation base class.
const ResultType CompositeType
Data type for composite expression templates.
Definition: SMatDMatSubExpr.h:139
bool isAliased(const T *alias) const noexcept
Returns whether the expression is aliased with the given address alias.
Definition: SMatDMatSubExpr.h:264
typename T::ReturnType ReturnType_t
Alias declaration for nested ReturnType type definitions.The ReturnType_t alias declaration provides ...
Definition: Aliases.h:410
constexpr size_t columns(const Matrix< MT, SO > &matrix) noexcept
Returns the current number of columns of the matrix.
Definition: Matrix.h:514
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
Constraint on the data type.
Constraint on the data type.
ReturnType operator()(size_t i, size_t j) const
2D-access to the matrix elements.
Definition: SMatDMatSubExpr.h:178
Expression object for sparse matrix-dense matrix subtractions.The SMatDMatSubExpr class represents th...
Definition: Forward.h:123
Header file for the DisableIf class template.
Header file for the IsTemporary type trait class.
SubTrait_t< RT1, RT2 > ResultType
Result type for expression template evaluations.
Definition: SMatDMatSubExpr.h:130
Namespace of the Blaze C++ math library.
Definition: Blaze.h:58
Header file for the If class template.
ReturnType_t< MT1 > RN1
Return type of the left-hand side sparse matrix expression.
Definition: SMatDMatSubExpr.h:97
#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
static constexpr bool returnExpr
Compilation switch for the selection of the subscript operator return type.
Definition: SMatDMatSubExpr.h:108
Header file for the DenseMatrix base class.
If_t< IsExpression_v< MT1 >, const MT1, const MT1 & > LeftOperand
Composite type of the left-hand side dense matrix expression.
Definition: SMatDMatSubExpr.h:142
Header file for the MatMatSubExpr base class.
LeftOperand leftOperand() const noexcept
Returns the left-hand side sparse matrix operand.
Definition: SMatDMatSubExpr.h:229
constexpr void MAYBE_UNUSED(const Args &...)
Suppression of unused parameter warnings.
Definition: MaybeUnused.h:81
Constraints on the storage order of matrix types.
Header file for the exception macros of the math module.
If_t< IsExpression_v< MT2 >, const MT2, const MT2 & > RightOperand
Composite type of the right-hand side sparse matrix expression.
Definition: SMatDMatSubExpr.h:145
ElementType_t< ResultType > ElementType
Resulting element type.
Definition: SMatDMatSubExpr.h:133
Constraint on the data type.
Header file for the EnableIf class template.
typename T::OppositeType OppositeType_t
Alias declaration for nested OppositeType type definitions.The OppositeType_t alias declaration provi...
Definition: Aliases.h:270
ResultType_t< MT1 > RT1
Result type of the left-hand side sparse matrix expression.
Definition: SMatDMatSubExpr.h:95
static constexpr bool simdEnabled
Compilation switch for the expression template evaluation strategy.
Definition: SMatDMatSubExpr.h:150
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.
OppositeType_t< ResultType > OppositeType
Result type with opposite storage order for expression template evaluations.
Definition: SMatDMatSubExpr.h:131
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
Header file for the IsZero type trait.
#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.
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
#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
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
constexpr size_t rows(const Matrix< MT, SO > &matrix) noexcept
Returns the current number of rows of the matrix.
Definition: Matrix.h:498
size_t rows() const noexcept
Returns the current number of rows of the matrix.
Definition: SMatDMatSubExpr.h:209
#define BLAZE_CONSTRAINT_MATRICES_MUST_HAVE_SAME_STORAGE_ORDER(T1, T2)
Constraint on the data type.In case either of the two given data types T1 or T2 is not a matrix type ...
Definition: StorageOrder.h:84
RightOperand rightOperand() const noexcept
Returns the right-hand side dense matrix operand.
Definition: SMatDMatSubExpr.h:239
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
static constexpr bool smpAssignable
Compilation switch for the expression template assignment strategy.
Definition: SMatDMatSubExpr.h:153
Header file for the IntegralConstant class template.
#define BLAZE_CONSTRAINT_MUST_FORM_VALID_MATMATSUBEXPR(T1, T2)
Constraint on the data type.In case the given data types T1 and T2 do not form a valid matrix/matrix ...
Definition: MatMatSubExpr.h:103
ReturnType_t< MT2 > RN2
Return type of the right-hand side dense matrix expression.
Definition: SMatDMatSubExpr.h:98
decltype(std::declval< RN1 >() - std::declval< RN2 >()) ExprReturnType
Expression return type for the subscript operator.
Definition: SMatDMatSubExpr.h:111
#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
#define BLAZE_CONSTRAINT_MUST_BE_SPARSE_MATRIX_TYPE(T)
Constraint on the data type.In case the given data type T is not a sparse, N-dimensional matrix type,...
Definition: SparseMatrix.h:61
Header file for the IsExpression type trait class.
Header file for the function trace functionality.