35#ifndef _BLAZE_MATH_EXPRESSIONS_DMATSERIALEXPR_H_
36#define _BLAZE_MATH_EXPRESSIONS_DMATSERIALEXPR_H_
77 :
public MatSerialExpr< DenseMatrix< DMatSerialExpr<MT,SO>, SO > >
142 if( i >=
dm_.rows() ) {
145 if( j >=
dm_.columns() ) {
157 inline size_t rows() const noexcept {
168 return dm_.columns();
198 template<
typename T >
199 inline bool canAlias(
const T* alias )
const noexcept {
200 return dm_.canAlias( alias );
210 template<
typename T >
211 inline bool isAliased(
const T* alias )
const noexcept {
212 return dm_.isAliased( alias );
222 return dm_.isAligned();
232 return dm_.canSMPAssign();
253 template<
typename MT2
262 assign( *lhs, rhs.
dm_ );
279 template<
typename MT2
288 assign( *lhs, rhs.
dm_ );
305 template<
typename MT2
307 friend inline void addAssign( DenseMatrix<MT2,SO2>& lhs,
const DMatSerialExpr& rhs )
314 addAssign( *lhs, rhs.dm_ );
331 template<
typename MT2
333 friend inline void addAssign( SparseMatrix<MT2,SO2>& lhs,
const DMatSerialExpr& rhs )
340 addAssign( *lhs, rhs.dm_ );
358 template<
typename MT2
360 friend inline void subAssign( DenseMatrix<MT2,SO2>& lhs,
const DMatSerialExpr& rhs )
367 subAssign( *lhs, rhs.dm_ );
385 template<
typename MT2
387 friend inline void subAssign( SparseMatrix<MT2,SO2>& lhs,
const DMatSerialExpr& rhs )
394 subAssign( *lhs, rhs.dm_ );
412 template<
typename MT2
414 friend inline void schurAssign( DenseMatrix<MT2,SO2>& lhs,
const DMatSerialExpr& rhs )
421 schurAssign( *lhs, rhs.dm_ );
439 template<
typename MT2
441 friend inline void schurAssign( SparseMatrix<MT2,SO2>& lhs,
const DMatSerialExpr& rhs )
448 schurAssign( *lhs, rhs.dm_ );
466 template<
typename MT2
468 friend inline void multAssign( DenseMatrix<MT2,SO2>& lhs,
const DMatSerialExpr& rhs )
475 multAssign( *lhs, rhs.sm_ );
493 template<
typename MT2
495 friend inline void multAssign( SparseMatrix<MT2,SO2>& lhs,
const DMatSerialExpr& rhs )
502 multAssign( *lhs, rhs.sm_ );
519 template<
typename MT2
528 assign( *lhs, rhs.dm_ );
545 template<
typename MT2
554 assign( *lhs, rhs.dm_ );
572 template<
typename MT2
581 addAssign( *lhs, rhs.dm_ );
599 template<
typename MT2
608 addAssign( *lhs, rhs.dm_ );
626 template<
typename MT2
635 subAssign( *lhs, rhs.dm_ );
653 template<
typename MT2
662 subAssign( *lhs, rhs.dm_ );
680 template<
typename MT2
689 schurAssign( *lhs, rhs.dm_ );
707 template<
typename MT2
716 schurAssign( *lhs, rhs.dm_ );
734 template<
typename MT2
743 multAssign( *lhs, rhs.sm_ );
761 template<
typename MT2
770 multAssign( *lhs, rhs.sm_ );
817 return ReturnType( *dm );
832template<
typename MT,
bool SO >
833struct IsAligned< DMatSerialExpr<MT,SO> >
834 :
public IsAligned<MT>
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 function trace functionality.
Header file for the If class template.
Header file for the IsAligned type trait.
Header file for the IsExpression type trait class.
Expression object for the forced serial evaluation of dense matrices.
Definition DMatSerialExpr.h:79
bool canAlias(const T *alias) const noexcept
Returns whether the expression can alias with the given address alias.
Definition DMatSerialExpr.h:199
DMatSerialExpr< MT, SO > This
Type of this DMatSerialExpr instance.
Definition DMatSerialExpr.h:83
If_t< IsExpression_v< MT >, const MT, const MT & > Operand
Composite data type of the dense matrix expression.
Definition DMatSerialExpr.h:98
Operand operand() const noexcept
Returns the dense matrix operand.
Definition DMatSerialExpr.h:177
ReturnType at(size_t i, size_t j) const
Checked access to the matrix elements.
Definition DMatSerialExpr.h:141
DMatSerialExpr(const MT &dm) noexcept
Constructor for the DMatSerialExpr class.
Definition DMatSerialExpr.h:114
size_t rows() const noexcept
Returns the current number of rows of the matrix.
Definition DMatSerialExpr.h:157
TransposeType_t< MT > TransposeType
Transpose type for expression template evaluations.
Definition DMatSerialExpr.h:90
ReturnType operator()(size_t i, size_t j) const
2D-access to the matrix elements.
Definition DMatSerialExpr.h:126
ResultType_t< MT > ResultType
Result type for expression template evaluations.
Definition DMatSerialExpr.h:88
const ResultType CompositeType
Data type for composite expression templates.
Definition DMatSerialExpr.h:95
ReturnType_t< MT > ReturnType
Return type for expression template evaluations.
Definition DMatSerialExpr.h:92
Operand dm_
Dense matrix of the serial evaluation expression.
Definition DMatSerialExpr.h:238
OppositeType_t< MT > OppositeType
Result type with opposite storage order for expression template evaluations.
Definition DMatSerialExpr.h:89
static constexpr bool simdEnabled
Compilation switch for the expression template evaluation strategy.
Definition DMatSerialExpr.h:103
bool canSMPAssign() const noexcept
Returns whether the expression can be used in SMP assignments.
Definition DMatSerialExpr.h:231
bool isAliased(const T *alias) const noexcept
Returns whether the expression is aliased with the given address alias.
Definition DMatSerialExpr.h:211
bool isAligned() const noexcept
Returns whether the operands of the expression are properly aligned in memory.
Definition DMatSerialExpr.h:221
size_t columns() const noexcept
Returns the current number of columns of the matrix.
Definition DMatSerialExpr.h:167
MatSerialExpr< DenseMatrix< This, SO > > BaseType
Base type of this DMatSerialExpr instance.
Definition DMatSerialExpr.h:86
static constexpr bool smpAssignable
Compilation switch for the expression template assignment strategy.
Definition DMatSerialExpr.h:106
ElementType_t< MT > ElementType
Resulting element type.
Definition DMatSerialExpr.h:91
Base class for dense matrices.
Definition DenseMatrix.h:82
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 DenseMatrix base class.
Header file for the MatSerialExpr 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_DENSE_MATRIX_TYPE(T)
Constraint on the data type.
Definition DenseMatrix.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
#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
typename If< Condition >::template Type< T1, T2 > If_t
Auxiliary alias template for the If class template.
Definition If.h:108
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.