Registered Member
|
Is there a way to calculate only first few eigen vectors, say first 1o instead of all, which may speed up the computation
|
Registered Member
|
If you are dealing with positive definite matrix, then you can try doing, in scilab:
R=chol(X); // so X=R'*R [U,S,V,rk] = svd(R,tol); // so R=U*S*V' and V*(S^2)*V' aproximates X This way S^2 is diagonal, with rk nonzero elements, which are the eigenvalues of X greater than tol^2. I'm not sure if this is fast or not, but it is worth a try. You can't control the number of eigenvalues calculated, but you are getting the bigger ones. |
Registered Member
|
I'm right now programming in c++ using eigen library, I want to calculate first few eigen vectors for a matrix of size 2500x2500 and is pretting slow
is there a way doing this using this library in c++.Thanks in advance! |
Registered Member
|
I don't think this is possible. There is only an option to calculate eigenvectors or not.
I used MKL/LAPACK for a similar case where I needed only the first (minimum) eigenvalue. |
Registered Member
|
With a little programming, you might implement the power method: repeatedly multiplying
an arbitrary vector by your matrix A and normalizing the result will get you the largest eigenvalue lambda1 (and associated eigenvector v1). Replacing A by A - lambda1*v1*v1' and using the same procedure will get you the second, etc. Easy to program and will be much faster if you only need a few eigenvectors/eigenvalues. |
Moderator
|
Have a look at this thread for a starting code for the power method: viewtopic.php?f=74&t=108033
|
Registered Member
|
You can use the ARPACK wrapper in Eigen/unsupported. It works with dense
matrices as well, and lets you compute the first k eigenvalues/vectors. You'll need ARPACK installed on your system. |
Registered users: Bing [Bot], Google [Bot], Sogou [Bot]