35#ifndef _BLAZE_MATH_EXPRESSIONS_SMATTRANSPOSER_H_
36#define _BLAZE_MATH_EXPRESSIONS_SMATTRANSPOSER_H_
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
528template<
typename MT,
bool SO >
529struct Size< SMatTransposer<MT,SO>, 0UL >
530 :
public Size<MT,0UL>
533template<
typename MT,
bool SO >
534struct Size< SMatTransposer<MT,SO>, 1UL >
535 :
public Size<MT,1UL>
551template<
typename MT,
bool SO >
552struct MaxSize< SMatTransposer<MT,SO>, 0UL >
553 :
public MaxSize<MT,0UL>
556template<
typename MT,
bool SO >
557struct MaxSize< SMatTransposer<MT,SO>, 1UL >
558 :
public MaxSize<MT,1UL>
Header file for auxiliary alias declarations.
typename T::ConstReference ConstReference_t
Alias declaration for nested ConstReference type definitions.
Definition: Aliases.h:170
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::Iterator Iterator_t
Alias declaration for nested Iterator type definitions.
Definition: Aliases.h:210
typename T::ConstIterator ConstIterator_t
Alias declaration for nested ConstIterator type definitions.
Definition: Aliases.h:130
typename T::Reference Reference_t
Alias declaration for nested Reference type definitions.
Definition: Aliases.h:390
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 MaxSize type trait.
Constraints on the storage order of matrix types.
Base class for matrices.
Definition: Matrix.h:85
Expression object for the transposition of a sparse matrix.
Definition: SMatTransposer.h:72
MT OppositeType
Result type with opposite storage order for expression template evaluations.
Definition: SMatTransposer.h:78
ConstIterator cend(size_t i) const
Returns an iterator just past the last non-zero element of row/column i.
Definition: SMatTransposer.h:231
void finalize(size_t i)
Finalizing the element insertion of a row/column.
Definition: SMatTransposer.h:405
static constexpr bool smpAssignable
Compilation flag for SMP assignments.
Definition: SMatTransposer.h:94
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
void reset()
Resets the matrix elements.
Definition: SMatTransposer.h:303
ElementType_t< MT > ElementType
Resulting element type.
Definition: SMatTransposer.h:80
Iterator end(size_t i)
Returns an iterator just past the last non-zero element of row/column i.
Definition: SMatTransposer.h:199
ResultType_t< MT > TransposeType
Transpose type for expression template evaluations.
Definition: SMatTransposer.h:79
ConstReference_t< MT > ConstReference
Reference to a constant matrix value.
Definition: SMatTransposer.h:84
size_t columns() const noexcept
Returns the current number of columns of the matrix.
Definition: SMatTransposer.h:251
ReturnType_t< MT > ReturnType
Return type for expression template evaluations.
Definition: SMatTransposer.h:81
size_t nonZeros(size_t i) const
Returns the number of non-zero elements in the specified row/column.
Definition: SMatTransposer.h:293
ConstIterator begin(size_t i) const
Returns an iterator to the first non-zero element of row/column i.
Definition: SMatTransposer.h:167
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
TransposeType_t< MT > ResultType
Result type for expression template evaluations.
Definition: SMatTransposer.h:77
Reference_t< MT > Reference
Reference to a non-constant matrix value.
Definition: SMatTransposer.h:83
bool isAliased(const Other *alias) const noexcept
Returns whether the matrix is aliased with the given address alias.
Definition: SMatTransposer.h:441
void assign(const Matrix< MT2, SO2 > &rhs)
Implementation of the transpose assignment of a matrix.
Definition: SMatTransposer.h:471
Iterator begin(size_t i)
Returns an iterator to the first non-zero element of row/column i.
Definition: SMatTransposer.h:151
Iterator insert(size_t i, size_t j, const ElementType &value)
Inserting an element into the sparse matrix.
Definition: SMatTransposer.h:321
ConstIterator end(size_t i) const
Returns an iterator just past the last non-zero element of row/column i.
Definition: SMatTransposer.h:215
bool canSMPAssign() const noexcept
Returns whether the matrix can be used in SMP assignments.
Definition: SMatTransposer.h:452
Iterator_t< MT > Iterator
Iterator over non-constant elements.
Definition: SMatTransposer.h:85
size_t rows() const noexcept
Returns the current number of rows of the matrix.
Definition: SMatTransposer.h:241
bool canAlias(const Other *alias) const noexcept
Returns whether the matrix can alias with the given address alias.
Definition: SMatTransposer.h:428
size_t capacity(size_t i) const noexcept
Returns the current capacity of the specified row/column.
Definition: SMatTransposer.h:272
ConstReference at(size_t i, size_t j) const
Checked access to the matrix elements.
Definition: SMatTransposer.h:129
ConstIterator_t< MT > ConstIterator
Iterator over constant elements.
Definition: SMatTransposer.h:86
bool isIntact() const noexcept
Returns whether the invariants of the matrix are intact.
Definition: SMatTransposer.h:415
ConstIterator cbegin(size_t i) const
Returns an iterator to the first non-zero element of row/column i.
Definition: SMatTransposer.h:183
size_t nonZeros() const
Returns the number of non-zero elements in the matrix.
Definition: SMatTransposer.h:282
size_t capacity() const noexcept
Returns the maximum capacity of the matrix.
Definition: SMatTransposer.h:261
void reserve(size_t nonzeros)
Setting the minimum capacity of the sparse matrix.
Definition: SMatTransposer.h:336
MT & sm_
The sparse matrix operand.
Definition: SMatTransposer.h:479
SMatTransposer(MT &sm) noexcept
Constructor for the SMatTransposer class.
Definition: SMatTransposer.h:102
ConstReference operator()(size_t i, size_t j) const
2D-access to the matrix elements.
Definition: SMatTransposer.h:114
Base class for sparse matrices.
Definition: SparseMatrix.h:77
Constraint on the data type.
Header file for the SparseMatrix base class.
decltype(auto) trans(const DenseMatrix< MT, SO > &dm)
Calculation of the transpose of the given dense matrix.
Definition: DMatTransExpr.h:766
bool isIntact(const DiagonalMatrix< MT, SO, DF > &m)
Returns whether the invariants of the given diagonal matrix are intact.
Definition: DiagonalMatrix.h:207
#define BLAZE_CONSTRAINT_MUST_NOT_BE_COMPUTATION_TYPE(T)
Constraint on the data type.
Definition: Computation.h:81
#define BLAZE_CONSTRAINT_MUST_BE_SPARSE_MATRIX_TYPE(T)
Constraint on the data type.
Definition: SparseMatrix.h:61
#define BLAZE_INTERNAL_ASSERT(expr, msg)
Run time assertion macro for internal checks.
Definition: Assert.h:101
#define BLAZE_THROW_OUT_OF_RANGE(MESSAGE)
Macro for the emission of a std::out_of_range exception.
Definition: Exception.h:331
Header file for the exception macros of the math module.
Header file for the Size type trait.
Header file for basic type definitions.