FillArrays.jl icon indicating copy to clipboard operation
FillArrays.jl copied to clipboard

Specialize repeat(::Fill)

Open cossio opened this issue 3 years ago • 1 comments

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  1  1  1
 1  1  1  1  1  1  1  1  1

Seems wasteful to return a dense matrix here, when it can just return Trues(4,9).'

Same goes for all AbstractFill types, in all cases repeat(::AbstractFill) should return the a Fill type.

cossio avatar Mar 27 '22 12:03 cossio

Related: https://github.com/JuliaArrays/FillArrays.jl/issues/23, it would make sense to have both of these added

jishnub avatar Oct 16 '22 07:10 jishnub