Skip to content

Planeshifter/ndarray-inv

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ndarray-inv

calculates matrix inverses via Gauss-Jordan elimination. The algorithm has a computational complexity of O(n^3). It handles singular matrices by throwing an error when no non-zero pivot can be chosen during the algorithm.

Build Status

Install

npm install ndarray-inv

Load

Load function via

const inv = require("ndarray-inv");

Example usage:

const ndarray = require("ndarray");
const show = require("ndarray-show");
const ops = require("ndarray-ops");

const M = ndarray(new Float64Array( [2.3, 4.1, 1.8, 1.4] ), [2, 2] )

console.log( show( inv(M) ) );

Output:

-0.337    0.433
0.986   -0.553

Tests

Run tests via command npm test.

About

calculating matrix inverses

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published