1.0.6 • Published 2 years ago

@flowcircuits/wasmles v1.0.6

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years 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

2 years ago

1.0.5

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.4

2 years ago

1.0.3

2 years ago

1.0.0

2 years ago

0.1.0

2 years ago