Quantcast
Channel: User Mark - Stack Overflow
Viewing all articles
Browse latest Browse all 44

Answer by Mark for Is there a NumPy-like package for Node.js and if not why not?

$
0
0

I've not tried this, but I found node-lapack. Since NumPy gets most of it's speed from using BLAS/LAPACK to do everything, this should help. From the readme it looks like it has an array object too, which is essential to not convert between JavaScript and LAPACK on every operation.

Here's a part of their demo:

var lapack = require('lapack');var result = lapack.sgeqrf([    [1, 2, 3],    [3, 4, 5],    [5, 6, 7]]);console.log(result.R);console.log(result.tau);result = sgesvd('A', 'A', [    [1, 2, 3],    [3, 4, 5],    [5, 6, 7]]);console.log(result.U);console.log(result.S);console.log(result.VT);result = lapack.sgetrf([    [1, 2, 3],    [3, 4, 5],    [5, 6, 7]]);// See the readme for more

It seems to be a pretty direct interface to lapack using the same names, so in that regard it's not as convenient as Numpy, but at least it takes care of array dimensions and stuff and should be about as fast (since most of the work is being done by Lapack in either case).

However, this won't work in a browser, which means everywhere where this is available, Python is probably also available. Personally, I'd stick with Python, which is much more dominant for numerical stuff, unless there's some specific Node functionality Python is missing...


Viewing all articles
Browse latest Browse all 44

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>