35#ifndef _BLAZE_MATH_EXPRESSIONS_SMATSERIALEXPR_H_
36#define _BLAZE_MATH_EXPRESSIONS_SMATSERIALEXPR_H_
76 :
public MatSerialExpr< SparseMatrix< SMatSerialExpr<MT,SO>, SO > >
138 if( i >=
sm_.rows() ) {
141 if( j >=
sm_.columns() ) {
153 inline size_t rows() const noexcept {
164 return sm_.columns();
174 return sm_.nonZeros();
185 return sm_.nonZeros(i);
215 template<
typename T >
216 inline bool canAlias(
const T* alias )
const noexcept {
217 return sm_.canAlias( alias );
227 template<
typename T >
228 inline bool isAliased(
const T* alias )
const noexcept {
229 return sm_.isAliased( alias );
239 return sm_.canSMPAssign();
260 template<
typename MT2
269 assign( *lhs, rhs.
sm_ );
286 template<
typename MT2
295 assign( *lhs, rhs.
sm_ );
312 template<
typename MT2
314 friend inline void addAssign( DenseMatrix<MT2,SO2>& lhs,
const SMatSerialExpr& rhs )
321 addAssign( *lhs, rhs.sm_ );
338 template<
typename MT2
340 friend inline void addAssign( SparseMatrix<MT2,SO2>& lhs,
const SMatSerialExpr& rhs )
347 addAssign( *lhs, rhs.sm_ );
365 template<
typename MT2
367 friend inline void subAssign( DenseMatrix<MT2,SO2>& lhs,
const SMatSerialExpr& rhs )
374 subAssign( *lhs, rhs.sm_ );
392 template<
typename MT2
394 friend inline void subAssign( SparseMatrix<MT2,SO2>& lhs,
const SMatSerialExpr& rhs )
401 subAssign( *lhs, rhs.sm_ );
419 template<
typename MT2
421 friend inline void schurAssign( DenseMatrix<MT2,SO2>& lhs,
const SMatSerialExpr& rhs )
428 schurAssign( *lhs, rhs.sm_ );
446 template<
typename MT2
448 friend inline void schurAssign( SparseMatrix<MT2,SO2>& lhs,
const SMatSerialExpr& rhs )
455 schurAssign( *lhs, rhs.sm_ );
473 template<
typename MT2
475 friend inline void multAssign( DenseMatrix<MT2,SO2>& lhs,
const SMatSerialExpr& rhs )
482 multAssign( *lhs, rhs.sm_ );
500 template<
typename MT2
502 friend inline void multAssign( SparseMatrix<MT2,SO2>& lhs,
const SMatSerialExpr& rhs )
509 multAssign( *lhs, rhs.sm_ );
526 template<
typename MT2
535 assign( *lhs, rhs.sm_ );
552 template<
typename MT2
561 assign( *lhs, rhs.sm_ );
579 template<
typename MT2
588 addAssign( *lhs, rhs.sm_ );
606 template<
typename MT2
615 addAssign( *lhs, rhs.sm_ );
633 template<
typename MT2
642 subAssign( *lhs, rhs.sm_ );
660 template<
typename MT2
669 subAssign( *lhs, rhs.sm_ );
687 template<
typename MT2
696 schurAssign( *lhs, rhs.sm_ );
714 template<
typename MT2
723 schurAssign( *lhs, rhs.sm_ );
741 template<
typename MT2
750 multAssign( *lhs, rhs.sm_ );
768 template<
typename MT2
777 multAssign( *lhs, rhs.sm_ );
824 return ReturnType( *sm );
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 function trace functionality.
Header file for the If class template.
Header file for the IsExpression type trait class.
Base class for dense matrices.
Definition: DenseMatrix.h:82
Expression object for the forced serial evaluation of sparse matrices.
Definition: SMatSerialExpr.h:78
size_t columns() const noexcept
Returns the current number of columns of the matrix.
Definition: SMatSerialExpr.h:163
ReturnType at(size_t i, size_t j) const
Checked access to the matrix elements.
Definition: SMatSerialExpr.h:137
bool canAlias(const T *alias) const noexcept
Returns whether the expression can alias with the given address alias.
Definition: SMatSerialExpr.h:216
SMatSerialExpr(const MT &sm) noexcept
Constructor for the SMatSerialExpr class.
Definition: SMatSerialExpr.h:110
If_t< IsExpression_v< MT >, const MT, const MT & > Operand
Composite data type of the sparse matrix expression.
Definition: SMatSerialExpr.h:97
ReturnType_t< MT > ReturnType
Return type for expression template evaluations.
Definition: SMatSerialExpr.h:91
ReturnType operator()(size_t i, size_t j) const
2D-access to the matrix elements.
Definition: SMatSerialExpr.h:122
size_t rows() const noexcept
Returns the current number of rows of the matrix.
Definition: SMatSerialExpr.h:153
Operand sm_
Sparse matrix of the serial evaluation expression.
Definition: SMatSerialExpr.h:245
ResultType_t< MT > ResultType
Result type for expression template evaluations.
Definition: SMatSerialExpr.h:87
size_t nonZeros(size_t i) const
Returns the number of non-zero elements in the specified row.
Definition: SMatSerialExpr.h:184
Operand operand() const noexcept
Returns the sparse matrix operand.
Definition: SMatSerialExpr.h:194
bool isAliased(const T *alias) const noexcept
Returns whether the expression is aliased with the given address alias.
Definition: SMatSerialExpr.h:228
OppositeType_t< MT > OppositeType
Result type with opposite storage order for expression template evaluations.
Definition: SMatSerialExpr.h:88
static constexpr bool smpAssignable
Compilation switch for the expression template assignment strategy.
Definition: SMatSerialExpr.h:102
TransposeType_t< MT > TransposeType
Transpose type for expression template evaluations.
Definition: SMatSerialExpr.h:89
size_t nonZeros() const
Returns the number of non-zero elements in the sparse matrix.
Definition: SMatSerialExpr.h:173
const ResultType CompositeType
Data type for composite expression templates.
Definition: SMatSerialExpr.h:94
bool canSMPAssign() const noexcept
Returns whether the expression can be used in SMP assignments.
Definition: SMatSerialExpr.h:238
ElementType_t< MT > ElementType
Resulting element type.
Definition: SMatSerialExpr.h:90
Base class for sparse matrices.
Definition: SparseMatrix.h:77
Constraint on the data type.
Header file for the Computation base class.
Header file for the MatSerialExpr base class.
Header file for the SparseMatrix base class.
decltype(auto) serial(const DenseMatrix< MT, SO > &dm)
Forces the serial evaluation of the given dense matrix expression dm.
Definition: DMatSerialExpr.h:812
#define BLAZE_CONSTRAINT_MUST_BE_SPARSE_MATRIX_TYPE(T)
Constraint on the data type.
Definition: SparseMatrix.h:61
#define BLAZE_CONSTRAINT_MUST_BE_MATRIX_WITH_STORAGE_ORDER(T, SO)
Constraint on the data type.
Definition: StorageOrder.h:63
#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 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_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.
Base class for all compute expression templates.
Definition: Computation.h:68
Base class for all matrix serial evaluation expression templates.
Definition: MatSerialExpr.h:69
Header file for basic type definitions.