-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
RFC: enabled selctg
to reorder eigen values from within gees/gges
#9655
Conversation
See Travis failure
|
Tests are passing on my machine. Can anyone reproduce this locally? Not sure what the problem could be. |
I think that |
I think the original intention was to match the scipy's results, but it doesn't look like they had it for the complex version. I'm going to try the less than 1 example and see what happens. |
Wrote something on this gist. I want it to grab eigenvalues with modulus less than 1 and put those in the "upper left" of the matrix. They both give me the same matrix, but there are definitely some generalized eigenvalues with modulus less than 1 (can verify with |
Bump. What's the next step here? |
@spencerlyon2 We brought in another LAPACK function that let us order the eigenvalues in the way we wanted and implemented this in PR #9701 which was enough to finish what we wanted to do at that point in time. Obviously, implementing the A few weeks ago, we came across some work done by Dynare.jl that looks like they have already implemented this functionality in their own package -- See this file. Neither of us have had a chance to look at this more closely due to the semester being in full gear, but if what they have works then it is already done and it is just a matter of writing it up. |
I think we can do better now that we have julia> A = randn(5,5);
julia> abs(eigvals(A))
5-element Array{Float64,1}:
1.72023
1.72023
1.0195
0.704244
0.101243
julia> testf(x,y) = Int(hypot(x,y) < 1);
julia> abs(schurfact(A, testf)[:values])
5-element Array{Float64,1}:
0.704244
0.101243
1.72023
1.72023
1.0195 |
Code has been reorganized quite a lot since this PR, so I am going to assume someone will re-do this if they need it |
The Schur and generalized Schur routines in LAPACK have the ability to sort the result based on a callback function (parameter named
selctg
) that analyzes the eigenvalues.This RFC enables this feature for each of the
gees
andgges
routines as well the correspondingshurfact
,schurfact!
, andschur
methods.I have implemented basic tests that make sure the factorization still holds, but we should write better tests to see if the reordering is happening as expected. The problem is I don't know exactly what the answer should be, so it is hard to know if this is doing the right thing. Do we have any LAPACK experts out there who could come up with a good test case?
I was considering implementing the test case for the scipy qz function, but I am not getting the same answers as scipy. Could the difference possibly be attributed to differences in LAPACK implementation or platform dependence?
CC: @cc7768