-
Notifications
You must be signed in to change notification settings - Fork 38
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
Support structured array types #223
Comments
See JuliaLang/LinearAlgebra.jl#993 for a different approach. In general, perhaps this should be done through broadcast styles? |
That's true, but I don't know how broadcast works. Will broadcasting not be affected by ambiguity? StaticArrays uses |
Prior to 1.9, can we have mini packages that resolve the ambiguities? For example, FillArraysXStaticArrays.jl |
one could use |
I think broadcasting is the right approach. I believe if there's an ambiguity in broadcasting it falls back to the default behaviour. That is: we should overload |
Note julia> S .+ S
5×5 Matrix{Float64}:
-1.90614 2.27016 -0.412719 0.331858 3.62299
2.27016 -1.48817 0.456745 2.18015 0.599337
-0.412719 0.456745 4.30436 -2.37771 0.431586
0.331858 2.18015 -2.37771 0.966284 0.971221
3.62299 0.599337 0.431586 0.971221 -1.9591
julia> S + S
5×5 Symmetric{Float64, Matrix{Float64}}:
-1.90614 2.27016 -0.412719 0.331858 3.62299
2.27016 -1.48817 0.456745 2.18015 0.599337
-0.412719 0.456745 4.30436 -2.37771 0.431586
0.331858 2.18015 -2.37771 0.966284 0.971221
3.62299 0.599337 0.431586 0.971221 -1.9591 So I'm inclined not to bother atm |
It appears that the julia> typeof(s)
Symmetric{Float64, Matrix{Float64}}
julia> Broadcast.BroadcastStyle(typeof(s))
Base.Broadcast.DefaultArrayStyle{2}() Perhaps |
Since JuliaLang/julia#222 , fill +/- loses support for most structured arrays.
It's not practical to list the types since ToeplitzMatrices, LazyArrays, StaticArrays, etc., are not dependencies. This could be solved in Julia 1.9 using package extensions.
The text was updated successfully, but these errors were encountered: