Function conjugate_gradient

Source
pub fn conjugate_gradient(
    a: &SparseMatrix,
    b: &[f64],
    initial: Option<&[f64]>,
    options: ConjugateGradientOptions,
) -> NumericResult<ConjugateGradientSolution>
Expand description

Solve A x = b for a symmetric positive definite sparse A by the Jacobi-preconditioned conjugate-gradient method, starting from initial (zero when None).

A run that exhausts its budget still returns its last iterate and residual with Status::BudgetExhausted; call ConjugateGradientSolution::converged to refuse it. A zero b returns the exact zero solution without iterating.

ยงErrors