Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
matrix-vector operation defined as -y := alpha * A * x + beta * y -or -y := alpha * A' * x + beta * y -where A is a general band matrix with kl sub-diagonals and ku super-diagonals
-Generated using TypeDoc
computes a scalar-matrix-matrix product and adds the result to a scalar-matrix product defined as -C := alpha * op(A) * op(B) + beta * C
-Generated using TypeDoc
matrix-vector operation defined as -y := alpha * A * x + beta * y -or -y := alpha * A' * x + beta * y -where A is a general matrix
-Generated using TypeDoc
matrix-vector operation defined as -A := alpha * x * y' + A -where A is a general matrix
-Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
matrix-vector operation defined as -y := alpha * A * x + beta * y -where A is a symmetric band matrix with k super-diagonals
-Generated using TypeDoc
Generated using TypeDoc
matrix-vector operation defined as -y := alpha * A * x + beta * y -or -y := alpha * A' * x + beta * y -where A is a symmetric matrix, supplied in packed form
-Generated using TypeDoc
matrix-vector operation defined as -A := alpha * x * x' + A -where A is a symmetric matrix, supplied in packed form
-Generated using TypeDoc
matrix-vector operation defined as -A := alpha * x * y' + alpha * y * x' + A -where A is a symmetric matrix, supplied in packed form
-Generated using TypeDoc
Generated using TypeDoc
computes a scalar-matrix-matrix product with one symmetric matrix and -adds the result to a scalar-matrix product defined as -C := alpha * A * B + beta * C -or -C := alpha * B * A + beta * C -where A is a symmetric matrix
-Generated using TypeDoc
matrix-vector operation defined as -y := alpha * A * x + beta * y -where A is a symmetric matrix
-Generated using TypeDoc
Generated using TypeDoc
matrix-vector operation defined as -A := alpha * x * y' + alpha * y * x' + A -where A is a symmetric matrix
-Generated using TypeDoc
perform a rank-2k matrix-matrix operation for a symmetric matrix C using general matrices A and B defined as -C := alpha * A * B' + alpha * B * A' + beta * C -or -C := alpha * A' * B + alpha * B' * A + beta * C -where C is a symmetric matrix
-Generated using TypeDoc
performs a rank-k matrix-matrix operation for a symmetric matrix C using a general matrix A defined as -C := alpha * A * A' + beta * C -or -C := alpha * A' * A + beta * C -where C is a symmetric matrix
-Generated using TypeDoc
matrix-vector operation defined as -x := A * x -or -x := A' * x -where A is a unit or non-unit upper or lower triangular band matrix, with k + 1 diagonals
-Generated using TypeDoc
solves one of the following systems of equations -A * x = b -or -A' * x = b -where A is a unit or non-unit upper or lower triangular band matrix, with k + 1 diagonals
-Generated using TypeDoc
matrix-vector operation defined as -x := A * x -or -x := A' * x -where A is a unit or non-unit upper or lower triangular matrix, supplied in packed form
-Generated using TypeDoc
solves one of the following systems of equations -A * x = b -or -A' * x = b -where A is a unit or non-unit upper or lower triangular matrix, supplied in packed form
-Generated using TypeDoc
computes a scalar-matrix-matrix product with one triangular matrix defined as -B := alpha * op(A) * B -or -B := alpha * B * op(A) -where A is a unit or non-unit upper or lower triangular matrix
-Generated using TypeDoc
matrix-vector operation defined as -x := A * x -or -x := A' * x -where A is a unit or non-unit upper or lower triangular matrix
-Generated using TypeDoc
solves one of the following matrix equations -op(A) * X = alpha * B -or -X * op(A) = alpha * B -where A is a unit or non-unit upper or lower triangular matrix
-Generated using TypeDoc
solves one of the following systems of equations -A * x = b -or -A' * x = b -where A is a unit or non-unit upper or lower triangular matrix
-Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Optional side: MatrixLeftRightOptional uplo: MatrixUpperLowerOptional transa: MatrixTransOptional diag: MatrixUnitOptional alpha: numberGenerated using TypeDoc
Generated using TypeDoc
Optional side: MatrixLeftRightOptional uplo: MatrixUpperLowerOptional transa: MatrixTransOptional diag: MatrixUnitOptional alpha: numberGenerated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Node >=6.9 C++ bindings for all single- and double-precision CBLAS (Basic Linear Algebra Subprograms) routines.
$ npm install nblas
$ npm test
-
+$ npm install nblas
$ npm test
+
+
BLAS Level 1 Routines and Functions
?asum (x)?axpy (x, y, [alpha = 1.0])?copy (x, y)?dot (x, y)?nrm2 (x)?rot (x, y, c, s)?rotg (x, y, c, s)?rotm (x, y, param)?rotmg (d1, d2, x1, y1, param)?scal (x, alpha)?swap (x, y)i?amax (x)?asum (x)?axpy (x, y, [alpha = 1.0])?copy (x, y)?dot (x, y)?nrm2 (x)?rot (x, y, c, s)?rotg (x, y, c, s)?rotm (x, y, param)?rotmg (d1, d2, x1, y1, param)?scal (x, alpha)?swap (x, y)i?amax (x)?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])?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])?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 layout enums
+trans)
trans)nblas.NoTrans (default)nblas.Transnblas.ConjTransuplo)uplo)
+nblas.Upper (default)nblas.Lowerdiag)diag)
+nblas.NonUnit (default)nblas.Unitside)side)
+nblas.Left (default)nblas.RightWorks 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).
import { dot, ddot, sdot, dznrm2 } from './src';
const f64a = new Float64Array([1, 2, 3]);
const f64b = new Float64Array([4, 5, 6]);
console.log(dot(f64a, f64b));
// 32
console.log(ddot(3, f64a, 1, f64b, 1));
// 32
const f32a = new Float32Array([1, 2, 3]);
const f32b = new Float32Array([4, 5, 6]);
console.log(dot(f32a, f32b));
// 32
console.log(sdot(3, f32a, 1, f32b, 1));
// 32
// complex arrays are packed like this: [Re, Im, Re, Im, ...]
// this is equivalent to [1 + 2i, 3 + 4i]
const c16 = new Float64Array([1, 2, 3, 4]);
// complex l2 norm
console.log(dznrm2(2, c16, 1));
// sqrt(1^2 + 2^2 + 3^2 + 4^2) ~ 5.477
-
+import { dot, ddot, sdot, dznrm2 } from './src';
const f64a = new Float64Array([1, 2, 3]);
const f64b = new Float64Array([4, 5, 6]);
console.log(dot(f64a, f64b));
// 32
console.log(ddot(3, f64a, 1, f64b, 1));
// 32
const f32a = new Float32Array([1, 2, 3]);
const f32b = new Float32Array([4, 5, 6]);
console.log(dot(f32a, f32b));
// 32
console.log(sdot(3, f32a, 1, f32b, 1));
// 32
// complex arrays are packed like this: [Re, Im, Re, Im, ...]
// this is equivalent to [1 + 2i, 3 + 4i]
const c16 = new Float64Array([1, 2, 3, 4]);
// complex l2 norm
console.log(dznrm2(2, c16, 1));
// sqrt(1^2 + 2^2 + 3^2 + 4^2) ~ 5.477
+
+
Double precision functions expect Float64Array vectors, single precision functions expect Float32Array vectors.
Generated using TypeDoc
Generated using TypeDoc
Const Generated using TypeDoc
ConstConst Generated using TypeDoc
ConstConst Generated using TypeDoc
ConstConst Generated using TypeDoc
ConstConst Generated using TypeDoc
ConstConst Generated using TypeDoc
ConstConst Generated using TypeDoc
ConstConst Generated using TypeDoc
ConstConst Generated using TypeDoc
ConstConstConstConstConstConstConstConstConstConstConstConstConstConstConstConstConstConstConstConstConstConstConstConstConstConstConstConstConstConstConstConstConstConstConstConstConstConstConstConstConstConstConstConstConstConstConstConstConstConstConstConstConstConstConstConstConstConstConstConstConstConstConstConstConstConstConstConstConstConstConstConstConstConstConstConstConstConstConstConstConstConstConstConstConstConstConstConstConstConstConstConstConstConstConstConstConstConstConstConstConstConstConstConstConstConstConstConstConstConstConstConstConstConstConstConstConstConstConstConstConstConstConstConstConstConstConstConstConstConstConstConstConstConstConstConstConstConstConstConstConstConstConstConstConstConstConstConstConstConstConstConstConstConstConstConstConstConstConstConstConstConstConstConstConstConstConstConstConstConstConstConstConstConstConstConstConst
sum of the magnitudes of elements of a real vector -res = \sum_i=0^n{|x_i|}
-