![]() |
Ginkgo Generated from branch based on main. Ginkgo version 1.11.0
A numerical linear algebra library targeting many-core architectures
|
CSR is a matrix format which stores only the nonzero coefficients by compressing each row of the matrix (compressed sparse row format). More...
#include <ginkgo/core/matrix/csr.hpp>
Classes | |
| class | strategy_type |
| strategy_type is to decide how to set the csr algorithm. More... | |
| class | classical |
| classical is a strategy_type which uses the same number of threads on each row. More... | |
| class | merge_path |
| merge_path is a strategy_type which uses the merge_path algorithm. More... | |
| class | cusparse |
| cusparse is a strategy_type which uses the sparselib csr. More... | |
| class | sparselib |
| sparselib is a strategy_type which uses the sparselib csr. More... | |
| class | load_balance |
| load_balance is a strategy_type which uses the load balance algorithm. More... | |
| class | automatical |
| class | multiply_reuse_info |
| Class describing the internal lookup structures created by multiply_reuse(const Csr*) to recompute a sparse matrix-matrix product with updated values. More... | |
| class | multiply_add_reuse_info |
| Class describing the internal lookup structures created by multiply_add_reuse to recompute a sparse matrix-matrix product with updated values. More... | |
| class | scale_add_reuse_info |
| Class describing the internal lookup structures created by scale_add_reuse to recompute a sparse matrix-matrix sum with updated values. More... | |
| struct | permuting_reuse_info |
| A struct describing a transformation of the matrix that reorders the values of the matrix into the transformed matrix. More... | |
Public Types | |
| using | value_type = ValueType |
| using | index_type = IndexType |
| using | transposed_type = Csr<ValueType, IndexType> |
| using | mat_data = matrix_data<ValueType, IndexType> |
| using | device_mat_data = device_matrix_data<ValueType, IndexType> |
| using | absolute_type = remove_complex<Csr> |
| Public Types inherited from gko::EnablePolymorphicAssignment< Csr< default_precision, int32 > > | |
| using | result_type |
| Public Types inherited from gko::DiagonalExtractable< default_precision > | |
| using | value_type |
| Public Types inherited from gko::ReadableFromMatrixData< default_precision, int32 > | |
| using | value_type |
| using | index_type |
| Public Types inherited from gko::WritableToMatrixData< default_precision, int32 > | |
| using | value_type |
| using | index_type |
| Public Types inherited from gko::EnableAbsoluteComputation< remove_complex< Csr< default_precision, int32 > > > | |
| using | absolute_type |
Public Member Functions | |
| void | convert_to (Csr< next_precision< ValueType >, IndexType > *result) const override |
| void | move_to (Csr< next_precision< ValueType >, IndexType > *result) override |
| void | convert_to (Dense< ValueType > *other) const override |
| void | move_to (Dense< ValueType > *other) override |
| void | convert_to (Coo< ValueType, IndexType > *result) const override |
| void | move_to (Coo< ValueType, IndexType > *result) override |
| void | convert_to (Ell< ValueType, IndexType > *result) const override |
| void | move_to (Ell< ValueType, IndexType > *result) override |
| void | convert_to (Fbcsr< ValueType, IndexType > *result) const override |
| void | move_to (Fbcsr< ValueType, IndexType > *result) override |
| void | convert_to (Hybrid< ValueType, IndexType > *result) const override |
| void | move_to (Hybrid< ValueType, IndexType > *result) override |
| void | convert_to (Sellp< ValueType, IndexType > *result) const override |
| void | move_to (Sellp< ValueType, IndexType > *result) override |
| void | convert_to (SparsityCsr< ValueType, IndexType > *result) const override |
| void | move_to (SparsityCsr< ValueType, IndexType > *result) override |
| void | read (const mat_data &data) override |
| void | read (const device_mat_data &data) override |
| void | read (device_mat_data &&data) override |
| void | write (mat_data &data) const override |
| std::unique_ptr< LinOp > | transpose () const override |
| Returns a LinOp representing the transpose of the Transposable object. | |
| std::unique_ptr< LinOp > | conj_transpose () const override |
| Returns a LinOp representing the conjugate transpose of the Transposable object. | |
| std::unique_ptr< Csr > | multiply (ptr_param< const Csr > other) const |
| Computes the sparse matrix product this * other on the executor of this matrix. | |
| std::pair< std::unique_ptr< Csr >, multiply_reuse_info > | multiply_reuse (ptr_param< const Csr > other) const |
| Computes the sparse matrix product this * other on the executor of this matrix, and necessary data for value updates: | |
| std::unique_ptr< Csr > | multiply_add (ptr_param< const Dense< value_type > > scale_mult, ptr_param< const Csr > mtx_mult, ptr_param< const Dense< value_type > > scale_add, ptr_param< const Csr > mtx_add) const |
| Computes the sparse matrix product scale_mult * this * mtx_mult + scale_add * mtx_add on the executor of this matrix. | |
| std::pair< std::unique_ptr< Csr >, multiply_add_reuse_info > | multiply_add_reuse (ptr_param< const Dense< value_type > > scale_mult, ptr_param< const Csr > mtx_mult, ptr_param< const Dense< value_type > > scale_add, ptr_param< const Csr > mtx_add) const |
| Computes the sparse matrix product scale_mult * this * mtx_mult + scale_add * mtx_add on the executor of this matrix, and necessary data for value updates: | |
| std::unique_ptr< Csr > | scale_add (ptr_param< const Dense< value_type > > scale_this, ptr_param< const Dense< value_type > > scale_other, ptr_param< const Csr > mtx_other) const |
| Computes the sparse matrix sum scale_this * this + scale_other * mtx_add on the executor of this matrix. | |
| std::pair< std::unique_ptr< Csr >, scale_add_reuse_info > | add_scale_reuse (ptr_param< const Dense< value_type > > scale_this, ptr_param< const Dense< value_type > > scale_other, ptr_param< const Csr > mtx_other) const |
| Computes the sparse matrix sum scale_this * this + scale_other * mtx_add on the executor of this matrix, and necessary data for value updates: | |
| std::pair< std::unique_ptr< Csr >, permuting_reuse_info > | transpose_reuse () const |
| Computes the necessary data to update a transposed matrix from its original matrix. | |
| std::unique_ptr< Csr > | permute (ptr_param< const Permutation< index_type > > permutation, permute_mode mode=permute_mode::symmetric) const |
| Creates a permuted copy | |
| std::unique_ptr< Csr > | permute (ptr_param< const Permutation< index_type > > row_permutation, ptr_param< const Permutation< index_type > > column_permutation, bool invert=false) const |
| Creates a non-symmetrically permuted copy | |
| std::pair< std::unique_ptr< Csr >, permuting_reuse_info > | permute_reuse (ptr_param< const Permutation< index_type > > permutation, permute_mode mode=permute_mode::symmetric) const |
| Computes the operations necessary to propagate changed values from a matrix A to a permuted matrix. | |
| std::pair< std::unique_ptr< Csr >, permuting_reuse_info > | permute_reuse (ptr_param< const Permutation< index_type > > row_permutation, ptr_param< const Permutation< index_type > > column_permutation, bool invert=false) const |
| Computes the operations necessary to propagate changed values from a matrix A to a permuted matrix. | |
| std::unique_ptr< Csr > | scale_permute (ptr_param< const ScaledPermutation< value_type, index_type > > permutation, permute_mode=permute_mode::symmetric) const |
| Creates a scaled and permuted copy of this matrix. | |
| std::unique_ptr< Csr > | scale_permute (ptr_param< const ScaledPermutation< value_type, index_type > > row_permutation, ptr_param< const ScaledPermutation< value_type, index_type > > column_permutation, bool invert=false) const |
| Creates a scaled and permuted copy of this matrix. | |
| std::unique_ptr< LinOp > | permute (const array< IndexType > *permutation_indices) const override |
| std::unique_ptr< LinOp > | inverse_permute (const array< IndexType > *inverse_permutation_indices) const override |
| std::unique_ptr< LinOp > | row_permute (const array< IndexType > *permutation_indices) const override |
| std::unique_ptr< LinOp > | column_permute (const array< IndexType > *permutation_indices) const override |
| std::unique_ptr< LinOp > | inverse_row_permute (const array< IndexType > *inverse_permutation_indices) const override |
| std::unique_ptr< LinOp > | inverse_column_permute (const array< IndexType > *inverse_permutation_indices) const override |
| std::unique_ptr< Diagonal< ValueType > > | extract_diagonal () const override |
| Extracts the diagonal entries of the matrix into a vector. | |
| std::unique_ptr< absolute_type > | compute_absolute () const override |
| Gets the AbsoluteLinOp. | |
| void | compute_absolute_inplace () override |
| Compute absolute inplace on each element. | |
| void | sort_by_column_index () |
| Sorts all (value, col_idx) pairs in each row by column index. | |
| bool | is_sorted_by_column_index () const |
| value_type * | get_values () noexcept |
| Returns the values of the matrix. | |
| const value_type * | get_const_values () const noexcept |
| Returns the values of the matrix. | |
| std::unique_ptr< Dense< ValueType > > | create_value_view () |
| Creates a Dense view of the value array of this matrix as a column vector of dimensions nnz x 1. | |
| std::unique_ptr< const Dense< ValueType > > | create_const_value_view () const |
| Creates a const Dense view of the value array of this matrix as a column vector of dimensions nnz x 1. | |
| index_type * | get_col_idxs () noexcept |
| Returns the column indexes of the matrix. | |
| const index_type * | get_const_col_idxs () const noexcept |
| Returns the column indexes of the matrix. | |
| index_type * | get_row_ptrs () noexcept |
| Returns the row pointers of the matrix. | |
| const index_type * | get_const_row_ptrs () const noexcept |
| Returns the row pointers of the matrix. | |
| index_type * | get_srow () noexcept |
| Returns the starting rows. | |
| const index_type * | get_const_srow () const noexcept |
| Returns the starting rows. | |
| size_type | get_num_srow_elements () const noexcept |
| Returns the number of the srow stored elements (involved warps). | |
| size_type | get_num_stored_elements () const noexcept |
| Returns the number of elements explicitly stored in the matrix. | |
| std::shared_ptr< strategy_type > | get_strategy () const noexcept |
| Returns the strategy. | |
| void | set_strategy (std::shared_ptr< strategy_type > strategy) |
| Set the strategy. | |
| void | scale (ptr_param< const LinOp > alpha) |
| Scales the matrix with a scalar. | |
| void | inv_scale (ptr_param< const LinOp > alpha) |
| Scales the matrix with the inverse of a scalar. | |
| std::unique_ptr< Csr< ValueType, IndexType > > | create_submatrix (const index_set< IndexType > &row_index_set, const index_set< IndexType > &column_index_set) const |
| Creates a submatrix from this Csr matrix given row and column index_set objects. | |
| std::unique_ptr< Csr< ValueType, IndexType > > | create_submatrix (const span &row_span, const span &column_span) const |
| Creates a submatrix from this Csr matrix given row and column spans. | |
| Csr & | operator= (const Csr &) |
| Copy-assigns a Csr matrix. | |
| Csr & | operator= (Csr &&) |
| Move-assigns a Csr matrix. | |
| Csr (const Csr &) | |
| Copy-constructs a Csr matrix. | |
| Csr (Csr &&) | |
| Move-constructs a Csr matrix. | |
| Public Member Functions inherited from gko::EnableLinOp< Csr< default_precision, int32 > > | |
| const Csr< default_precision, int32 > * | apply (ptr_param< const LinOp > b, ptr_param< LinOp > x) const |
| Public Member Functions inherited from gko::EnablePolymorphicAssignment< Csr< default_precision, int32 > > | |
| void | convert_to (result_type *result) const override |
| void | move_to (result_type *result) override |
| Public Member Functions inherited from gko::DiagonalExtractable< default_precision > | |
| std::unique_ptr< LinOp > | extract_diagonal_linop () const override |
| Extracts the diagonal entries of the matrix into a vector. | |
| Public Member Functions inherited from gko::ReadableFromMatrixData< default_precision, int32 > | |
| virtual void | read (const matrix_data< default_precision, int32 > &data)=0 |
| Reads a matrix from a matrix_data structure. | |
| Public Member Functions inherited from gko::WritableToMatrixData< default_precision, int32 > | |
| virtual void | write (matrix_data< default_precision, int32 > &data) const=0 |
| Writes a matrix to a matrix_data structure. | |
| Public Member Functions inherited from gko::Permutable< int32 > | |
| virtual std::unique_ptr< LinOp > | permute (const array< int32 > *permutation_indices) const |
| Returns a LinOp representing the symmetric row and column permutation of the Permutable object. | |
| virtual std::unique_ptr< LinOp > | inverse_permute (const array< int32 > *permutation_indices) const |
| Returns a LinOp representing the symmetric inverse row and column permutation of the Permutable object. | |
| virtual std::unique_ptr< LinOp > | row_permute (const array< int32 > *permutation_indices) const=0 |
| Returns a LinOp representing the row permutation of the Permutable object. | |
| virtual std::unique_ptr< LinOp > | column_permute (const array< int32 > *permutation_indices) const=0 |
| Returns a LinOp representing the column permutation of the Permutable object. | |
| virtual std::unique_ptr< LinOp > | inverse_row_permute (const array< int32 > *permutation_indices) const=0 |
| Returns a LinOp representing the row permutation of the inverse permuted object. | |
| virtual std::unique_ptr< LinOp > | inverse_column_permute (const array< int32 > *permutation_indices) const=0 |
| Returns a LinOp representing the row permutation of the inverse permuted object. | |
| Public Member Functions inherited from gko::EnableAbsoluteComputation< remove_complex< Csr< default_precision, int32 > > > | |
| std::unique_ptr< LinOp > | compute_absolute_linop () const override |
| Gets the absolute LinOp. | |
| Public Member Functions inherited from gko::ScaledIdentityAddable | |
| void | add_scaled_identity (ptr_param< const LinOp > const a, ptr_param< const LinOp > const b) |
| Scales this and adds another scalar times the identity to it. | |
Static Public Member Functions | |
| static std::unique_ptr< Csr > | create (std::shared_ptr< const Executor > exec, std::shared_ptr< strategy_type > strategy) |
| Creates an uninitialized CSR matrix of the specified size. | |
| static std::unique_ptr< Csr > | create (std::shared_ptr< const Executor > exec, const dim< 2 > &size={}, size_type num_nonzeros={}, std::shared_ptr< strategy_type > strategy=nullptr) |
| Creates an uninitialized CSR matrix of the specified size. | |
| static std::unique_ptr< Csr > | create (std::shared_ptr< const Executor > exec, const dim< 2 > &size, array< value_type > values, array< index_type > col_idxs, array< index_type > row_ptrs, std::shared_ptr< strategy_type > strategy=nullptr) |
| Creates a CSR matrix from already allocated (and initialized) row pointer, column index and value arrays. | |
| template<typename InputValueType, typename InputColumnIndexType, typename InputRowPtrType> | |
| static std::unique_ptr< Csr > | create (std::shared_ptr< const Executor > exec, const dim< 2 > &size, std::initializer_list< InputValueType > values, std::initializer_list< InputColumnIndexType > col_idxs, std::initializer_list< InputRowPtrType > row_ptrs) |
| create(std::shared_ptr<const Executor>,const dim<2>&, array<value_type>, array<index_type>, array<index_type>) | |
| static std::unique_ptr< const Csr > | create_const (std::shared_ptr< const Executor > exec, const dim< 2 > &size, gko::detail::const_array_view< ValueType > &&values, gko::detail::const_array_view< IndexType > &&col_idxs, gko::detail::const_array_view< IndexType > &&row_ptrs, std::shared_ptr< strategy_type > strategy=nullptr) |
| Creates a constant (immutable) Csr matrix from a set of constant arrays. | |
CSR is a matrix format which stores only the nonzero coefficients by compressing each row of the matrix (compressed sparse row format).
The nonzero elements are stored in a 1D array row-wise, and accompanied with a row pointer array which stores the starting index of each row. An additional column index array is used to identify the column of each nonzero element.
The Csr LinOp supports different operations:
Both the SpGEMM and SpGEAM operation require the input matrices to be sorted by column index, otherwise the algorithms will produce incorrect results.
| ValueType | precision of matrix elements |
| IndexType | precision of matrix indexes |
| gko::matrix::Csr< ValueType, IndexType >::Csr | ( | const Csr< ValueType, IndexType > & | ) |
Copy-constructs a Csr matrix.
Inherits executor, strategy and data.
| gko::matrix::Csr< ValueType, IndexType >::Csr | ( | Csr< ValueType, IndexType > && | ) |
| std::pair< std::unique_ptr< Csr >, scale_add_reuse_info > gko::matrix::Csr< ValueType, IndexType >::add_scale_reuse | ( | ptr_param< const Dense< value_type > > | scale_this, |
| ptr_param< const Dense< value_type > > | scale_other, | ||
| ptr_param< const Csr< ValueType, IndexType > > | mtx_other ) const |
Computes the sparse matrix sum scale_this * this + scale_other * mtx_add on the executor of this matrix, and necessary data for value updates:
This matrix needs to be sorted by column index, otherwise the result will be incorrect.
| scale_this | the scalar by which this matrix will be scaled. |
| scale_other | the scalar by which this matrix will be scaled. |
| mtx_other | the matrix which will be added to this, scaled by scale_other. It needs to be sorted by column index, otherwise the result will be incorrect. |
|
overridevirtual |
Gets the AbsoluteLinOp.
Implements gko::EnableAbsoluteComputation< remove_complex< Csr< default_precision, int32 > > >.
|
overridevirtual |
Compute absolute inplace on each element.
Implements gko::AbsoluteComputable.
|
overridevirtual |
Returns a LinOp representing the conjugate transpose of the Transposable object.
Implements gko::Transposable.
|
static |
Creates a CSR matrix from already allocated (and initialized) row pointer, column index and value arrays.
| exec | Executor associated to the matrix |
| size | size of the matrix |
| values | array of matrix values |
| col_idxs | array of column indexes |
| row_ptrs | array of row pointers |
| strategy | the strategy the matrix uses for SpMV operations |
|
inlinestatic |
create(std::shared_ptr<const Executor>,const dim<2>&, array<value_type>, array<index_type>, array<index_type>)
create(std::shared_ptr<const Executor>,const dim<2>&, array<value_type>, array<index_type>, array<index_type>)
|
static |
Creates an uninitialized CSR matrix of the specified size.
| exec | Executor associated to the matrix |
| size | size of the matrix |
| num_nonzeros | number of nonzeros |
| strategy | the strategy of CSR, or the default strategy if set to nullptr |
|
static |
Creates an uninitialized CSR matrix of the specified size.
| exec | Executor associated to the matrix |
| strategy | the strategy of CSR |
Referenced by gko::matrix::Csr< ValueType, IndexType >::automatical::automatical(), gko::matrix::Csr< value_type, index_type >::create(), and gko::matrix::Csr< ValueType, IndexType >::load_balance::load_balance().
|
static |
Creates a constant (immutable) Csr matrix from a set of constant arrays.
| exec | the executor to create the matrix on |
| size | the dimensions of the matrix |
| values | the value array of the matrix |
| col_idxs | the column index array of the matrix |
| row_ptrs | the row pointer array of the matrix |
| strategy | the strategy the matrix uses for SpMV operations |
| std::unique_ptr< Csr< ValueType, IndexType > > gko::matrix::Csr< ValueType, IndexType >::create_submatrix | ( | const index_set< IndexType > & | row_index_set, |
| const index_set< IndexType > & | column_index_set ) const |
Creates a submatrix from this Csr matrix given row and column index_set objects.
| row_index_set | the row index set containing the set of rows to be in the submatrix. |
| column_index_set | the col index set containing the set of columns to be in the submatrix. |
| std::unique_ptr< Csr< ValueType, IndexType > > gko::matrix::Csr< ValueType, IndexType >::create_submatrix | ( | const span & | row_span, |
| const span & | column_span ) const |
Creates a submatrix from this Csr matrix given row and column spans.
| row_span | the row span containing the contiguous set of rows to be in the submatrix. |
| column_span | the column span containing the contiguous set of columns to be in the submatrix. |
|
overridevirtual |
Extracts the diagonal entries of the matrix into a vector.
| diag | the vector into which the diagonal will be written |
Implements gko::DiagonalExtractable< default_precision >.
|
inlinenoexcept |
Returns the column indexes of the matrix.
|
inlinenoexcept |
Returns the column indexes of the matrix.
|
inlinenoexcept |
Returns the row pointers of the matrix.
|
inlinenoexcept |
Returns the starting rows.
|
inlinenoexcept |
Returns the values of the matrix.
|
inlinenoexcept |
Returns the number of the srow stored elements (involved warps).
|
inlinenoexcept |
Returns the number of elements explicitly stored in the matrix.
|
inlinenoexcept |
Returns the row pointers of the matrix.
|
inlinenoexcept |
Returns the starting rows.
|
inlinenoexcept |
Returns the strategy.
|
inlinenoexcept |
Returns the values of the matrix.
|
inline |
Scales the matrix with the inverse of a scalar.
| alpha | The entire matrix is scaled by 1 / alpha. alpha has to be a 1x1 Dense matrix. |
| std::unique_ptr< Csr > gko::matrix::Csr< ValueType, IndexType >::multiply | ( | ptr_param< const Csr< ValueType, IndexType > > | other | ) | const |
Computes the sparse matrix product this * other on the executor of this matrix.
| other | the matrix with which the product will be computed. It needs to be sorted by column indices when using OmpExecutor or DpcppExecutor for this. |
| std::unique_ptr< Csr > gko::matrix::Csr< ValueType, IndexType >::multiply_add | ( | ptr_param< const Dense< value_type > > | scale_mult, |
| ptr_param< const Csr< ValueType, IndexType > > | mtx_mult, | ||
| ptr_param< const Dense< value_type > > | scale_add, | ||
| ptr_param< const Csr< ValueType, IndexType > > | mtx_add ) const |
Computes the sparse matrix product scale_mult * this * mtx_mult + scale_add * mtx_add on the executor of this matrix.
| scale_mult | the scalar by which the matrix product will be scaled. |
| mtx_mult | the matrix with which the product will be computed. It needs to be sorted by column indices when using OmpExecutor or DpcppExecutor for this. |
| scale_add | the scalar by which the matrix mtx_add will be scaled. |
| mtx_add | the matrix which will be added to the product, scaled by scale_add. |
| std::pair< std::unique_ptr< Csr >, multiply_add_reuse_info > gko::matrix::Csr< ValueType, IndexType >::multiply_add_reuse | ( | ptr_param< const Dense< value_type > > | scale_mult, |
| ptr_param< const Csr< ValueType, IndexType > > | mtx_mult, | ||
| ptr_param< const Dense< value_type > > | scale_add, | ||
| ptr_param< const Csr< ValueType, IndexType > > | mtx_add ) const |
Computes the sparse matrix product scale_mult * this * mtx_mult + scale_add * mtx_add on the executor of this matrix, and necessary data for value updates:
| scale_mult | the scalar by which the matrix product will be scaled. |
| mtx_mult | the matrix with which the product will be computed. It needs to be sorted by column indices when using OmpExecutor or DpcppExecutor for this. |
| scale_add | the scalar by which the matrix mtx_add will be scaled. |
| mtx_add | the matrix which will be added to the product, scaled by scale_add. |
| std::pair< std::unique_ptr< Csr >, multiply_reuse_info > gko::matrix::Csr< ValueType, IndexType >::multiply_reuse | ( | ptr_param< const Csr< ValueType, IndexType > > | other | ) | const |
Computes the sparse matrix product this * other on the executor of this matrix, and necessary data for value updates:
| other | the matrix with which the product will be computed. It needs to be sorted by column indices when using OmpExecutor or DpcppExecutor for this. |
| Csr & gko::matrix::Csr< ValueType, IndexType >::operator= | ( | const Csr< ValueType, IndexType > & | ) |
Copy-assigns a Csr matrix.
Preserves executor, copies everything else.
| Csr & gko::matrix::Csr< ValueType, IndexType >::operator= | ( | Csr< ValueType, IndexType > && | ) |
| std::unique_ptr< Csr > gko::matrix::Csr< ValueType, IndexType >::permute | ( | ptr_param< const Permutation< index_type > > | permutation, |
| permute_mode | mode = permute_mode::symmetric ) const |
Creates a permuted copy 


