Skip to main content

nnls

Function nnls 

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

Non-negative least squares min ‖A x − b‖ with x ≥ 0 (SciPy’s nnls), by Lawson and Hanson’s active-set method: repeatedly free the variable whose gradient most wants to grow, solve the unconstrained problem on the free set, and step back to the boundary when a free variable would turn negative.