35#ifndef _BLAZE_MATH_EXPRESSIONS_DMATDECLHERMEXPR_H_
36#define _BLAZE_MATH_EXPRESSIONS_DMATDECLHERMEXPR_H_
93 :
public DeclHermExpr< DenseMatrix< DMatDeclHermExpr<MT,SO>, SO > >
112 static constexpr bool useAssign = RequiresEvaluation_v<MT>;
116 template<
typename MT2 >
117 static constexpr bool UseAssign_v =
useAssign;
129 template<
typename MT2 >
130 static constexpr bool UseSMPAssign_v = ( MT2::smpAssignable &&
useAssign );
206 if( i >=
dm_.rows() ) {
209 if( j >=
dm_.columns() ) {
228 return dm_.load(i,j);
269 inline size_t rows() const noexcept {
280 return dm_.columns();
300 template<
typename T >
301 inline bool canAlias(
const T* alias )
const noexcept {
302 return dm_.canAlias( alias );
312 template<
typename T >
313 inline bool isAliased(
const T* alias )
const noexcept {
314 return dm_.isAliased( alias );
324 return dm_.isAligned();
334 return dm_.canSMPAssign();
355 template<
typename MT2
365 assign( *lhs, rhs.dm_ );
382 template<
typename MT2
392 assign( *lhs, rhs.dm_ );
409 template<
typename MT2
411 friend inline auto addAssign( DenseMatrix<MT2,SO2>& lhs,
const DMatDeclHermExpr& rhs )
412 -> EnableIf_t< UseAssign_v<MT2> >
419 addAssign( *lhs, rhs.dm_ );
436 template<
typename MT2
438 friend inline auto addAssign( SparseMatrix<MT2,SO2>& lhs,
const DMatDeclHermExpr& rhs )
439 -> EnableIf_t< UseAssign_v<MT2> >
446 addAssign( *lhs, rhs.dm_ );
463 template<
typename MT2
465 friend inline auto subAssign( DenseMatrix<MT2,SO2>& lhs,
const DMatDeclHermExpr& rhs )
466 -> EnableIf_t< UseAssign_v<MT2> >
473 subAssign( *lhs, rhs.dm_ );
490 template<
typename MT2
492 friend inline auto subAssign( SparseMatrix<MT2,SO2>& lhs,
const DMatDeclHermExpr& rhs )
493 -> EnableIf_t< UseAssign_v<MT2> >
500 subAssign( *lhs, rhs.dm_ );
517 template<
typename MT2
519 friend inline auto schurAssign( DenseMatrix<MT2,SO2>& lhs,
const DMatDeclHermExpr& rhs )
520 -> EnableIf_t< UseAssign_v<MT2> >
527 schurAssign( *lhs, rhs.dm_ );
544 template<
typename MT2
546 friend inline auto schurAssign( SparseMatrix<MT2,SO2>& lhs,
const DMatDeclHermExpr& rhs )
547 -> EnableIf_t< UseAssign_v<MT2> >
554 schurAssign( *lhs, rhs.dm_ );
571 template<
typename MT2
573 friend inline auto multAssign( DenseMatrix<MT2,SO2>& lhs,
const DMatDeclHermExpr& rhs )
574 -> EnableIf_t< UseAssign_v<MT2> >
581 multAssign( *lhs, rhs.dm_ );
598 template<
typename MT2
600 friend inline auto multAssign( SparseMatrix<MT2,SO2>& lhs,
const DMatDeclHermExpr& rhs )
601 -> EnableIf_t< UseAssign_v<MT2> >
608 multAssign( *lhs, rhs.dm_ );
625 template<
typename MT2
628 -> EnableIf_t< UseSMPAssign_v<MT2> >
652 template<
typename MT2
655 -> EnableIf_t< UseSMPAssign_v<MT2> >
679 template<
typename MT2
682 -> EnableIf_t< UseSMPAssign_v<MT2> >
706 template<
typename MT2
709 -> EnableIf_t< UseSMPAssign_v<MT2> >
733 template<
typename MT2
736 -> EnableIf_t< UseSMPAssign_v<MT2> >
760 template<
typename MT2
763 -> EnableIf_t< UseSMPAssign_v<MT2> >
787 template<
typename MT2
790 -> EnableIf_t< UseSMPAssign_v<MT2> >
814 template<
typename MT2
817 -> EnableIf_t< UseSMPAssign_v<MT2> >
842 template<
typename MT2
845 -> EnableIf_t< UseSMPAssign_v<MT2> >
870 template<
typename MT2
873 -> EnableIf_t< UseSMPAssign_v<MT2> >
919 , DisableIf_t< IsHermitian_v<MT> || IsUniTriangular_v<MT> >* =
nullptr >
920inline const DMatDeclHermExpr<MT,SO> declherm_backend(
const DenseMatrix<MT,SO>& dm )
926 return DMatDeclHermExpr<MT,SO>( *dm );
945 , EnableIf_t< !IsHermitian_v<MT> && IsUniTriangular_v<MT> >* =
nullptr >
946inline const IdentityMatrix<ElementType_t<MT>,SO> declherm_backend(
const DenseMatrix<MT,SO>& dm )
952 return IdentityMatrix<ElementType_t<MT>,SO>( (*dm).rows() );
971 , EnableIf_t< IsHermitian_v<MT> >* =
nullptr >
972inline const MT& declherm_backend(
const DenseMatrix<MT,SO>& dm )
1003template<
typename MT
1013 return declherm_backend( *dm );
1028template<
typename MT,
bool SO >
1029struct HasConstDataAccess< DMatDeclHermExpr<MT,SO> >
1030 :
public HasConstDataAccess<MT>
1046template<
typename MT,
bool SO >
1047struct IsAligned< DMatDeclHermExpr<MT,SO> >
1048 :
public IsAligned<MT>
1064template<
typename MT,
bool SO >
1065struct IsHermitian< DMatDeclHermExpr<MT,SO> >
Header file for auxiliary alias declarations.
typename T::ReturnType ReturnType_t
Alias declaration for nested ReturnType type definitions.
Definition: Aliases.h:470
typename T::ResultType ResultType_t
Alias declaration for nested ResultType type definitions.
Definition: Aliases.h:450
typename T::ElementType ElementType_t
Alias declaration for nested ElementType type definitions.
Definition: Aliases.h:190
typename T::OppositeType OppositeType_t
Alias declaration for nested OppositeType type definitions.
Definition: Aliases.h:310
typename T::TransposeType TransposeType_t
Alias declaration for nested TransposeType type definitions.
Definition: Aliases.h:550
Header file for run time assertion macros.
Header file for the declherm trait.
Header file for the EnableIf class template.
Header file for the function trace functionality.
Header file for the GetMemberType type trait.
Header file for the HasConstDataAccess type trait.
Constraint on the data type.
Header file for the If class template.
Header file for the IntegralConstant class template.
Utility type for generic codes.
Header file for the IsAligned type trait.
Header file for the IsExpression type trait class.
Header file for the IsHermitian type trait.
Header file for the IsUniTriangular type trait.
Header file for the SIMD trait.
Constraint on the data type.
Header file for the implementation of the base template of the HeritianMatrix.
Expression object for the explicit Hermitian declaration of dense matrices.
Definition: DMatDeclHermExpr.h:95
bool canAlias(const T *alias) const noexcept
Returns whether the expression can alias with the given address alias.
Definition: DMatDeclHermExpr.h:301
size_t columns() const noexcept
Returns the current number of columns of the matrix.
Definition: DMatDeclHermExpr.h:279
BLAZE_CREATE_GET_TYPE_MEMBER_TYPE_TRAIT(GetConstIterator, ConstIterator, INVALID_TYPE)
Definition of the GetConstIterator type trait.
static constexpr bool useAssign
Compilation switch for the serial evaluation strategy of the Hermitian declaration expression.
Definition: DMatDeclHermExpr.h:112
ConstIterator begin(size_t i) const
Returns an iterator to the first non-zero element of row/column i.
Definition: DMatDeclHermExpr.h:248
BLAZE_ALWAYS_INLINE auto load(size_t i, size_t j) const noexcept
Access to the SIMD elements of the matrix.
Definition: DMatDeclHermExpr.h:223
Operand operand() const noexcept
Returns the dense matrix operand.
Definition: DMatDeclHermExpr.h:289
DMatDeclHermExpr(const MT &dm) noexcept
Constructor for the DMatDeclHermExpr class.
Definition: DMatDeclHermExpr.h:176
OppositeType_t< ResultType > OppositeType
Result type with opposite storage order for expression template evaluations.
Definition: DMatDeclHermExpr.h:143
Operand dm_
Dense matrix of the declherm expression.
Definition: DMatDeclHermExpr.h:340
DeclHermTrait_t< RT > ResultType
Result type for expression template evaluations.
Definition: DMatDeclHermExpr.h:142
ReturnType_t< MT > ReturnType
Return type for expression template evaluations.
Definition: DMatDeclHermExpr.h:146
bool canSMPAssign() const noexcept
Returns whether the expression can be used in SMP assignments.
Definition: DMatDeclHermExpr.h:333
bool isAliased(const T *alias) const noexcept
Returns whether the expression is aliased with the given address alias.
Definition: DMatDeclHermExpr.h:313
bool isAligned() const noexcept
Returns whether the operands of the expression are properly aligned in memory.
Definition: DMatDeclHermExpr.h:323
static constexpr size_t SIMDSIZE
The number of elements packed within a single SIMD element.
Definition: DMatDeclHermExpr.h:168
ResultType_t< MT > RT
Result type of the dense matrix expression.
Definition: DMatDeclHermExpr.h:98
static constexpr bool simdEnabled
Compilation switch for the expression template evaluation strategy.
Definition: DMatDeclHermExpr.h:160
size_t rows() const noexcept
Returns the current number of rows of the matrix.
Definition: DMatDeclHermExpr.h:269
ReturnType operator()(size_t i, size_t j) const
2D-access to the matrix elements.
Definition: DMatDeclHermExpr.h:190
TransposeType_t< ResultType > TransposeType
Transpose type for expression template evaluations.
Definition: DMatDeclHermExpr.h:144
ReturnType at(size_t i, size_t j) const
Checked access to the matrix elements.
Definition: DMatDeclHermExpr.h:205
ElementType_t< MT > ElementType
Resulting element type.
Definition: DMatDeclHermExpr.h:145
const ElementType * data() const noexcept
Low-level data access to the matrix elements.
Definition: DMatDeclHermExpr.h:237
If_t< IsExpression_v< MT >, const MT, const MT & > Operand
Composite data type of the dense matrix expression.
Definition: DMatDeclHermExpr.h:155
ConstIterator end(size_t i) const
Returns an iterator just past the last non-zero element of row/column i.
Definition: DMatDeclHermExpr.h:259
If_t< RequiresEvaluation_v< MT >, const ResultType, const DMatDeclHermExpr & > CompositeType
Data type for composite expression templates.
Definition: DMatDeclHermExpr.h:149
static constexpr bool smpAssignable
Compilation switch for the expression template assignment strategy.
Definition: DMatDeclHermExpr.h:163
GetConstIterator_t< MT > ConstIterator
Iterator over the elements of the dense matrix.
Definition: DMatDeclHermExpr.h:152
Base class for dense matrices.
Definition: DenseMatrix.h:82
SIMD characteristics of data types.
Definition: SIMDTrait.h:297
Base class for sparse matrices.
Definition: SparseMatrix.h:77
Constraint on the data type.
Constraint on the data type.
Header file for the DeclHermExpr base class.
Header file for the Declaration base class.
Header file for the DenseMatrix base class.
decltype(auto) declherm(const DenseMatrix< MT, SO > &dm)
Declares the given dense matrix expression dm as Hermitian.
Definition: DMatDeclHermExpr.h:1005
#define BLAZE_CONSTRAINT_MUST_NOT_BE_HERMITIAN_MATRIX_TYPE(T)
Constraint on the data type.
Definition: Hermitian.h:79
#define BLAZE_CONSTRAINT_MUST_NOT_BE_MATMATMULTEXPR_TYPE(T)
Constraint on the data type.
Definition: MatMatMultExpr.h:83
#define BLAZE_CONSTRAINT_MUST_BE_DENSE_MATRIX_TYPE(T)
Constraint on the data type.
Definition: DenseMatrix.h:61
#define BLAZE_CONSTRAINT_MUST_NOT_BE_UNITRIANGULAR_MATRIX_TYPE(T)
Constraint on the data type.
Definition: UniTriangular.h:81
#define BLAZE_CONSTRAINT_MUST_BE_MATRIX_WITH_STORAGE_ORDER(T, SO)
Constraint on the data type.
Definition: StorageOrder.h:63
typename DeclHermTrait< MT >::Type DeclHermTrait_t
Auxiliary alias declaration for the DeclHermTrait type trait.
Definition: DeclHermTrait.h:144
bool isSquare(const Matrix< MT, SO > &matrix) noexcept
Checks if the given matrix is a square matrix.
Definition: Matrix.h:1383
#define BLAZE_INTERNAL_ASSERT(expr, msg)
Run time assertion macro for internal checks.
Definition: Assert.h:101
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
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 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:192
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
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
#define BLAZE_ALWAYS_INLINE
Platform dependent setup of an enforced inline keyword.
Definition: Inline.h:85
BoolConstant< true > TrueType
Type traits base class.
Definition: IntegralConstant.h:132
typename EnableIf< Condition, T >::Type EnableIf_t
Auxiliary type for the EnableIf class template.
Definition: EnableIf.h:138
typename If< Condition >::template Type< T1, T2 > If_t
Auxiliary alias template for the If class template.
Definition: If.h:108
#define BLAZE_THROW_OUT_OF_RANGE(MESSAGE)
Macro for the emission of a std::out_of_range exception.
Definition: Exception.h:331
#define BLAZE_THROW_INVALID_ARGUMENT(MESSAGE)
Macro for the emission of a std::invalid_argument exception.
Definition: Exception.h:235
#define BLAZE_FUNCTION_TRACE
Function trace macro.
Definition: FunctionTrace.h:94
Header file for the exception macros of the math module.
Constraints on the storage order of matrix types.
Header file for all forward declarations for expression class templates.
Header file for all forward declarations for sparse vectors and matrices.
Base class for all declherm expression templates.
Definition: DeclHermExpr.h:68
Base class for all declaration expression templates.
Definition: Declaration.h:76
Header file for the RequiresEvaluation type trait.
Header file for basic type definitions.