2
votes

I am trying to compute the eigenvectors (say the first 10 of them) of a large matrix. My initial problems were caused by a misunderstanding of the Intel MKL library. To make my question clear and easy to understand I decided to generalize it and remove some unnecessary details.

The basic question is: Which computer code should be used to find the eigenvalues of a large sparse matrix?

The matrix I have can be considered sparse under certain approximations. Namely, the values are becoming very small when moving away from the diagonal. Some of them are even unphysical, caused by statistics effects (the matrix is generated by MC code). This is why the term sparse is in brackets.

I will appreciate if someone can provide a code example.

Thank you in advance,

Alex

1
Don't Intel provide code examples in their documentation ? Unless you can show SO what you've done, preferably with code, an be quite specific about the programming problem that you are stuck on you are unlikely to get much help here. You may even get down votes and your question might attract close votes.High Performance Mark
This routine is called DGEEV (if working with double). Here is are examples : software.intel.com/sites/products/documentation/doclib/mkl_sa/…francis
Hi Francis, thank you for your reply. This is exactly what I needed, but as it turns out I need sparse storage. The matrix I have is too big to fit into memory when using dense storage.Alexander Cska
You can take a look at the SLEPc library grycap.upv.es/slepc , especially at their use guide and EPS module grycap.upv.es/slepc/documentation/current/docs/manualpages/EPS/… Look at their examples grycap.upv.es/slepc/documentation/current/src/eps/examples/…francis
Hi, I have been experimenting with the eigenvalue routines. Unfortunately besides MKL, I was not really able to get them running. The manuals are real crap and it is not very clear what should be done. ARPACK is te most vivid example for this. I tried coding some of the algorithms myself. Unfortunately I was not able to get what I needed.Alexander Cska

1 Answers

2
votes

ARPACK is probably the right thing to use. It's old fortran code and can be a pain to install (though perhaps the maintained arpack-ng is better).

Alternatively, libigl has a crude implementation of power iterations built on top of Eigen. You can use the libigl version just like MATLAB's eigs:

Eigen::SparseMatrix<double> A;
Eigen::SparseMatrix<double> B;
...
Eigen::MatrixXd V;
Eigen::VectorXd D;
igl::eigs(A,B,3,igl::EIGS_TYPE_SM,V,D);

This will compute the eigen vectors in the columns of V and the eigen values in D for the 3 smallest eigenvalues.