Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Look into using a library for matrix math #4

Open
tzaeschke opened this issue Oct 31, 2013 · 4 comments
Open

Look into using a library for matrix math #4

tzaeschke opened this issue Oct 31, 2013 · 4 comments

Comments

@tzaeschke
Copy link
Owner

MTJ/MTJ-n:
https://github.com/fommil/matrix-toolkits-java

EJML:
http://code.google.com/p/efficient-java-matrix-library/

Comparison:
https://code.google.com/p/java-matrix-benchmark/wiki/RuntimeCorei7v2600_2013_10

Also, any inclusion of such libraries should consider that ODE partly takes special precautions to improve mathematical instability.

@kephale
Copy link

kephale commented Oct 31, 2013

Big ODE4j fan here. I'm using jBLAS for matrix math in some projects that link to ODE4j. However, I haven't done any speed tests against MTJ.

@tzaeschke
Copy link
Owner Author

Hey, good to hear there are some fans :-), I get very little feedback. I just updated the title and issue text. I got the MTJ/EJML suggestion from another ode4j user. According to the comparison above, EJML is best for small matrices and MTJ-n is best for larger ones. EJML appears to be faster than jBLAS for matrices of all sizes.

Of course, I guess it depends on which operations would actually be used.

MTJ also appears to be based on BLAS.

Anyway, this migration won't be happening anytime soon, unless there are volunteers?

@kephale
Copy link

kephale commented Nov 2, 2013

Alright, I'll think about volunteering, but can't promise anything at the moment. I'm back to considering this issue for some of my own code.

It is a shame MTJ seems to do so poorly on small matrices. I'm taking hits from rotation ops and solving large matrix systems. That being said, I guess I'm sold on EJML for speeding up my rotations. So my vote goes for EJML.

I wonder if it would be possible to cheaply and dynamically transition between the two libraries during runtime...

[Actually, I may retract my vote for now. Rotations aren't a good enough reason, since they really should probably just be unrolled anyway.]

@tzaeschke
Copy link
Owner Author

Indeed, most of the 1x3, 1x4, 3x3, 3x4 and 4x4 operations are already unrolled.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants