35 #ifndef _BLAZE_MATH_EXPRESSIONS_SMATTRANSPOSER_H_ 36 #define _BLAZE_MATH_EXPRESSIONS_SMATTRANSPOSER_H_ 72 :
public SparseMatrix< SMatTransposer<MT,SO>, SO >
94 enum :
bool { smpAssignable = MT::smpAssignable };
117 return const_cast<const MT&
>(
sm_ )(j,i);
130 if( i >=
sm_.columns() ) {
133 if( j >=
sm_.rows() ) {
168 return sm_.cbegin(i);
184 return sm_.cbegin(i);
241 inline size_t rows() const noexcept {
242 return sm_.columns();
262 return sm_.capacity();
272 inline size_t capacity(
size_t i )
const noexcept {
273 return sm_.capacity( i );
283 return sm_.nonZeros();
294 return sm_.nonZeros( i );
322 return sm_.insert( j, i, value );
337 sm_.reserve( nonzeros );
355 inline void reserve(
size_t i,
size_t nonzeros ) {
356 sm_.reserve( i, nonzeros );
388 sm_.append( j, i, value, check );
427 template<
typename Other >
428 inline bool canAlias(
const Other* alias )
const noexcept
430 return sm_.canAlias( alias );
440 template<
typename Other >
441 inline bool isAliased(
const Other* alias )
const noexcept
443 return sm_.isAliased( alias );
454 return sm_.canSMPAssign();
469 template<
typename MT2
508 template<
typename MT
526 template<
typename MT
546 template<
typename MT,
bool SO,
size_t... CSAs >
565 template<
typename MT,
bool SO,
size_t... CRAs >
584 template<
typename MT,
bool SO,
size_t... CCAs >
size_t capacity(size_t i) const noexcept
Returns the current capacity of the specified row/column.
Definition: SMatTransposer.h:272
Constraint on the data type.
Header file for auxiliary alias declarations.
Header file for basic type definitions.
ReturnType_< MT > ReturnType
Return type for expression template evaluations.
Definition: SMatTransposer.h:81
ConstReference at(size_t i, size_t j) const
Checked access to the matrix elements.
Definition: SMatTransposer.h:129
Base template for the SubmatrixTrait class.
Definition: SubmatrixTrait.h:109
ConstIterator cend(size_t i) const
Returns an iterator just past the last non-zero element of row/column i.
Definition: SMatTransposer.h:231
#define BLAZE_CONSTRAINT_MUST_NOT_BE_COMPUTATION_TYPE(T)
Constraint on the data type.In case the given data type T is a computational expression (i...
Definition: Computation.h:81
SMatTransposer(MT &sm) noexcept
Constructor for the SMatTransposer class.
Definition: SMatTransposer.h:102
bool isAliased(const Other *alias) const noexcept
Returns whether the matrix is aliased with the given address alias.
Definition: SMatTransposer.h:441
MT OppositeType
Result type with opposite storage order for expression template evaluations.
Definition: SMatTransposer.h:78
Iterator_< MT > Iterator
Iterator over non-constant elements.
Definition: SMatTransposer.h:85
Constraints on the storage order of matrix types.
typename SubmatrixTrait< MT, CSAs... >::Type SubmatrixTrait_
Auxiliary alias declaration for the SubmatrixTrait type trait.The SubmatrixTrait_ alias declaration p...
Definition: SubmatrixTrait.h:145
size_t columns() const noexcept
Returns the current number of columns of the matrix.
Definition: SMatTransposer.h:251
typename T::ResultType ResultType_
Alias declaration for nested ResultType type definitions.The ResultType_ alias declaration provides a...
Definition: Aliases.h:343
bool isIntact() const noexcept
Returns whether the invariants of the matrix are intact.
Definition: SMatTransposer.h:415
Base template for the RowsTrait class.
Definition: RowsTrait.h:109
MT & sm_
The sparse matrix operand.
Definition: SMatTransposer.h:479
typename T::ReturnType ReturnType_
Alias declaration for nested ReturnType type definitions.The ReturnType_ alias declaration provides a...
Definition: Aliases.h:363
Header file for the SparseMatrix base class.
void reserve(size_t i, size_t nonzeros)
Setting the minimum capacity of a specific row/column of the sparse matrix.
Definition: SMatTransposer.h:355
size_t nonZeros() const
Returns the number of non-zero elements in the matrix.
Definition: SMatTransposer.h:282
typename ColumnsTrait< MT, CCAs... >::Type ColumnsTrait_
Auxiliary alias declaration for the ColumnsTrait type trait.The ColumnsTrait_ alias declaration provi...
Definition: ColumnsTrait.h:145
Namespace of the Blaze C++ math library.
Definition: Blaze.h:58
Iterator begin(size_t i)
Returns an iterator to the first non-zero element of row/column i.
Definition: SMatTransposer.h:151
ConstReference operator()(size_t i, size_t j) const
2D-access to the matrix elements.
Definition: SMatTransposer.h:114
#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
Reference_< MT > Reference
Reference to a non-constant matrix value.
Definition: SMatTransposer.h:83
void reset()
Resets the matrix elements.
Definition: SMatTransposer.h:303
typename T::ElementType ElementType_
Alias declaration for nested ElementType type definitions.The ElementType_ alias declaration provides...
Definition: Aliases.h:163
ConstIterator begin(size_t i) const
Returns an iterator to the first non-zero element of row/column i.
Definition: SMatTransposer.h:167
Header file for the exception macros of the math module.
ConstIterator end(size_t i) const
Returns an iterator just past the last non-zero element of row/column i.
Definition: SMatTransposer.h:215
ConstIterator cbegin(size_t i) const
Returns an iterator to the first non-zero element of row/column i.
Definition: SMatTransposer.h:183
typename T::Reference Reference_
Alias declaration for nested Reference type definitions.The Reference_ alias declaration provides a c...
Definition: Aliases.h:303
void reserve(size_t nonzeros)
Setting the minimum capacity of the sparse matrix.
Definition: SMatTransposer.h:336
typename RowsTrait< MT, CRAs... >::Type RowsTrait_
Auxiliary alias declaration for the RowsTrait type trait.The RowsTrait_ alias declaration provides a ...
Definition: RowsTrait.h:145
ConstIterator_< MT > ConstIterator
Iterator over constant elements.
Definition: SMatTransposer.h:86
TransposeType_< MT > ResultType
Result type for expression template evaluations.
Definition: SMatTransposer.h:77
ElementType_< MT > ElementType
Resulting element type.
Definition: SMatTransposer.h:80
Expression object for the transposition of a sparse matrix.The SMatTransposer class is a wrapper obje...
Definition: Forward.h:124
Header file for run time assertion macros.
bool canAlias(const Other *alias) const noexcept
Returns whether the matrix can alias with the given address alias.
Definition: SMatTransposer.h:428
ResultType_< MT > TransposeType
Transpose type for expression template evaluations.
Definition: SMatTransposer.h:79
Header file for the submatrix trait.
Header file for the columns trait.
void append(size_t i, size_t j, const ElementType &value, bool check=false)
Appending an element to the specified row/column of the sparse matrix.
Definition: SMatTransposer.h:387
Iterator end(size_t i)
Returns an iterator just past the last non-zero element of row/column i.
Definition: SMatTransposer.h:199
size_t rows() const noexcept
Returns the current number of rows of the matrix.
Definition: SMatTransposer.h:241
Base class for matrices.The Matrix class is a base class for all dense and sparse matrix classes with...
Definition: Forward.h:101
Iterator insert(size_t i, size_t j, const ElementType &value)
Inserting an element into the sparse matrix.
Definition: SMatTransposer.h:321
ConstReference_< MT > ConstReference
Reference to a constant matrix value.
Definition: SMatTransposer.h:84
void assign(const Matrix< MT2, SO2 > &rhs)
Implementation of the transpose assignment of a matrix.
Definition: SMatTransposer.h:471
typename T::Iterator Iterator_
Alias declaration for nested Iterator type definitions.The Iterator_ alias declaration provides a con...
Definition: Aliases.h:183
void finalize(size_t i)
Finalizing the element insertion of a row/column.
Definition: SMatTransposer.h:405
Header file for the rows trait.
typename T::ConstReference ConstReference_
Alias declaration for nested ConstReference type definitions.The ConstReference_ alias declaration pr...
Definition: Aliases.h:143
typename T::ConstIterator ConstIterator_
Alias declaration for nested ConstIterator type definitions.The ConstIterator_ alias declaration prov...
Definition: Aliases.h:103
decltype(auto) trans(const DenseMatrix< MT, SO > &dm)
Calculation of the transpose of the given dense matrix.
Definition: DMatTransExpr.h:789
Base template for the ColumnsTrait class.
Definition: ColumnsTrait.h:109
size_t capacity() const noexcept
Returns the maximum capacity of the matrix.
Definition: SMatTransposer.h:261
bool isIntact(const DiagonalMatrix< MT, SO, DF > &m)
Returns whether the invariants of the given diagonal matrix are intact.
Definition: DiagonalMatrix.h:254
size_t nonZeros(size_t i) const
Returns the number of non-zero elements in the specified row/column.
Definition: SMatTransposer.h:293
typename T::TransposeType TransposeType_
Alias declaration for nested TransposeType type definitions.The TransposeType_ alias declaration prov...
Definition: Aliases.h:423
bool canSMPAssign() const noexcept
Returns whether the matrix can be used in SMP assignments.
Definition: SMatTransposer.h:452
#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
#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