TDMatSMatSubExpr.h
Go to the documentation of this file.
1 //=================================================================================================
33 //=================================================================================================
34 
35 #ifndef _BLAZE_MATH_EXPRESSIONS_TDMATSMATSUBEXPR_H_
36 #define _BLAZE_MATH_EXPRESSIONS_TDMATSMATSUBEXPR_H_
37 
38 
39 //*************************************************************************************************
40 // Includes
41 //*************************************************************************************************
42 
43 #include <utility>
44 #include <blaze/math/Aliases.h>
52 #include <blaze/math/Exception.h>
63 #include <blaze/util/Assert.h>
64 #include <blaze/util/DisableIf.h>
65 #include <blaze/util/EnableIf.h>
68 #include <blaze/util/mpl/If.h>
69 #include <blaze/util/Types.h>
71 #include <blaze/util/Unused.h>
72 
73 
74 namespace blaze {
75 
76 //=================================================================================================
77 //
78 // CLASS TDMATSMATSUBEXPR
79 //
80 //=================================================================================================
81 
82 //*************************************************************************************************
89 template< typename MT1 // Type of the left-hand side dense matrix
90  , typename MT2 > // Type of the right-hand side sparse matrix
91 class TDMatSMatSubExpr
92  : public MatMatSubExpr< DenseMatrix< TDMatSMatSubExpr<MT1,MT2>, true > >
93  , private Computation
94 {
95  private:
96  //**Type definitions****************************************************************************
101  //**********************************************************************************************
102 
103  //**Return type evaluation**********************************************************************
105 
110  static constexpr bool returnExpr = ( !IsTemporary_v<RN1> && !IsTemporary_v<RN2> );
111 
113  using ExprReturnType = decltype( std::declval<RN1>() - std::declval<RN2>() );
114  //**********************************************************************************************
115 
116  //**Parallel evaluation strategy****************************************************************
118 
123  template< typename MT >
124  static constexpr bool UseSMPAssign_v = ( !MT1::smpAssignable || !MT2::smpAssignable );
126  //**********************************************************************************************
127 
128  public:
129  //**Type definitions****************************************************************************
136 
139 
141  using CompositeType = const ResultType;
142 
144  using LeftOperand = If_t< IsExpression_v<MT1>, const MT1, const MT1& >;
145 
147  using RightOperand = If_t< IsExpression_v<MT2>, const MT2, const MT2& >;
148  //**********************************************************************************************
149 
150  //**Compilation flags***************************************************************************
152  static constexpr bool simdEnabled = false;
153 
155  static constexpr bool smpAssignable = false;
156  //**********************************************************************************************
157 
158  //**Constructor*********************************************************************************
164  explicit inline TDMatSMatSubExpr( const MT1& lhs, const MT2& rhs ) noexcept
165  : lhs_( lhs ) // Left-hand side dense matrix of the subtraction expression
166  , rhs_( rhs ) // Right-hand side sparse matrix of the subtraction expression
167  {
168  BLAZE_INTERNAL_ASSERT( lhs.rows() == rhs.rows() , "Invalid number of rows" );
169  BLAZE_INTERNAL_ASSERT( lhs.columns() == rhs.columns(), "Invalid number of columns" );
170  }
171  //**********************************************************************************************
172 
173  //**Access operator*****************************************************************************
180  inline ReturnType operator()( size_t i, size_t j ) const {
181  BLAZE_INTERNAL_ASSERT( i < lhs_.rows() , "Invalid row access index" );
182  BLAZE_INTERNAL_ASSERT( j < lhs_.columns(), "Invalid column access index" );
183  return lhs_(i,j) - rhs_(i,j);
184  }
185  //**********************************************************************************************
186 
187  //**At function*********************************************************************************
195  inline ReturnType at( size_t i, size_t j ) const {
196  if( i >= lhs_.rows() ) {
197  BLAZE_THROW_OUT_OF_RANGE( "Invalid row access index" );
198  }
199  if( j >= lhs_.columns() ) {
200  BLAZE_THROW_OUT_OF_RANGE( "Invalid column access index" );
201  }
202  return (*this)(i,j);
203  }
204  //**********************************************************************************************
205 
206  //**Rows function*******************************************************************************
211  inline size_t rows() const noexcept {
212  return lhs_.rows();
213  }
214  //**********************************************************************************************
215 
216  //**Columns function****************************************************************************
221  inline size_t columns() const noexcept {
222  return lhs_.columns();
223  }
224  //**********************************************************************************************
225 
226  //**Left operand access*************************************************************************
231  inline LeftOperand leftOperand() const noexcept {
232  return lhs_;
233  }
234  //**********************************************************************************************
235 
236  //**Right operand access************************************************************************
241  inline RightOperand rightOperand() const noexcept {
242  return rhs_;
243  }
244  //**********************************************************************************************
245 
246  //**********************************************************************************************
252  template< typename T >
253  inline bool canAlias( const T* alias ) const noexcept {
254  return ( IsExpression_v<MT1> && lhs_.canAlias( alias ) ) ||
255  ( rhs_.canAlias( alias ) );
256  }
257  //**********************************************************************************************
258 
259  //**********************************************************************************************
265  template< typename T >
266  inline bool isAliased( const T* alias ) const noexcept {
267  return ( lhs_.isAliased( alias ) || rhs_.isAliased( alias ) );
268  }
269  //**********************************************************************************************
270 
271  private:
272  //**Member variables****************************************************************************
275  //**********************************************************************************************
276 
277  //**Assignment to dense matrices****************************************************************
289  template< typename MT // Type of the target dense matrix
290  , bool SO2 > // Storage order of the target dense matrix
291  friend inline void assign( DenseMatrix<MT,SO2>& lhs, const TDMatSMatSubExpr& rhs )
292  {
294 
295  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
296  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
297 
298  if( !IsOperation_v<MT1> && isSame( ~lhs, rhs.lhs_ ) ) {
299  subAssign( ~lhs, rhs.rhs_ );
300  }
301  else {
302  assign ( ~lhs, rhs.lhs_ );
303  subAssign( ~lhs, rhs.rhs_ );
304  }
305  }
307  //**********************************************************************************************
308 
309  //**Assignment to sparse matrices***************************************************************
321  template< typename MT // Type of the target sparse matrix
322  , bool SO2 > // Storage order of the target sparse matrix
323  friend inline void assign( SparseMatrix<MT,SO2>& lhs, const TDMatSMatSubExpr& rhs )
324  {
326 
328 
335 
336  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
337  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
338 
339  const TmpType tmp( serial( rhs ) );
340  assign( ~lhs, tmp );
341  }
343  //**********************************************************************************************
344 
345  //**Addition assignment to dense matrices*******************************************************
358  template< typename MT // Type of the target dense matrix
359  , bool SO2 > // Storage order of the target dense matrix
360  friend inline void addAssign( DenseMatrix<MT,SO2>& lhs, const TDMatSMatSubExpr& rhs )
361  {
363 
364  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
365  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
366 
367  addAssign( ~lhs, rhs.lhs_ );
368  subAssign( ~lhs, rhs.rhs_ );
369  }
371  //**********************************************************************************************
372 
373  //**Addition assignment to sparse matrices******************************************************
374  // No special implementation for the addition assignment to sparse matrices.
375  //**********************************************************************************************
376 
377  //**Subtraction assignment to dense matrices****************************************************
390  template< typename MT // Type of the target dense matrix
391  , bool SO2 > // Storage order of the target dense matrix
392  friend inline void subAssign( DenseMatrix<MT,SO2>& lhs, const TDMatSMatSubExpr& rhs )
393  {
395 
396  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
397  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
398 
399  subAssign( ~lhs, rhs.lhs_ );
400  addAssign( ~lhs, rhs.rhs_ );
401  }
403  //**********************************************************************************************
404 
405  //**Subtraction assignment to sparse matrices***************************************************
406  // No special implementation for the subtraction assignment to sparse matrices.
407  //**********************************************************************************************
408 
409  //**Schur product assignment to dense matrices**************************************************
422  template< typename MT // Type of the target dense matrix
423  , bool SO2 > // Storage order of the target dense matrix
424  friend inline void schurAssign( DenseMatrix<MT,SO2>& lhs, const TDMatSMatSubExpr& rhs )
425  {
427 
431 
432  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
433  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
434 
435  const ResultType tmp( serial( rhs ) );
436  schurAssign( ~lhs, tmp );
437  }
439  //**********************************************************************************************
440 
441  //**Schur product assignment to sparse matrices*************************************************
442  // No special implementation for the Schur product assignment to sparse matrices.
443  //**********************************************************************************************
444 
445  //**Multiplication assignment to dense matrices*************************************************
446  // No special implementation for the multiplication assignment to dense matrices.
447  //**********************************************************************************************
448 
449  //**Multiplication assignment to sparse matrices************************************************
450  // No special implementation for the multiplication assignment to sparse matrices.
451  //**********************************************************************************************
452 
453  //**SMP assignment to dense matrices************************************************************
467  template< typename MT // Type of the target dense matrix
468  , bool SO2 > // Storage order of the target dense matrix
469  friend inline auto smpAssign( DenseMatrix<MT,SO2>& lhs, const TDMatSMatSubExpr& rhs )
470  -> EnableIf_t< UseSMPAssign_v<MT> >
471  {
473 
474  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
475  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
476 
477  if( !IsOperation_v<MT1> && isSame( ~lhs, rhs.lhs_ ) ) {
478  smpSubAssign( ~lhs, rhs.rhs_ );
479  }
480  else {
481  smpAssign ( ~lhs, rhs.lhs_ );
482  smpSubAssign( ~lhs, rhs.rhs_ );
483  }
484  }
486  //**********************************************************************************************
487 
488  //**SMP assignment to sparse matrices***********************************************************
502  template< typename MT // Type of the target sparse matrix
503  , bool SO2 > // Storage order of the target sparse matrix
504  friend inline auto smpAssign( SparseMatrix<MT,SO2>& lhs, const TDMatSMatSubExpr& rhs )
505  -> EnableIf_t< UseSMPAssign_v<MT> >
506  {
508 
509  using TmpType = If_t< SO2, ResultType, OppositeType >;
510 
517 
518  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
519  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
520 
521  const TmpType tmp( rhs );
522  smpAssign( ~lhs, tmp );
523  }
525  //**********************************************************************************************
526 
527  //**SMP addition assignment to dense matrices***************************************************
542  template< typename MT // Type of the target dense matrix
543  , bool SO2 > // Storage order of the target dense matrix
544  friend inline auto smpAddAssign( DenseMatrix<MT,SO2>& lhs, const TDMatSMatSubExpr& rhs )
545  -> EnableIf_t< UseSMPAssign_v<MT> >
546  {
548 
549  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
550  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
551 
552  smpAddAssign( ~lhs, rhs.lhs_ );
553  smpSubAssign( ~lhs, rhs.rhs_ );
554  }
556  //**********************************************************************************************
557 
558  //**SMP addition assignment to sparse matrices**************************************************
559  // No special implementation for the SMP addition assignment to sparse matrices.
560  //**********************************************************************************************
561 
562  //**SMP subtraction assignment to dense matrices************************************************
577  template< typename MT // Type of the target dense matrix
578  , bool SO2 > // Storage order of the target dense matrix
579  friend inline auto smpSubAssign( DenseMatrix<MT,SO2>& lhs, const TDMatSMatSubExpr& rhs )
580  -> EnableIf_t< UseSMPAssign_v<MT> >
581  {
583 
584  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
585  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
586 
587  smpSubAssign( ~lhs, rhs.lhs_ );
588  smpAddAssign( ~lhs, rhs.rhs_ );
589  }
591  //**********************************************************************************************
592 
593  //**SMP subtraction assignment to sparse matrices***********************************************
594  // No special implementation for the SMP subtraction assignment to sparse matrices.
595  //**********************************************************************************************
596 
597  //**SMP Schur product assignment to dense matrices**********************************************
612  template< typename MT // Type of the target dense matrix
613  , bool SO2 > // Storage order of the target dense matrix
614  friend inline auto smpSchurAssign( DenseMatrix<MT,SO2>& lhs, const TDMatSMatSubExpr& rhs )
615  -> EnableIf_t< UseSMPAssign_v<MT> >
616  {
618 
622 
623  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
624  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
625 
626  const ResultType tmp( rhs );
627  smpSchurAssign( ~lhs, tmp );
628  }
630  //**********************************************************************************************
631 
632  //**SMP Schur product assignment to sparse matrices*********************************************
633  // No special implementation for the SMP Schur product assignment to sparse matrices.
634  //**********************************************************************************************
635 
636  //**SMP multiplication assignment to dense matrices*********************************************
637  // No special implementation for the SMP multiplication assignment to dense matrices.
638  //**********************************************************************************************
639 
640  //**SMP multiplication assignment to sparse matrices********************************************
641  // No special implementation for the SMP multiplication assignment to sparse matrices.
642  //**********************************************************************************************
643 
644  //**Compile time checks*************************************************************************
652  //**********************************************************************************************
653 };
654 //*************************************************************************************************
655 
656 
657 
658 
659 //=================================================================================================
660 //
661 // GLOBAL BINARY ARITHMETIC OPERATORS
662 //
663 //=================================================================================================
664 
665 //*************************************************************************************************
678 template< typename MT1 // Type of the left-hand side dense matrix
679  , typename MT2 // Type of the right-hand side sparse matrix
680  , DisableIf_t< IsZero_v<MT2> &&
681  IsSame_v< ElementType_t<MT1>, ElementType_t<MT2> > >* = nullptr >
682 inline const TDMatSMatSubExpr<MT1,MT2>
683  tdmatsmatsub( const DenseMatrix<MT1,true>& lhs, const SparseMatrix<MT2,false>& rhs )
684 {
686 
687  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == (~rhs).rows() , "Invalid number of rows" );
688  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == (~rhs).columns(), "Invalid number of columns" );
689 
690  return TDMatSMatSubExpr<MT1,MT2>( ~lhs, ~rhs );
691 }
693 //*************************************************************************************************
694 
695 
696 //*************************************************************************************************
710 template< typename MT1 // Type of the left-hand side dense matrix
711  , typename MT2 // Type of the right-hand side sparse matrix
712  , EnableIf_t< IsZero_v<MT2> &&
713  IsSame_v< ElementType_t<MT1>, ElementType_t<MT2> > >* = nullptr >
714 inline const MT1&
715  tdmatsmatsub( const DenseMatrix<MT1,true>& lhs, const SparseMatrix<MT2,false>& rhs )
716 {
718 
719  UNUSED_PARAMETER( rhs );
720 
721  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == (~rhs).rows() , "Invalid number of rows" );
722  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == (~rhs).columns(), "Invalid number of columns" );
723 
724  return (~lhs);
725 }
727 //*************************************************************************************************
728 
729 
730 //*************************************************************************************************
761 template< typename MT1 // Type of the left-hand side dense matrix
762  , typename MT2 > // Type of the right-hand side sparse matrix
763 inline decltype(auto)
764  operator-( const DenseMatrix<MT1,true>& lhs, const SparseMatrix<MT2,false>& rhs )
765 {
767 
768  if( (~lhs).rows() != (~rhs).rows() || (~lhs).columns() != (~rhs).columns() ) {
769  BLAZE_THROW_INVALID_ARGUMENT( "Matrix sizes do not match" );
770  }
771 
772  return tdmatsmatsub( ~lhs, ~rhs );
773 }
774 //*************************************************************************************************
775 
776 
777 
778 
779 //=================================================================================================
780 //
781 // GLOBAL RESTRUCTURING BINARY ARITHMETIC OPERATORS
782 //
783 //=================================================================================================
784 
785 //*************************************************************************************************
798 template< typename MT1 // Type of the dense matrix of the left-hand side expression
799  , typename MT2 // Type of the sparse matrix of the left-hand side expression
800  , typename MT3 // Type of the right-hand side dense matrix
801  , bool SO > // Storage order of the right-hand side dense matrix
802 inline decltype(auto)
803  operator+( const TDMatSMatSubExpr<MT1,MT2>& lhs, const DenseMatrix<MT3,SO>& rhs )
804 {
806 
807  return ( lhs.leftOperand() + (~rhs) ) - lhs.rightOperand();
808 }
810 //*************************************************************************************************
811 
812 
813 //*************************************************************************************************
826 template< typename MT1 // Type of the dense matrix of the left-hand side expression
827  , typename MT2 // Type of the sparse matrix of the left-hand side expression
828  , typename MT3 // Type of the right-hand side dense matrix
829  , bool SO > // Storage order of the right-hand side dense matrix
830 inline decltype(auto)
831  operator-( const TDMatSMatSubExpr<MT1,MT2>& lhs, const DenseMatrix<MT3,SO>& rhs )
832 {
834 
835  return ( lhs.leftOperand() - (~rhs) ) - lhs.rightOperand();
836 }
838 //*************************************************************************************************
839 
840 } // namespace blaze
841 
842 #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.
LeftOperand lhs_
Left-hand side dense matrix of the subtraction expression.
Definition: TDMatSMatSubExpr.h:273
ReturnType_t< MT2 > RN2
Return type of the right-hand side sparse matrix expression.
Definition: TDMatSMatSubExpr.h:100
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 UNUSED_PARAMETER function template.
static constexpr bool returnExpr
Compilation switch for the selection of the subscript operator return type.
Definition: TDMatSMatSubExpr.h:110
Header file for the subtraction trait.
bool isSame(const Matrix< MT1, SO1 > &a, const Matrix< MT2, SO2 > &b) noexcept
Returns whether the two given matrices represent the same observable state.
Definition: Matrix.h:992
Header file for basic type definitions.
typename If< Condition, T1, T2 >::Type If_t
Auxiliary alias declaration for the If class template.The If_t alias declaration provides a convenien...
Definition: If.h:109
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.
Efficient implementation of a compressed matrix.The CompressedMatrix class template is the represent...
Definition: CompressedMatrix.h:224
#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
If_t< IsExpression_v< MT2 >, const MT2, const MT2 &> RightOperand
Composite type of the right-hand side sparse matrix expression.
Definition: TDMatSMatSubExpr.h:147
Header file for the IsSame and IsStrictlySame type traits.
size_t rows() const noexcept
Returns the current number of rows of the matrix.
Definition: TDMatSMatSubExpr.h:211
static constexpr bool smpAssignable
Compilation flag for SMP assignments.
Definition: CompressedMatrix.h:3113
ReturnType at(size_t i, size_t j) const
Checked access to the matrix elements.
Definition: TDMatSMatSubExpr.h:195
bool canAlias(const T *alias) const noexcept
Returns whether the expression can alias with the given address alias.
Definition: TDMatSMatSubExpr.h:253
Header file for the Computation base class.
Constraints on the storage order of matrix types.
constexpr void UNUSED_PARAMETER(const Args &...)
Suppression of unused parameter warnings.
Definition: Unused.h:81
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:80
Base class for sparse matrices.The SparseMatrix class is a base class for all sparse matrix classes...
Definition: Forward.h:137
typename T::ElementType ElementType_t
Alias declaration for nested ElementType type definitions.The ElementType_t alias declaration provide...
Definition: Aliases.h:170
RightOperand rightOperand() const noexcept
Returns the right-hand side sparse matrix operand.
Definition: TDMatSMatSubExpr.h:241
static constexpr bool smpAssignable
Compilation switch for the expression template assignment strategy.
Definition: TDMatSMatSubExpr.h:155
ElementType_t< ResultType > ElementType
Resulting element type.
Definition: TDMatSMatSubExpr.h:135
Constraint on the data type.
Constraint on the data type.
bool isAliased(const T *alias) const noexcept
Returns whether the expression is aliased with the given address alias.
Definition: TDMatSMatSubExpr.h:266
RightOperand rhs_
Right-hand side sparse matrix of the subtraction expression.
Definition: TDMatSMatSubExpr.h:274
Header file for the DisableIf class template.
Header file for the IsTemporary type trait class.
Namespace of the Blaze C++ math library.
Definition: Blaze.h:58
Header file for the If class template.
#define BLAZE_CONSTRAINT_MUST_BE_COLUMN_MAJOR_MATRIX_TYPE(T)
Constraint on the data type.In case the given data type T is not a column-major dense or sparse matri...
Definition: ColumnMajorMatrix.h:61
LeftOperand leftOperand() const noexcept
Returns the left-hand side transpose dense matrix operand.
Definition: TDMatSMatSubExpr.h:231
#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
Header file for the DenseMatrix base class.
Header file for the MatMatSubExpr base class.
Header file for the IsOperation type trait class.
Constraints on the storage order of matrix types.
Header file for the exception macros of the math module.
ResultType_t< MT1 > RT1
Result type of the left-hand side dense matrix expression.
Definition: TDMatSMatSubExpr.h:97
Constraint on the data type.
Header file for all forward declarations for expression class templates.
ReturnType_t< MT1 > RN1
Return type of the left-hand side dense matrix expression.
Definition: TDMatSMatSubExpr.h:99
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
size_t columns() const noexcept
Returns the current number of columns of the matrix.
Definition: TDMatSMatSubExpr.h:221
#define BLAZE_CONSTRAINT_MUST_BE_ROW_MAJOR_MATRIX_TYPE(T)
Constraint on the data type.In case the given data type T is not a row-major dense or sparse matrix t...
Definition: RowMajorMatrix.h:61
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.
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
ResultType_t< MT2 > RT2
Result type of the right-hand side sparse matrix expression.
Definition: TDMatSMatSubExpr.h:98
OppositeType_t< ResultType > OppositeType
Result type with opposite storage order for expression template evaluations.
Definition: TDMatSMatSubExpr.h:133
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
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
Constraints on the storage order of matrix types.
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
#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
ReturnType operator()(size_t i, size_t j) const
2D-access to the matrix elements.
Definition: TDMatSMatSubExpr.h:180
TDMatSMatSubExpr(const MT1 &lhs, const MT2 &rhs) noexcept
Constructor for the TDMatSMatSubExpr class.
Definition: TDMatSMatSubExpr.h:164
const If_t< returnExpr, ExprReturnType, ElementType > ReturnType
Return type for expression template evaluations.
Definition: TDMatSMatSubExpr.h:138
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
Header file for the IntegralConstant class template.
If_t< IsExpression_v< MT1 >, const MT1, const MT1 &> LeftOperand
Composite type of the left-hand side dense matrix expression.
Definition: TDMatSMatSubExpr.h:144
#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
static constexpr bool simdEnabled
Compilation switch for the expression template evaluation strategy.
Definition: TDMatSMatSubExpr.h:152
decltype(std::declval< RN1 >() - std::declval< RN2 >()) ExprReturnType
Expression return type for the subscript operator.
Definition: TDMatSMatSubExpr.h:113
TransposeType_t< ResultType > TransposeType
Transpose type for expression template evaluations.
Definition: TDMatSMatSubExpr.h:134
#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
Expression object for transpose dense matrix-sparse matrix subtractions.The TDMatSMatSubExpr class re...
Definition: Forward.h:161
#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
const ResultType CompositeType
Data type for composite expression templates.
Definition: TDMatSMatSubExpr.h:141
Header file for the IsExpression type trait class.
Header file for the function trace functionality.
SubTrait_t< RT1, RT2 > ResultType
Result type for expression template evaluations.
Definition: TDMatSMatSubExpr.h:132