![]() |
Ginkgo Generated from branch based on main. Ginkgo version 1.11.0
A numerical linear algebra library targeting many-core architectures
|
A block-Jacobi preconditioner is a block-diagonal linear operator, obtained by inverting the diagonal blocks of the source operator. More...
#include <ginkgo/core/preconditioner/jacobi.hpp>
Classes | |
| struct | parameters_type |
| class | Factory |
Public Types | |
| using | value_type = ValueType |
| using | index_type = IndexType |
| using | mat_data = matrix_data<ValueType, IndexType> |
| using | transposed_type = Jacobi<ValueType, IndexType> |
| Public Types inherited from gko::EnablePolymorphicAssignment< Jacobi< default_precision, int32 > > | |
| using | result_type |
| Public Types inherited from gko::WritableToMatrixData< default_precision, int32 > | |
| using | value_type |
| using | index_type |
Public Member Functions | |
| size_type | get_num_blocks () const noexcept |
| Returns the number of blocks of the operator. | |
| const block_interleaved_storage_scheme< index_type > & | get_storage_scheme () const noexcept |
| Returns the storage scheme used for storing Jacobi blocks. | |
| const value_type * | get_blocks () const noexcept |
| Returns the pointer to the memory used for storing the block data. | |
| const remove_complex< value_type > * | get_conditioning () const noexcept |
| Returns an array of 1-norm condition numbers of the blocks. | |
| size_type | get_num_stored_elements () const noexcept |
| Returns the number of elements explicitly stored in the matrix. | |
| void | convert_to (matrix::Dense< value_type > *result) const override |
| void | move_to (matrix::Dense< value_type > *result) 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. | |
| Jacobi & | operator= (const Jacobi &other) |
| Copy-assigns a Jacobi preconditioner. | |
| Jacobi & | operator= (Jacobi &&other) |
| Move-assigns a Jacobi preconditioner. | |
| Jacobi (const Jacobi &other) | |
| Copy-constructs a Jacobi preconditioner. | |
| Jacobi (Jacobi &&other) | |
| Move-assigns a Jacobi preconditioner. | |
| const parameters_type & | get_parameters () const |
| Public Member Functions inherited from gko::EnableLinOp< Jacobi< default_precision, int32 > > | |
| const Jacobi< default_precision, int32 > * | apply (ptr_param< const LinOp > b, ptr_param< LinOp > x) const |
| Public Member Functions inherited from gko::EnablePolymorphicAssignment< Jacobi< default_precision, int32 > > | |
| void | convert_to (result_type *result) const override |
| void | move_to (result_type *result) override |
| 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. | |
Static Public Member Functions | |
| static auto | build () -> decltype(Factory::create()) |
| static parameters_type | parse (const config::pnode &config, const config::registry &context, const config::type_descriptor &td_for_child=config::make_type_descriptor< ValueType, IndexType >()) |
| Create the parameters from the property_tree. | |
Friends | |
| class | EnableLinOp< Jacobi > |
| class | EnablePolymorphicObject< Jacobi, LinOp > |
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.
| ValueType | precision of matrix elements |
| IndexType | integral type used to store pointers to the start of each block |
| gko::preconditioner::Jacobi< ValueType, IndexType >::Jacobi | ( | const Jacobi< ValueType, IndexType > & | other | ) |
Copy-constructs a Jacobi preconditioner.
Inherits executor, copies all data and parameters.
| gko::preconditioner::Jacobi< ValueType, IndexType >::Jacobi | ( | Jacobi< ValueType, IndexType > && | other | ) |
Move-assigns a Jacobi preconditioner.
Inherits executor, moves all data and parameters. The moved-from object will be empty (0x0 and default parameters).
|
overridevirtual |
Returns a LinOp representing the conjugate transpose of the Transposable object.
Implements gko::Transposable.
|
inlinenoexcept |
Returns the pointer to the memory used for storing the block data.
Element (i, j) of block b is stored in position (get_block_pointers()[b] + i) * stride + j of the array.
|
inlinenoexcept |
Returns an array of 1-norm condition numbers of the blocks.
|
inlinenoexcept |
Returns the number of blocks of the operator.
|
inlinenoexcept |
Returns the number of elements explicitly stored in the matrix.
|
inlinenoexcept |
| Jacobi & gko::preconditioner::Jacobi< ValueType, IndexType >::operator= | ( | const Jacobi< ValueType, IndexType > & | other | ) |
Copy-assigns a Jacobi preconditioner.
Preserves executor, copies all data and parameters.
| Jacobi & gko::preconditioner::Jacobi< ValueType, IndexType >::operator= | ( | Jacobi< ValueType, IndexType > && | other | ) |
Move-assigns a Jacobi preconditioner.
Preserves executor, moves all data and parameters. The moved-from object will be empty (0x0 and default parameters).
|
static |
Create the parameters from the property_tree.
Because this is directly tied to the specific type, the value/index type settings within config are ignored and type_descriptor is only used for children configs.
| config | the property tree for setting |
| context | the registry |
| td_for_child | the type descriptor for children configs. The default uses the value/index type of this class. |
|
overridevirtual |
Returns a LinOp representing the transpose of the Transposable object.
Implements gko::Transposable.