pub fn gmres_affine<T, F>(
apply_a: F,
b: &T,
x0: &T,
a0: AnyScalar,
a1: AnyScalar,
options: &GmresOptions,
) -> Result<GmresResult<T>, KrylovError>Expand description
Solve (a0 I + a1 A) x = b using GMRES with relative residual tolerance.
The Arnoldi basis is built from the unshifted A callback, while affine
coefficients are applied in the projected Hessenberg problem, matching
KrylovKit’s affine linear-solve convention.
§Errors
Returns KrylovError::InvalidOptions when an option is invalid,
KrylovError::NoAffineCoefficient when both affine coefficients are zero,
and KrylovError::Operation when the operator application, vector-space
arithmetic, or a backend call fails. Non-convergence is reported through the
result’s converged flag and does not produce an error.