-
-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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
symmetrize/transpose in getindex of SymTridiagonal #31327
Conversation
|
I think this is ready for review/merge. |
I think this one hits the same issue as #32041. I'm wondering if we should materialize the transpose to avoid the type instability. |
Do you mean we should make block |
I fixed the type instability, at the expense of materializing the subdiagonal elements at every BTW, the |
After some long detour in between, I think I figured out how to solve the problem. I see two open issues:
Otherwise, the tests even check for type inference... and pass. |
added block matrix docstring more consistency in SymTridiagonal(A) and diag fix x-ref fix and test diag remove x-ref for Transpose fix and test for type inference simplify constructor, fix use of symmetric update docstrings, add comment
Is this still of interest? @dlfivefifty @andreasnoack |
Yes. Thanks for following up. |
* symmetrize/transpose in SymTridiagonal added block matrix docstring more consistency in SymTridiagonal(A) and diag fix x-ref fix and test diag remove x-ref for Transpose fix and test for type inference simplify constructor, fix use of symmetric update docstrings, add comment * don't symmetrize diagonal elements at construction, but at getindex * remove symmetry check at construction * don't symmetrize in SymTridiagonal(::Matrix) * fix doctests
Fixes JuliaLang/LinearAlgebra.jl#613.
Previously, there was no distinction between whether the second argument in the
SymTridiagonal
constructor was the super- or subdiagional, and whether the matrices on the diagonal are:U
or:L
symmetric. With this PR, this is hardcoded to:U
symmetry and superdiagonal, so that the subdiagonal gets transposed. Also, the code comment in line 8 should be changed then to "superdiagonal" as a correct reminder for developers.We could introduce an
uplo::Char
field, to switch between the two cases, with:U
being the default? But I'm not sure if this would be breaking...