0

I am writing some Java software which requires calculating eigenvalues and eigenvectors of positive definite symmetric sparse matrices. I don't need all of the eigenvalues, but I'm mostly interested in the small ones. The problem is:

1) For testing purposes, my code needs to run on a laptop (quad core, 4 gigs of RAM)

2) The test data involves big matrices - generally over 10000 by 10000

These two constraints mean that most of the usual Java matrix packages are inadequate for my current needs - I can't even store a dense 10000 by 10000 matrix in memory let alone compute with them.

So my question is: how do people work around memory constraints when doing matrix calculations? My matrices are generally pretty sparse - usually under 5% of the entries are nonzero. Are there algorithms which exploit this? Could I somehow store the matrix on my hard drive and only load pieces of it at a time to reduce the pressure on my RAM?

Paul Siegel
  • 1,401
  • 13
  • 36
  • There is some good information on how to store sparse matrices efficiently here, along with some eigenvalue algos for sparse matrices http://www-users.cs.umn.edu/~saad/eig_book_2ndEd.pdf – arynaq Jul 15 '13 at 12:38

1 Answers1

0

You can try to use la4j library for that:

// Compressed Sparse Row Matrix
Matrix a = new CRSMatrix(...); 

// eigen[0] = P, eigen[1] = D
Matrix eigen[] = a.decompose(Matrices.EIGEN_DECOMPOSITOR);
Vladimir Kostyukov
  • 2,492
  • 3
  • 21
  • 30