By default, this computes a symmetric permutation (permute_mode::symmetric). For the effect of the different permutation modes, see permute_mode
| permutation | The input permutation. |
| mode | The permutation mode. If permute_mode::inverse is set, we use the inverse permutation |
| std::unique_ptr< Csr > gko::matrix::Csr< ValueType, IndexType >::permute | ( | ptr_param< const Permutation< index_type > > | row_permutation, |
| ptr_param< const Permutation< index_type > > | column_permutation, | ||
| bool | invert = false ) const |
Creates a non-symmetrically permuted copy 



The operation will compute ![$A'(i, j) = A(p[i], q[j])$](form_69.png)

![$A'(p[i], q[j]) = A(i,j)$](form_71.png)

| row_permutation | The permutation |
| column_permutation | The permutation |
| invert | If set to false, uses the input permutations, otherwise uses their inverses |
| std::pair< std::unique_ptr< Csr >, permuting_reuse_info > gko::matrix::Csr< ValueType, IndexType >::permute_reuse | ( | ptr_param< const Permutation< index_type > > | permutation, |
| permute_mode | mode = permute_mode::symmetric ) const |
Computes the operations necessary to propagate changed values from a matrix A to a permuted matrix.
The semantics of this function match those of permute(ptr_param<const Permutation<index_type>>, permute_mode). Updating values works as follows:
| permutation | The input permutation. |
| mode | The permutation mode. If permute_mode::inverse is set, we use the inverse permutation |
| std::pair< std::unique_ptr< Csr >, permuting_reuse_info > gko::matrix::Csr< ValueType, IndexType >::permute_reuse | ( | ptr_param< const Permutation< index_type > > | row_permutation, |
| ptr_param< const Permutation< index_type > > | column_permutation, | ||
| bool | invert = false ) const |
Computes the operations necessary to propagate changed values from a matrix A to a permuted matrix.
The semantics of this function match those of permute(ptr_param<const Permutation<index_type>>, ptr_param<const Permutation<index_type>>, bool). Updating values works as follows:
| row_permutation | The permutation |
| column_permutation | The permutation |
| invert | If set to false, uses the input permutations, otherwise uses their inverses |
|
inline |
Scales the matrix with a scalar.
| alpha | The entire matrix is scaled by alpha. alpha has to be a 1x1 Dense matrix. |
| std::unique_ptr< Csr > gko::matrix::Csr< ValueType, IndexType >::scale_add | ( | ptr_param< const Dense< value_type > > | scale_this, |
| ptr_param< const Dense< value_type > > | scale_other, | ||
| ptr_param< const Csr< ValueType, IndexType > > | mtx_other ) const |
Computes the sparse matrix sum scale_this * this + scale_other * mtx_add on the executor of this matrix.
This matrix needs to be sorted by column index, otherwise the result will be incorrect.
| scale_this | the scalar by which this matrix will be scaled. |
| scale_other | the scalar by which this matrix will be scaled. |
| mtx_other | the matrix which will be added to this, scaled by scale_other. It needs to be sorted by column index, otherwise the result will be incorrect. |
Referenced by gko::matrix::Csr< ValueType, IndexType >::multiply_add_reuse_info::update_values().
| std::unique_ptr< Csr > gko::matrix::Csr< ValueType, IndexType >::scale_permute | ( | ptr_param< const ScaledPermutation< value_type, index_type > > | permutation, |
| permute_mode | = permute_mode::symmetric ) const |
Creates a scaled and permuted copy of this matrix.
For an explanation of the permutation modes, see permute(ptr_param<const Permutation<index_type>>, permute_mode)
| permutation | The scaled permutation. |
| mode | The permutation mode. |
| std::unique_ptr< Csr > gko::matrix::Csr< ValueType, IndexType >::scale_permute | ( | ptr_param< const ScaledPermutation< value_type, index_type > > | row_permutation, |
| ptr_param< const ScaledPermutation< value_type, index_type > > | column_permutation, | ||
| bool | invert = false ) const |
Creates a scaled and permuted copy of this matrix.
For an explanation of the parameters, see permute(ptr_param<const Permutation<index_type>>, ptr_param<const Permutation<index_type>>, permute_mode)
| row_permutation | The scaled row permutation. |
| column_permutation | The scaled column permutation. |
| invert | If set to false, uses the input permutations, otherwise uses their inverses |
|
inline |
Set the strategy.
| strategy | the csr strategy |
|
overridevirtual |
Returns a LinOp representing the transpose of the Transposable object.
Implements gko::Transposable.
| std::pair< std::unique_ptr< Csr >, permuting_reuse_info > gko::matrix::Csr< ValueType, IndexType >::transpose_reuse | ( | ) | const |
Computes the necessary data to update a transposed matrix from its original matrix.