Fix infinite loop in complex non-symmetric eigenvalue decomposition#1156
Open
su-senka wants to merge 1 commit into
Open
Fix infinite loop in complex non-symmetric eigenvalue decomposition#1156su-senka wants to merge 1 commit into
su-senka wants to merge 1 commit into
Conversation
The non-symmetric Hessenberg-QR eigenvalue loops for Complex and Complex32 had no iteration cap, so they could loop forever on defective matrices with repeated eigenvalues (e.g. the 3x3 from mathnet#11). The real-valued Double/Single versions already guard this with 'iter >= 30*order -> NonConvergenceException'; this ports the same guard into the four complex-valued spots (UserEvd and the managed provider, for both Complex and Complex32), and adds regression tests covering each path. Fixes mathnet#11.
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.
Evd()hangs indefinitely on defective complex matrices (repeated eigenvalues), e.g. the 3×3 from #11. The non-symmetric Hessenberg-QR loop in the complex-valued algorithms has no iteration cap — it tries exceptional shifts atiter==10/20, but nothing terminates the loop if those don't resolve the degeneracy.The real-valued
Double/Singlepaths already guard this withiter >= 30*order -> throw NonConvergenceException. This change ports the same guard into the four missing complex-valued spots:UserEvdandManagedLinearAlgebraProvider, for bothComplexandComplex32.Verified the affected complex paths now throw
NonConvergenceExceptionin a few ms instead of hanging, while the real-valued paths still converge correctly on the same matrix structure. Added a regression test per path (4 total).Fixes #11.