Skip to main content

conjugate_gradient

Function conjugate_gradient 

Source
pub fn conjugate_gradient<A: Fn(&[f64]) -> Vec<f64>>(
    apply: A,
    b: &[f64],
    tolerance: f64,
    max_iterations: usize,
) -> Result<Vec<f64>, ErrorsJSL>
Expand description

Conjugate gradients for a symmetric positive-definite operator apply, from zero, to the relative residual tolerance. If max_iterations is reached first, a solution whose residual is within a factor 1000 of the target is still returned (rounding often stalls the last digits); otherwise the result is an error.