@@ -34,21 +34,21 @@ DiffEqArray(vec::AbstractVector{VT},ts::AbstractVector) where {T, N, VT<:Abstrac
3434@inline Base. IteratorSize (VA:: AbstractVectorOfArray ) = Base. HasLength ()
3535# Linear indexing will be over the container elements, not the individual elements
3636# unlike an true AbstractArray
37- @inline Base. getindex (VA:: AbstractVectorOfArray{T, N} , I:: Int ) where {T, N} = VA. u[I]
38- @inline Base. getindex (VA:: AbstractVectorOfArray{T, N} , I:: Colon ) where {T, N} = VA. u[I]
39- @inline Base. getindex (VA:: AbstractVectorOfArray{T, N} , I:: AbstractArray{Int} ) where {T, N} = VectorOfArray (VA. u[I])
40- @inline Base. getindex (VA:: AbstractDiffEqArray{T, N} , I:: AbstractArray{Int} ) where {T, N} = DiffEqArray (VA. u[I],VA. t[I])
41- @inline Base. getindex (VA:: AbstractVectorOfArray{T, N} , i:: Int ,:: Colon ) where {T, N} = [VA. u[j][i] for j in 1 : length (VA)]
37+ Base . @propagate_inbounds Base. getindex (VA:: AbstractVectorOfArray{T, N} , I:: Int ) where {T, N} = VA. u[I]
38+ Base . @propagate_inbounds Base. getindex (VA:: AbstractVectorOfArray{T, N} , I:: Colon ) where {T, N} = VA. u[I]
39+ Base . @propagate_inbounds Base. getindex (VA:: AbstractVectorOfArray{T, N} , I:: AbstractArray{Int} ) where {T, N} = VectorOfArray (VA. u[I])
40+ Base . @propagate_inbounds Base. getindex (VA:: AbstractDiffEqArray{T, N} , I:: AbstractArray{Int} ) where {T, N} = DiffEqArray (VA. u[I],VA. t[I])
41+ Base . @propagate_inbounds Base. getindex (VA:: AbstractVectorOfArray{T, N} , i:: Int ,:: Colon ) where {T, N} = [VA. u[j][i] for j in 1 : length (VA)]
4242Base. @propagate_inbounds function Base. getindex (VA:: AbstractVectorOfArray{T,N} , ii:: CartesianIndex ) where {T, N}
4343 ti = Tuple (ii)
4444 i = first (ti)
4545 jj = CartesianIndex (Base. tail (ti))
4646 return VA. u[i][jj]
4747end
48- @inline Base. setindex! (VA:: AbstractVectorOfArray{T, N} , v, I:: Int ) where {T, N} = VA. u[I] = v
49- @inline Base. setindex! (VA:: AbstractVectorOfArray{T, N} , v, I:: Colon ) where {T, N} = VA. u[I] = v
50- @inline Base. setindex! (VA:: AbstractVectorOfArray{T, N} , v, I:: AbstractArray{Int} ) where {T, N} = VA. u[I] = v
51- @inline function Base. setindex! (VA:: AbstractVectorOfArray{T, N} , v, i:: Int ,:: Colon ) where {T, N}
48+ Base . @propagate_inbounds Base. setindex! (VA:: AbstractVectorOfArray{T, N} , v, I:: Int ) where {T, N} = VA. u[I] = v
49+ Base . @propagate_inbounds Base. setindex! (VA:: AbstractVectorOfArray{T, N} , v, I:: Colon ) where {T, N} = VA. u[I] = v
50+ Base . @propagate_inbounds Base. setindex! (VA:: AbstractVectorOfArray{T, N} , v, I:: AbstractArray{Int} ) where {T, N} = VA. u[I] = v
51+ Base . @propagate_inbounds function Base. setindex! (VA:: AbstractVectorOfArray{T, N} , v, i:: Int ,:: Colon ) where {T, N}
5252 for j in 1 : length (VA)
5353 VA. u[j][i] = v[j]
5454 end
6363
6464# Interface for the two dimensional indexing, a more standard AbstractArray interface
6565@inline Base. size (VA:: AbstractVectorOfArray ) = (size (VA. u[1 ])... , length (VA. u))
66- @inline Base. getindex (VA:: AbstractVectorOfArray{T, N} , I:: Int... ) where {T, N} = VA. u[I[end ]][Base. front (I)... ]
67- @inline Base. getindex (VA:: AbstractVectorOfArray{T, N} , :: Colon , I:: Int ) where {T, N} = VA. u[I]
68- @inline Base. setindex! (VA:: AbstractVectorOfArray{T, N} , v, I:: Int... ) where {T, N} = VA. u[I[end ]][Base. front (I)... ] = v
66+ Base . @propagate_inbounds Base. getindex (VA:: AbstractVectorOfArray{T, N} , I:: Int... ) where {T, N} = VA. u[I[end ]][Base. front (I)... ]
67+ Base . @propagate_inbounds Base. getindex (VA:: AbstractVectorOfArray{T, N} , :: Colon , I:: Int ) where {T, N} = VA. u[I]
68+ Base . @propagate_inbounds Base. setindex! (VA:: AbstractVectorOfArray{T, N} , v, I:: Int... ) where {T, N} = VA. u[I[end ]][Base. front (I)... ] = v
6969
7070# The iterator will be over the subarrays of the container, not the individual elements
7171# unlike an true AbstractArray
0 commit comments