Skip to main content

lsqr

Function lsqr 

Source
pub fn lsqr<F, G>(
    apply_a: F,
    apply_at: G,
    b: &[f64],
    tol: f64,
    max_iter: usize,
) -> Vec<f64>
where F: Fn(&[f64]) -> Vec<f64>, G: Fn(&[f64]) -> Vec<f64>,
Expand description

LSQR iterative solver for Ax = b

Solves the least squares problem min ||Ax - b||² using the LSQR algorithm. Based on Paige & Saunders (1982).

§Arguments

  • apply_a - Function that computes A*x
  • apply_at - Function that computes A^T*x
  • b - Right-hand side vector
  • tol - Convergence tolerance
  • max_iter - Maximum iterations

§Returns

Solution vector x