Skip to main content

least_squares_cgnr

Function least_squares_cgnr 

Source
pub fn least_squares_cgnr(
    a: &SparseMatrix,
    b: &[f64],
    tolerance: f64,
    max_iterations: usize,
) -> Option<Vec<f64>>
Expand description

Minimize ‖A·x − b‖ by conjugate gradient on the normal equations, from zero, so a rank-deficient system yields the minimum-norm least-squares solution. Convergence is declared when the gradient ‖Aᵀ(b − A·x)‖ falls to tolerance relative to ‖Aᵀb‖; None means the iteration budget ran out before that happened.

§Panics

If b is not rows long.