Live data from Hacker News

Show HN: Advanced Mathematics Library for Node.js and JavaScript

github.com

41–49 of 49 posts

Re: Show HN: Advanced Mathematics Library for Node.js and JavaScript

#41

This is pretty cool. I've been using CoffeeScript to post-process MD simulation results because it's such an easy language to get things done in. Tools like this will make it even easier. Although, could someone clarify for me the floating point issues mentioned by Steve? I wasn't aware there were issues...

Interesting! I've never heard of anyone using javascript for molecular dynamics analysis. How large are your trajectories?

Re: Show HN: Advanced Mathematics Library for Node.js and JavaScript

#42
post #18
post #7

What audience do you have in mind calling this advanced? (Not criticising your library, it looks useful).

Just out of curiosity, what features would you want to add to make it more advanced? I'll make tickets for them.

QR decomposition

Re: Show HN: Advanced Mathematics Library for Node.js and JavaScript

#43
First of all, good work!

A couple of observations:

1. You should probably go ahead and implement at least LU decomposition, QR factorization, and maybe some eigenvalue/eigenvector stuff if you want to claim "advanced".

2. You should use the recursive definition of the determinant in the >3x3 matrix case.

3. You should consider adding some vector methods of the form: ax+by (for scalar a & b, and vector x & y). This can be useful for doing linear interpolation and whatnot.

4. You should add cross products/outer products for vectors.

5. You should have a mechanism for generating a Gaussian or normal distribution, or at least supply some standard mappings from your (presumably uniform) random function to something more useful (Gaussian, Possoin, Weibull, whatever).

6. An FFT would be nice. :)

7. Quaternions would also be handy for graphics folks, or motion folks.

8. Complex number support would be cool.

9. Support for optimization, like integer programming, linear programming, or even least-squares or whatever would be nice.

~

Again, great work--I look forward to seeing how this project evolves!

Re: Show HN: Advanced Mathematics Library for Node.js and JavaScript

#44

First of all, good work! A couple of observations: 1. You should probably go ahead and implement at least LU decomposition, QR factorization, and maybe some eigenvalue/eigenvector stuff if you want to claim "advanced". 2. You should use the recursive definition of the determinant in the >3x3 matrix case. 3. You should consider adding some vector methods of the form: ax+by (for scalar a & b, and vector x & y). This ca…

This is a fantastic list. There are a few people who've expressed interest in working on eigenvalue work. I'll definitely be adding a couple of these in, in the next few days. I'll keep you posted.

Re: Show HN: Advanced Mathematics Library for Node.js and JavaScript

#45
This is awesome! I started thinking about doing something similar a few months ago, but the project I needed it for kind of fell through and I moved on. Anyway, a few thoughts I had at the time:

  -should support FFT/convolution
  -could tie into http://sylvester.jcoglan.com/ for
   vector/matrix stuff (excellent library!)
    -I emailed jcoglan about the possibility of adding
     complex number support to Sylvester, he encouraged me
     to try but thought it might introduce too much function
     call overhead (caching function results might help a
     bit?)
  -I didn't get to look at it too closely, but
   https://github.com/jtobey/javascript-bignum looks
   interesting, as does https://github.com/pr1001/MathPlus
  -polynomial fit (least squares regression) and
   interpolation stuff is in high demand
  -it should be super easy to integrate output with d3.js
   (like the equivalent of MATLAB plot function)
Honestly, I doubt I would have been able to pull it off, but I intend to contribute to this project as much as I can.

EDIT: Formatting

Re: Show HN: Advanced Mathematics Library for Node.js and JavaScript

#46

This is awesome ! I started thinking about doing something similar a few months ago, but the project I needed it for kind of fell through and I moved on. Anyway, a few thoughts I had at the time: -should support FFT/convolution -could tie into http://sylvester.jcoglan.com/ for vector/matrix stuff (excellent library!) -I emailed jcoglan about the possibility of adding complex number support to Sylvester, he encouraged…

Great, it'd be sweet to have you involved! FFT, polynomial fit, and d3.js would be huge steps. For me, the most important thing is ensuring that all changes are application driven. Building a library that's designed to be used is top priority.

Re: Show HN: Advanced Mathematics Library for Node.js and JavaScript

#47

First of all, good work! A couple of observations: 1. You should probably go ahead and implement at least LU decomposition, QR factorization, and maybe some eigenvalue/eigenvector stuff if you want to claim "advanced". 2. You should use the recursive definition of the determinant in the >3x3 matrix case. 3. You should consider adding some vector methods of the form: ax+by (for scalar a & b, and vector x & y). This ca…

This is a fantastic list. There are a few people who've expressed interest in working on eigenvalue work. I'll definitely be adding a couple of these in, in the next few days. I'll keep you posted.

Sparse and dense matrix math and eigensolvers would be really nice. Especially solvers that let you efficiently get the eigenvectors associated with the smallest eigenvalues as this comes up in graph and image partitioning.

Re: Show HN: Advanced Mathematics Library for Node.js and JavaScript

#48
post #38
post #16

Earlier quoted context omitted.

That's why you don't compare floating point numbers with the = operator. You use something like: fabs( a-b ) where epsilon is usually defined by the language as a very small quantity (example values in C are 1E-8 for a float, 1E-15 for double), or you can just use a hard coded value appropriate to the values you are comparing.

That "where epsilon is usually defined by the language as a very small quantity" is BAD advice. double.epsilon and float.epsilon (std::numeric_limits::epsilon in C++) are "machine epsilons": numbers equal to the difference between 1 and the next representable value. In other words: 1 and 1+epsilon can be represented exactly, but there are no representable numbers between the two. The distance between representable nu…

Thanks for the clarification, I did say they were examples (they were the first results I found in a quick google) and that you should use epsilon values appropriate to the values you are comparing.

Re: Show HN: Advanced Mathematics Library for Node.js and JavaScript

#49

First of all, good work! A couple of observations: 1. You should probably go ahead and implement at least LU decomposition, QR factorization, and maybe some eigenvalue/eigenvector stuff if you want to claim "advanced". 2. You should use the recursive definition of the determinant in the >3x3 matrix case. 3. You should consider adding some vector methods of the form: ax+by (for scalar a & b, and vector x & y). This ca…

It should be mentioned that most of these things are already implemented by numeric.js (http://www.numericjs.com/)
Post reply on HN