views:

2079

answers:

6

Is there any libraries in java that allow using mathematical matrices?

I am looking for a library that allows me to perform operations in matrices such as invert, scalar multiplication, linear transformations, etc. etc. etc.

In a nutshell, the operations required for lineal algebra.

+6  A: 

You'll want to check out http://math.nist.gov/javanumerics/jama/

Pete
I used Jama with great success in large project.
Heath Borders
See also http://math.nist.gov/javanumerics/ for a comprehensive looking list of other packages, benchmarks and tools.
Emil
A: 

The build in class AffineTransform can do some of it for a 2D matrix.

Horcrux7
+3  A: 

There is a math library that is part of apache commons http://commons.apache.org/math/userguide/linear.html

pfranza
A: 

The most promising package I've found so far is Jama

http://math.nist.gov/javanumerics/jama/

Mario Ortegón
+2  A: 

Colt, latest release from 2004 but might be useful

Jasper
I have been working with Colt in several engineering projects and I do highly recommend it.
Dieter
+2  A: 

In my investigation so far I have found

Commons Math: http://commons.apache.org/math

JAMA (dupe I know): http://math.nist.gov/javanumerics/jama/

ojAlgo: http://ojalgo.org/

Shared scientific toolbox: http://hubris.ucsd.edu/sstj/

ojAlgo is essentially a bunch of infrastructure for linear algebra, with JAMA as one of the implementations at the back end. Commons Math is nice in that it provides some interfaces for providing operations on the various data types it provides. and Shared scientific toolbox has a lot of signal processing methods in it, as well as some parallel processing utilities. And JAMA is no longer under development (the rest still are).

Mixing and matching can be quite clumsy, so be aware.

I've mainly used ojAlgo, and the Commons Math for its statistical classes, but SST is very interesting as it really uses the language (1.5 annotation), and it's moto is prototype in Matlab, deploy in the SST. But, I've not used it seriously so I can't really endorse it.