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

ml-sparse-matrix

Package Overview
Dependencies
Maintainers
7
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ml-sparse-matrix - npm Package Compare versions

Comparing version 0.1.1 to 0.2.0

2

package.json
{
"name": "ml-sparse-matrix",
"version": "0.1.1",
"version": "0.2.0",
"description": "Sparse matrix library",

@@ -5,0 +5,0 @@ "main": "src/SparseMatrix.js",

@@ -142,7 +142,8 @@ const HashTable = require('ml-hash-table');

forEachNonZero(callback) {
return this.elements.forEachPair((key, value) => {
this.elements.forEachPair((key, value) => {
const i = (key / this.columns) | 0;
const j = key % this.columns;
const r = callback(i, j, value);
let r = callback(i, j, value);
if (r === false) return false; // stop iteration
if (this.threshold && Math.abs(r) < this.threshold) r = 0;
if (r !== value) {

@@ -157,2 +158,3 @@ if (r === 0) {

});
return this;
}

@@ -175,2 +177,10 @@

}
setThreshold(newThreshold) {
if (newThreshold !== 0 && newThreshold !== this.threshold) {
this.threshold = newThreshold;
this.forEachNonZero((i, j, v) => v);
}
return this;
}
}

@@ -177,0 +187,0 @@

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