-
-
Notifications
You must be signed in to change notification settings - Fork 5.1k
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
address svds returning nans for zero input matrix #3719
Conversation
Changes Unknown when pulling 2357848 on argriffing:singular-svds-lm into * on scipy:master*. |
This should be ready for review/merge. |
# Gramian matrices have real non-negative eigenvalues. | ||
eigvals = np.maximum(eigvals.real, 0) | ||
|
||
# Copy the sophisticated detection of small eigenvalues from pinvh. |
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.
Maybe just write it out rather than copypaste?
The if statements and several of the assignments are redundant here...
The maths look OK to me. Minor comments otherwise above. |
@pv Thanks for your comments, I've simplified the code accordingly. |
Changes Unknown when pulling ba71000 on argriffing:singular-svds-lm into * on scipy:master*. |
BUG: sparse.linalg: address svds returning nans for zero input matrix
Thanks, merged. |
fixes #3452 and passes sparse.linalg tests locally