DMatSMatAddExpr.h
Go to the documentation of this file.
1 //=================================================================================================
33 //=================================================================================================
34 
35 #ifndef _BLAZE_MATH_EXPRESSIONS_DMATSMATADDEXPR_H_
36 #define _BLAZE_MATH_EXPRESSIONS_DMATSMATADDEXPR_H_
37 
38 
39 //*************************************************************************************************
40 // Includes
41 //*************************************************************************************************
42 
43 #include <utility>
44 #include <blaze/math/Aliases.h>
50 #include <blaze/math/Exception.h>
61 #include <blaze/util/Assert.h>
62 #include <blaze/util/DisableIf.h>
63 #include <blaze/util/EnableIf.h>
66 #include <blaze/util/mpl/If.h>
67 #include <blaze/util/Types.h>
69 #include <blaze/util/Unused.h>
70 
71 
72 namespace blaze {
73 
74 //=================================================================================================
75 //
76 // CLASS DMATSMATADDEXPR
77 //
78 //=================================================================================================
79 
80 //*************************************************************************************************
87 template< typename MT1 // Type of the left-hand side dense matrix
88  , typename MT2 // Type of the right-hand side sparse matrix
89  , bool SO > // Storage order
91  : public MatMatAddExpr< DenseMatrix< DMatSMatAddExpr<MT1,MT2,SO>, SO > >
92  , private Computation
93 {
94  private:
95  //**Type definitions****************************************************************************
100  //**********************************************************************************************
101 
102  //**Return type evaluation**********************************************************************
104 
109  static constexpr bool returnExpr = ( !IsTemporary_v<RN1> && !IsTemporary_v<RN2> );
110 
112  using ExprReturnType = decltype( std::declval<RN1>() + std::declval<RN2>() );
113  //**********************************************************************************************
114 
115  //**Parallel evaluation strategy****************************************************************
117 
122  template< typename MT >
123  static constexpr bool UseSMPAssign_v = ( !MT1::smpAssignable || !MT2::smpAssignable );
125  //**********************************************************************************************
126 
127  public:
128  //**Type definitions****************************************************************************
135 
138 
140  using CompositeType = const ResultType;
141 
143  using LeftOperand = If_t< IsExpression_v<MT1>, const MT1, const MT1& >;
144 
146  using RightOperand = If_t< IsExpression_v<MT2>, const MT2, const MT2& >;
147  //**********************************************************************************************
148 
149  //**Compilation flags***************************************************************************
151  static constexpr bool simdEnabled = false;
152 
154  static constexpr bool smpAssignable = false;
155  //**********************************************************************************************
156 
157  //**Constructor*********************************************************************************
163  explicit inline DMatSMatAddExpr( const MT1& lhs, const MT2& rhs ) noexcept
164  : lhs_( lhs ) // Left-hand side dense matrix of the addition expression
165  , rhs_( rhs ) // Right-hand side sparse matrix of the addition expression
166  {
167  BLAZE_INTERNAL_ASSERT( lhs.rows() == rhs.rows() , "Invalid number of rows" );
168  BLAZE_INTERNAL_ASSERT( lhs.columns() == rhs.columns(), "Invalid number of columns" );
169  }
170  //**********************************************************************************************
171 
172  //**Access operator*****************************************************************************
179  inline ReturnType operator()( size_t i, size_t j ) const {
180  BLAZE_INTERNAL_ASSERT( i < lhs_.rows() , "Invalid row access index" );
181  BLAZE_INTERNAL_ASSERT( j < lhs_.columns(), "Invalid column access index" );
182  return lhs_(i,j) + rhs_(i,j);
183  }
184  //**********************************************************************************************
185 
186  //**At function*********************************************************************************
194  inline ReturnType at( size_t i, size_t j ) const {
195  if( i >= lhs_.rows() ) {
196  BLAZE_THROW_OUT_OF_RANGE( "Invalid row access index" );
197  }
198  if( j >= lhs_.columns() ) {
199  BLAZE_THROW_OUT_OF_RANGE( "Invalid column access index" );
200  }
201  return (*this)(i,j);
202  }
203  //**********************************************************************************************
204 
205  //**Rows function*******************************************************************************
210  inline size_t rows() const noexcept {
211  return lhs_.rows();
212  }
213  //**********************************************************************************************
214 
215  //**Columns function****************************************************************************
220  inline size_t columns() const noexcept {
221  return lhs_.columns();
222  }
223  //**********************************************************************************************
224 
225  //**Left operand access*************************************************************************
230  inline LeftOperand leftOperand() const {
231  return lhs_;
232  }
233  //**********************************************************************************************
234 
235  //**Right operand access************************************************************************
240  inline RightOperand rightOperand() const noexcept {
241  return rhs_;
242  }
243  //**********************************************************************************************
244 
245  //**********************************************************************************************
251  template< typename T >
252  inline bool canAlias( const T* alias ) const noexcept {
253  return ( IsExpression_v<MT1> && lhs_.canAlias( alias ) ) ||
254  ( rhs_.canAlias( alias ) );
255  }
256  //**********************************************************************************************
257 
258  //**********************************************************************************************
264  template< typename T >
265  inline bool isAliased( const T* alias ) const noexcept {
266  return ( lhs_.isAliased( alias ) || rhs_.isAliased( alias ) );
267  }
268  //**********************************************************************************************
269 
270  private:
271  //**Member variables****************************************************************************
274  //**********************************************************************************************
275 
276  //**Assignment to dense matrices****************************************************************
288  template< typename MT // Type of the target dense matrix
289  , bool SO2 > // Storage order of the target dense matrix
290  friend inline void assign( DenseMatrix<MT,SO2>& lhs, const DMatSMatAddExpr& rhs )
291  {
293 
294  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
295  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
296 
297  if( !IsOperation_v<MT1> && isSame( ~lhs, rhs.lhs_ ) ) {
298  addAssign( ~lhs, rhs.rhs_ );
299  }
300  else {
301  assign ( ~lhs, rhs.lhs_ );
302  addAssign( ~lhs, rhs.rhs_ );
303  }
304  }
306  //**********************************************************************************************
307 
308  //**Assignment to sparse matrices***************************************************************
320  template< typename MT // Type of the target sparse matrix
321  , bool SO2 > // Storage order of the target sparse matrix
322  friend inline void assign( SparseMatrix<MT,SO2>& lhs, const DMatSMatAddExpr& rhs )
323  {
325 
327 
334 
335  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
336  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
337 
338  const TmpType tmp( serial( rhs ) );
339  assign( ~lhs, tmp );
340  }
342  //**********************************************************************************************
343 
344  //**Addition assignment to dense matrices*******************************************************
356  template< typename MT // Type of the target dense matrix
357  , bool SO2 > // Storage order of the target dense matrix
358  friend inline void addAssign( DenseMatrix<MT,SO2>& lhs, const DMatSMatAddExpr& rhs )
359  {
361 
362  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
363  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
364 
365  addAssign( ~lhs, rhs.lhs_ );
366  addAssign( ~lhs, rhs.rhs_ );
367  }
369  //**********************************************************************************************
370 
371  //**Addition assignment to sparse matrices******************************************************
372  // No special implementation for the addition assignment to sparse matrices.
373  //**********************************************************************************************
374 
375  //**Subtraction assignment to dense matrices****************************************************
387  template< typename MT // Type of the target dense matrix
388  , bool SO2 > // Storage order of the target dense matrix
389  friend inline void subAssign( DenseMatrix<MT,SO2>& lhs, const DMatSMatAddExpr& rhs )
390  {
392 
393  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
394  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
395 
396  subAssign( ~lhs, rhs.lhs_ );
397  subAssign( ~lhs, rhs.rhs_ );
398  }
400  //**********************************************************************************************
401 
402  //**Subtraction assignment to sparse matrices***************************************************
403  // No special implementation for the subtraction assignment to sparse matrices.
404  //**********************************************************************************************
405 
406  //**Schur product assignment to dense matrices**************************************************
418  template< typename MT // Type of the target dense matrix
419  , bool SO2 > // Storage order of the target dense matrix
420  friend inline void schurAssign( DenseMatrix<MT,SO2>& lhs, const DMatSMatAddExpr& rhs )
421  {
423 
427 
428  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
429  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
430 
431  const ResultType tmp( serial( rhs ) );
432  schurAssign( ~lhs, tmp );
433  }
435  //**********************************************************************************************
436 
437  //**Schur product assignment to sparse matrices*************************************************
438  // No special implementation for the Schur product assignment to sparse matrices.
439  //**********************************************************************************************
440 
441  //**Multiplication assignment to dense matrices*************************************************
442  // No special implementation for the multiplication assignment to dense matrices.
443  //**********************************************************************************************
444 
445  //**Multiplication assignment to sparse matrices************************************************
446  // No special implementation for the multiplication assignment to sparse matrices.
447  //**********************************************************************************************
448 
449  //**SMP assignment to dense matrices************************************************************
463  template< typename MT // Type of the target dense matrix
464  , bool SO2 > // Storage order of the target dense matrix
465  friend inline auto smpAssign( DenseMatrix<MT,SO2>& lhs, const DMatSMatAddExpr& rhs )
466  -> EnableIf_t< UseSMPAssign_v<MT> >
467  {
469 
470  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
471  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
472 
473  if( !IsOperation_v<MT1> && isSame( ~lhs, rhs.lhs_ ) ) {
474  smpAddAssign( ~lhs, rhs.rhs_ );
475  }
476  else {
477  smpAssign ( ~lhs, rhs.lhs_ );
478  smpAddAssign( ~lhs, rhs.rhs_ );
479  }
480  }
482  //**********************************************************************************************
483 
484  //**SMP assignment to sparse matrices***********************************************************
498  template< typename MT // Type of the target sparse matrix
499  , bool SO2 > // Storage order of the target sparse matrix
500  friend inline auto smpAssign( SparseMatrix<MT,SO2>& lhs, const DMatSMatAddExpr& rhs )
501  -> EnableIf_t< UseSMPAssign_v<MT> >
502  {
504 
505  using TmpType = If_t< SO == SO2, ResultType, OppositeType >;
506 
513 
514  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
515  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
516 
517  const TmpType tmp( rhs );
518  smpAssign( ~lhs, tmp );
519  }
521  //**********************************************************************************************
522 
523  //**SMP addition assignment to dense matrices***************************************************
537  template< typename MT // Type of the target dense matrix
538  , bool SO2 > // Storage order of the target dense matrix
539  friend inline auto smpAddAssign( DenseMatrix<MT,SO2>& lhs, const DMatSMatAddExpr& rhs )
540  -> EnableIf_t< UseSMPAssign_v<MT> >
541  {
543 
544  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
545  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
546 
547  smpAddAssign( ~lhs, rhs.lhs_ );
548  smpAddAssign( ~lhs, rhs.rhs_ );
549  }
551  //**********************************************************************************************
552 
553  //**SMP addition assignment to sparse matrices**************************************************
554  // No special implementation for the SMP addition assignment to sparse matrices.
555  //**********************************************************************************************
556 
557  //**SMP subtraction assignment to dense matrices************************************************
571  template< typename MT // Type of the target dense matrix
572  , bool SO2 > // Storage order of the target dense matrix
573  friend inline auto smpSubAssign( DenseMatrix<MT,SO2>& lhs, const DMatSMatAddExpr& rhs )
574  -> EnableIf_t< UseSMPAssign_v<MT> >
575  {
577 
578  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
579  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
580 
581  smpSubAssign( ~lhs, rhs.lhs_ );
582  smpSubAssign( ~lhs, rhs.rhs_ );
583  }
585  //**********************************************************************************************
586 
587  //**SMP subtraction assignment to sparse matrices***********************************************
588  // No special implementation for the SMP subtraction assignment to sparse matrices.
589  //**********************************************************************************************
590 
591  //**SMP Schur product assignment to dense matrices**********************************************
605  template< typename MT // Type of the target dense matrix
606  , bool SO2 > // Storage order of the target dense matrix
607  friend inline auto smpSchurAssign( DenseMatrix<MT,SO2>& lhs, const DMatSMatAddExpr& rhs )
608  -> EnableIf_t< UseSMPAssign_v<MT> >
609  {
611 
615 
616  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
617  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
618 
619  const ResultType tmp( rhs );
620  smpSchurAssign( ~lhs, tmp );
621  }
623  //**********************************************************************************************
624 
625  //**SMP subtraction assignment to sparse matrices***********************************************
626  // No special implementation for the SMP subtraction assignment to sparse matrices.
627  //**********************************************************************************************
628 
629  //**SMP multiplication assignment to dense matrices*********************************************
630  // No special implementation for the SMP multiplication assignment to dense matrices.
631  //**********************************************************************************************
632 
633  //**SMP multiplication assignment to sparse matrices********************************************
634  // No special implementation for the SMP multiplication assignment to sparse matrices.
635  //**********************************************************************************************
636 
637  //**Compile time checks*************************************************************************
644  //**********************************************************************************************
645 };
646 //*************************************************************************************************
647 
648 
649 
650 
651 //=================================================================================================
652 //
653 // GLOBAL BINARY ARITHMETIC OPERATORS
654 //
655 //=================================================================================================
656 
657 //*************************************************************************************************
670 template< typename MT1 // Type of the left-hand side dense matrix
671  , typename MT2 // Type of the right-hand side sparse matrix
672  , bool SO // Storage order
673  , DisableIf_t< IsZero_v<MT2> &&
674  IsSame_v< ElementType_t<MT1>, ElementType_t<MT2> > >* = nullptr >
675 inline const DMatSMatAddExpr<MT1,MT2,SO>
676  dmatsmatadd( const DenseMatrix<MT1,SO>& lhs, const SparseMatrix<MT2,SO>& rhs )
677 {
679 
680  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == (~rhs).rows() , "Invalid number of rows" );
681  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == (~rhs).columns(), "Invalid number of columns" );
682 
683  return DMatSMatAddExpr<MT1,MT2,SO>( ~lhs, ~rhs );
684 }
686 //*************************************************************************************************
687 
688 
689 //*************************************************************************************************
702 template< typename MT1 // Type of the left-hand side dense matrix
703  , typename MT2 // Type of the right-hand side sparse matrix
704  , bool SO // Storage order
705  , EnableIf_t< IsZero_v<MT2> &&
706  IsSame_v< ElementType_t<MT1>, ElementType_t<MT2> > >* = nullptr >
707 inline const MT1&
708  dmatsmatadd( const DenseMatrix<MT1,SO>& lhs, const SparseMatrix<MT2,SO>& rhs )
709 {
711 
712  UNUSED_PARAMETER( rhs );
713 
714  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == (~rhs).rows() , "Invalid number of rows" );
715  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == (~rhs).columns(), "Invalid number of columns" );
716 
717  return (~lhs);
718 }
720 //*************************************************************************************************
721 
722 
723 //*************************************************************************************************
749 template< typename MT1 // Type of the left-hand side dense matrix
750  , typename MT2 // Type of the right-hand side sparse matrix
751  , bool SO > // Storage order
752 inline decltype(auto)
753  operator+( const DenseMatrix<MT1,SO>& lhs, const SparseMatrix<MT2,SO>& rhs )
754 {
756 
757  if( (~lhs).rows() != (~rhs).rows() || (~lhs).columns() != (~rhs).columns() ) {
758  BLAZE_THROW_INVALID_ARGUMENT( "Matrix sizes do not match" );
759  }
760 
761  return dmatsmatadd( ~lhs, ~rhs );
762 }
763 //*************************************************************************************************
764 
765 
766 //*************************************************************************************************
792 template< typename MT1 // Type of the left-hand side sparse matrix
793  , typename MT2 // Type of the right-hand side dense matrix
794  , bool SO > // Storage order
795 inline decltype(auto)
796  operator+( const SparseMatrix<MT1,SO>& lhs, const DenseMatrix<MT2,SO>& rhs )
797 {
799 
800  if( (~lhs).rows() != (~rhs).rows() || (~lhs).columns() != (~rhs).columns() ) {
801  BLAZE_THROW_INVALID_ARGUMENT( "Matrix sizes do not match" );
802  }
803 
804  return dmatsmatadd( ~rhs, ~lhs );
805 }
806 //*************************************************************************************************
807 
808 
809 
810 
811 //=================================================================================================
812 //
813 // GLOBAL RESTRUCTURING BINARY ARITHMETIC OPERATORS
814 //
815 //=================================================================================================
816 
817 //*************************************************************************************************
830 template< typename MT1 // Type of the dense matrix of the left-hand side expression
831  , typename MT2 // Type of the sparse matrix of the left-hand side expression
832  , bool SO1 // Storage order of the left-hand side expression
833  , typename MT3 // Type of the right-hand side dense matrix
834  , bool SO2 > // Storage order of the right-hand side dense matrix
835 inline decltype(auto)
836  operator+( const DMatSMatAddExpr<MT1,MT2,SO1>& lhs, const DenseMatrix<MT3,SO2>& rhs )
837 {
839 
840  return ( lhs.leftOperand() + (~rhs) ) + lhs.rightOperand();
841 }
843 //*************************************************************************************************
844 
845 
846 //*************************************************************************************************
859 template< typename MT1 // Type of the dense matrix of the left-hand side expression
860  , typename MT2 // Type of the sparse matrix of the left-hand side expression
861  , bool SO1 // Storage order of the left-hand side expression
862  , typename MT3 // Type of the right-hand side dense matrix
863  , bool SO2 > // Storage order of the right-hand side dense matrix
864 inline decltype(auto)
865  operator-( const DMatSMatAddExpr<MT1,MT2,SO1>& lhs, const DenseMatrix<MT3,SO2>& rhs )
866 {
868 
869  return ( lhs.leftOperand() - (~rhs) ) + lhs.rightOperand();
870 }
872 //*************************************************************************************************
873 
874 } // namespace blaze
875 
876 #endif
#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 addition expression.
Definition: DMatSMatAddExpr.h:272
If_t< IsExpression_v< MT2 >, const MT2, const MT2 &> RightOperand
Composite type of the right-hand side sparse matrix expression.
Definition: DMatSMatAddExpr.h:146
Header file for the UNUSED_PARAMETER function template.
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.
bool isAliased(const T *alias) const noexcept
Returns whether the expression is aliased with the given address alias.
Definition: DMatSMatAddExpr.h:265
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.
#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
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
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: DMatSMatAddExpr.h:194
static constexpr bool smpAssignable
Compilation flag for SMP assignments.
Definition: CompressedMatrix.h:3113
ResultType_t< MT1 > RT1
Result type of the left-hand side dense matrix expression.
Definition: DMatSMatAddExpr.h:96
Header file for the Computation base class.
ResultType_t< MT2 > RT2
Result type of the right-hand side sparse matrix expression.
Definition: DMatSMatAddExpr.h:97
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
size_t rows() const noexcept
Returns the current number of rows of the matrix.
Definition: DMatSMatAddExpr.h:210
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
If_t< IsExpression_v< MT1 >, const MT1, const MT1 &> LeftOperand
Composite type of the left-hand side dense matrix expression.
Definition: DMatSMatAddExpr.h:143
RightOperand rhs_
Right-hand side sparse matrix of the addition expression.
Definition: DMatSMatAddExpr.h:273
decltype(std::declval< RN1 >()+std::declval< RN2 >()) ExprReturnType
Expression return type for the subscript operator.
Definition: DMatSMatAddExpr.h:112
ReturnType operator()(size_t i, size_t j) const
2D-access to the matrix elements.
Definition: DMatSMatAddExpr.h:179
Constraint on the data type.
Constraint on the data type.
Header file for the DisableIf class template.
Header file for the IsTemporary type trait class.
static constexpr bool returnExpr
Compilation switch for the selection of the subscript operator return type.
Definition: DMatSMatAddExpr.h:109
RightOperand rightOperand() const noexcept
Returns the right-hand side sparse matrix operand.
Definition: DMatSMatAddExpr.h:240
Namespace of the Blaze C++ math library.
Definition: Blaze.h:58
Header file for the If class template.
#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.
Base class for all matrix/matrix addition expression templates.The MatMatAddExpr class serves as a ta...
Definition: MatMatAddExpr.h:66
Header file for the IsOperation type trait class.
typename AddTrait< T1, T2 >::Type AddTrait_t
Auxiliary alias declaration for the AddTrait class template.The AddTrait_t alias declaration provides...
Definition: AddTrait.h:238
AddTrait_t< RT1, RT2 > ResultType
Result type for expression template evaluations.
Definition: DMatSMatAddExpr.h:131
Constraints on the storage order of matrix types.
Header file for the exception macros of the math module.
#define BLAZE_CONSTRAINT_MUST_FORM_VALID_MATMATADDEXPR(T1, T2)
Constraint on the data type.In case the given data types T1 and T2 do not form a valid matrix/matrix ...
Definition: MatMatAddExpr.h:103
Constraint on the data type.
Header file for all forward declarations for expression class templates.
static constexpr bool simdEnabled
Compilation switch for the expression template evaluation strategy.
Definition: DMatSMatAddExpr.h:151
TransposeType_t< ResultType > TransposeType
Transpose type for expression template evaluations.
Definition: DMatSMatAddExpr.h:133
Header file for the EnableIf class template.
LeftOperand leftOperand() const
Returns the left-hand side dense matrix operand.
Definition: DMatSMatAddExpr.h:230
typename T::OppositeType OppositeType_t
Alias declaration for nested OppositeType type definitions.The OppositeType_t alias declaration provi...
Definition: Aliases.h:270
DMatSMatAddExpr(const MT1 &lhs, const MT2 &rhs) noexcept
Constructor for the DMatSMatAddExpr class.
Definition: DMatSMatAddExpr.h:163
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: DMatSMatAddExpr.h:132
Header file for the addition trait.
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
Constraint on the data type.
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
const If_t< returnExpr, ExprReturnType, ElementType > ReturnType
Return type for expression template evaluations.
Definition: DMatSMatAddExpr.h:137
bool canAlias(const T *alias) const noexcept
Returns whether the expression can alias with the given address alias.
Definition: DMatSMatAddExpr.h:252
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
Header file for the MatMatAddExpr base class.
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
const ResultType CompositeType
Data type for composite expression templates.
Definition: DMatSMatAddExpr.h:140
ReturnType_t< MT1 > RN1
Return type of the left-hand side dense matrix expression.
Definition: DMatSMatAddExpr.h:98
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
Expression object for dense matrix-sparse matrix additions.The DMatSMatAddExpr class represents the c...
Definition: DMatSMatAddExpr.h:90
Base class for all compute expression templates.The Computation class serves as a tag for all computa...
Definition: Computation.h:66
size_t columns() const noexcept
Returns the current number of columns of the matrix.
Definition: DMatSMatAddExpr.h:220
Header file for the IntegralConstant class template.
static constexpr bool smpAssignable
Compilation switch for the expression template assignment strategy.
Definition: DMatSMatAddExpr.h:154
ReturnType_t< MT2 > RN2
Return type of the right-hand side sparse matrix expression.
Definition: DMatSMatAddExpr.h:99
ElementType_t< ResultType > ElementType
Resulting element type.
Definition: DMatSMatAddExpr.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
#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.