Skip to main content

gmres_with_absolute_tolerance

Function gmres_with_absolute_tolerance 

Source
pub fn gmres_with_absolute_tolerance<T, F>(
    apply_a: F,
    b: &T,
    x0: &T,
    options: &GmresOptions,
    atol: f64,
) -> Result<GmresResult<T>, KrylovError>
where T: TensorVectorSpace, F: Fn(&T) -> Result<T>,
Expand description

Solve A x = b using GMRES with an absolute residual tolerance. 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 the options have an overflowing capacity (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.