|
|
void | convert_to (Csr< next_precision< ValueType >, IndexType > *result) const override |
| |
|
void | move_to (Csr< next_precision< ValueType >, IndexType > *result) override |
| |
| std::unique_ptr< unbatch_type > | create_view_for_item (size_type item_id) |
| | Creates a mutable view (of matrix::Csr type) of one item of the batch::matrix::Csr<value_type> object. More...
|
| |
| std::unique_ptr< const unbatch_type > | create_const_view_for_item (size_type item_id) const |
| | Creates a mutable view (of matrix::Csr type) of one item of the batch::matrix::Csr<value_type> object. More...
|
| |
| value_type * | get_values () noexcept |
| | Returns a pointer to the array of values of the matrix. More...
|
| |
| const value_type * | get_const_values () const noexcept |
| | Returns a pointer to the array of values of the matrix. More...
|
| |
| index_type * | get_col_idxs () noexcept |
| | Returns a pointer to the array of column indices of the matrix. More...
|
| |
| const index_type * | get_const_col_idxs () const noexcept |
| | Returns a pointer to the array of column indices of the matrix. More...
|
| |
| index_type * | get_row_ptrs () noexcept |
| | Returns a pointer to the array of row pointers of the matrix. More...
|
| |
| const index_type * | get_const_row_ptrs () const noexcept |
| | Returns a pointer to the array of row pointers of the matrix. More...
|
| |
| size_type | get_num_stored_elements () const noexcept |
| | Returns the number of elements explicitly stored in the batch matrix, cumulative across all the batch items. More...
|
| |
| size_type | get_num_elements_per_item () const noexcept |
| | Returns the number of stored elements in each batch item. More...
|
| |
| value_type * | get_values_for_item (size_type batch_id) noexcept |
| | Returns a pointer to the array of values of the matrix for a specific batch item. More...
|
| |
| const value_type * | get_const_values_for_item (size_type batch_id) const noexcept |
| | Returns a pointer to the array of values of the matrix for a specific batch item. More...
|
| |
| void | apply (ptr_param< const MultiVector< value_type >> b, ptr_param< MultiVector< value_type >> x) |
| | Apply the matrix to a multi-vector. More...
|
| |
| void | apply (ptr_param< const MultiVector< value_type >> alpha, ptr_param< const MultiVector< value_type >> b, ptr_param< const MultiVector< value_type >> beta, ptr_param< MultiVector< value_type >> x) |
| | Apply the matrix to a multi-vector with a linear combination of the given input vector. More...
|
| |
| void | apply (ptr_param< const MultiVector< value_type >> b, ptr_param< MultiVector< value_type >> x) const |
| |
| void | apply (ptr_param< const MultiVector< value_type >> alpha, ptr_param< const MultiVector< value_type >> b, ptr_param< const MultiVector< value_type >> beta, ptr_param< MultiVector< value_type >> x) const |
| |
| void | scale (const array< value_type > &row_scale, const array< value_type > &col_scale) |
| | Performs in-place row and column scaling for this matrix. More...
|
| |
| void | add_scaled_identity (ptr_param< const MultiVector< value_type >> alpha, ptr_param< const MultiVector< value_type >> beta) |
| | Performs the operation this = alpha*I + beta*this. More...
|
| |
| size_type | get_num_batch_items () const noexcept |
| | Returns the number of items in the batch operator. More...
|
| |
| dim< 2 > | get_common_size () const |
| | Returns the common size of the batch items. More...
|
| |
| const batch_dim< 2 > & | get_size () const noexcept |
| | Returns the size of the batch operator. More...
|
| |
|
template<typename ValueType > |
| void | validate_application_parameters (const MultiVector< ValueType > *b, MultiVector< ValueType > *x) const |
| | Validates the sizes for the apply(b,x) operation in the concrete BatchLinOp.
|
| |
|
template<typename ValueType > |
| void | validate_application_parameters (const MultiVector< ValueType > *alpha, const MultiVector< ValueType > *b, const MultiVector< ValueType > *beta, MultiVector< ValueType > *x) const |
| | Validates the sizes for the apply(alpha, b , beta, x) operation in the concrete BatchLinOp.
|
| |
|
virtual void | validate_data () const |
| | Throws gko::InvalidData exception if we found the data inside the object does not fulfill certain property up to our knowledge.
|
| |
|
PolymorphicObject & | operator= (const PolymorphicObject &) |
| |
| std::shared_ptr< const Executor > | get_executor () const noexcept |
| | Returns the Executor of the object. More...
|
| |
|
void | add_logger (std::shared_ptr< const Logger > logger) override |
| |
|
void | remove_logger (const Logger *logger) override |
| |
|
void | remove_logger (ptr_param< const Logger > logger) |
| |
|
const std::vector< std::shared_ptr< const Logger > > & | get_loggers () const override |
| |
|
void | clear_loggers () override |
| |
|
void | remove_logger (ptr_param< const Logger > logger) |
| |
| std::unique_ptr< Csr< ValueType, IndexType > > | clone (std::shared_ptr< const Executor > exec) const |
| | Creates a clone of the object. More...
|
| |
| std::unique_ptr< Csr< ValueType, IndexType > > | clone () const |
| | Creates a clone of the object. More...
|
| |
| void | convert_to (result_type *result) const override |
| | Converts the implementer to an object of type result_type. More...
|
| |
| void | move_to (result_type *result) override |
| | Converts the implementer to an object of type result_type by moving data from this object. More...
|
| |
|
std::unique_ptr< Csr< ValueType, IndexType > > | create_default () const |
| |
|
std::unique_ptr< Csr< ValueType, IndexType > > | create_default (std::shared_ptr< const Executor > exec) const |
| |
|
void | convert_to (ptr_param< result_type > result) const |
| |
|
void | move_to (ptr_param< result_type > result) |
| |
|
std::unique_ptr< Cloneable > | clone (std::shared_ptr< const Executor > exec) const |
| |
|
std::unique_ptr< Cloneable > | clone () const |
| |
|
Cloneable * | copy_from (ptr_param< const Cloneable > other) |
| |
|
Cloneable * | move_from (ptr_param< Cloneable > other) |
| |
|
std::unique_ptr< Cloneable > | create_default (std::shared_ptr< const Executor > exec) const |
| |
|
std::unique_ptr< Cloneable > | create_default () const |
| |
| virtual void | convert_to (result_type *result) const=0 |
| | Converts the implementer to an object of type result_type. More...
|
| |
|
void | convert_to (ptr_param< result_type > result) const |
| |
| virtual void | move_to (result_type *result)=0 |
| | Converts the implementer to an object of type result_type by moving data from this object. More...
|
| |
|
void | move_to (ptr_param< result_type > result) |
| |
|
| static std::unique_ptr< Csr > | create (std::shared_ptr< const Executor > exec, const batch_dim< 2 > &size=batch_dim< 2 >{}, size_type num_nonzeros_per_item={}) |
| | Creates an uninitialized Csr matrix of the specified size. More...
|
| |
| static std::unique_ptr< Csr > | create (std::shared_ptr< const Executor > exec, const batch_dim< 2 > &size, array< value_type > values, array< index_type > col_idxs, array< index_type > row_ptrs) |
| | Creates a Csr matrix from an already allocated (and initialized) array. More...
|
| |
| template<typename InputValueType , typename ColIndexType , typename RowPtrType > |
| static std::unique_ptr< Csr > | create (std::shared_ptr< const Executor > exec, const batch_dim< 2 > &size, std::initializer_list< InputValueType > values, std::initializer_list< ColIndexType > col_idxs, std::initializer_list< RowPtrType > row_ptrs) |
| | create(std::shared_ptr<const Executor>, More...
|
| |
| static std::unique_ptr< const Csr > | create_const (std::shared_ptr< const Executor > exec, const batch_dim< 2 > &sizes, gko::detail::const_array_view< value_type > &&values, gko::detail::const_array_view< index_type > &&col_idxs, gko::detail::const_array_view< index_type > &&row_ptrs) |
| | Creates a constant (immutable) batch csr matrix from a constant array. More...
|
| |
template<typename ValueType = default_precision, typename IndexType = int32>
class gko::batch::matrix::Csr< ValueType, IndexType >
Csr is a general sparse matrix format that stores the column indices for each nonzero entry and a cumulative sum of the number of nonzeros in each row.
It is one of the most popular sparse matrix formats due to its versatility and ability to store a wide range of sparsity patterns in an efficient fashion.
- Note
- It is assumed that the sparsity pattern of all the items in the batch is the same and therefore only a single copy of the sparsity pattern is stored.
-
Currently only IndexType of int32 is supported.
- Template Parameters
-
| ValueType | value precision of matrix elements |
| IndexType | index precision of matrix elements |