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

ndarray-crout-decomposition

Package Overview
Dependencies
Maintainers
2
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ndarray-crout-decomposition

LU decomposition using the crout algorithm

  • 1.1.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
26K
decreased by-11.02%
Maintainers
2
Weekly downloads
 
Created
Source

ndarray-crout-decomposition

LU decomposition using the crout algorithm

testling badge

build status

example

var ndarray = require('ndarray');
var zeros = require('zeros');
var show = require('ndarray-show');
var crout = require('ndarray-crout-decomposition');

var A = ndarray([ 4, 3, 6, 3 ], [ 2, 2 ]);
var L = zeros([ 2, 2 ]);
var U = zeros([ 2, 2 ]);

crout(A, L, U);
console.log('L=\n' + show(L));
console.log('U=\n' + show(U));

output:

L=
   4.000    0.000
   3.000   -1.500
U=
   1.000    1.500
   0.000    1.000

or to save space, you can use a single matrix to store the L and U values:

var ndarray = require('ndarray');
var zeros = require('zeros');
var show = require('ndarray-show');
var crout = require('ndarray-crout-decomposition');

var A = ndarray([ 4, 3, 6, 3 ], [ 2, 2 ]);
var LU = zeros([ 2, 2 ]);

crout(A, LU);
console.log('LU=\n' + show(LU));

output:

LU=
   4.000    1.500
   3.000   -1.500

methods

var crout = require('ndarray-crout-decomposition')

var ok = crout(A, L, U)

Decompose the matrix A into L and U, mutating L and U in-place.

A is not modified.

If you don't pass in a U matrix, L will be used to store both the L and U values, omitting the diagonal of ones from U to make room.

If A was non-square or the algorithm could not find a solution, ok is false. Otherwise ok is true.

install

With npm do:

npm install ndarray-crout-decomposition

license

MIT

Keywords

FAQs

Package last updated on 29 May 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