-
-
Notifications
You must be signed in to change notification settings - Fork 37
make eigvals(::Diagonal) accept sortby #1477
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
base: master
Are you sure you want to change the base?
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #1477 +/- ##
=======================================
Coverage 93.92% 93.92%
=======================================
Files 34 34
Lines 15933 15934 +1
=======================================
+ Hits 14965 14966 +1
Misses 968 968 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
cc @stevengj |
dkarrasch
left a comment
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.
Just a minor comment. I like it in terms of consistency, but I'm a little afraid due to changing the default behavior.
Co-authored-by: Daniel Karrasch <[email protected]>
|
I think one can hardly rely on eigenvalues not being sorted, making them sorted by default is harmless. Another possibility would be to add the |
|
Do we have a test for the eigenvectors with sorted eigenvalues? Currently, the default About the default sorting, @stevengj's comment is relevant here: #1450 (comment) Before v.12, the eigenvectors were returned as a dense matrix, for which it doesn't seem to make any difference whether the eigenvectors are the identity matrix or a permuted version thereof. With the new In any case, making sorting accessible is a clear (consistency) win! |
|
There is already a test, line 422 of Note that I didn't change the behaviour of |
|
Now I see clearer. If you change the default, it won't return a |
|
Ah, I see, functions are types, so it is not actually type unstable. Just a trip hazard. Is it less controversial, though? People already complained about it in the original PR JuliaLang/julia#21598, and another person besides me filed an issue about it. |
|
I guess differing opinions is what makes it controversial. 😂 I don't have a personal preference TBH. If we change the default behavior, this needs to be listed in some sort of NEWS.md, together with the advice that if the user wants to benefit from low-memory |
|
Sorry, I thought you meant keeping the default Fair enough, I want to do another PR for |
|
Yes, adding the keyword is nice, and an "uncontroversial" new feature if we, for the time being, use/leave the current default sorting function Orthogonally to that, perhaps in an issue, we should discuss if we shift towards having all |
Solves the
Diagonalpart of #1471 and #1450.I thought it would be better to start with
Diagonal, as it was the only part that required a bit of thinking. I think it also makes sense in itself, sinceeigenacceptedsortby, justeigvalsandeigvecsdid not. Even though the docstring said none did.If this is welcome I'll also do
SymTridiagonal, and then we can document that eigenvalues are sorted by default.