views:

157

answers:

3

If I had a square matrix that is 1,000 by 1,000 could Lapack calculate the eigenvectors and eigenvalues for this matrix? And if it can how long would it take? Also what about for a 10,000 by 10,000 matrix or even a 1,000,000 by 1,000,000 matrix?

Please note these are going to be sparse matrices primarily populated by 0s (the matrices will be graphs representing social networks). Are there any special procedures in Lapack for dealing with sparse matrices? I see the Arpack recommendation. But would this allow for calculating very large matrices?

+1  A: 

Lapack only has support for dense and banded matrices (no support for general sparse matrices). So unless your sparse matrix is banded (from your description it sounds like it would be a general sparse matrix, usually stored in a compressed row storage scheme), then lapack is not what you want to use.

For large sparse matrices, Arpack would be a good place to start.

MarkD
+4  A: 

LAPACK does not have special support built in for sparse matrices, but ARPACK does. Depending on the machine you plan to run this on, this could rule out use of LAPACK, as you may run out of memory for very large matrices. See http://www.netlib.org/utk/people/JackDongarra/la-sw.html for a summary of various linear algebra libraries.

There is no way to give you a meaningful estimate for how long these computations would take without details of what matrices you expect (symmetric ones will be many times faster), what processor you plan to run this on, how much memory you have available, etc.

Based on your other questions, I would recommend sticking with MATLAB. It has sparse matrix support and is good for linear algebra in general.

Larry Wang
+1  A: 

If your matrices are sparse, you are probably better off using a sparse matrix package. See this StackOverflow article for more info.

Using lapack you could do a 1000 x 1000 in a couple of seconds (depending on your machine). A 10000 x 10000 would take 1000 times longer, as the algorithms all tend to be O(n^3).

deinst