35 #ifndef _BLAZE_MATH_EXPRESSIONS_SMATDECLLOWEXPR_H_ 36 #define _BLAZE_MATH_EXPRESSIONS_SMATDECLLOWEXPR_H_ 90 :
public DeclLowExpr< SparseMatrix< SMatDeclLowExpr<MT,SO>, SO > >
91 ,
public Declaration<MT>
109 static constexpr
bool useAssign = RequiresEvaluation_v<MT>;
112 template<
typename MT2 >
114 static constexpr
bool UseAssign_v =
useAssign;
126 template<
typename MT2 >
127 static constexpr
bool UseSMPAssign_v = ( MT2::smpAssignable &&
useAssign );
191 if( i >=
sm_.rows() ) {
194 if( j >=
sm_.columns() ) {
228 inline size_t rows() const noexcept {
239 return sm_.columns();
249 return sm_.nonZeros();
260 return sm_.nonZeros(i);
280 template<
typename T >
281 inline bool canAlias(
const T* alias )
const noexcept {
282 return sm_.canAlias( alias );
292 template<
typename T >
293 inline bool isAliased(
const T* alias )
const noexcept {
294 return sm_.isAliased( alias );
304 return sm_.canSMPAssign();
325 template<
typename MT2
335 assign( ~lhs, rhs.sm_ );
352 template<
typename MT2
362 assign( ~lhs, rhs.sm_ );
379 template<
typename MT2
381 friend inline auto addAssign( DenseMatrix<MT2,SO2>& lhs,
const SMatDeclLowExpr& rhs )
382 -> EnableIf_t< UseAssign_v<MT2> >
389 addAssign( ~lhs, rhs.sm_ );
406 template<
typename MT2
408 friend inline auto addAssign( SparseMatrix<MT2,SO2>& lhs,
const SMatDeclLowExpr& rhs )
409 -> EnableIf_t< UseAssign_v<MT2> >
416 addAssign( ~lhs, rhs.sm_ );
433 template<
typename MT2
435 friend inline auto subAssign( DenseMatrix<MT2,SO2>& lhs,
const SMatDeclLowExpr& rhs )
436 -> EnableIf_t< UseAssign_v<MT2> >
443 subAssign( ~lhs, rhs.sm_ );
460 template<
typename MT2
462 friend inline auto subAssign( SparseMatrix<MT2,SO2>& lhs,
const SMatDeclLowExpr& rhs )
463 -> EnableIf_t< UseAssign_v<MT2> >
470 subAssign( ~lhs, rhs.sm_ );
487 template<
typename MT2
489 friend inline auto schurAssign( DenseMatrix<MT2,SO2>& lhs,
const SMatDeclLowExpr& rhs )
490 -> EnableIf_t< UseAssign_v<MT2> >
497 schurAssign( ~lhs, rhs.sm_ );
514 template<
typename MT2
516 friend inline auto schurAssign( SparseMatrix<MT2,SO2>& lhs,
const SMatDeclLowExpr& rhs )
517 -> EnableIf_t< UseAssign_v<MT2> >
524 schurAssign( ~lhs, rhs.sm_ );
541 template<
typename MT2
543 friend inline auto multAssign( DenseMatrix<MT2,SO2>& lhs,
const SMatDeclLowExpr& rhs )
544 -> EnableIf_t< UseAssign_v<MT2> >
551 multAssign( ~lhs, rhs.sm_ );
568 template<
typename MT2
570 friend inline auto multAssign( SparseMatrix<MT2,SO2>& lhs,
const SMatDeclLowExpr& rhs )
571 -> EnableIf_t< UseAssign_v<MT2> >
578 multAssign( ~lhs, rhs.sm_ );
595 template<
typename MT2
598 -> EnableIf_t< UseSMPAssign_v<MT2> >
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> >
812 template<
typename MT2
815 -> EnableIf_t< UseSMPAssign_v<MT2> >
840 template<
typename MT2
843 -> EnableIf_t< UseSMPAssign_v<MT2> >
886 template<
typename MT
888 , DisableIf_t< IsLower_v<MT> || IsUniUpper_v<MT> >* =
nullptr >
889 inline const SMatDeclLowExpr<MT,SO> decllow_backend(
const SparseMatrix<MT,SO>& sm )
895 return SMatDeclLowExpr<MT,SO>( ~sm );
912 template<
typename MT
914 , EnableIf_t< !IsLower_v<MT> && IsUniUpper_v<MT> >* =
nullptr >
915 inline const IdentityMatrix<ElementType_t<MT>,SO> decllow_backend(
const SparseMatrix<MT,SO>& sm )
921 return IdentityMatrix<ElementType_t<MT>,SO>( (~sm).
rows() );
938 template<
typename MT
940 , EnableIf_t< IsLower_v<MT> >* =
nullptr >
941 inline const MT& decllow_backend(
const SparseMatrix<MT,SO>& sm )
971 template<
typename MT
981 return decllow_backend( ~sm );
1008 template<
typename MT
1011 , DisableIf_t< IsLower_v<MT> >* =
nullptr >
1012 inline decltype(
auto)
decllow( const SMatScalarMultExpr<MT,ST,SO>& sm )
1020 return decllow( sm.leftOperand() ) * sm.rightOperand();
1036 template<
typename MT,
bool SO >
1037 struct IsLower< SMatDeclLowExpr<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.
Header file for the IsUniUpper type trait.
OppositeType_t< ResultType > OppositeType
Result type with opposite storage order for expression template evaluations.
Definition: SMatDeclLowExpr.h:136
Header file for basic type definitions.
static constexpr bool smpAssignable
Compilation switch for the expression template assignment strategy.
Definition: SMatDeclLowExpr.h:153
Header file for all forward declarations for sparse vectors and matrices.
DeclLowTrait_t< RT > ResultType
Result type for expression template evaluations.
Definition: SMatDeclLowExpr.h:135
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
bool canAlias(const T *alias) const noexcept
Returns whether the expression can alias with the given address alias.
Definition: SMatDeclLowExpr.h:281
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
BLAZE_CREATE_GET_TYPE_MEMBER_TYPE_TRAIT(GetConstIterator, ConstIterator, INVALID_TYPE)
Definition of the GetConstIterator type trait.
#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
bool canSMPAssign() const noexcept
Returns whether the expression can be used in SMP assignments.
Definition: SMatDeclLowExpr.h:303
Expression object for the explicit lower declaration of sparse matrices.The SMatDeclLowExpr class rep...
Definition: Forward.h:117
ReturnType at(size_t i, size_t j) const
Checked access to the matrix elements.
Definition: SMatDeclLowExpr.h:190
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.
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
ReturnType operator()(size_t i, size_t j) const
2D-access to the matrix elements.
Definition: SMatDeclLowExpr.h:175
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
ReturnType_t< MT > ReturnType
Return type for expression template evaluations.
Definition: SMatDeclLowExpr.h:139
ConstIterator end(size_t i) const
Returns an iterator just past the last non-zero element of row i.
Definition: SMatDeclLowExpr.h:218
Header file for the SparseMatrix base class.
Constraint on the data type.
ConstIterator begin(size_t i) const
Returns an iterator to the first non-zero element of row i.
Definition: SMatDeclLowExpr.h:207
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
GetConstIterator_t< MT > ConstIterator
Iterator over the elements of the dense matrix.
Definition: SMatDeclLowExpr.h:145
Header file for the DisableIf class template.
Namespace of the Blaze C++ math library.
Definition: Blaze.h:58
Operand operand() const noexcept
Returns the sparse matrix operand.
Definition: SMatDeclLowExpr.h:269
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
size_t rows() const noexcept
Returns the current number of rows of the matrix.
Definition: SMatDeclLowExpr.h:228
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.
If_t< IsExpression_v< MT >, const MT, const MT & > Operand
Composite data type of the sparse matrix expression.
Definition: SMatDeclLowExpr.h:148
Constraints on the storage order of matrix types.
size_t nonZeros() const
Returns the number of non-zero elements in the sparse matrix.
Definition: SMatDeclLowExpr.h:248
Header file for the exception macros of the math module.
Header file for the DeclLowExpr base class.
Constraint on the data type.
Header file for the EnableIf class template.
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 Declaration base class.
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< RequiresEvaluation_v< MT >, const ResultType, const SMatDeclLowExpr & > CompositeType
Data type for composite expression templates.
Definition: SMatDeclLowExpr.h:142
#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
#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.
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
ElementType_t< MT > ElementType
Resulting element type.
Definition: SMatDeclLowExpr.h:138
Header file for the implementation of the base template of the LowerMatrix.
SMatDeclLowExpr(const MT &sm) noexcept
Constructor for the SMatDeclLowExpr class.
Definition: SMatDeclLowExpr.h:161
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
Operand sm_
Sparse matrix of the decllow expression.
Definition: SMatDeclLowExpr.h:310
TransposeType_t< ResultType > TransposeType
Transpose type for expression template evaluations.
Definition: SMatDeclLowExpr.h:137
Header file for the IntegralConstant class template.
static constexpr bool useAssign
Compilation switch for the serial evaluation strategy of the lower declaration expression.
Definition: SMatDeclLowExpr.h:109
size_t nonZeros(size_t i) const
Returns the number of non-zero elements in the specified row.
Definition: SMatDeclLowExpr.h:259
bool isSquare(const Matrix< MT, SO > &matrix) noexcept
Checks if the given matrix is a square matrix.
Definition: Matrix.h:951
size_t columns() const noexcept
Returns the current number of columns of the matrix.
Definition: SMatDeclLowExpr.h:238
#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
ResultType_t< MT > RT
Result type of the sparse matrix expression.
Definition: SMatDeclLowExpr.h:95
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
#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
bool isAliased(const T *alias) const noexcept
Returns whether the expression is aliased with the given address alias.
Definition: SMatDeclLowExpr.h:293
Header file for the IsExpression type trait class.
Header file for the function trace functionality.