Skip to content

Commit 7076632

Browse files
Merge pull request #25 from baggepinnen/patch-1
Add getindex(::VofA, ::Colon, ::Int)
2 parents b1b147c + fa36501 commit 7076632

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/vector_of_array.jl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ end
4040
# Interface for the two dimensional indexing, a more standard AbstractArray interface
4141
@inline Base.size(VA::AbstractVectorOfArray) = (size(VA.u[1])..., length(VA.u))
4242
@inline Base.getindex{T, N}(VA::AbstractVectorOfArray{T, N}, I::Int...) = VA.u[I[end]][Base.front(I)...]
43+
@inline Base.getindex{T, N}(VA::AbstractVectorOfArray{T, N}, ::Colon, I::Int) = VA.u[I]
4344
@inline Base.setindex!{T, N}(VA::AbstractVectorOfArray{T, N}, v, I::Int...) = VA.u[I[end]][Base.front(I)...] = v
4445

4546
# The iterator will be over the subarrays of the container, not the individual elements

0 commit comments

Comments
 (0)