35#ifndef _BLAZE_MATH_EXPRESSIONS_SMATTRANSEXPR_H_
36#define _BLAZE_MATH_EXPRESSIONS_SMATTRANSEXPR_H_
85 :
public MatTransExpr< SparseMatrix< SMatTransExpr<MT,SO>, SO > >
86 ,
private If_t< IsComputation_v<MT>, Computation, Transformation >
106 template<
typename MT2 >
107 static constexpr bool UseAssign_v =
useAssign;
119 template<
typename MT2 >
120 static constexpr bool UseSMPAssign_v = ( MT2::smpAssignable &&
useAssign );
186 if( i >=
sm_.columns() ) {
189 if( j >=
sm_.rows() ) {
223 inline size_t rows() const noexcept {
224 return sm_.columns();
244 return sm_.nonZeros();
255 return sm_.nonZeros( i );
268 return sm_.find( j, i );
281 return sm_.lowerBound( j, i );
294 return sm_.upperBound( j, i );
314 template<
typename T >
315 inline bool canAlias(
const T* alias )
const noexcept {
316 return sm_.isAliased( alias );
326 template<
typename T >
327 inline bool isAliased(
const T* alias )
const noexcept {
328 return sm_.isAliased( alias );
338 return sm_.canSMPAssign();
361 template<
typename MT2
372 assign( tmp, rhs.sm_ );
391 template<
typename MT2
402 assign( tmp, rhs.sm_ );
421 template<
typename MT2
423 friend inline auto addAssign( DenseMatrix<MT2,SO2>& lhs,
const SMatTransExpr& rhs )
431 DMatTransposer<MT2,!SO2> tmp( *lhs );
432 addAssign( tmp, rhs.sm_ );
455 template<
typename MT2
457 friend inline auto subAssign( DenseMatrix<MT2,SO2>& lhs,
const SMatTransExpr& rhs )
465 DMatTransposer<MT2,!SO2> tmp( *lhs );
466 subAssign( tmp, rhs.sm_ );
489 template<
typename MT2
491 friend inline auto schurAssign( DenseMatrix<MT2,SO2>& lhs,
const SMatTransExpr& rhs )
499 DMatTransposer<MT2,!SO2> tmp( *lhs );
500 schurAssign( tmp, rhs.sm_ );
531 template<
typename MT2
541 DMatTransposer<MT2,!SO2> tmp( *lhs );
561 template<
typename MT2
571 SMatTransposer<MT2,!SO2> tmp( *lhs );
591 template<
typename MT2
601 DMatTransposer<MT2,!SO2> tmp( *lhs );
626 template<
typename MT2
636 DMatTransposer<MT2,!SO2> tmp( *lhs );
661 template<
typename MT2
671 DMatTransposer<MT2,!SO2> tmp( *lhs );
733 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::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 dense matrix transposer.
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.
Utility type for generic codes.
Header file for the IsComputation type trait class.
Header file for the IsExpression type trait class.
Header file for the sparse matrix transposer.
Expression object for the transposition of a dense matrix.
Definition DMatTransposer.h:79
Base class for dense matrices.
Definition DenseMatrix.h:82
Expression object for sparse matrix transpositions.
Definition SMatTransExpr.h:87
SMatTransExpr(const MT &sm) noexcept
Constructor for the SMatTransExpr class.
Definition SMatTransExpr.h:158
ElementType_t< MT > ElementType
Resulting element type.
Definition SMatTransExpr.h:135
size_t columns() const noexcept
Returns the current number of columns of the matrix.
Definition SMatTransExpr.h:233
ReturnType_t< MT > ReturnType
Return type for expression template evaluations.
Definition SMatTransExpr.h:136
static constexpr bool useAssign
Compilation switch for the serial evaluation strategy of the transposition expression.
Definition SMatTransExpr.h:102
ReturnType operator()(size_t i, size_t j) const
2D-access to the matrix elements.
Definition SMatTransExpr.h:170
Operand operand() const noexcept
Returns the sparse matrix operand.
Definition SMatTransExpr.h:303
size_t nonZeros() const
Returns the number of non-zero elements in the sparse matrix.
Definition SMatTransExpr.h:243
ConstIterator end(size_t i) const
Returns an iterator just past the last non-zero element of row/column i.
Definition SMatTransExpr.h:213
ResultType_t< MT > TransposeType
Transpose type for expression template evaluations.
Definition SMatTransExpr.h:134
static constexpr bool smpAssignable
Compilation switch for the expression template assignment strategy.
Definition SMatTransExpr.h:150
GetConstIterator_t< MT > ConstIterator
Iterator over the elements of the sparse matrix.
Definition SMatTransExpr.h:142
If_t< IsExpression_v< MT >, const MT, const MT & > Operand
Composite data type of the sparse matrix expression.
Definition SMatTransExpr.h:145
TransposeType_t< MT > ResultType
Result type for expression template evaluations.
Definition SMatTransExpr.h:132
ConstIterator upperBound(size_t i, size_t j) const
Returns an iterator to the first index greater then the given index.
Definition SMatTransExpr.h:292
size_t nonZeros(size_t i) const
Returns the number of non-zero elements in the specified row/column.
Definition SMatTransExpr.h:254
bool isAliased(const T *alias) const noexcept
Returns whether the expression is aliased with the given address alias.
Definition SMatTransExpr.h:327
SMatTransExpr< MT, SO > This
Type of this SMatTransExpr instance.
Definition SMatTransExpr.h:127
Operand sm_
Sparse matrix of the transposition expression.
Definition SMatTransExpr.h:344
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 SMatTransExpr.h:133
ConstIterator find(size_t i, size_t j) const
Searches for a specific matrix element.
Definition SMatTransExpr.h:266
bool canAlias(const T *alias) const noexcept
Returns whether the expression can alias with the given address alias.
Definition SMatTransExpr.h:315
If_t< useAssign, const ResultType, const SMatTransExpr & > CompositeType
Data type for composite expression templates.
Definition SMatTransExpr.h:139
ReturnType at(size_t i, size_t j) const
Checked access to the matrix elements.
Definition SMatTransExpr.h:185
bool canSMPAssign() const noexcept
Returns whether the expression can be used in SMP assignments.
Definition SMatTransExpr.h:337
MatTransExpr< SparseMatrix< This, SO > > BaseType
Base type of this SMatTransExpr instance.
Definition SMatTransExpr.h:130
ConstIterator begin(size_t i) const
Returns an iterator to the first non-zero element of row/column i.
Definition SMatTransExpr.h:202
ConstIterator lowerBound(size_t i, size_t j) const
Returns an iterator to the first index not less then the given index.
Definition SMatTransExpr.h:279
size_t rows() const noexcept
Returns the current number of rows of the matrix.
Definition SMatTransExpr.h:223
Expression object for the transposition of a sparse matrix.
Definition SMatTransposer.h:72
Base class for sparse matrices.
Definition SparseMatrix.h:77
Constraint on the data type.
Constraint on the data type.
Header file for the Computation base class.
Header file for the MatTransExpr base class.
Header file for the SparseMatrix base class.
decltype(auto) transIf(const DenseMatrix< MT, SO > &dm)
Conditional calculation of the transpose of the given dense matrix.
Definition DMatTransExpr.h:832
decltype(auto) trans(const DenseMatrix< MT, SO > &dm)
Calculation of the transpose of the given dense matrix.
Definition DMatTransExpr.h:766
#define BLAZE_CONSTRAINT_MUST_NOT_REQUIRE_EVALUATION(T)
Constraint on the data type.
Definition RequiresEvaluation.h:81
#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
constexpr bool RequiresEvaluation_v
Auxiliary variable template for the RequiresEvaluation type trait.
Definition RequiresEvaluation.h:91
#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 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
BoolConstant< false > FalseType
Type/value traits base class.
Definition IntegralConstant.h:121
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_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
IntegralConstant< bool, B > BoolConstant
Generic wrapper for a compile time constant boolean value.
Definition IntegralConstant.h:110
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 matrix transposition expression templates.
Definition MatTransExpr.h:69
Header file for the RequiresEvaluation type trait.
Header file for basic type definitions.