Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

essy-nnls

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

essy-nnls

Wrapper for native C non-negative least squares (NNLS) algorithm.

  • 1.0.3
  • latest
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

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;  // m0, n0
a[1] = 0.6861;  // m1, n0
a[2] = 0.6233;  // m2, n0
a[3] = 0.6344;  // m3, n0
a[4] = 0.2869;  // m0, n1
a[5] = 0.7071;  // m1, n1
a[6] = 0.6245;  // m2, n1
a[7] = 0.6170;  // m3, n1

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);  // => [0, 0.629]

FAQs

Package last updated on 28 Sep 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc