Skip to main content

cg

Function cg 

Source
pub fn cg(
    a: &dyn LinearOperator,
    b: &[f64],
    x0: Option<&[f64]>,
    m: Option<&dyn LinearOperator>,
    options: IterativeOptions,
) -> Result<IterativeResult>
Expand description

Conjugate gradients for symmetric positive definite A (SciPy’s cg): each step minimises the A-norm of the error over a growing Krylov subspace, with search directions that are A-conjugate. With M, the preconditioned residual z = M r replaces r in the recurrences.