
Research
Node.js Fixes AsyncLocalStorage Crash Bug That Could Take Down Production Servers
Node.js patched a crash bug where AsyncLocalStorage could cause stack overflows to bypass error handlers and terminate production servers.
conjugate-gradient
Advanced tools
Solves sparse symmetric positive definite linear systems. These problems arise in many physical applications, like linear elasticity, heat transfer and other diffusion based transport phenomena.
This code implements the conjugate gradient method using a Jacobi preconditioner.
npm install conjugate-gradient
var pcg = require("conjugate-gradient")
, CSRMatrix = require("csr-matrix")
//Create a matrix
var A = CSRMatrix.fromDense([[-2, 1, 0],
[ 1,-2, 1],
[ 0, 1,-2]])
//Create input vector
var B = new Float64Array([1, 0, 0])
//Solve equation:
//
// A x = B
//
console.log(pcg(A, b))
require("conjugate-gradient")(A, b[, x0, tolerance, max_iter])Solves the equation Ax = b by conjugate gradient
A is a symmetric positive definite matrix represented as a CSRMatrixb is an array of length nx0 is an optional initial guess for the solution to the equation. If specified, the result of the solution will also get stored in this arraytolerance is a cutoff tolerance for the solution. (Default is 1e-5)max_iter is the maximum number of iterations to run the solver. (Default is min(n, 20))Returns An array encoding the solution to the equation Ax = b
(c) 2013 Mikola Lysenko. MIT License
FAQs
Conjugate gradient solver
We found that conjugate-gradient demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

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.

Research
Node.js patched a crash bug where AsyncLocalStorage could cause stack overflows to bypass error handlers and terminate production servers.

Research
/Security News
A malicious Chrome extension steals newly created MEXC API keys, exfiltrates them to Telegram, and enables full account takeover with trading and withdrawal rights.

Security News
CVE disclosures hit a record 48,185 in 2025, driven largely by vulnerabilities in third-party WordPress plugins.