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

ndarray-linear-solve

Package Overview
Dependencies
Maintainers
2
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ndarray-linear-solve

solve a linear system with a cached LU decomposition

  • 3.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
4
decreased by-60%
Maintainers
2
Weekly downloads
 
Created
Source

ndarray-linear-solve

Solves a system of linear equations, similar to MATLAB's backslash operator, but not yet as sophisticated. (But maybe it will be someday soon! Pull requests welcome!)

testling badge

build status

example

var solve = require('ndarray-linear-solve');
var show = require('ndarray-show');
var ndarray = require('ndarray');

var A = ndarray([ 2, 1, -1, -3, -1, 2, -2, 1, 2 ], [ 3, 3 ], [ 1, 3 ]);
var B = ndarray([ 8, -11, -3 ])
var X = ndarray(new Float64Array(3))
var r = solve(X, A, B)
console.log('input:\n' + show(A), '\n');
if (r) {
  console.log('solution:\n' + show(X));
} else {
  console.log('matrix is singular')
}

output:

input:
   2.000    1.000   -1.000
  -3.000   -1.000    2.000
  -2.000    1.000    2.000 

solution:
   2.000    3.000   -1.000

methods

var solve = require('ndarray-linear-solve')

var solution = solve(X, A, B)

Solves the linear system, AX = B for X

  • X is a vector into which the solution is written
  • A is a matrix encoded as an ndarray
  • B is a vector, encoded as an ndarray

Returns true if the matrix has a solution, otherwise false.

install

With npm do:

npm install ndarray-linear-solve

license

MIT

Keywords

FAQs

Package last updated on 07 Jun 2014

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