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 matrixlib with all npm packages installed. Try it out:

var matrixlib = require("matrixlib")

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

matrixlib v0.0.3

Adds matrix support and routines

Matrixlib

Add matrix support and routines to nodejs

Methods

.matrix(m,n,init)

Create a matrix m by n (m rows, n columns) with initial value init

Example

// 4x4 matrix filled with 0
var mlib = require('matrixlib');
var myMatrix = mlib.matrix(4,4,0);

.identity(n)

Create an identity matrix n by n

Example

// 3x3 identity matrix
var mlib = require('matrixlib');
var myIdentityMatrix = mlib.identity(3);

.copy(matrix)

Returns a copy of a matrix.

.equals(a,b)

Tests for equality between matrix a and b.

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