-
-
Notifications
You must be signed in to change notification settings - Fork 9
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
implement Tridiagonal, Bidiagonal, and Triangular eigensolvers #17
Comments
+1 |
@andreasnoackjensen - In case you have some spare cycles... |
I've implemented |
Can't you just compute the left eigenvectors of its transpose? |
Right, I forgot that For |
See also JuliaLang/julia#5255 |
Apparently every time I rebase a commit referencing an issue, Github creates a new cross-reference. Oopsie. |
bump |
Sorry I haven't made a pull request yet. I have spent some time on preparing some QR code and I plan to open a pull request with later today. When that is code I'll prepare the eigensolver code. |
@andreasnoack can this issue be closed? |
Not yet. The tridiagonal case is still to be implemented. |
(Sorry, I confused Tridiagonal with SymTridiagonal.) I think that for (sterf,elty) in ((:dsterf_,Float64), (:ssterf_,Float32))
# DSTERF computes all eigenvalues of a symmetric tridiagonal matrix
# using the Pal-Walker-Kahan variant of the QL or QR algorithm.
# Arguments:
# N (input) INTEGER -- The order of the matrix. N >= 0.
# D (input/output) DOUBLE PRECISION array, dimension (N)
# On entry, the n diagonal elements of the tridiagonal matrix.
# On exit, if INFO = 0, the eigenvalues in ascending order.
# E (input/output) DOUBLE PRECISION array, dimension (N-1)
# On entry, the (n-1) subdiagonal elements of the tridiagonal matrix.
# On exit, E has been destroyed.
# INFO (output) INTEGER -- exit code
@eval function sterf!(A::SymTridiagonal{$elty})
info = Array(BlasInt, 1)
n = size(A, 2)
ccall(($(blasfunc(sterf)), liblapack), Void,
(Ptr{BlasInt}, Ptr{$elty}, Ptr{$elty}, Ptr{BlasInt}), &n, A.dv, A.ev, info)
# @lapackerror
return A.dv
end
end
n = 1000
A = SymTridiagonal(rand(n), rand(n-1))
@time sterf!(copy(A))
@time eigvals(A);
@time eigvals(full(A)); gives
I'm not sure if there is some other reason to prefer |
(
|
Yes, the |
@stevengj I have now changed the default solver for |
Thanks. (Which commit?) |
Oops. I only pushed it to |
bump. what's the status on this? it's on the v0.4.x list, but looks like it has not had any work done this year. that seems to imply it is not a current high priority? |
I think we are actually good here since the original wish for solvers for |
Currently,
eig
and similar throwno method eigfact
when applied to these types of matrices. We should be able to provide efficient LAPACK-based solvers for these types.For
Tridiagonal
, we can exploit the fact that it is already in Hessenberg form to callxHSEQR
directly.In the case of
Bidiagonal
matrices, the eigenvalues can be read off the diagonal with no computation, and eigenvectors can be obtained in O(m^2) time (one linear-time solve per eigenvector).Similarly, any
Triangular
matrix is already in Schur form (or its transpose), allowing us to read off the eigenvalues from the diagonal and to compute the eigenvectors by callingxTREVC
.TridiagonalThe text was updated successfully, but these errors were encountered: