Linear Algebra powered by Web Assembly
This project is currently in alpha and missing some crucial features
Here, to demonstrate, we'll be using vite to scaffold a project:
npm init vite@latest # choose a simple vanilla js project
npm i vite-plugin-cross-origin-isolation
npm i @ml.wasm/linalg
And add this to main.js
:
import init, {
initThreadPool,
IntegersVector,
FloatsVector,
StringsVector,
IntegersMatrix,
FloatsMatrix,
StringsMatrix,
} from 'arrays-wasm';
(async () => {
// This init function sets up everything you need to use this library
await init();
// This sets up the concurrency
await initThreadPool(navigator.hardwareConcurrency);
// All your code goes here...
})();
Note that you'll have to create a vite.config.js
:
import crossOriginIsolation from 'vite-plugin-cross-origin-isolation'
export default {
plugins: [
crossOriginIsolation()
],
server: {
fs: {
allow: ['..']
}
}
}