-
Notifications
You must be signed in to change notification settings - Fork 2
Closed
Description
Thanks for sharing this package. It's a very useful data structure to use when I write simulations and need moving windows of multidimensional data.
I was surprised by the behavior of push!
at first:
julia> a = CircularArrayBuffer(zeros(4,3))
4×3 CircularArrayBuffer{Float64, 2}:
0.0 0.0 0.0
0.0 0.0 0.0
0.0 0.0 0.0
0.0 0.0 0.0
julia> push!(a, 0.5)
4×3 CircularArrayBuffer{Float64, 2}:
0.0 0.0 0.5
0.0 0.0 0.5
0.0 0.0 0.5
0.0 0.0 0.5
On second thought, it of course makes sense that this behavior is useful in some situations, but would it also be possible and make sense to add another function or add an option to push!
that would allow one to efficiently push single values?
Something like:
julia> push!(a, 0.5, broadcast=false)
4×3 CircularArrayBuffer{Float64, 2}:
0.0 0.0 0.0
0.0 0.0 0.0
0.0 0.0 0.0
0.0 0.0 0.5
Metadata
Metadata
Assignees
Labels
No labels