Skip to content
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 combination with FillArrays.jl #815

Closed
dlfivefifty opened this issue Aug 16, 2020 · 3 comments
Closed

Support combination with FillArrays.jl #815

dlfivefifty opened this issue Aug 16, 2020 · 3 comments
Labels

Comments

@dlfivefifty
Copy link
Member

It comes up pretty naturally to combine StaticArrays.jl with FillArrays.jl, e.g., Fill(SVector(1,2), 10). This can support more specialised behaviour, for example, we could support

Fill(SVector(1,2), 10) .* Zeros(10) === Zeros{SVector{2,Float64},1}(10)

This raises a couple questions:

  1. Should FillArrays.jl depend on StaticArrays.jl or the other way around? An argument that FillArrays.jl should depend on StaticArrays.jl is that the tests already do, and its currently more prone to breaking tags.
  2. Should we add a static version of Fill? Ref Unify Ones and Zeros as SFill{0} and SFill{k}? FillArrays.jl#104

If we decide on FillArrays.jl depending on StaticArrays.jl, I can close this issue as there's nothing to do here, but just wanted to raise the question first.

@c42f c42f added the question label Sep 16, 2020
@c42f
Copy link
Member

c42f commented Sep 16, 2020

Should FillArrays.jl depend on StaticArrays.jl?

Yes, this seems like the right way around.

Should we add a static version of Fill?

I don't know about this one. Probably best discussed at FillArrays :)

@dlfivefifty
Copy link
Member Author

Should we add a static version of Fill? Ref JuliaArrays/FillArrays.jl#104

Ha, just realised it already works!

julia> Fill(1, (SOneTo{2}(),))
2-element Fill{Int64,1,Tuple{SOneTo{2}}} with indices SOneTo(2): entries equal to 1

@c42f
Copy link
Member

c42f commented Sep 16, 2020

Nice!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants