Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can I use Lapack for calculating the eigenvalues and eigenvectors of large sparse matrices?

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?

like image 554
Spencer Avatar asked Jul 20 '10 18:07

Spencer


2 Answers

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.

like image 159
Larry Wang Avatar answered Sep 25 '22 03:09

Larry Wang


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).

like image 26
deinst Avatar answered Sep 24 '22 03:09

deinst