# Number of eigenvalues when using eigs

2 Ansichten (letzte 30 Tage)
Thomas am 6 Dez. 2011
Kommentiert: Andrew Knyazev am 15 Mai 2015
Dear all,
I specify a certain number of eigenvalues eigs should return e.g. [V,D]=eigs(A,B,100,'lr'). I hardly get 100 eigenvalues. Usually I get much less than 100 eigenvalues. Anyone knows why this is so? I need to compare all the 100 eigenvalues for my problem. A and B are large sparse matrices (on the order of a few thousand entries).
Thomas
##### 1 KommentarKeine anzeigenKeine ausblenden
the cyclist am 6 Dez. 2011
I was not able to replicate the behavior. Are you able to give a simply specified version that exhibits the behavior? Are you able to scale down the size and still see it?
Also, eigs() is not a built-in, so you might get a clue about what is going on breakpointing inside the function and going through step-by-step.

Melden Sie sich an, um zu kommentieren.

### Antworten (2)

Mark Stone am 15 Mai 2015
Bearbeitet: Mark Stone am 15 Mai 2015
eigs does not always converge, even if maximum number of iterations is significantly increased and/or solution tolerance decreased. Furthermore, it is random, i.e., non-repeatable, even on the exact same matrix unless random numbers are controlled to be the same at invocation.
eig is much more robust than eigs, and execution time of eigs is more unpredictable than eig, and can be longer. I've run nonlinear optimization algorithms in which eigenvalues (maybe the most extreme 1 or 2) appear in the objective function and/or constraints - even though the algorithm might start and finish (if it ever gets there) in a nice neighborhood in which eigs works just fine, the algorithm might have to go through some unseemly areas along the way, and eigs has a propensity for getting into trouble somewhere and muck everything up. I've rendered eigs to the ash heap of history after wasting too much time dealing with its nonsense. Someone should shoot it and put it out of the misery it causes.
##### 1 KommentarKeine anzeigenKeine ausblenden
Andrew Knyazev am 15 Mai 2015
http://www.mathworks.com/matlabcentral/fileexchange/48-lobpcg-m is a possible replacement of eigs in some cases

Melden Sie sich an, um zu kommentieren.

Andrew Knyazev am 15 Mai 2015
This is normal for eigs.
##### 0 Kommentare-1 ältere Kommentare anzeigen-1 ältere Kommentare ausblenden

Melden Sie sich an, um zu kommentieren.

### Kategorien

Find more on Linear Algebra in Help Center and File Exchange

### Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by