[hist] Implement RBinIndexRange
#19694
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The interface allows convenient iteration over
RBinIndex
.A bit of context on constructing
RBinIndexRange
: Initially I considered a plain constructor and / or static factory methods that would allow creating bin index ranges without an axis object. That was kind of awkward because of conventions (end
is exclusive, so to have a range includingRBinIndex::Overflow()
we use the invalidRBinIndex
), the difference in axis configurations (are flow bins enabled?), and in axis types (a categorical axis will only have an overflow, but not an underflow bin). When discussing with @hageboeck, we came to the conclusion that (for the moment) we prefer creatingRBinIndexRange
s from axis objects. This can also enforce a number of constraints, for example that the normal bins are actually valid for the given axis configuration. To simplify testing, I opted for aInternal::CreateBinIndexRange
that is also used byGet{Normal,Full}Range
.