![]() |
Ginkgo
Generated from pipelines/2837190956 branch based on develop. Ginkgo version 2.0.0
A numerical linear algebra library targeting many-core architectures
|
Stopping criterion based on the explicit residual norm \( \| r_k \| = \| b - A x_k \| \). More...
#include <ginkgo/core/stop/residual_norm.hpp>
Classes | |
| class | Factory |
| struct | parameters_type |
Public Types | |
| using | ComplexVector = matrix::Dense< to_complex< ValueType > > |
| using | NormVector = matrix::Dense< remove_complex< ValueType > > |
| using | Vector = matrix::Dense< ValueType > |
Public Member Functions | |
| const parameters_type & | get_parameters () const |
Public Member Functions inherited from gko::stop::Criterion | |
| Updater | update () |
| Returns the updater object. More... | |
| bool | check (uint8 stopping_id, bool set_finalized, array< stopping_status > *stop_status, bool *one_changed, const Updater &updater) |
| This checks whether convergence was reached for a certain criterion. More... | |
Public Member Functions inherited from gko::PolymorphicObject | |
| 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... | |
Public Member Functions inherited from gko::log::EnableLogging< PolymorphicObject > | |
| 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 |
Public Member Functions inherited from gko::log::Loggable | |
| void | remove_logger (ptr_param< const Logger > logger) |
Static Public Member Functions | |
| static auto | build () -> decltype(Factory ::create()) |
Stopping criterion based on the explicit residual norm \( \| r_k \| = \| b - A x_k \| \).
The iteration halts once \( \| r_k \| \le \tau \cdot \beta \), where \(\tau\) is the factory parameter reduction_factor and the baseline \(\beta\) is selected by the baseline factory parameter:
mode::rhs_norm (default) — relative to the right-hand side: \( \beta = \| b \| \), so the condition is \( \| r_k \| \le \tau \| b \| \).mode::initial_resnorm — relative to the initial residual: \( \beta = \| r_0 \| \), so the condition is \( \| r_k \| \le \tau \| r_0 \| \).mode::absolute — absolute threshold: \( \beta = 1 \), so the condition is \( \| r_k \| \le \tau \).Per-iteration, the criterion prefers a pre-computed residual norm passed by the solver (via Updater::residual_norm); otherwise it falls back to computing the 2-norm of the residual vector itself (via Updater::residual), which costs one global reduction. When even cheaper checks are needed and the solver maintains an internal squared-norm estimate, use ImplicitResidualNorm instead.
mode::rhs_norm requires the right-hand side \( b \).mode::initial_resnorm requires either the initial residual \( r_0 \) explicitly, or the triple \( (A, b, x_0) \) from which it is computed as \( r_0 = b - A x_0 \).mode::absolute requires \( b \) as well — to determine the number of right-hand sides; its baseline is then filled with ones. If the required arguments are missing, ::gko::NotSupported() is thrown.
1.8.16