Some matrix algebra compiled to WebAssembly. See the example folder for an example website. There you can also find the actual LinearAlgebra.wasm file.
JavaScript:
instantiate("LinearAlgebra.wasm").then((mat) => main(mat));
function main(mat) {
let W = mat.store([1, 2, 3, 4, 5, 6], [2, 3]); //store(matrix, size)
let x = mat.store([1, 2, 3]); //default to vector
let y = mat.mul(W, x);
}
Since this is translated from julia; Unittesting gold is what the equivalent call in julia would return.
- dot(a, b)
- cross(a, b)
- mul(W, X)
- muladd(W, X, b)
- rmul(v, s)
- rdiv(v, s)
- norm2(v)
- norm(v, p)
- normalize(v)
- transpose(M)
- copy(M)
- size(M)
- tr(M)
- mix(a, b, v)
- mixscalar(a, b, t)
- triu(M)
- tril(M)
- svd(M)
- kron(M)
- det(M)
- eigen(M)
- eigvals(M)
- eigmin(M)
- eigmax(M)