35#ifndef _BLAZE_MATH_EXPRESSIONS_DMATDECLUNIUPPEXPR_H_
36#define _BLAZE_MATH_EXPRESSIONS_DMATDECLUNIUPPEXPR_H_
95 :
public DeclUniUppExpr< DenseMatrix< DMatDeclUniUppExpr<MT,SO>, SO > >
114 static constexpr bool useAssign = RequiresEvaluation_v<MT>;
118 template<
typename MT2 >
119 static constexpr bool UseAssign_v =
useAssign;
131 template<
typename MT2 >
132 static constexpr bool UseSMPAssign_v = ( MT2::smpAssignable &&
useAssign );
208 if( i >=
dm_.rows() ) {
211 if( j >=
dm_.columns() ) {
230 return dm_.load(i,j);
271 inline size_t rows() const noexcept {
282 return dm_.columns();
302 template<
typename T >
303 inline bool canAlias(
const T* alias )
const noexcept {
304 return dm_.canAlias( alias );
314 template<
typename T >
315 inline bool isAliased(
const T* alias )
const noexcept {
316 return dm_.isAliased( alias );
326 return dm_.isAligned();
336 return dm_.canSMPAssign();
357 template<
typename MT2
367 assign( *lhs, rhs.dm_ );
384 template<
typename MT2
394 assign( *lhs, rhs.dm_ );
411 template<
typename MT2
413 friend inline auto addAssign( DenseMatrix<MT2,SO2>& lhs,
const DMatDeclUniUppExpr& rhs )
414 -> EnableIf_t< UseAssign_v<MT2> >
421 addAssign( *lhs, rhs.dm_ );
438 template<
typename MT2
440 friend inline auto addAssign( SparseMatrix<MT2,SO2>& lhs,
const DMatDeclUniUppExpr& rhs )
441 -> EnableIf_t< UseAssign_v<MT2> >
448 addAssign( *lhs, rhs.dm_ );
465 template<
typename MT2
467 friend inline auto subAssign( DenseMatrix<MT2,SO2>& lhs,
const DMatDeclUniUppExpr& rhs )
468 -> EnableIf_t< UseAssign_v<MT2> >
475 subAssign( *lhs, rhs.dm_ );
492 template<
typename MT2
494 friend inline auto subAssign( SparseMatrix<MT2,SO2>& lhs,
const DMatDeclUniUppExpr& rhs )
495 -> EnableIf_t< UseAssign_v<MT2> >
502 subAssign( *lhs, rhs.dm_ );
519 template<
typename MT2
521 friend inline auto schurAssign( DenseMatrix<MT2,SO2>& lhs,
const DMatDeclUniUppExpr& rhs )
522 -> EnableIf_t< UseAssign_v<MT2> >
529 schurAssign( *lhs, rhs.dm_ );
546 template<
typename MT2
548 friend inline auto schurAssign( SparseMatrix<MT2,SO2>& lhs,
const DMatDeclUniUppExpr& rhs )
549 -> EnableIf_t< UseAssign_v<MT2> >
556 schurAssign( *lhs, rhs.dm_ );
573 template<
typename MT2
575 friend inline auto multAssign( DenseMatrix<MT2,SO2>& lhs,
const DMatDeclUniUppExpr& rhs )
576 -> EnableIf_t< UseAssign_v<MT2> >
583 multAssign( *lhs, rhs.dm_ );
600 template<
typename MT2
602 friend inline auto multAssign( SparseMatrix<MT2,SO2>& lhs,
const DMatDeclUniUppExpr& rhs )
603 -> EnableIf_t< UseAssign_v<MT2> >
610 multAssign( *lhs, rhs.dm_ );
627 template<
typename MT2
630 -> EnableIf_t< UseSMPAssign_v<MT2> >
654 template<
typename MT2
657 -> EnableIf_t< UseSMPAssign_v<MT2> >
681 template<
typename MT2
684 -> EnableIf_t< UseSMPAssign_v<MT2> >
708 template<
typename MT2
711 -> EnableIf_t< UseSMPAssign_v<MT2> >
735 template<
typename MT2
738 -> EnableIf_t< UseSMPAssign_v<MT2> >
762 template<
typename MT2
765 -> EnableIf_t< UseSMPAssign_v<MT2> >
789 template<
typename MT2
792 -> EnableIf_t< UseSMPAssign_v<MT2> >
816 template<
typename MT2
819 -> EnableIf_t< UseSMPAssign_v<MT2> >
844 template<
typename MT2
847 -> EnableIf_t< UseSMPAssign_v<MT2> >
872 template<
typename MT2
875 -> EnableIf_t< UseSMPAssign_v<MT2> >
920 , DisableIf_t< IsUniUpper_v<MT> || IsLower_v<MT> >* =
nullptr >
921inline const DMatDeclUniUppExpr<MT,SO> decluniupp_backend(
const DenseMatrix<MT,SO>& dm )
927 return DMatDeclUniUppExpr<MT,SO>( *dm );
946 , EnableIf_t< !IsUniUpper_v<MT> && IsLower_v<MT> >* =
nullptr >
947inline const IdentityMatrix<ElementType_t<MT>,SO> decluniupp_backend(
const DenseMatrix<MT,SO>& dm )
953 return IdentityMatrix<ElementType_t<MT>,SO>( (*dm).rows() );
972 , EnableIf_t< IsUniUpper_v<MT> >* =
nullptr >
973inline const MT& decluniupp_backend(
const DenseMatrix<MT,SO>& dm )
1003template<
typename MT
1016 return decluniupp_backend( *dm );
1031template<
typename MT,
bool SO >
1032struct HasConstDataAccess< DMatDeclUniUppExpr<MT,SO> >
1033 :
public HasConstDataAccess<MT>
1049template<
typename MT,
bool SO >
1050struct IsAligned< DMatDeclUniUppExpr<MT,SO> >
1051 :
public IsAligned<MT>
1067template<
typename MT,
bool SO >
1068struct IsUniUpper< DMatDeclUniUppExpr<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 decluniupp 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.
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 IsLower type trait.
Header file for the IsUniUpper type trait.
Constraint on the data type.
Header file for the SIMD trait.
Constraint on the data type.
Constraint on the data type.
Header file for the implementation of the base template of the UniUpperMatrix.
Expression object for the explicit uniupper declaration of dense matrices.
Definition: DMatDeclUniUppExpr.h:97
DMatDeclUniUppExpr(const MT &dm) noexcept
Constructor for the DMatDeclUniUppExpr class.
Definition: DMatDeclUniUppExpr.h:178
Operand operand() const noexcept
Returns the dense matrix operand.
Definition: DMatDeclUniUppExpr.h:291
size_t columns() const noexcept
Returns the current number of columns of the matrix.
Definition: DMatDeclUniUppExpr.h:281
OppositeType_t< ResultType > OppositeType
Result type with opposite storage order for expression template evaluations.
Definition: DMatDeclUniUppExpr.h:145
ConstIterator begin(size_t i) const
Returns an iterator to the first non-zero element of row/column i.
Definition: DMatDeclUniUppExpr.h:250
static constexpr bool smpAssignable
Compilation switch for the expression template assignment strategy.
Definition: DMatDeclUniUppExpr.h:165
static constexpr bool simdEnabled
Compilation switch for the expression template evaluation strategy.
Definition: DMatDeclUniUppExpr.h:162
ElementType_t< MT > ElementType
Resulting element type.
Definition: DMatDeclUniUppExpr.h:147
ResultType_t< MT > RT
Result type of the dense matrix expression.
Definition: DMatDeclUniUppExpr.h:100
ReturnType operator()(size_t i, size_t j) const
2D-access to the matrix elements.
Definition: DMatDeclUniUppExpr.h:192
bool canSMPAssign() const noexcept
Returns whether the expression can be used in SMP assignments.
Definition: DMatDeclUniUppExpr.h:335
static constexpr bool useAssign
Compilation switch for the serial evaluation strategy of the uniupper declaration expression.
Definition: DMatDeclUniUppExpr.h:114
ReturnType at(size_t i, size_t j) const
Checked access to the matrix elements.
Definition: DMatDeclUniUppExpr.h:207
If_t< RequiresEvaluation_v< MT >, const ResultType, const DMatDeclUniUppExpr & > CompositeType
Data type for composite expression templates.
Definition: DMatDeclUniUppExpr.h:151
DeclUniUppTrait_t< RT > ResultType
Result type for expression template evaluations.
Definition: DMatDeclUniUppExpr.h:144
TransposeType_t< ResultType > TransposeType
Transpose type for expression template evaluations.
Definition: DMatDeclUniUppExpr.h:146
BLAZE_ALWAYS_INLINE auto load(size_t i, size_t j) const noexcept
Access to the SIMD elements of the matrix.
Definition: DMatDeclUniUppExpr.h:225
BLAZE_CREATE_GET_TYPE_MEMBER_TYPE_TRAIT(GetConstIterator, ConstIterator, INVALID_TYPE)
Definition of the GetConstIterator type trait.
bool isAliased(const T *alias) const noexcept
Returns whether the expression is aliased with the given address alias.
Definition: DMatDeclUniUppExpr.h:315
bool canAlias(const T *alias) const noexcept
Returns whether the expression can alias with the given address alias.
Definition: DMatDeclUniUppExpr.h:303
ConstIterator end(size_t i) const
Returns an iterator just past the last non-zero element of row/column i.
Definition: DMatDeclUniUppExpr.h:261
const ElementType * data() const noexcept
Low-level data access to the matrix elements.
Definition: DMatDeclUniUppExpr.h:239
GetConstIterator_t< MT > ConstIterator
Iterator over the elements of the dense matrix.
Definition: DMatDeclUniUppExpr.h:154
size_t rows() const noexcept
Returns the current number of rows of the matrix.
Definition: DMatDeclUniUppExpr.h:271
ReturnType_t< MT > ReturnType
Return type for expression template evaluations.
Definition: DMatDeclUniUppExpr.h:148
If_t< IsExpression_v< MT >, const MT, const MT & > Operand
Composite data type of the dense matrix expression.
Definition: DMatDeclUniUppExpr.h:157
Operand dm_
Dense matrix of the decluniupp expression.
Definition: DMatDeclUniUppExpr.h:342
static constexpr size_t SIMDSIZE
The number of elements packed within a single SIMD element.
Definition: DMatDeclUniUppExpr.h:170
bool isAligned() const noexcept
Returns whether the operands of the expression are properly aligned in memory.
Definition: DMatDeclUniUppExpr.h:325
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 DeclUniUppExpr base class.
Header file for the Declaration base class.
Header file for the DenseMatrix base class.
decltype(auto) decluniupp(const DenseMatrix< MT, SO > &dm)
Declares the given dense matrix expression dm as uniupper.
Definition: DMatDeclUniUppExpr.h:1005
#define BLAZE_CONSTRAINT_MUST_NOT_BE_STRICTLY_TRIANGULAR_MATRIX_TYPE(T)
Constraint on the data type.
Definition: StrictlyTriangular.h:81
#define BLAZE_CONSTRAINT_MUST_BE_DENSE_MATRIX_TYPE(T)
Constraint on the data type.
Definition: DenseMatrix.h:61
#define BLAZE_CONSTRAINT_MUST_NOT_BE_UNIUPPER_MATRIX_TYPE(T)
Constraint on the data type.
Definition: UniUpper.h:81
#define BLAZE_CONSTRAINT_MUST_NOT_BE_UNIFORM_TYPE(T)
Constraint on the data type.
Definition: Uniform.h:81
#define BLAZE_CONSTRAINT_MUST_NOT_BE_LOWER_MATRIX_TYPE(T)
Constraint on the data type.
Definition: Lower.h:81
#define BLAZE_CONSTRAINT_MUST_BE_MATRIX_WITH_STORAGE_ORDER(T, SO)
Constraint on the data type.
Definition: StorageOrder.h:63
typename DeclUniUppTrait< MT >::Type DeclUniUppTrait_t
Auxiliary alias declaration for the DeclUniUppTrait type trait.
Definition: DeclUniUppTrait.h:146
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 decluniupp expression templates.
Definition: DeclUniUppExpr.h:69
Base class for all declaration expression templates.
Definition: Declaration.h:76
Header file for the RequiresEvaluation type trait.
Header file for basic type definitions.