Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

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.

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
```