Skip to content

Some matrix operations compiled to WebAssembly for usage on websites.

Notifications You must be signed in to change notification settings

Andersgee/LinearAlgebra.wasm

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

LinearAlgebra.wasm

Some matrix algebra compiled to WebAssembly. See the example folder for an example website. There you can also find the actual LinearAlgebra.wasm file.

Example

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);
}

Function reference

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)

About

Some matrix operations compiled to WebAssembly for usage on websites.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published