-
Notifications
You must be signed in to change notification settings - Fork 42
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
view != getindex, with IdentityUnitRange #100
Comments
If you wrap it with julia> view(out, CartesianIndices(item), 1)
3-element view(::Array{Int64,2}, [3, 4, 5], 1) with eltype Int64:
301
4
5
julia> to_indices(item, (axes(item)..., 1))
(3:5, 1)
julia> to_indices(item, (CartesianIndices(item), 1))
(CartesianIndex{1}[CartesianIndex(3,), CartesianIndex(4,), CartesianIndex(5,)], 1) |
Thanks, that's a useful work-around, which I would never have thought to try! |
update with another result: julia> ind = OffsetArrays.IdOffsetRange(3:5, 0)
3:5
julia> view(out, ind, 1)
3-element view(::Array{Int64,2}, 3:5, 1) with eltype Int64 with indices 3:5:
5
6
7
julia> view(out, 3:5, 1)
3-element view(::Array{Int64,2}, 3:5, 1) with eltype Int64:
301
4
5 Definitely that there's something not covered here. Let me see if I can tackle this ( seems like a good exercise to me :P) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I got some strange results copying a piece into a larger array, and if I understand right it looks like a problem with how
view
deals withIdentityUnitRange
.The text was updated successfully, but these errors were encountered: