boostorg / histogram

Fast multi-dimensional generalized histogram with convenient interface for C++14
Boost Software License 1.0
315 stars 71 forks source link

Bin count is limited by `unsigned` #332

Closed vakokako closed 3 years ago

vakokako commented 3 years ago

histogram::axis::regular constructor takes bins count as unsigned. Are there any plans to support bigger types?

There is histogram::axis::index_type, maybe adding equivalent for bin count so that this could be a simple patch if somebody would want lets say size_t number of bins.

henryiii commented 3 years ago

Just curious, do you have an actual use case for more than four billion bins in a single histogram axis?

HDembinski commented 3 years ago

What @henryiii said. unsigned is deemed large enough (by a huge margin) and so there are currently no plans to support a bigger type per axis, but if you have a convincing use-case, I am happy to consider this.

HDembinski commented 3 years ago

Note that a multi-dimensional histogram is allowed to have more than four billion bins. The restriction here is four billion bins per axis.

vakokako commented 3 years ago

It's true, the number of bins is probably enough. It's mostly for consistency with most other containers, where the size_t is used for size.