README
Wrapper for nnls.c as implemented in Chordino / Chroma NNLS by Matthias Mauch and Chris Cannon.
See http://www.isophonics.net/nnls-chroma.
Documentation
The package exposes a single function NNLS(a, b, m, n, tol)
.
a {Float32Array}
A flat m x n matrix. m0n0, m1,n0, m2,n0 ... mN,nN.
b {Float32Array}
An m-length vector.
m {Number}
Number of rows.
n {Number}
Number of columns.
tol {Number}
Tolerance for precision. 0 produces best results, higher values (eg, 0.01) faster but more approximate.
Returns an n-length Float32Array
.
Example usage.
import essyNNLS from 'essy-nnls';
const a = new Float32Array(8);
a[0] = 0.0372;
a[1] = 0.6861;
a[2] = 0.6233;
a[3] = 0.6344;
a[4] = 0.2869;
a[5] = 0.7071;
a[6] = 0.6245;
a[7] = 0.6170;
const b = new Float32Array(4);
b[0] = 0.8587;
b[1] = 0.1781;
b[2] = 0.0747;
b[3] = 0.8405;
essyNNLS.NNLS(a, b, 4, 2, 0);