-
-
Notifications
You must be signed in to change notification settings - Fork 22
Too restrictive setindex! for triangular matrices #761
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
Comments
|
Yes, I haven't encountered any numeric types for which these two are different. What I was doing is making tests for JuliaArrays/StaticArrays.jl#814 using block matrices and I was surprised that |
Triangular matrices are certainly useful in principle for block-triangular types, but I suspect that a number of code updates are required to make that work with our existing types. Using |
We've had this same discussion in the context of SparseArrays; we should match that. JuliaLang/julia#30580 |
All that PR does is changing |
So I would support changing |
Using |
Currently |
If The point is, whatever units (Note that |
setindex!
of triangular matrices could be less restrictive when setting to a structural zero: https://github.com/JuliaLang/julia/blob/4ed484fe7ac591da67bfe384c369430ed658606d/stdlib/LinearAlgebra/src/triangular.jl#L231it could be
iszero(x)
instead.I'm not sure about diagonals of unit triangular matrices (Julia doesn't have
isoneunit
) butisone(x)
may be better thenx == 1
as well.The text was updated successfully, but these errors were encountered: