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

3

13

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?

Obau answered 20/7, 2010 at 18:50 Comment(1)
I am using LAPACK in Intel MKL for same purpose. Usually my calculations are with matrices n=20k, m=between 100m and 1m. Calculating eigenvalues are quite fast, if you also need all of the eigenvectors, it takes about 30 minutes on a fast PC (i7-2600, 4-cores). If you have 16GB ram, memory is not problem.Pforzheim
N
10

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.

Neomaneomah answered 20/7, 2010 at 18:57 Comment(0)
Y
3

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

Yokoyama answered 20/7, 2010 at 19:2 Comment(0)
E
1

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.

Erythrism answered 20/7, 2010 at 18:55 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.