acts-project / acts-project/acts
`Axis` produces underflow and overflow bins unconditionally
- Dominant language
- C++
- Stars
- 131
- Forks
- 276
- Avg merge
- 3d 13h
- Merged PRs (30d)
- 112
Description
Currently `Axis` produces underflow and overflow bins unconditionally which then propagates to `MultiAxis` and `Grid`. For 1D this is not really a problem, one just needs to be careful with the indexing. The underflow bin is `bin = 0` and the overflow bin is `bin = # bins`. While some functions that receive a `bin` will handle underflow and overflow bins gracefully, others only document that `bin` needs to be inside the covered range and produce funny output.
In case of `AxisBoundaryType::Bound` and `AxisBoundaryType::Closed`, underflow and overflow bins do not exist but will still be indexed as mentioned above.
For `MultiAxis` this might become a burden as with increasing dimension more and more bins will be underflow and overflow bins. For `Grid` we allocate a dense storage. In case these bins don't end up used it could be quite wasteful in terms of total memory used and memory bandwidth and cache locality.
Just to provide one example: a multi axis with `{1, 2, 3}` regular bin vector and a total of 6 regular bins ends up having 60 bins the including underflow and overflow ones.
Contributor guide
Assessment
This issue has not been assessed yet.