A high performance linear algebra library, written in JavaScript and optimized with C++ bindings to BLAS.
$ npm install vectorious
var v = require('vectorious'),
Matrix = v.Matrix,
Vector = v.Vector,
BLAS = v.BLAS; // access BLAS routines
Will use your local BLAS copy (if any). Some notes for different operating systems:
- OSX - by default included in the Accelerate framework
- Debian/Ubuntu - different options, easiest is to
apt-get install libblas-dev
- Windows - https://icl.cs.utk.edu/lapack-for-windows/
Download a release and use it like this:
<script src="vectorious-4.x.x.min.js"></script>
<script>
var A = new Matrix([[1], [2], [3]]),
B = new Matrix([[1, 3, 5]]),
C = A.multiply(B);
console.log('C:', C.toArray());
/* C: [
[1, 3, 5],
[2, 6, 10],
[3, 9, 15]
] */
</script>
Basic
Machine learning
The documentation is located in the wiki section of this repository.
Internal benchmarks are located in the wiki section of this repository.
The following benchmarks compare Vectorious 4.1.0 with three popular matrix/vector libraries:
The graphs show operations per second on the vertical (y) axis.
Below is a graph comparing the vector operations add
, angle
, dot
, magnitude
(aka L2-norm
), normalize
and scale
.
The operations were performed on vectors generated with Vector.random(1048576)
.
Below is a graph comparing the matrix operations add
, scale
and transpose
.
The operations were performed on matrices generated with Matrix.random(512, 512)
.