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
julia> using OffsetArrays
julia> reduce(hcat, OffsetVector([1:2, 1:2],10))
ERROR: BoundsError: attempt to access 2-element Array{UnitRange{Int64},1} at index [-9]
The text was updated successfully, but these errors were encountered:
That seems to be a different issue, as the vectors being concatenated (arguments to hcat) have offsets, whereas the current issue is about the argument to reduce having an offset.
Since reduce is defined for a general iterator, it shouldn't matter what the input axes of its second argument are, only what it returns when iterated.
EDIT: the original example was bad, because it should also fail for a different reason. I edited it now. This should clarify the problem:
julia> reduce(hcat, [1:2, 1:2])
2×2 Array{Int64,2}:
1 1
2 2
julia> reduce(hcat, OffsetVector([1:2, 1:2], 10)) # should return the same result
ERROR: BoundsError: attempt to access 2-element Array{UnitRange{Int64},1} at index [-9]
EDIT 2: a possible workaround is directly invoking the general method:
On Julia 1.5.1:
The text was updated successfully, but these errors were encountered: