35 #ifndef _BLAZE_MATH_EXPRESSIONS_DMATDECLLOWEXPR_H_ 36 #define _BLAZE_MATH_EXPRESSIONS_DMATDECLLOWEXPR_H_ 94 :
public DeclLowExpr< DenseMatrix< DMatDeclLowExpr<MT,SO>, SO > >
113 static constexpr
bool useAssign = RequiresEvaluation_v<MT>;
116 template<
typename MT2 >
118 static constexpr
bool UseAssign_v =
useAssign;
130 template<
typename MT2 >
131 static constexpr
bool UseSMPAssign_v = ( MT2::smpAssignable &&
useAssign );
203 if( i >=
dm_.rows() ) {
206 if( j >=
dm_.columns() ) {
225 return dm_.load(i,j);
266 inline size_t rows() const noexcept {
277 return dm_.columns();
297 template<
typename T >
298 inline bool canAlias(
const T* alias )
const noexcept {
299 return dm_.canAlias( alias );
309 template<
typename T >
310 inline bool isAliased(
const T* alias )
const noexcept {
311 return dm_.isAliased( alias );
321 return dm_.isAligned();
331 return dm_.canSMPAssign();
352 template<
typename MT2
362 assign( ~lhs, rhs.dm_ );
379 template<
typename MT2
389 assign( ~lhs, rhs.dm_ );
406 template<
typename MT2
408 friend inline auto addAssign( DenseMatrix<MT2,SO2>& lhs,
const DMatDeclLowExpr& rhs )
409 -> EnableIf_t< UseAssign_v<MT2> >
416 addAssign( ~lhs, rhs.dm_ );
433 template<
typename MT2
435 friend inline auto addAssign( SparseMatrix<MT2,SO2>& lhs,
const DMatDeclLowExpr& rhs )
436 -> EnableIf_t< UseAssign_v<MT2> >
443 addAssign( ~lhs, rhs.dm_ );
460 template<
typename MT2
462 friend inline auto subAssign( DenseMatrix<MT2,SO2>& lhs,
const DMatDeclLowExpr& rhs )
463 -> EnableIf_t< UseAssign_v<MT2> >
470 subAssign( ~lhs, rhs.dm_ );
487 template<
typename MT2
489 friend inline auto subAssign( SparseMatrix<MT2,SO2>& lhs,
const DMatDeclLowExpr& rhs )
490 -> EnableIf_t< UseAssign_v<MT2> >
497 subAssign( ~lhs, rhs.dm_ );
514 template<
typename MT2
516 friend inline auto schurAssign( DenseMatrix<MT2,SO2>& lhs,
const DMatDeclLowExpr& rhs )
517 -> EnableIf_t< UseAssign_v<MT2> >
524 schurAssign( ~lhs, rhs.dm_ );
541 template<
typename MT2
543 friend inline auto schurAssign( SparseMatrix<MT2,SO2>& lhs,
const DMatDeclLowExpr& rhs )
544 -> EnableIf_t< UseAssign_v<MT2> >
551 schurAssign( ~lhs, rhs.dm_ );
568 template<
typename MT2
570 friend inline auto multAssign( DenseMatrix<MT2,SO2>& lhs,
const DMatDeclLowExpr& rhs )
571 -> EnableIf_t< UseAssign_v<MT2> >
578 multAssign( ~lhs, rhs.dm_ );
595 template<
typename MT2
597 friend inline auto multAssign( SparseMatrix<MT2,SO2>& lhs,
const DMatDeclLowExpr& rhs )
598 -> EnableIf_t< UseAssign_v<MT2> >
605 multAssign( ~lhs, rhs.dm_ );
622 template<
typename MT2
625 -> EnableIf_t< UseSMPAssign_v<MT2> >
649 template<
typename MT2
652 -> EnableIf_t< UseSMPAssign_v<MT2> >
676 template<
typename MT2
679 -> EnableIf_t< UseSMPAssign_v<MT2> >
703 template<
typename MT2
706 -> EnableIf_t< UseSMPAssign_v<MT2> >
730 template<
typename MT2
733 -> EnableIf_t< UseSMPAssign_v<MT2> >
757 template<
typename MT2
760 -> EnableIf_t< UseSMPAssign_v<MT2> >
784 template<
typename MT2
787 -> EnableIf_t< UseSMPAssign_v<MT2> >
811 template<
typename MT2
814 -> EnableIf_t< UseSMPAssign_v<MT2> >
839 template<
typename MT2
842 -> EnableIf_t< UseSMPAssign_v<MT2> >
867 template<
typename MT2
870 -> EnableIf_t< UseSMPAssign_v<MT2> >
914 template<
typename MT
916 , DisableIf_t< IsLower_v<MT> || IsUniUpper_v<MT> >* =
nullptr >
917 inline const DMatDeclLowExpr<MT,SO> decllow_backend(
const DenseMatrix<MT,SO>& dm )
923 return DMatDeclLowExpr<MT,SO>( ~dm );
940 template<
typename MT
942 , EnableIf_t< !IsLower_v<MT> && IsUniUpper_v<MT> >* =
nullptr >
943 inline const IdentityMatrix<ElementType_t<MT>,SO> decllow_backend(
const DenseMatrix<MT,SO>& dm )
949 return IdentityMatrix<ElementType_t<MT>,SO>( (~dm).
rows() );
966 template<
typename MT
968 , EnableIf_t< IsLower_v<MT> >* =
nullptr >
969 inline const MT& decllow_backend(
const DenseMatrix<MT,SO>& dm )
999 template<
typename MT
1009 return decllow_backend( ~dm );
1036 template<
typename MT
1039 , DisableIf_t< IsLower_v<MT> >* =
nullptr >
1040 inline decltype(
auto)
decllow( const DMatScalarMultExpr<MT,ST,SO>& dm )
1048 return decllow( dm.leftOperand() ) * dm.rightOperand();
1064 template<
typename MT,
bool SO >
1065 struct HasConstDataAccess< DMatDeclLowExpr<MT,SO> >
1066 :
public HasConstDataAccess<MT>
1082 template<
typename MT,
bool SO >
1083 struct IsAligned< DMatDeclLowExpr<MT,SO> >
1084 :
public IsAligned<MT>
1100 template<
typename MT,
bool SO >
1101 struct IsLower< DMatDeclLowExpr<MT,SO> >
#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.
bool isAligned() const noexcept
Returns whether the operands of the expression are properly aligned in memory.
Definition: DMatDeclLowExpr.h:320
Header file for the IsUniUpper type trait.
Header file for basic type definitions.
size_t columns() const noexcept
Returns the current number of columns of the matrix.
Definition: DMatDeclLowExpr.h:276
Header file for all forward declarations for sparse vectors and matrices.
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
typename T::ResultType ResultType_t
Alias declaration for nested ResultType type definitions.The ResultType_t alias declaration provides ...
Definition: Aliases.h:390
#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
typename DeclLowTrait< MT >::Type DeclLowTrait_t
Auxiliary alias declaration for the DeclLowTrait type trait.The DeclLowTrait_t alias declaration prov...
Definition: DeclLowTrait.h:160
#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
Base class for all declaration expression templates.The Declaration class serves as a tag for all dec...
Definition: Declaration.h:70
#define BLAZE_CONSTRAINT_MUST_NOT_BE_UNIUPPER_MATRIX_TYPE(T)
Constraint on the data type.In case the given data type T is a upper unitriangular matrix type,...
Definition: UniUpper.h:81
static constexpr bool useAssign
Compilation switch for the serial evaluation strategy of the lower declaration expression.
Definition: DMatDeclLowExpr.h:113
Expression object for the explicit lower declaration of dense matrices.The DMatDeclLowExpr class repr...
Definition: DMatDeclLowExpr.h:93
TransposeType_t< ResultType > TransposeType
Transpose type for expression template evaluations.
Definition: DMatDeclLowExpr.h:141
Operand operand() const noexcept
Returns the dense matrix operand.
Definition: DMatDeclLowExpr.h:286
DeclLowTrait_t< RT > ResultType
Result type for expression template evaluations.
Definition: DMatDeclLowExpr.h:139
BoolConstant< true > TrueType
Type traits base class.The TrueType class is used as base class for type traits and value traits that...
Definition: IntegralConstant.h:132
Header file for the RequiresEvaluation type trait.
OppositeType_t< ResultType > OppositeType
Result type with opposite storage order for expression template evaluations.
Definition: DMatDeclLowExpr.h:140
Constraint on the data type.
typename T::ReturnType ReturnType_t
Alias declaration for nested ReturnType type definitions.The ReturnType_t alias declaration provides ...
Definition: Aliases.h:410
Header file for the SIMD trait.
bool canAlias(const T *alias) const noexcept
Returns whether the expression can alias with the given address alias.
Definition: DMatDeclLowExpr.h:298
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.
typename EnableIf< Condition, T >::Type EnableIf_t
Auxiliary type for the EnableIf class template.The EnableIf_t alias declaration provides a convenient...
Definition: EnableIf.h:138
ReturnType_t< MT > ReturnType
Return type for expression template evaluations.
Definition: DMatDeclLowExpr.h:143
Header file for the DisableIf class template.
bool canSMPAssign() const noexcept
Returns whether the expression can be used in SMP assignments.
Definition: DMatDeclLowExpr.h:330
Namespace of the Blaze C++ math library.
Definition: Blaze.h:58
#define BLAZE_ALWAYS_INLINE
Platform dependent setup of an enforced inline keyword.
Definition: Inline.h:85
Header file for the If class template.
Header file for the decllow trait.
#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
ConstIterator begin(size_t i) const
Returns an iterator to the first non-zero element of row/column i.
Definition: DMatDeclLowExpr.h:245
Header file for the DenseMatrix base class.
Header file for the GetMemberType type trait.
decltype(auto) decllow(const DenseMatrix< MT, SO > &dm)
Declares the given dense matrix expression dm as lower.
Definition: DMatDeclLowExpr.h:1001
Header file for the IsLower type trait.
ResultType_t< MT > RT
Result type of the dense matrix expression.
Definition: DMatDeclLowExpr.h:99
Header file for the IsAligned type trait.
#define BLAZE_CONSTRAINT_MUST_NOT_BE_MATMATMULTEXPR_TYPE(T)
Constraint on the data type.In case the given data type T is a matrix/matrix multiplication expressio...
Definition: MatMatMultExpr.h:83
static constexpr bool simdEnabled
Compilation switch for the expression template evaluation strategy.
Definition: DMatDeclLowExpr.h:157
Constraints on the storage order of matrix types.
Header file for the exception macros of the math module.
BLAZE_ALWAYS_INLINE auto load(size_t i, size_t j) const noexcept
Access to the SIMD elements of the matrix.
Definition: DMatDeclLowExpr.h:220
Header file for the DeclLowExpr base class.
Constraint on the data type.
Header file for the EnableIf class template.
Base class for all decllow expression templates.The DeclLowExpr class serves as a tag for all express...
Definition: DeclLowExpr.h:66
typename T::OppositeType OppositeType_t
Alias declaration for nested OppositeType type definitions.The OppositeType_t alias declaration provi...
Definition: Aliases.h:270
Header file for the HasConstDataAccess type trait.
Header file for the Declaration base class.
ReturnType operator()(size_t i, size_t j) const
2D-access to the matrix elements.
Definition: DMatDeclLowExpr.h:187
typename T::TransposeType TransposeType_t
Alias declaration for nested TransposeType type definitions.The TransposeType_t alias declaration pro...
Definition: Aliases.h:470
Header file for run time assertion macros.
Utility type for generic codes.
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
If_t< IsExpression_v< MT >, const MT, const MT & > Operand
Composite data type of the dense matrix expression.
Definition: DMatDeclLowExpr.h:152
ConstIterator end(size_t i) const
Returns an iterator just past the last non-zero element of row/column i.
Definition: DMatDeclLowExpr.h:256
ReturnType at(size_t i, size_t j) const
Checked access to the matrix elements.
Definition: DMatDeclLowExpr.h:202
bool isAliased(const T *alias) const noexcept
Returns whether the expression is aliased with the given address alias.
Definition: DMatDeclLowExpr.h:310
#define BLAZE_CONSTRAINT_MUST_NOT_BE_LOWER_MATRIX_TYPE(T)
Constraint on the data type.In case the given data type T is a lower triangular matrix type,...
Definition: Lower.h:81
SIMD characteristics of data types.The SIMDTrait class template provides the SIMD characteristics of ...
Definition: SIMDTrait.h:295
#define BLAZE_FUNCTION_TRACE
Function trace macro.This macro can be used to reliably trace function calls. In case function tracin...
Definition: FunctionTrace.h:94
Header file for all forward declarations for expression class templates.
DMatDeclLowExpr(const MT &dm) noexcept
Constructor for the DMatDeclLowExpr class.
Definition: DMatDeclLowExpr.h:173
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
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
BLAZE_CREATE_GET_TYPE_MEMBER_TYPE_TRAIT(GetConstIterator, ConstIterator, INVALID_TYPE)
Definition of the GetConstIterator type trait.
size_t rows() const noexcept
Returns the current number of rows of the matrix.
Definition: DMatDeclLowExpr.h:266
Header file for the implementation of the base template of the LowerMatrix.
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
If_t< RequiresEvaluation_v< MT >, const ResultType, const DMatDeclLowExpr & > CompositeType
Data type for composite expression templates.
Definition: DMatDeclLowExpr.h:146
ElementType_t< MT > ElementType
Resulting element type.
Definition: DMatDeclLowExpr.h:142
Header file for the IntegralConstant class template.
static constexpr bool smpAssignable
Compilation switch for the expression template assignment strategy.
Definition: DMatDeclLowExpr.h:160
Operand dm_
Dense matrix of the decllow expression.
Definition: DMatDeclLowExpr.h:337
GetConstIterator_t< MT > ConstIterator
Iterator over the elements of the dense matrix.
Definition: DMatDeclLowExpr.h:149
Constraint on the data type.
bool isSquare(const Matrix< MT, SO > &matrix) noexcept
Checks if the given matrix is a square matrix.
Definition: Matrix.h:951
static constexpr size_t SIMDSIZE
The number of elements packed within a single SIMD element.
Definition: DMatDeclLowExpr.h:165
const ElementType * data() const noexcept
Low-level data access to the matrix elements.
Definition: DMatDeclLowExpr.h:234
#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
auto smpMultAssign(Vector< VT1, TF1 > &lhs, const Vector< VT2, TF2 > &rhs) -> EnableIf_t< IsDenseVector_v< VT1 > >
Default implementation of the SMP multiplication assignment of a vector to a dense vector.
Definition: DenseVector.h:191
Header file for the IsExpression type trait class.
Header file for the function trace functionality.