This forum has been archived. All content is frozen. Please use KDE Discuss instead.

Equivalent to Matlab "eigs" function ?

Tags: None
(comma "," separated)
mehrdadh
Registered Member
Posts
26
Karma
0
Hi,

I was wondering if you have any function to calculate only a small amount of eigenvalues and eigenvectors of a matrix using "Implicitly Restarted Arnoldi Methods". It is much faster if we want only the small subset of the eigenvalues. This function is already in ARPACK. I was wondering if it is in Eigen? and if not, how can I incorporate it (if it is easy) ?

Thanks
drewm1980
Registered Member
Posts
13
Karma
0
Hi-

I would find this functionality useful as well, but I don't believe it is currently in eigen. In my code I only need the first value:
#include <iostream>

#include <Eigen/Core>
#include <Eigen/Array>
#include <Eigen/SVD>
using namespace Eigen;

G = A.transpose()*A;
SVD<MatrixXd> svdOfG(G);
double tau = svdOfG.singularValues()(0);

I can't answer your question about how hard it would be to add.
User avatar
bjacob
Registered Member
Posts
658
Karma
3
Eigen doesn't do this at the moment, and it's actually quite nontrivial to add, as it is a completely separate algorithm.

However, if you're starting from a general (not banded/hessenberg) matrix, then the benefit of not computing all the eigenvalues, is not too big, as most of the time is typically spend in first reducing to banded/hessenberg form.


Join us on Eigen's IRC channel: #eigen on irc.freenode.net
Have a serious interest in Eigen? Then join the mailing list!
FMD
Registered Member
Posts
25
Karma
0
bjacob wrote:...
However, if you're starting from a general (not banded/hessenberg) matrix, then the benefit of not computing all the eigenvalues, is not too big, as most of the time is typically spend in first reducing to banded/hessenberg form.


OK. But --while I'm consider myself in the best case as semi-educated in this kind of discussion-- please let me add:
Starting from a FE-Analysis one typically have to deal with large sparse, often symmetrical, matrices. There exists also often a need to determine the very first eigenvalue. In this scenario, computing all eigenvalues is preventable slow by using specialized (e.g. iterative) methods.

(see e.g. http://www.cs.utk.edu/~dongarra/etemplates/index.html)

Frank
mehrdadh
Registered Member
Posts
26
Karma
0
I managed to compile arpack and then used arpack++ wrapper for its eigenvalue computations. It has very good performance. I haven't linked it with Eigen yet, but basically, you can add this functionality by using arpack, and for matrix-vector multiplication in the algorithms you can either use blas or use Eigen.
So I think it's an easy add-on functionality to Eigen.

Best


Bookmarks



Who is online

Registered users: Bing [Bot], Google [Bot], Sogou [Bot]