gko::stop::ResidualNorm#
Residual-norm tolerance criteria. The baseline factory parameter
picks how the threshold is interpreted (relative to the right-hand
side, relative to the initial residual, or absolute); see the class
docstring for the three modes.
Two flavours:
ResidualNorm: tests the residual \(\|r_k\|_2 = \|b - A x_k\|_2\). The norm comes from the residual vector or residual norm that the solver passes to the criterion; when the solver passes neither (MINRES, Multigrid), the criterion evaluates \(b - A x_k\) with a matrix-vector product.ImplicitResidualNorm: uses the squared residual-norm estimate the solver maintains internally (typically an inner product that is already computed each iteration). For CG-type solvers this saves the global reduction that the norm of the residual vector needs, and it never needs a matrix-vector product, at the cost of a quantity that can drift from the true residual norm on long runs.
-
template<typename ValueType = default_precision>
class ResidualNorm # Inherits from
public gko::stop::ResidualNormBase<default_precision>
The ResidualNorm class is a stopping criterion which stops the iteration process when the actual residual norm is below a certain threshold relative to
the norm of the right-hand side, norm(residual) $\leq$ < threshold * norm(right_hand_side).
the initial residual, norm(residual) $\leq$ threshold * norm(initial_residual).
one, norm(residual) $\leq$ threshold.
For better performance, the checks are run on the executor where the algorithm is executed.
Note
To use this stopping criterion there are some dependencies. The constructor depends on either
bor theinitial_residualin order to compute their norms. If this is not correctly provided, an exception ::gko::NotSupported() is thrown.-
struct parameters_type#
-
template<typename ValueType = default_precision>
class ImplicitResidualNorm # Inherits from
public gko::stop::ResidualNormBase<default_precision>
The ImplicitResidualNorm class is a stopping criterion which stops the iteration process when the implicit residual norm is below a certain threshold relative to
the norm of the right-hand side, implicit_resnorm $\leq$ < threshold * norm(right_hand_side)
the initial residual, implicit_resnorm $\leq$ threshold * norm(initial_residual) .
one, implicit_resnorm $\leq$ threshold.
Note
To use this stopping criterion there are some dependencies. The constructor depends on either
bor theinitial_residualin order to compute their norms. If this is not correctly provided, an exception ::gko::NotSupported() is thrown.-
struct parameters_type#
-
template<typename ValueType>
class ResidualNormBase # Inherits from
public gko::EnablePolymorphicObject<ResidualNormBase<ValueType>, Criterion>
The ResidualNormBase class provides a framework for stopping criteria related to the residual norm. These criteria differ in the way they initialize starting_tau_, so in the value they compare the residual norm against. The provided check_impl uses the actual residual to check for convergence.