Skip to content

Cartesian indexing for SubArrays with non-integer AbstractRanges #52094

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

Merged
merged 6 commits into from
Nov 19, 2023

Conversation

jishnub
Copy link
Member

@jishnub jishnub commented Nov 9, 2023

With #50457 now merged, an AbstractRange of CartesianIndexes should use CartesianIndexing in constructing a SubArray. I've limited the method to integer ranges, as this is the case where we know for sure that the indexing may be linear.

Fixes

julia> view(1:2, StepRangeLen(CartesianIndex(1), CartesianIndex(1), 0))
0-element view(::UnitRange{Int64}, StepRangeLen(CartesianIndex(1,), CartesianIndex(1,), 0)) with eltype Int64

@jishnub jishnub added the arrays [a, r, r, a, y, s] label Nov 9, 2023
@jishnub jishnub requested a review from N5N3 November 17, 2023 06:13
@jishnub
Copy link
Member Author

jishnub commented Nov 19, 2023

Good to go?

@N5N3 N5N3 added the merge me PR is reviewed. Merge when all tests are passing label Nov 19, 2023
@jishnub jishnub merged commit c07893d into master Nov 19, 2023
@jishnub jishnub deleted the jishnub/viewindexingcartesianrange branch November 19, 2023 10:09
@giordano giordano removed the merge me PR is reviewed. Merge when all tests are passing label Nov 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
arrays [a, r, r, a, y, s]
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants