Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Fast bounds-check for infinite CartesianIndex StepRangeLen #190

Merged
merged 2 commits into from
Aug 27, 2024

Conversation

jishnub
Copy link
Member

@jishnub jishnub commented Aug 27, 2024

Julia v1.11 allows StepRangeLen{<:CartesianIndex} indices, but the bounds-check for such a range falls back to element-wise iteration. The other issue with such an infinite range is that last can't be defined as a CartesianIndex, as it only accepts Ints.
In this PR, we define checkindex for such indices by only comparing the starting point. This would allow bounds-checking for infinite arrays with such indices.

Copy link

codecov bot commented Aug 27, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 86.14%. Comparing base (8865985) to head (7ee603a).
Report is 5 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #190      +/-   ##
==========================================
+ Coverage   85.49%   86.14%   +0.65%     
==========================================
  Files           7        6       -1     
  Lines         772      758      -14     
==========================================
- Hits          660      653       -7     
+ Misses        112      105       -7     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@jishnub jishnub force-pushed the jishnub/bounds_check_steprangelen_cartinds branch from 6cd7144 to 7ee603a Compare August 27, 2024 08:54
@jishnub jishnub merged commit d9f862f into master Aug 27, 2024
12 checks passed
@jishnub jishnub deleted the jishnub/bounds_check_steprangelen_cartinds branch August 27, 2024 10:02
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant