FillArrays.jl
FillArrays.jl copied to clipboard
Julia package for lazily representing matrices filled with a single entry
On master: ```julia julia> @btime fill(2, 300, 300); 61.167 μs (2 allocations: 703.17 KiB) julia> x = Fill(2, 300, 300); julia> @btime [i for i in $x]; 77.769 μs (2...
Fixes #179
This package overwrites Base's behaviour for one-argument `map`, for example: ``` julia> map(println) # calls println() julia> using FillArrays julia> map(println) ERROR: MethodError: reducing over an empty collection is not...
This is surprising: ```julia julia> real(Fill(1+im)) isa Array{ real(fill(1+im)) isa Array{Int,0} true (jl_AeiBcQ) pkg> st Status `/private/var/folders/yq/4p2zwd614y59gszh7y9ypyhh0000gn/T/jl_AeiBcQ/Project.toml` [1a297f60] FillArrays v0.11.7 ``` I guess it comes from this difference, via `broadcast_preserving_zero_d`:...
Hi there! I love your package, and I recently stumbled upon undefined behavior when combining it with SparseArrays. Here's the MWE: ```julia julia> using FillArrays, SparseArrays julia> x = Zeros(10)...
ChainRules now has a projection mechanism to preserve, among other things, the structure of structured arrays. This should probably apply to FillArrays. So this PR writes a few methods. However,...
It might make the code cleaner to do: ```julia struct SFill{k, T, N, Axes}
Derived from #176 and #104 > @dlfivefifty: I would say a better solution may be to just support Fill{StaticInt}, etc. Taking on Static.jl as a dependency would open up interesting...
Fixes #23 in case the offer from 2018 still stands :) There where a few more edge cases than I had first thought and I hope the testing covers them...
``` julia> repeat(Trues(2,3), 2,3) 4×9 Matrix{Bool}: 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1...