I have to implement an algorithm which uses a 2D data structure but each cell of the data has to be a further matrix. Which java library should I use? Thanks!
Asked
Active
Viewed 521 times
0
-
Why don't you use arrays containing arrays? – Mirco Jan 31 '14 at 09:24
-
what about this one: http://la4j.org/ – kofemann Jan 31 '14 at 09:25
-
I have been using JAMA package: http://math.nist.gov/javanumerics/jama/ – Stefan Jan 31 '14 at 09:25
-
@verbose-mode what should i use? Like ArrayList or any other data structure? – M Omayr Jan 31 '14 at 09:45
-
@tigran Thanks! I have looked it but I couldn't find any thing in which I can make each cell of array to be a further 2D array.. – M Omayr Jan 31 '14 at 09:46
1 Answers
2
You may try to use the JAMA Java Matrix Package: http://math.nist.gov/javanumerics/jama/
I have used it quite lot some years ago and the ability to create Arrays containing Matrix Objects may suite your needs directly.
Anyhow you may find this 2 questions interesting:
(1) Java matrix libraries (2) Performance of Java matrix math libraries?
-
I looked over the class Matrix of this library but couldn't find how to make arrays containing matrix.. What am I missing there? But Thanks it's good library – M Omayr Jan 31 '14 at 09:48
-
What did you not understand? You make an array of objects and each element points to an object therefor. Matrix[][] 2d_matrix_to_matrix = new Matrix[10][10]; Matrix[0][0] = new Matrix(int m, int n); This creates 2d squared array containing each element a matrix of size m x n – Stefan Jan 31 '14 at 10:01
-