Expression object for the transposition of a sparse matrix.The SMatTransposer class is a wrapper object for the temporary transposition of a sparse matrix.
More...
#include <SMatTransposer.h>
Inherits blaze::SparseMatrix< SMatTransposer< MT, SO >, SO >.
|
typedef SMatTransposer< MT, SO > | This |
| Type of this SMatTransposer instance.
|
|
typedef MT::TransposeType | ResultType |
| Result type for expression template evaluations.
|
|
typedef MT | OppositeType |
| Result type with opposite storage order for expression template evaluations.
|
|
typedef MT::ResultType | TransposeType |
| Transpose type for expression template evaluations.
|
|
typedef MT::ElementType | ElementType |
| Resulting element type.
|
|
typedef MT::ReturnType | ReturnType |
| Return type for expression template evaluations.
|
|
typedef const This & | CompositeType |
| Data type for composite expression templates.
|
|
typedef MT::Reference | Reference |
| Reference to a non-constant matrix value.
|
|
typedef MT::ConstReference | ConstReference |
| Reference to a constant matrix value.
|
|
typedef MT::Iterator | Iterator |
| Iterator over non-constant elements.
|
|
typedef MT::ConstIterator | ConstIterator |
| Iterator over constant elements.
|
|
typedef MT | MatrixType |
| Type of the matrix.
|
|
|
| SMatTransposer (MT &sm) |
| Constructor for the SMatTransposer class.
|
|
Reference | operator() (size_t i, size_t j) const |
| 2D-access to the matrix elements.
|
|
ConstIterator | begin (size_t i) const |
| Returns an iterator to the first non-zero element of row/column i.
|
|
ConstIterator | end (size_t i) const |
| Returns an iterator just past the last non-zero element of row/column i.
|
|
size_t | rows () const |
| Returns the current number of rows of the matrix.
|
|
size_t | columns () const |
| Returns the current number of columns of the matrix.
|
|
void | reset () |
| Resets the matrix elements.
|
|
Iterator | insert (size_t i, size_t j, const ElementType &value) |
| Inserting an element into the sparse matrix.
|
|
void | reserve (size_t nonzeros) |
| Setting the minimum capacity of the sparse matrix.
|
|
void | reserve (size_t i, size_t nonzeros) |
| Setting the minimum capacity of a specific row/column of the sparse matrix.
|
|
void | append (size_t i, size_t j, const ElementType &value) |
| Appending an element to the specified row/column of the sparse matrix.
|
|
void | finalize (size_t i) |
| Finalizing the element insertion of a row/column.
|
|
template<typename Other > |
bool | isAliased (const Other *alias) const |
| Returns whether the matrix is aliased with the given address alias.
|
|
template<typename MT2 > |
void | assign (const SparseMatrix< MT2, false > &rhs) |
| Implementation of the transpose assignment of a row-major sparse matrix.
|
|
template<typename MT2 > |
void | assign (const SparseMatrix< MT2, true > &rhs) |
| Implementation of the transpose assignment of a column-major sparse matrix.
|
|
MatrixType & | operator~ () |
| Conversion operator for non-constant matrices.
|
|
const MatrixType & | operator~ () const |
| Conversion operator for constant matrices.
|
|
|
MT & | sm_ |
| The sparse matrix operand.
|
|
template<typename MT, bool SO>
class blaze::SMatTransposer< MT, SO >
Expression object for the transposition of a sparse matrix.
The SMatTransposer class is a wrapper object for the temporary transposition of a sparse matrix.
template<typename MT , bool SO>
Constructor for the SMatTransposer class.
- Parameters
-
sm | The sparse matrix operand. |
template<typename MT , bool SO>
Appending an element to the specified row/column of the sparse matrix.
- Parameters
-
i | The row index of the new element. The index has to be in the range . |
j | The column index of the new element. The index has to be in the range . |
value | The value of the element to be appended. |
- Returns
- void
This function provides a very efficient way to fill a sparse matrix with elements. It appends a new element to the end of the specified row/column without any additional parameter verification or memory allocation. Therefore it is strictly necessary to keep the following preconditions in mind:
- the index of the new element must be strictly larger than the largest index of non-zero elements in the specified row/column of the sparse matrix
- the current number of non-zero elements in row/column i must be smaller than the capacity of row/column i.
Ignoring these preconditions might result in undefined behavior!
Note: Although append() does not allocate new memory, it still invalidates all iterators returned by the end() functions!
template<typename MT , bool SO>
template<typename MT2 >
Implementation of the transpose assignment of a row-major sparse matrix.
- Parameters
-
rhs | The right-hand side sparse matrix to be assigned. |
- Returns
- void
This function must NOT be called explicitly! It is used internally for the performance optimized evaluation of expression templates. Calling this function explicitly might result in erroneous results and/or in compilation errors. Instead of using this function use the assignment operator.
template<typename MT , bool SO>
template<typename MT2 >
Implementation of the transpose assignment of a column-major sparse matrix.
- Parameters
-
rhs | The right-hand side sparse matrix to be assigned. |
- Returns
- void
This function must NOT be called explicitly! It is used internally for the performance optimized evaluation of expression templates. Calling this function explicitly might result in erroneous results and/or in compilation errors. Instead of using this function use the assignment operator.
template<typename MT , bool SO>
Returns an iterator to the first non-zero element of row/column i.
- Parameters
-
- Returns
- Iterator to the first non-zero element of row/column i.
This function returns a row/column iterator to the first non-zero element of row/column i. In case the storage order is set to rowMajor the function returns an iterator to the first non-zero element of row i, in case the storage flag is set to columnMajor the function returns an iterator to the first non-zero element of column i.
template<typename MT , bool SO>
Returns the current number of columns of the matrix.
- Returns
- The number of columns of the matrix.
template<typename MT , bool SO>
Returns an iterator just past the last non-zero element of row/column i.
- Parameters
-
- Returns
- Iterator just past the last non-zero element of row/column i.
This function returns an row/column iterator just past the last non-zero element of row/column i. In case the storage order is set to rowMajor the function returns an iterator just past the last non-zero element of row i, in case the storage flag is set to columnMajor the function returns an iterator just past the last non-zero element of column i.
template<typename MT , bool SO>
Finalizing the element insertion of a row/column.
- Parameters
-
i | The index of the row/column to be finalized . |
- Returns
- void
This function is part of the low-level interface to efficiently fill the matrix with elements. After completion of row/column i via the append() function, this function can be called to finalize row/column i and prepare the next row/column for insertion process via append().
Note: Although finalize() does not allocate new memory, it still invalidates all iterators returned by the end() functions!
template<typename MT , bool SO>
Inserting an element into the sparse matrix.
- Parameters
-
i | The row index of the new element. The index has to be in the range . |
j | The column index of the new element. The index has to be in the range . |
value | The value of the element to be inserted. |
- Returns
- Iterator to the newly inserted element.
- Exceptions
-
std::invalid_argument | Invalid sparse matrix access index. |
This function insert a new element into the sparse matrix. However, duplicate elements are not allowed. In case the sparse matrix already contains an element with row index i and column index j, a std::invalid_argument exception is thrown.
template<typename MT , bool SO>
template<typename Other >
Returns whether the matrix is aliased with the given address alias.
- Parameters
-
alias | The alias to be checked. |
- Returns
- true in case the alias corresponds to this matrix, false if not.
template<typename MT , bool SO>
2D-access to the matrix elements.
- Parameters
-
i | Access index for the row. The index has to be in the range . |
j | Access index for the column. The index has to be in the range . |
- Returns
- Reference to the accessed value.
template<typename MT, bool SO>
Conversion operator for non-constant matrices.
- Returns
- Reference of the actual type of the matrix.
template<typename MT, bool SO>
Conversion operator for constant matrices.
- Returns
- Constant reference of the actual type of the matrix.
template<typename MT , bool SO>
Setting the minimum capacity of the sparse matrix.
- Parameters
-
nonzeros | The new minimum capacity of the sparse matrix. |
- Returns
- void
This function increases the capacity of the sparse matrix to at least nonzeros elements. The current values of the matrix elements and the individual capacities of the matrix rows are preserved.
template<typename MT , bool SO>
template<typename MT , bool SO>
Resets the matrix elements.
- Returns
- void
template<typename MT , bool SO>
Returns the current number of rows of the matrix.
- Returns
- The number of rows of the matrix.
The documentation for this class was generated from the following file: