You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I found some questionable behavior regarding indices of OffsetArrays.
julia> include("test/TestHelpers.jl")
Main.TestHelpers
julia> using Main.TestHelpers.OAs
julia> a = [11,12,13]
3-element Array{Int64,1}:
11
12
13
julia> b = OffsetArray(a, (-3,))
OffsetArray{Int64,1,Array{Int64,1}} with indices -2:0:
11
12
13
julia> i = LinearIndices(b)
LinearIndices{1,Tuple{Base.Slice{UnitRange{Int64}}}} with indices -2:0:
-2
-1
0
julia> i[-2]
-2
julia> i[-2:end]
-5:-3
I suspect this is a bug. Because these are a Slice I feel the scalar getindex behavior is correct and the behavior here is wrongly assuming 1-based indexing.
The text was updated successfully, but these errors were encountered:
I found some questionable behavior regarding indices of
OffsetArray
s.I suspect this is a bug. Because these are a
Slice
I feel the scalargetindex
behavior is correct and the behavior here is wrongly assuming 1-based indexing.The text was updated successfully, but these errors were encountered: