Sign Up for Free

RunKit +

Try any Node.js package right in your browser

This is a playground to test code. It runs a full Node.js environment and already has all of npm’s 400,000 packages pre-installed, including ndarray-determinant with all npm packages installed. Try it out:

var ndarrayDeterminant = require("ndarray-determinant")

This service is provided by RunKit and is not affiliated with npm, Inc or the package authors.

ndarray-determinant v1.0.0

Computes the determinant of an ndarray

ndarray-determinant

Computes the determinant of a matrix (encoded as an ndarray)

Example

var pack = require('ndarray-pack')
var det  = require('ndarray-determinant')

var M = pack([[1,2,3],
              [4,5,6],
              [7,8,9]])

console.log(det(M))

Output:

0

Install

npm install ndarray-determinant

API

require('ndarray-determinant')(M)

Computes the determinant of the square matrix M

  • M is a square 2D ndarray

Returns The determinant of M

Credits

(c) 2014 Mikola Lysenko. MIT License

RunKit is a free, in-browser JavaScript dev environment for prototyping Node.js code, with every npm package installed. Sign up to share your code.
Sign Up for Free