Skip to main content

lsmr

Function lsmr 

Source
pub fn lsmr<F, G>(
    apply_a: F,
    apply_at: G,
    b: &[f64],
    n: usize,
    atol: f64,
    btol: f64,
    max_iter: usize,
    _verbose: bool,
) -> Vec<f64>
where F: Fn(&[f64]) -> Vec<f64>, G: Fn(&[f64]) -> Vec<f64>,
Expand description

LSMR iterative solver for Ax = b

Solves the least squares problem min ||Ax - b||² using the LSMR algorithm. Based on Fong & Saunders (2011). More stable than LSQR for ill-conditioned problems.

§Arguments

  • apply_a - Function that computes A*x
  • apply_at - Function that computes A^T*x
  • b - Right-hand side vector
  • n - Size of solution vector
  • atol - Absolute tolerance
  • btol - Relative tolerance
  • max_iter - Maximum iterations
  • verbose - Print progress

§Returns

Solution vector x