fn cgsolve(
a: &mut impl FnMut(&[f64], &mut [f64]),
b: &[f64],
tol: f64,
maxiter: usize,
progress: &mut impl FnMut(usize, usize),
) -> Vec<f64>Expand description
cgsolve.m (Romberg; as modified for MEDI) from x0 = 0: conjugate gradients on A x = b,
stopping after maxiter iterations or when ||r|| / ||b|| <= tol, with the residual
recomputed from x every 50 iterations. Returns the last iterate, as cgsolve.m does.