Skip to content

Commit 12b943a

Browse files
add eachindex for linear indexing
1 parent 33b2a7a commit 12b943a

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
@@ -12,6 +12,7 @@ VectorOfArray(vec::AbstractVector) = VectorOfArray(vec, (size(vec[1])..., length
1212
# Interface for the linear indexing. This is just a view of the underlying nested structure
1313
@inline Base.endof(VA::AbstractVectorOfArray) = endof(VA.u)
1414
@inline Base.length(VA::AbstractVectorOfArray) = length(VA.u)
15+
@inline Base.eachindex(VA::AbstractVectorOfArray) = Base.OneTo(length(VA.u))
1516
# Linear indexing will be over the container elements, not the individual elements
1617
# unlike an true AbstractArray
1718
@inline Base.getindex{T, N}(VA::AbstractVectorOfArray{T, N}, I::Int) = VA.u[I]

0 commit comments

Comments
 (0)