-
-
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
Fixed #38346: Eigen decomposition of Symmetric Matrix containing NaNs now throws exception #38408
Conversation
@kc611 Thank you and welcome! Can you please add a test (à la |
It seems that there was already a test present for Eigen of matrices with NaN values. I extended it's functionality to Symmetric, Hermitian and Diagonal(just in case) ones. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Has comments that need to be addressed.
…lues appropriately
Changed the iterations to column-wise (the loops looks a bit clean and consistent that way) and added one based indexing check and Also I was thinking about adding a test case where the code is not supposed to throw exception. But dropped the idea since I could not find any appropriate way for doing that (#18780). Any suggestions? |
To verify, that a test does not throw and exception you could do for example:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
The usual unrelated test failures. Thank you very much @kc611, and sorry that it took a while. Your contribution is much appreciated! |
… now throws exception (JuliaLang#38408)
Fixes JuliaLang/LinearAlgebra.jl#780.
As suggested by @KlausC in the issue
adding a call to 'ckfinite' in 'syevr' is a nice fix for the problem. Since Eigen decomposition for both symmetric and hermitian matrix is making call to 'syevr' function it fixes the issue for both. Diagonal matrices already had such a fail-safe for NaN values
julia/stdlib/LinearAlgebra/src/diagonal.jl
Lines 674 to 676 in af3cd59