0.0.1 • Published 5 years ago

matrix-k v0.0.1

Weekly downloads
-
License
MIT
Repository
github
Last release
5 years ago

matrix-k

Fast Matrix library for Java Script

Benchmarks

Some Matrix multiplication benchmarks using Benchmark.js:

2x23x34x416x1632x32512x5121024x1024
Matrix-K24,62421,90015,3941,7992650.080.10
ml-Matrix8,6066,2054,1121,0032170.080.09
Math.js5,5603,8302,91314620timeouttimeout

number of operations per second obtained from chunks of 100 multiplications of squared nxn matrices

How to install

Run the command:

$ npm install matrix-k

How to use

const { Matrix } = require('matrix-k');

const A = new Matrix([[1, 2, 3], [4, 5, 6]]);
const B = new Matrix([[2, 1], [2, 0]]);
console.log(A.multiply(B));

shold print out:

How to run the benchmarks

The benchmark code is here. Run:

node benchmarks/multiplication.benchmark.js 10 4 10 5

for benchmark chunks of 10 4x10 by 10x5 matrix multiplications. Use --max-old-space-size=4096 when running huge matrices.

0.0.1

5 years ago