add exceptional shift#1603
Open
Toucan4Life wants to merge 1 commit into
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary of Changes
This PR fixes some cases where the search for eigenvalue could hang. This was solved by using the "Exceptional Shift" method in Wilkinson, J. H., & Reinsch, C. (1971).
Handbook for automatic computation (Vol. 2: Linear algebra).
Details
I first checked why the Lapack algorithm would converge and not hang. I looked at dlahqr procedure (https://netlib.org/lapack/explore-html/d8/df4/group__lahqr_ga100049ab080cef756846702a33e8e28f.html) saw the mention of the exceptional shift and the Ahues & Tisseur stopping criterion.
The last one was a red herring, I implemented it but the test matrix from #611 would still hang. I then implemented the exceptional shift and it worked. I tried tracing back the magical value (0.75 & -0.4375), and discovered https://www.netlib.org/eispack/hqr.f that led me to the original source:
Wilkinson, J. H., & Reinsch, C. (1971).
Handbook for automatic computation (Vol. 2: Linear algebra).
You can view the orignal magical number and algorithm implementation here : https://www.scribd.com/document/568239788/Wilkinson-Reinsch1971-Book-HandbookForAutomaticComputatio#page=373
AI was used to find the original paper
Testing
I implemented a test with the matrix from #611 that now pass successfully
Fixes #611