Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/snickerdoodlelabs/eigents
Typescript interface for Eigen Tux.
https://github.com/snickerdoodlelabs/eigents
eigen-library emscripten typescript wasm
Last synced: about 23 hours ago
JSON representation
Typescript interface for Eigen Tux.
- Host: GitHub
- URL: https://github.com/snickerdoodlelabs/eigents
- Owner: SnickerdoodleLabs
- License: mit
- Created: 2024-04-23T17:35:58.000Z (7 months ago)
- Default Branch: main
- Last Pushed: 2024-04-29T13:45:51.000Z (7 months ago)
- Last Synced: 2024-04-29T14:58:06.694Z (7 months ago)
- Topics: eigen-library, emscripten, typescript, wasm
- Language: JavaScript
- Homepage:
- Size: 898 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# EigenTS
A minimalist typescript interface for the [Eigen Tux](https://eigen.tuxfamily.org/) matrix library (calculations run in [WASM](https://webassembly.org/)). Perform fast matrix-matrix multiplies, norm calculations, and system solves (Ax=b) in a mobile or desktop browser.
Currently, this demo focuses on dense matrix operations, but could easily be extended to include sparse matrix methods as well.
## Running Eigen in WASM
This package uses [emscripten](https://emscripten.org/) to compile Eigen into a WASM module that can be run in a mobile or desktop browser.
Compile the Eigen bindings like this:
```shell
emcc src/eigen/eigen.cpp -o wasm/eigen.html -I ./Eigen -sEXPORTED_FUNCTIONS=_float_norm,_float_random_matrix,_float_matrix_matrix_mult,_float_system_solve,_float_matrix_matrix_add,_free -sEXPORTED_RUNTIME_METHODS=cwrap
```This will produce a `.wasm` module and a wrapper `.js` file (as well as a demo `.html` page) in the `/wasm` directory.
### Docker Environment
If you don't have or do not want to set up emscripten locally, you can use the supplied [Dockerfile](/Dockerfile) which installs all
dependencies needed to create the WASM artifacts:```shell
docker build -t emcc .
docker run -it --rm --entrypoint bash -v /path/to/EigenTS:/root/EigenTS emcc
cd /root/EigenTS
# run emscripten from the mounted repository to build eigen.cpp
```