35#ifndef _BLAZE_MATH_EXPRESSIONS_SMATDECLUPPEXPR_H_
36#define _BLAZE_MATH_EXPRESSIONS_SMATDECLUPPEXPR_H_
89 :
public DeclUppExpr< SparseMatrix< SMatDeclUppExpr<MT,SO>, SO > >
112 template<
typename MT2 >
113 static constexpr bool UseAssign_v =
useAssign;
125 template<
typename MT2 >
126 static constexpr bool UseSMPAssign_v = ( MT2::smpAssignable &&
useAssign );
194 if( i >=
sm_.rows() ) {
197 if( j >=
sm_.columns() ) {
231 inline size_t rows() const noexcept {
242 return sm_.columns();
252 return sm_.nonZeros();
263 return sm_.nonZeros(i);
283 template<
typename T >
284 inline bool canAlias(
const T* alias )
const noexcept {
285 return sm_.canAlias( alias );
295 template<
typename T >
296 inline bool isAliased(
const T* alias )
const noexcept {
297 return sm_.isAliased( alias );
307 return sm_.canSMPAssign();
328 template<
typename MT2
338 assign( *lhs, rhs.sm_ );
355 template<
typename MT2
365 assign( *lhs, rhs.sm_ );
382 template<
typename MT2
384 friend inline auto addAssign( DenseMatrix<MT2,SO2>& lhs,
const SMatDeclUppExpr& rhs )
392 addAssign( *lhs, rhs.sm_ );
409 template<
typename MT2
411 friend inline auto addAssign( SparseMatrix<MT2,SO2>& lhs,
const SMatDeclUppExpr& rhs )
419 addAssign( *lhs, rhs.sm_ );
436 template<
typename MT2
438 friend inline auto subAssign( DenseMatrix<MT2,SO2>& lhs,
const SMatDeclUppExpr& rhs )
446 subAssign( *lhs, rhs.sm_ );
463 template<
typename MT2
465 friend inline auto subAssign( SparseMatrix<MT2,SO2>& lhs,
const SMatDeclUppExpr& rhs )
473 subAssign( *lhs, rhs.sm_ );
490 template<
typename MT2
492 friend inline auto schurAssign( DenseMatrix<MT2,SO2>& lhs,
const SMatDeclUppExpr& rhs )
500 schurAssign( *lhs, rhs.sm_ );
517 template<
typename MT2
519 friend inline auto schurAssign( SparseMatrix<MT2,SO2>& lhs,
const SMatDeclUppExpr& rhs )
527 schurAssign( *lhs, rhs.sm_ );
544 template<
typename MT2
546 friend inline auto multAssign( DenseMatrix<MT2,SO2>& lhs,
const SMatDeclUppExpr& rhs )
554 multAssign( *lhs, rhs.sm_ );
571 template<
typename MT2
573 friend inline auto multAssign( SparseMatrix<MT2,SO2>& lhs,
const SMatDeclUppExpr& rhs )
581 multAssign( *lhs, rhs.sm_ );
598 template<
typename MT2
625 template<
typename MT2
652 template<
typename MT2
679 template<
typename MT2
706 template<
typename MT2
733 template<
typename MT2
760 template<
typename MT2
787 template<
typename MT2
815 template<
typename MT2
843 template<
typename MT2
984 return declupp_backend( *sm );
999template<
typename MT,
bool SO >
1000struct IsUpper< SMatDeclUppExpr<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::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
typename T::ElementType ElementType_t
Alias declaration for nested ElementType type definitions.
Definition Aliases.h:190
typename T::ResultType ResultType_t
Alias declaration for nested ResultType type definitions.
Definition Aliases.h:450
Header file for run time assertion macros.
Header file for the declupp 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 If class template.
Header file for the IntegralConstant class template.
Utility type for generic codes.
Header file for the IsExpression type trait class.
Header file for the IsUniLower type trait.
Header file for the IsUpper type trait.
Constraint on the data type.
Constraint on the data type.
Header file for the implementation of the base template of the UpperMatrix.
Base class for dense matrices.
Definition DenseMatrix.h:82
Efficient implementation of an identity matrix.
Definition IdentityMatrix.h:197
Expression object for the explicit upper declaration of sparse matrices.
Definition SMatDeclUppExpr.h:91
SMatDeclUppExpr< MT, SO > This
Type of this SMatDeclUppExpr instance.
Definition SMatDeclUppExpr.h:133
static constexpr bool smpAssignable
Compilation switch for the expression template assignment strategy.
Definition SMatDeclUppExpr.h:156
ReturnType operator()(size_t i, size_t j) const
2D-access to the matrix elements.
Definition SMatDeclUppExpr.h:178
size_t nonZeros(size_t i) const
Returns the number of non-zero elements in the specified row.
Definition SMatDeclUppExpr.h:262
BLAZE_CREATE_GET_TYPE_MEMBER_TYPE_TRAIT(GetConstIterator, ConstIterator, INVALID_TYPE)
Definition of the GetConstIterator type trait.
OppositeType_t< ResultType > OppositeType
Result type with opposite storage order for expression template evaluations.
Definition SMatDeclUppExpr.h:139
TransposeType_t< ResultType > TransposeType
Transpose type for expression template evaluations.
Definition SMatDeclUppExpr.h:140
DeclUppExpr< SparseMatrix< This, SO > > BaseType
Base type of this SMatDeclUppExpr instance.
Definition SMatDeclUppExpr.h:136
ElementType_t< MT > ElementType
Resulting element type.
Definition SMatDeclUppExpr.h:141
ConstIterator begin(size_t i) const
Returns an iterator to the first non-zero element of row i.
Definition SMatDeclUppExpr.h:210
If_t< IsExpression_v< MT >, const MT, const MT & > Operand
Composite data type of the sparse matrix expression.
Definition SMatDeclUppExpr.h:151
ResultType_t< MT > RT
Result type of the sparse matrix expression.
Definition SMatDeclUppExpr.h:94
ReturnType_t< MT > ReturnType
Return type for expression template evaluations.
Definition SMatDeclUppExpr.h:142
SMatDeclUppExpr(const MT &sm) noexcept
Constructor for the SMatDeclUppExpr class.
Definition SMatDeclUppExpr.h:164
ConstIterator end(size_t i) const
Returns an iterator just past the last non-zero element of row i.
Definition SMatDeclUppExpr.h:221
If_t< RequiresEvaluation_v< MT >, const ResultType, const SMatDeclUppExpr & > CompositeType
Data type for composite expression templates.
Definition SMatDeclUppExpr.h:145
ReturnType at(size_t i, size_t j) const
Checked access to the matrix elements.
Definition SMatDeclUppExpr.h:193
size_t rows() const noexcept
Returns the current number of rows of the matrix.
Definition SMatDeclUppExpr.h:231
size_t nonZeros() const
Returns the number of non-zero elements in the sparse matrix.
Definition SMatDeclUppExpr.h:251
DeclUppTrait_t< RT > ResultType
Result type for expression template evaluations.
Definition SMatDeclUppExpr.h:138
Operand sm_
Sparse matrix of the declupp expression.
Definition SMatDeclUppExpr.h:313
bool isAliased(const T *alias) const noexcept
Returns whether the expression is aliased with the given address alias.
Definition SMatDeclUppExpr.h:296
static constexpr bool useAssign
Compilation switch for the serial evaluation strategy of the upper declaration expression.
Definition SMatDeclUppExpr.h:108
GetConstIterator_t< MT > ConstIterator
Iterator over the elements of the dense matrix.
Definition SMatDeclUppExpr.h:148
size_t columns() const noexcept
Returns the current number of columns of the matrix.
Definition SMatDeclUppExpr.h:241
Operand operand() const noexcept
Returns the sparse matrix operand.
Definition SMatDeclUppExpr.h:272
bool canAlias(const T *alias) const noexcept
Returns whether the expression can alias with the given address alias.
Definition SMatDeclUppExpr.h:284
bool canSMPAssign() const noexcept
Returns whether the expression can be used in SMP assignments.
Definition SMatDeclUppExpr.h:306
Base class for sparse matrices.
Definition SparseMatrix.h:77
Constraint on the data type.
Header file for the DeclUppExpr base class.
Header file for the Declaration base class.
Header file for the SparseMatrix base class.
decltype(auto) declupp(const DenseMatrix< MT, SO > &dm)
Declares the given dense matrix expression dm as upper.
Definition DMatDeclUppExpr.h:1004
#define BLAZE_CONSTRAINT_MUST_NOT_BE_UPPER_MATRIX_TYPE(T)
Constraint on the data type.
Definition Upper.h:81
#define BLAZE_CONSTRAINT_MUST_BE_SPARSE_MATRIX_TYPE(T)
Constraint on the data type.
Definition SparseMatrix.h:61
#define BLAZE_CONSTRAINT_MUST_NOT_BE_UNILOWER_MATRIX_TYPE(T)
Constraint on the data type.
Definition UniLower.h:81
#define BLAZE_CONSTRAINT_MUST_BE_MATRIX_WITH_STORAGE_ORDER(T, SO)
Constraint on the data type.
Definition StorageOrder.h:63
typename DeclUppTrait< MT >::Type DeclUppTrait_t
Auxiliary alias declaration for the DeclUppTrait type trait.
Definition DeclUppTrait.h:144
constexpr bool RequiresEvaluation_v
Auxiliary variable template for the RequiresEvaluation type trait.
Definition RequiresEvaluation.h:91
constexpr bool IsUniLower_v
Auxiliary variable template for the IsUniLower type trait.
Definition IsUniLower.h:173
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
typename EnableIf< Condition, T >::Type EnableIf_t
Auxiliary type for the EnableIf class template.
Definition EnableIf.h:138
BoolConstant< true > TrueType
Type traits base class.
Definition IntegralConstant.h:132
#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
typename If< Condition >::template Type< T1, T2 > If_t
Auxiliary alias template for the If class template.
Definition If.h:108
typename EnableIf<!Condition, T >::Type DisableIf_t
Auxiliary type for the EnableIf class template.
Definition EnableIf.h:175
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 declupp expression templates.
Definition DeclUppExpr.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.