35 #ifndef _BLAZE_MATH_EXPRESSIONS_SMATSERIALEXPR_H_ 36 #define _BLAZE_MATH_EXPRESSIONS_SMATSERIALEXPR_H_ 76 :
public MatSerialExpr< SparseMatrix< SMatSerialExpr<MT,SO>, SO > >
134 if( i >=
sm_.rows() ) {
137 if( j >=
sm_.columns() ) {
149 inline size_t rows() const noexcept {
160 return sm_.columns();
170 return sm_.nonZeros();
181 return sm_.nonZeros(i);
211 template<
typename T >
212 inline bool canAlias(
const T* alias )
const noexcept {
213 return sm_.canAlias( alias );
223 template<
typename T >
224 inline bool isAliased(
const T* alias )
const noexcept {
225 return sm_.isAliased( alias );
235 return sm_.canSMPAssign();
256 template<
typename MT2
265 assign( ~lhs, rhs.sm_ );
282 template<
typename MT2
291 assign( ~lhs, rhs.sm_ );
308 template<
typename MT2
310 friend inline void addAssign( DenseMatrix<MT2,SO2>& lhs,
const SMatSerialExpr& rhs )
317 addAssign( ~lhs, rhs.sm_ );
334 template<
typename MT2
336 friend inline void addAssign( SparseMatrix<MT2,SO2>& lhs,
const SMatSerialExpr& rhs )
343 addAssign( ~lhs, rhs.sm_ );
361 template<
typename MT2
363 friend inline void subAssign( DenseMatrix<MT2,SO2>& lhs,
const SMatSerialExpr& rhs )
370 subAssign( ~lhs, rhs.sm_ );
388 template<
typename MT2
390 friend inline void subAssign( SparseMatrix<MT2,SO2>& lhs,
const SMatSerialExpr& rhs )
397 subAssign( ~lhs, rhs.sm_ );
415 template<
typename MT2
417 friend inline void schurAssign( DenseMatrix<MT2,SO2>& lhs,
const SMatSerialExpr& rhs )
424 schurAssign( ~lhs, rhs.sm_ );
442 template<
typename MT2
444 friend inline void schurAssign( SparseMatrix<MT2,SO2>& lhs,
const SMatSerialExpr& rhs )
451 schurAssign( ~lhs, rhs.sm_ );
469 template<
typename MT2
471 friend inline void multAssign( DenseMatrix<MT2,SO2>& lhs,
const SMatSerialExpr& rhs )
478 multAssign( ~lhs, rhs.sm_ );
496 template<
typename MT2
498 friend inline void multAssign( SparseMatrix<MT2,SO2>& lhs,
const SMatSerialExpr& rhs )
505 multAssign( ~lhs, rhs.sm_ );
522 template<
typename MT2
531 assign( ~lhs, rhs.sm_ );
548 template<
typename MT2
557 assign( ~lhs, rhs.sm_ );
575 template<
typename MT2
584 addAssign( ~lhs, rhs.sm_ );
602 template<
typename MT2
611 addAssign( ~lhs, rhs.sm_ );
629 template<
typename MT2
638 subAssign( ~lhs, rhs.sm_ );
656 template<
typename MT2
665 subAssign( ~lhs, rhs.sm_ );
683 template<
typename MT2
692 schurAssign( ~lhs, rhs.sm_ );
710 template<
typename MT2
719 schurAssign( ~lhs, rhs.sm_ );
737 template<
typename MT2
746 multAssign( ~lhs, rhs.sm_ );
764 template<
typename MT2
773 multAssign( ~lhs, rhs.sm_ );
813 template<
typename MT
844 template<
typename MT
846 inline decltype(
auto)
serial( const SMatSerialExpr<MT,SO>& sm )
Header file for auxiliary alias declarations.
SMatSerialExpr(const MT &sm) noexcept
Constructor for the SMatSerialExpr class.
Definition: SMatSerialExpr.h:106
bool isAliased(const T *alias) const noexcept
Returns whether the expression is aliased with the given address alias.
Definition: SMatSerialExpr.h:224
Header file for basic type definitions.
typename If< Condition, T1, T2 >::Type If_t
Auxiliary alias declaration for the If class template.The If_t alias declaration provides a convenien...
Definition: If.h:109
TransposeType_t< MT > TransposeType
Transpose type for expression template evaluations.
Definition: SMatSerialExpr.h:85
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
size_t nonZeros() const
Returns the number of non-zero elements in the sparse matrix.
Definition: SMatSerialExpr.h:169
static constexpr bool smpAssignable
Compilation flag for SMP assignments.
Definition: CompressedMatrix.h:3113
Header file for the Computation base class.
ReturnType at(size_t i, size_t j) const
Checked access to the matrix elements.
Definition: SMatSerialExpr.h:133
typename T::ReturnType ReturnType_t
Alias declaration for nested ReturnType type definitions.The ReturnType_t alias declaration provides ...
Definition: Aliases.h:410
Base class for dense matrices.The DenseMatrix class is a base class for all dense matrix classes...
Definition: DenseMatrix.h:80
Base class for sparse matrices.The SparseMatrix class is a base class for all sparse matrix classes...
Definition: Forward.h:137
typename T::ElementType ElementType_t
Alias declaration for nested ElementType type definitions.The ElementType_t alias declaration provide...
Definition: Aliases.h:170
Header file for the SparseMatrix base class.
ElementType_t< MT > ElementType
Resulting element type.
Definition: SMatSerialExpr.h:86
Constraint on the data type.
Namespace of the Blaze C++ math library.
Definition: Blaze.h:58
Operand operand() const noexcept
Returns the sparse matrix operand.
Definition: SMatSerialExpr.h:190
Header file for the If class template.
#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: SMatSerialExpr.h:149
Constraints on the storage order of matrix types.
Header file for the exception macros of the math module.
Header file for all forward declarations for expression class templates.
Header file for the MatSerialExpr base class.
If_t< IsExpression_v< MT >, const MT, const MT &> Operand
Composite data type of the sparse matrix expression.
Definition: SMatSerialExpr.h:93
Operand sm_
Sparse matrix of the serial evaluation expression.
Definition: SMatSerialExpr.h:241
typename T::OppositeType OppositeType_t
Alias declaration for nested OppositeType type definitions.The OppositeType_t alias declaration provi...
Definition: Aliases.h:270
OppositeType_t< MT > OppositeType
Result type with opposite storage order for expression template evaluations.
Definition: SMatSerialExpr.h:84
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.
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
bool canSMPAssign() const noexcept
Returns whether the expression can be used in SMP assignments.
Definition: SMatSerialExpr.h:234
bool canAlias(const T *alias) const noexcept
Returns whether the expression can alias with the given address alias.
Definition: SMatSerialExpr.h:212
static constexpr bool smpAssignable
Compilation switch for the expression template assignment strategy.
Definition: SMatSerialExpr.h:98
#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
size_t nonZeros(size_t i) const
Returns the number of non-zero elements in the specified row.
Definition: SMatSerialExpr.h:180
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
ResultType_t< MT > ResultType
Result type for expression template evaluations.
Definition: SMatSerialExpr.h:83
decltype(auto) serial(const DenseMatrix< MT, SO > &dm)
Forces the serial evaluation of the given dense matrix expression dm.
Definition: DMatSerialExpr.h:808
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
const ResultType CompositeType
Data type for composite expression templates.
Definition: SMatSerialExpr.h:90
const Type & ReturnType
Return type for expression template evaluations.
Definition: CompressedMatrix.h:3081
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
ReturnType_t< MT > ReturnType
Return type for expression template evaluations.
Definition: SMatSerialExpr.h:87
ReturnType operator()(size_t i, size_t j) const
2D-access to the matrix elements.
Definition: SMatSerialExpr.h:118
size_t columns() const noexcept
Returns the current number of columns of the matrix.
Definition: SMatSerialExpr.h:159
Expression object for the forced serial evaluation of sparse matrices.The SMatSerialExpr class repres...
Definition: Forward.h:123
#define BLAZE_INTERNAL_ASSERT(expr, msg)
Run time assertion macro for internal checks.In case of an invalid run time expression, the program execution is terminated. The BLAZE_INTERNAL_ASSERT macro can be disabled by setting the BLAZE_USER_ASSERTION flag to zero or by defining NDEBUG during the compilation.
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
#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
Header file for the IsExpression type trait class.
Header file for the function trace functionality.