1.0.6 • Published 10 months ago

@flowcircuits/wasmles v1.0.6

Weekly downloads
-
License
MIT
Repository
github
Last release
10 months ago

npm (tag) npm bundle size NPM

@flowcircuits/wasmles

An easy to use Web Assembly linear equation solver built with Rust

Installation

yarn add @flowcircuits/wasmles

Usage

import wasmInit, { solveLinearEquations } from "@flowcircuits/wasmles";

interface LinearEquation {
    constant: number;
    variables: Record<string, number>;
}

const linearEquations: LinearEquation[] = [
    { variables: { a: 2, b: 3, c: -1 }, constant: 5 },
    { variables: { a: 1, b: -4, c: 2 }, constant: -6 },
    { variables: { a: 3, b: 2, c: 1 }, constant: 9 },
];

wasmInit().then(() => {
    const solutionMap = solveLinearEquations(linearEquations);
    const solution = Object.fromEntries(solutionMap);
    console.log(solution);
    // {
    //     a: 2,
    //     b: 1,
    //     c: 3,
    // }
});

Development

Build

yarn build

Test

yarn test
1.0.6

10 months ago

1.0.5

10 months ago

1.0.2

11 months ago

1.0.1

11 months ago

1.0.4

11 months ago

1.0.3

11 months ago

1.0.0

1 year ago

0.1.0

1 year ago