Skip to main content

lsqr_matlab_into

Function lsqr_matlab_into 

Source
fn lsqr_matlab_into<F, G>(
    apply_a: F,
    apply_ah: G,
    b: Vec<Complex64>,
    parts: (&[usize], &[usize]),
    tol: f64,
    max_iter: usize,
) -> (Vec<Complex64>, LsqrOutcome)
where F: FnMut(&[Complex64], &mut [Complex64]), G: FnMut(&[Complex64], &mut [Complex64]),
Expand description

lsqr_matlab with operators that write into a caller-owned buffer (out holds stale data on entry and must be overwritten), taking b by value as LSQR’s first u, so a solve allocates its six vectors once. parts = (range parts, domain parts): how the norms of u and v vectors are split (see dense_parts); the domain parts also give the length of the unknown. Performs exactly the same floating-point operations as the textbook loop (the norms of updated vectors are fused into the update passes, with the same parts).