Skip to main content

lsq_linear

Function lsq_linear 

Source
pub fn lsq_linear(
    a: &Array2<f64>,
    b: &[f64],
    lb: &[f64],
    ub: &[f64],
    tol: f64,
) -> Result<LinearLsqResult, ErrorsJSL>
Expand description

Linear least squares with bounds, min ½‖A x − b‖² subject to lb ≤ x ≤ ub (SciPy’s lsq_linear(method='bvls')), by Stark and Parker’s bounded-variable least squares: start from the unconstrained solution clipped to the bounds, then, while the KKT conditions are violated, free the variable with the most violated condition and solve on the free set, stepping back to the first bound crossed.