nblas-plus

C++ bindings for all single- and double-precision CBLAS (Basic Linear Algebra Subprograms), SPBLAS (Sparse BLAS), LAPACK.

Usage no npm install needed!

<script type="module">
  import nblasPlus from 'https://cdn.skypack.dev/nblas-plus';
</script>

README

nBLAS+

Node >=4.0 C++ bindings for all single- and double-precision CBLAS (Basic Linear Algebra Subprograms) and SPBLAS (Sparse BLAS) routines. Also LAPACK routines (for now only solve general system of linear equations AX=B).

Preinstall

LINUX:

$ cd preinstall
$ sh debian.sh

Tested on Ubuntu 16

OSX:

$ cd preinstall
$ sh osx.sh

Tested on OSX ElCapitan

WIN:

Not tested.

https://icl.cs.utk.edu/lapack-for-windows/

Install

$ npm install nblas-plus
$ npm test

API

Double precision functions expect Float64Array vectors, single precision functions expect Float32Array vectors.

Examples

See test/test.js

var nblas = require('nblas');

var f64a = new Float64Array([1, 2, 3]),
    f64b = new Float64Array([4, 5, 6]);

nblas.dot(f64a, f64b); // or
nblas.ddot(3, f64a, 1, f64b, 1); // 32

var f32a = new Float32Array([1, 2, 3]),
    f32b = new Float32Array([4, 5, 6]);

nblas.dot(f32a, f32b); // or
nblas.sdot(3, f32a, 1, f32b, 1); // 32