Node >=4.0
C++ bindings for all single- and double-precision CBLAS (Basic Linear Algebra Subprograms) routines.
$ npm install nblas
$ npm test
-
-
?gbmv (a, x, y, [kl = 0], [ku = 0], [alpha = 1.0], [beta = 0], [trans = nblas.NoTrans])
-
?gemv (a, x, y, [alpha = 1.0], [beta = 0], [trans = nblas.NoTrans])
-
?ger (a, x, y, [alpha = 1.0])
-
?sbmv (a, x, y, [uplo = nblas.Upper], [alpha = 1.0], [beta = 0])
-
?spmv (ap, x, y, [uplo = nblas.Upper], [alpha = 1.0], [beta = 0])
-
?spr (ap, x, [uplo = nblas.Upper], [alpha = 1.0])
-
?spr2 (ap, x, y, [uplo = nblas.Upper], [alpha = 1.0])
-
?symv (a, x, y, [uplo = nblas.Upper], [alpha = 1.0], [beta = 0])
-
?syr (a, x, [uplo = nblas.Upper], [alpha = 1.0])
-
?syr2 (a, x, y, [uplo = nblas.Upper], [alpha = 1.0], [beta = 0])
-
?tbmv (a, x, y, [uplo = nblas.Upper], [trans = nblas.NoTrans], [diag = nblas.NonUnit])
-
?tbsv (a, x, [uplo = nblas.Upper], [diag = nblas.NonUnit])
-
?tpmv (ap, x, [uplo = nblas.Upper], [trans = nblas.NoTrans], [diag = nblas.NonUnit])
-
?tpsv (ap, x, [uplo = nblas.Upper], [trans = nblas.NoTrans], [diag = nblas.NonUnit])
-
?trmv (a, x, [uplo = nblas.Upper], [trans = nblas.NoTrans], [diag = nblas.NonUnit])
-
?trsv (a, x, [uplo = nblas.Upper], [trans = nblas.NoTrans], [diag = nblas.NonUnit])
-
-
-
?gemm (a, b, c, m, n, k, [transa = 111], [transb = 111], [alpha = 1.0], [beta = 0])
-
?symm (a, b, c, m, n, [side = nblas.Left], [uplo = nblas.Upper], [alpha = 1.0], [beta = 0])
-
?syrk (a, c, n, k, [uplo = nblas.Upper], [trans = nblas.NoTrans], [alpha = 1.0], [beta = 0])
-
?syr2k (a, b, c, n, k, [uplo = nblas.Upper], [trans = nblas.NoTrans], [alpha = 1.0], [beta = 0])
-
?trmm (a, b, m, n, [side = nblas.Left], [uplo = nblas.Upper], [transa = 111], [diag = nblas.NonUnit], [alpha = 1.0])
-
?trsm (a, b, m, n, [diag = nblas.NonUnit], [uplo = nblas.Upper], [transa = 111], [diag = nblas.NonUnit], [alpha = 1.0])
-
-
Matrix layout enums
- Matrix transpose (
trans
)nblas.NoTrans (default)
nblas.Trans
nblas.ConjTrans
- Upper/lower matrix (
uplo
)nblas.Upper (default)
nblas.Lower
- Matrix diagonal (
diag
)nblas.NonUnit (default)
nblas.Unit
- Matrix side (
side
)nblas.Left (default)
nblas.Right
- Matrix transpose (
Works out of the box with OSX since CBLAS is included in the standard Accelerate framework. You might have to download and build LAPACK from source on other operating systems (LINUX: sudo apt-get libblas-dev
).
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
Double precision functions expect Float64Array
vectors, single precision functions expect Float32Array
vectors.