Skip to content

Specialize repeat(::Fill) #175

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

Closed
cossio opened this issue Mar 27, 2022 · 1 comment · Fixed by #242
Closed

Specialize repeat(::Fill) #175

cossio opened this issue Mar 27, 2022 · 1 comment · Fixed by #242

Comments

@cossio
Copy link

cossio commented Mar 27, 2022

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 cossio changed the title Specialize repeat(::FIll) Specialize repeat(::Fill) Mar 27, 2022
@jishnub
Copy link
Member

jishnub commented Oct 16, 2022

Related: #23, it would make sense to have both of these added

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

Successfully merging a pull request may close this issue.

2 participants