A block-Jacobi preconditioner is a block-diagonal linear operator, obtained by inverting the diagonal blocks of the source operator.
More...
|
size_type | get_num_blocks () const noexcept |
| Returns the number of blocks of the operator. More...
|
|
const block_interleaved_storage_scheme< index_type > & | get_storage_scheme () const noexcept |
| Returns the storage scheme used for storing Jacobi blocks. More...
|
|
const value_type * | get_blocks () const noexcept |
| Returns the pointer to the memory used for storing the block data. More...
|
|
const remove_complex< value_type > * | get_conditioning () const noexcept |
| Returns an array of 1-norm condition numbers of the blocks. More...
|
|
size_type | get_num_stored_elements () const noexcept |
| Returns the number of elements explicitly stored in the matrix. More...
|
|
void | convert_to (matrix::Dense< value_type > *result) const override |
| Converts the implementer to an object of type result_type. More...
|
|
void | move_to (matrix::Dense< value_type > *result) override |
| Converts the implementer to an object of type result_type by moving data from this object. More...
|
|
void | write (mat_data &data) const override |
| Writes a matrix to a matrix_data structure. More...
|
|
const parameters_type & | get_parameters () const |
|
const Jacobi< ValueType, IndexType > * | apply (const LinOp *b, LinOp *x) const |
|
Jacobi< ValueType, IndexType > * | apply (const LinOp *b, LinOp *x) |
|
const Jacobi< ValueType, IndexType > * | apply (const LinOp *alpha, const LinOp *b, const LinOp *beta, LinOp *x) const |
|
Jacobi< ValueType, IndexType > * | apply (const LinOp *alpha, const LinOp *b, const LinOp *beta, LinOp *x) |
|
std::unique_ptr< Jacobi< ValueType, IndexType > > | create_default (std::shared_ptr< const Executor > exec) const |
|
std::unique_ptr< Jacobi< ValueType, IndexType > > | create_default () const |
|
std::unique_ptr< Jacobi< ValueType, IndexType > > | clone (std::shared_ptr< const Executor > exec) const |
|
std::unique_ptr< Jacobi< ValueType, IndexType > > | clone () const |
|
Jacobi< ValueType, IndexType > * | copy_from (const PolymorphicObject *other) |
|
Jacobi< ValueType, IndexType > * | copy_from (std::unique_ptr< PolymorphicObject > other) |
|
Jacobi< ValueType, IndexType > * | clear () |
|
LinOp * | apply (const LinOp *b, LinOp *x) |
| Applies a linear operator to a vector (or a sequence of vectors). More...
|
|
const LinOp * | apply (const LinOp *b, LinOp *x) const |
| Applies a linear operator to a vector (or a sequence of vectors). More...
|
|
LinOp * | apply (const LinOp *alpha, const LinOp *b, const LinOp *beta, LinOp *x) |
| Performs the operation x = alpha * op(b) + beta * x. More...
|
|
const LinOp * | apply (const LinOp *alpha, const LinOp *b, const LinOp *beta, LinOp *x) const |
| Performs the operation x = alpha * op(b) + beta * x. More...
|
|
const dim< 2 > & | get_size () const noexcept |
| Returns the size of the operator. More...
|
|
std::unique_ptr< LinOp > | create_default (std::shared_ptr< const Executor > exec) const |
|
std::unique_ptr< LinOp > | create_default () const |
|
std::unique_ptr< LinOp > | clone (std::shared_ptr< const Executor > exec) const |
|
std::unique_ptr< LinOp > | clone () const |
|
LinOp * | copy_from (const PolymorphicObject *other) |
|
LinOp * | copy_from (std::unique_ptr< PolymorphicObject > other) |
|
LinOp * | clear () |
|
PolymorphicObject & | operator= (const PolymorphicObject &) |
|
std::unique_ptr< PolymorphicObject > | create_default (std::shared_ptr< const Executor > exec) const |
| Creates a new "default" object of the same dynamic type as this object. More...
|
|
std::unique_ptr< PolymorphicObject > | create_default () const |
| Creates a new "default" object of the same dynamic type as this object. More...
|
|
std::unique_ptr< PolymorphicObject > | clone (std::shared_ptr< const Executor > exec) const |
| Creates a clone of the object. More...
|
|
std::unique_ptr< PolymorphicObject > | clone () const |
| Creates a clone of the object. More...
|
|
PolymorphicObject * | copy_from (const PolymorphicObject *other) |
| Copies another object into this object. More...
|
|
PolymorphicObject * | copy_from (std::unique_ptr< PolymorphicObject > other) |
| Moves another object into this object. More...
|
|
PolymorphicObject * | clear () |
| Transforms the object into its default state. More...
|
|
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 |
| Adds a new logger to the list of subscribed loggers. More...
|
|
void | remove_logger (const Logger *logger) override |
| Removes a logger from the list of subscribed loggers. 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...
|
|
template<typename ValueType = default_precision, typename IndexType = int32>
class gko::preconditioner::Jacobi< ValueType, IndexType >
A block-Jacobi preconditioner is a block-diagonal linear operator, obtained by inverting the diagonal blocks of the source operator.
The Jacobi class implements the inversion of the diagonal blocks using Gauss-Jordan elimination with column pivoting, and stores the inverse explicitly in a customized format.
If the diagonal blocks of the matrix are not explicitly set by the user, the implementation will try to automatically detect the blocks by first finding the natural blocks of the matrix, and then applying the supervariable agglomeration procedure on them. However, if problem-specific knowledge regarding the block diagonal structure is available, it is usually beneficial to explicitly pass the starting rows of the diagonal blocks, as the block detection is merely a heuristic and cannot perfectly detect the diagonal block structure. The current implementation supports blocks of up to 32 rows / columns.
The implementation also includes an improved, adaptive version of the block-Jacobi preconditioner, which can store some of the blocks in lower precision and thus improve the performance of preconditioner application by reducing the amount of memory transfers. This variant can be enabled by setting the Jacobi::Factory's storage_optimization
parameter. Refer to the documentation of the parameter for more details.
- Template Parameters
-
ValueType | precision of matrix elements |
IndexType | integral type used to store pointers to the start of each block |
- Note
- The current implementation supports blocks of up to 32 rows / columns.
-
When using the adaptive variant, there may be a trade-off in terms of slightly longer preconditioner generation due to extra work required to detect the optimal precision of the blocks.