35 #ifndef _BLAZE_MATH_EXPRESSIONS_SMATTRANSPOSER_H_ 36 #define _BLAZE_MATH_EXPRESSIONS_SMATTRANSPOSER_H_ 71 :
public SparseMatrix< SMatTransposer<MT,SO>, SO >
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
528 inline bool isIntact(
const SMatTransposer<MT,SO>& m ) noexcept
546 template<
typename MT,
bool SO >
547 struct Size< SMatTransposer<MT,SO>, 0UL >
548 :
public Size<MT,0UL>
551 template<
typename MT,
bool SO >
552 struct Size< SMatTransposer<MT,SO>, 1UL >
553 :
public Size<MT,1UL>
569 template<
typename MT,
bool SO >
570 struct MaxSize< SMatTransposer<MT,SO>, 0UL >
571 :
public MaxSize<MT,0UL>
574 template<
typename MT,
bool SO >
575 struct MaxSize< SMatTransposer<MT,SO>, 1UL >
576 :
public MaxSize<MT,1UL>
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.
ResultType_t< MT > TransposeType
Transpose type for expression template evaluations.
Definition: SMatTransposer.h:79
ConstReference at(size_t i, size_t j) const
Checked access to the matrix elements.
Definition: SMatTransposer.h:129
ConstIterator cend(size_t i) const
Returns an iterator just past the last non-zero element of row/column i.
Definition: SMatTransposer.h:231
typename T::ResultType ResultType_t
Alias declaration for nested ResultType type definitions.The ResultType_t alias declaration provides ...
Definition: Aliases.h:390
typename T::Reference Reference_t
Alias declaration for nested Reference type definitions.The Reference_t alias declaration provides a ...
Definition: Aliases.h:330
#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
void reset(const DiagonalProxy< MT > &proxy)
Resetting the represented element to the default initial values.
Definition: DiagonalProxy.h:595
Constraints on the storage order of matrix types.
size_t columns() const noexcept
Returns the current number of columns of the matrix.
Definition: SMatTransposer.h:251
typename T::ReturnType ReturnType_t
Alias declaration for nested ReturnType type definitions.The ReturnType_t alias declaration provides ...
Definition: Aliases.h:410
Header file for the MaxSize type trait.
bool isIntact() const noexcept
Returns whether the invariants of the matrix are intact.
Definition: SMatTransposer.h:415
MT & sm_
The sparse matrix operand.
Definition: SMatTransposer.h:479
Base class for sparse matrices.The SparseMatrix class is a base class for all sparse matrix classes....
Definition: Forward.h:145
typename T::ElementType ElementType_t
Alias declaration for nested ElementType type definitions.The ElementType_t alias declaration provide...
Definition: Aliases.h:170
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
TransposeType_t< MT > ResultType
Result type for expression template evaluations.
Definition: SMatTransposer.h:77
size_t nonZeros() const
Returns the number of non-zero elements in the matrix.
Definition: SMatTransposer.h:282
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
void reset()
Resets the matrix elements.
Definition: SMatTransposer.h:303
ConstIterator begin(size_t i) const
Returns an iterator to the first non-zero element of row/column i.
Definition: SMatTransposer.h:167
ConstReference_t< MT > ConstReference
Reference to a constant matrix value.
Definition: SMatTransposer.h:84
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
void reserve(size_t nonzeros)
Setting the minimum capacity of the sparse matrix.
Definition: SMatTransposer.h:336
Iterator_t< MT > Iterator
Iterator over non-constant elements.
Definition: SMatTransposer.h:85
ConstIterator_t< MT > ConstIterator
Iterator over constant elements.
Definition: SMatTransposer.h:86
Expression object for the transposition of a sparse matrix.The SMatTransposer class is a wrapper obje...
Definition: Forward.h:139
typename T::Iterator Iterator_t
Alias declaration for nested Iterator type definitions.The Iterator_t alias declaration provides a co...
Definition: Aliases.h:190
typename T::TransposeType TransposeType_t
Alias declaration for nested TransposeType type definitions.The TransposeType_t alias declaration pro...
Definition: Aliases.h:470
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
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:114
typename T::ConstReference ConstReference_t
Alias declaration for nested ConstReference type definitions.The ConstReference_t alias declaration p...
Definition: Aliases.h:150
ElementType_t< MT > ElementType
Resulting element type.
Definition: SMatTransposer.h:80
Iterator insert(size_t i, size_t j, const ElementType &value)
Inserting an element into the sparse matrix.
Definition: SMatTransposer.h:321
void assign(const Matrix< MT2, SO2 > &rhs)
Implementation of the transpose assignment of a matrix.
Definition: SMatTransposer.h:471
static constexpr bool smpAssignable
Compilation flag for SMP assignments.
Definition: SMatTransposer.h:94
void finalize(size_t i)
Finalizing the element insertion of a row/column.
Definition: SMatTransposer.h:405
typename T::ConstIterator ConstIterator_t
Alias declaration for nested ConstIterator type definitions.The ConstIterator_t alias declaration pro...
Definition: Aliases.h:110
decltype(auto) trans(const DenseMatrix< MT, SO > &dm)
Calculation of the transpose of the given dense matrix.
Definition: DMatTransExpr.h:765
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:264
Reference_t< MT > Reference
Reference to a non-constant matrix value.
Definition: SMatTransposer.h:83
size_t nonZeros(size_t i) const
Returns the number of non-zero elements in the specified row/column.
Definition: SMatTransposer.h:293
Header file for the Size type trait.
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,...
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
ReturnType_t< MT > ReturnType
Return type for expression template evaluations.
Definition: SMatTransposer.h:81