Code Monkey home page Code Monkey logo

Comments (4)

BertrandBev avatar BertrandBev commented on June 16, 2024

For sure! In a new folder, create a simple package.json file containing

{ "dependencies": { "eigen": "^0.2.2" } }

Create a file named test.mjs containing

`
// test.mjs
import eig from 'eigen';

(async () => {
await eig.ready;
let M = new eig.Matrix([[1, 2], [3, 4]]);
M.print("M");
M = M.inverse();
M.print("Minv");
eig.GC.flush();
})();
`

Now run yarn in that folder to install dependencies, and execute the test using node test.mjs

from eigen-js.

recidive avatar recidive commented on June 16, 2024

Yes, this worked now, but sometimes it breaks with the error TypeError: eigen_1.default.Matrix is not a constructor. I got this intermittently in an Observable notebook.

Maybe this is something related to asynchronous loading of the wasm?

from eigen-js.

BertrandBev avatar BertrandBev commented on June 16, 2024

Ah, I never tried it in that context. Not sure how Observable handles package loading...

from eigen-js.

recidive avatar recidive commented on June 16, 2024

I'm not saying this is just on Observable but in both contexts, this is an intermittent error that needs some debugging, maybe using async import() in typescript helps.

from eigen-js.

Related Issues (13)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.