-
Notifications
You must be signed in to change notification settings - Fork 1.4k
[skip-ci][hist] Document architecture for initial set of classes #19295
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
Conversation
To enable incremental review, the start of this architecture document is provided upfront. Further classes will be added when implemented.
```c++ | ||
RLinearizedIndex ComputeLinearizedIndex(double x); | ||
``` | ||
The `bool` is used to indicate if the return value is valid. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since the switch from pair<size_t,bool>
to RLinearizedIndex
and with RLinearizedIndex
not being described (at that point of reading). This sentence ("The bool ..") is lacking a bit of context.
For example, the argument may be outside the axis with the underflow and overflow bins disabled. | ||
`RLinearizedIndex` is a simple struct with a `std::size_t index` and `bool valid`. | ||
It is chosen over `std::optional` because it unifies the return value construction: | ||
If outside the axis, the validity is just determined by the member property `fEnableFlowBins`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If outside the axis, the validity is still valid if flow bins have been enabled (as recorded by the member property `fEnableFlowBins`).
RLinearizedIndex ComputeGlobalIndex(const std::tuple<A...> &args) const; | ||
``` | ||
that dispatches arguments to the individual `ComputeLinearizedIndex` and combines the results. | ||
If any of the linearized indices is invalid, so will be the combination. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If any of the linearized indices is invalid, so is the combination.
maybe ... to match tenses.
|
||
This class combines an `RAxes` object and storage of bin contents in a `std::vector`. | ||
During `Fill`, it calls `RAxes::ComputeLinearizedIndex` and then updates the bin content. | ||
In contrast to `RHist`, this class supports direct concurrent filling via `FillAtomic`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This could use some more context and justification. (i.e. why this contrast/difference?).
|
||
### `RBinIndex` | ||
|
||
A single bin index, which is just an integer for normal bins. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is the relation ship with RLinearizedIndex
?
### `RBinIndex` | ||
|
||
A single bin index, which is just an integer for normal bins. | ||
`Underflow()` and `Overflow()` are special values and not ordered with respect to others. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not ordered with respect to others.
Why not? and/or why is it important?
To enable incremental review, the start of this architecture document is provided upfront. Further classes will be added when implemented.