wasm-big-mult

1.0.2 • Public • Published

big-mult

Extremely fast, low error, sampling based matrix multiplaction algorithm for giant matrices. Implemented in AssemblyScript and tested with as-pect;

Usage

  • Import and stream the wasm module using the async function buildMultiplier.
  • Run giantMult using the module you built.
import { giantMult, buildMultiplier } from "wasm-big-mult";
 
// Trivially small matrices just to show usage
const a = [[1, 2], [1, 2], [1, 2], [1, 2], [1, 2]];
const b = [[1, 2, 3, 4, 5], [1, 2, 3, 4, 5]];
const samples = 3;
 
buildMultiplier()
  .then(wasmModule => {
    console.log(giantMult(wasmModule, a, b, samples));
  })
  .catch(err => console.log(err));

Note

Functionality is not currently defined when the dimensions of a and b are not valid, the function will throw descriptive errors in future versions

Warnings

  • Parcel does not support assemblyscript, please use webpack if you wish to use this package.
  • Due to js memory limitations the biggest matrices supported right now are 1000x1000. WIth some improvements to way this package manages memory the cap will increase in the future.

Credits

Package Sidebar

Install

npm i wasm-big-mult

Weekly Downloads

1

Version

1.0.2

License

MIT

Unpacked Size

41.6 kB

Total Files

12

Last publish

Collaborators

  • jparratt