pub fn gmres_with_absolute_tolerance<T, F>(
apply_a: F,
b: &T,
x0: &T,
options: &GmresOptions,
atol: f64,
) -> Result<GmresResult<T>, KrylovError>Expand description
Solve A x = b using GMRES with an absolute residual tolerance.
A zero-norm RHS returns the zero vector rather than the initial guess.
This variant stops when ||b - A*x|| < atol. The default gmres API uses
relative residual tolerance and is preferred for scale-independent solves.
§Errors
Returns an error when max_iter needs a Krylov workspace whose capacity
overflows or cannot be allocated (a KrylovError::InvalidOptions), when the operator and vectors have
incompatible shapes, when the affine coefficients are all zero (a
KrylovError::NoAffineCoefficient for affine solves), or when an
underlying tensor or backend operation fails (a KrylovError::Operation).
Non-convergence is reported through the result’s converged flag and does
not produce an error.
A right-hand side whose norm is not finite, which would make every relative
residual zero, is a KrylovError::NumericalBreakdown.