Ginkgo  Generated from pipelines/2837190956 branch based on develop. Ginkgo version 2.0.0
A numerical linear algebra library targeting many-core architectures
Classes | Public Types | Public Member Functions | Static Public Member Functions | List of all members
gko::stop::ImplicitResidualNorm< ValueType > Class Template Reference

Stopping criterion based on a solver-maintained squared residual-norm estimate \( \rho_k^2 \approx \| r_k \|^2 \). More...

#include <ginkgo/core/stop/residual_norm.hpp>

Inheritance diagram for gko::stop::ImplicitResidualNorm< ValueType >:
[legend]
Collaboration diagram for gko::stop::ImplicitResidualNorm< ValueType >:
[legend]

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_typeget_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.
 
PolymorphicObjectoperator= (const PolymorphicObject &)
 
std::shared_ptr< const Executorget_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())
 

Detailed Description

template<typename ValueType = default_precision>
class gko::stop::ImplicitResidualNorm< ValueType >

Stopping criterion based on a solver-maintained squared residual-norm estimate \( \rho_k^2 \approx \| r_k \|^2 \).

Several Krylov methods (CG, BiCGSTAB, …) already compute this quantity per iteration as a by-product of their inner-product recurrences, so the criterion can check convergence without computing a norm of its own — saving the global reduction the explicit ResidualNorm form needs when the solver only passes \( r_k \). The iteration halts once \( \rho_k \le \tau \cdot \beta \), with the same reduction_factor and baseline factory parameters as ResidualNorm:

Because \( \rho_k^2 \) is updated by short recurrences rather than recomputed from \( b - A x_k \) each step, it can drift from the true residual norm on long runs in finite precision; pair this criterion with an Iteration cap when that matters.

Note
The solver must pass the squared estimate through Updater::implicit_sq_residual_norm on every check — there is no fallback path. If it is missing, ::gko::NotSupported() is thrown at check time.
Baseline prerequisites at construction time mirror ResidualNorm:
  • mode::rhs_norm requires \( b \).
  • mode::initial_resnorm requires either \( r_0 \) explicitly or the triple \( (A, b, x_0) \) to derive it.
  • mode::absolute requires \( b \) for sizing the per-RHS baseline. If the required arguments are missing, ::gko::NotSupported() is thrown.

The documentation for this class was generated from the following file: