-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
LAPACKException(22) for 32-bit storage and large matrices #64
Comments
According to the
|
Can you convert the matrix to |
In particular, if you generate a random real skew-Hermitian matrix, the eigenvalues always come in ± pairs. If, on top of that, you have a near degeneracy, this will lead to a near fourfold degeneracy of the eigenvalues, which LAPACK might not be built to deal with? |
(If the problem is the near degeneracy, a simple trick would be to shift the tridiagonal matrix by e.g. the Frobenius norm to break up the ± pairs). |
I tried to shift the |
However, scaling the matrix by its norm(thus scaling its eigenvalues) did work instead of shifting its eigenvalues. Remains to know if scaling a matrix by its norm is a good idea. If the norm is to big, it could overflow, if it is less than one, it squeezes the eigenvalues instead of getting these far from each other.
|
Scaling the matrix doesn't make any sense to me. The only thing that I can think of is that LAPACK has an erroneous absolute tolerance somewhere, which it really shouldn't — the algorithms to should be invariant under overall scaling. I wouldn't do a multiplicative scaling, even if it happens to work for some mysterious reason, because it seems like just piling bugs on top of bugs. |
(It seems like, since we know all of the eigenvalues come in pairs, there should be a way to reduce it to an eigenproblem of half the size somehow.) I would maybe look again through some of the papers on skew-symmetric eigensolvers in case they have any suggestions about the degenerate magnitudes. |
Scaling didn't make any sense to me either and I don't have any idea why it allowed |
The error only occurs for random |
It seems like this will have to be fixed in LAPACK itself. |
(Alternatively, you'd have to implement your own eigensolver, e.g. with a version of QR iterations, I guess. In principle this might be able to outperform the generic symtridiagonal eigensolver because you can take advantage of the diagonals being zero and the eigenvalues coming in ±λ pairs, maybe ala algorithm 530.) |
I think that trying to implement a fast eigensolver for tridiagonal skew-symmetric matrices could be a very nice challenge for my last week in Boston. As the package becomes quite complete, it is a very interesting problem to address, which is more on the "math side" of this package. |
#95 new skew-symmetric eigensolver was added. It is faster for tridiagonal matrices than the symmetric solver. However it cannot always work where LAPACK fails. For dense matrices, it is faster for matrices of size less than 200(on my machine), then it becomes slightly slower due to the hessenberg reduction that is slower. The skew-symmetric mv product is thus the last stone to beat LAPACK in single threaded. |
Can this issue be closed if you are no longer using the LAPACK solver? |
For sufficiently large matrices and 32-bit storage, LAPACKException(22) arises when
eigen
is called.eigen
callsstegr!
which throws the exception.The text was updated successfully, but these errors were encountered: