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.
; const a = 8;a0 = 00372; // m0, n0a1 = 06861; // m1, n0a2 = 06233; // m2, n0a3 = 06344; // m3, n0a4 = 02869; // m0, n1a5 = 07071; // m1, n1a6 = 06245; // m2, n1a7 = 06170; // m3, n1 const b = 4;b0 = 08587;b1 = 01781;b2 = 00747;b3 = 08405; essyNNLS; // => [0, 0.629]