octave-maintainers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: eigs compatibility


From: Daniel J Sebald
Subject: Re: eigs compatibility
Date: Thu, 04 Jul 2013 14:54:37 -0500
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.24) Gecko/20111108 Fedora/3.1.16-1.fc14 Thunderbird/3.1.16

On 07/04/2013 02:21 PM, John W. Eaton wrote:
On 07/04/2013 03:03 PM, Daniel J Sebald wrote:

I guess a sparse matrix of 2x2 isn't really all that sparse. Anyway, if
it is important to have compatibility or just handle all dimensions, and
it is only 2x2 and 1x1 that must be dealt with, rather than require a
different math package be used to offer those results, it might be just
as easy to write out the formulas for the solution to the eigenvalues.
If one were to study the math, it probably breaks down into some simple
inversion formulas which aren't so challenging until getting above 3x3.
Why isn't there support in the sparse math package?

I have no clue why ARPACK has the limitation of providing at most N-2
eigenvalues, but that's the way it works. I'm not going to try to fix
that problem.

I'm not familiar with the ARPACK library, but it looks like the number of subdimensions is selectable as 'k'. I'm going to guess that these eigenvalue techniques of ARPACK are fast at finding the eigenvalues of higher strength but then become slower with weaker eigenvalues. So, if one were to ask for all the eigenvalues, the routine my get bogged down, in a sense. Not sure.

But here

http://www.caam.rice.edu/software/ARPACK/UG/node13.html#SECTION00570000000000000000

the developers indicate that BLAS and LAPACK are requirements and if there is something in those libraries to substitute or utilize, do so. Given that, I guess falling back on those libraries for small matrix eigenvalues is fine.


Apparently Matlab's eigs function automatically handles the cases of
computing N or N-1 eigenvalues. I don't know how to do that other than
by calling eig and sorting the results as needed.

Oh, so it isn't just the 2x2 case. It might be if someone has a 20x20 matrix and asks for 19 eigenvalues/vectors? I would say try a timing experiment comparing:

20x20 non-sparse
20x20 sparse requesting 18 eigenvalues/vectors

If those two are close then, i.e., the ARPACK really slows down as the number of subdimensions approaches the dimension of the matrix, then the ARPACK developers probably figured it is best to have the users of the software fall back on the LAPACK or BLAS full matrix equivalent...as you are proposing. I've a feeling that there really isn't a problem here, it just that the original Octave programmer didn't realize ARPACK suggests falling back on LAPACK or BLAS.


I think Matlab does not issue a warning until N >= 8, then it says that
you should use "eig (full (A))" or something similar, but still goes
ahead and does the calculation anyway. Would someone like to confirm
that behavior?

I don't think it makes sense to try to write out the analyical solution
for eigenvalues for N == 6, or 5, ...

One wouldn't want to write out analytical solutions for N equal 5 or 6, just 2 or in a pinch 3. Anything above that is best handled with rotation, pivoting, whatever.

Also, I don't know why Matlab would issue a warning about N > 7. That doesn't seem like a such a big and CPU consuming problem. I would guess somewhere above 20 is when things become noticeably slow for modern processors. Maybe 15, but certainly not 7.

Dan


reply via email to

[Prev in Thread] Current Thread [Next in Thread]