boostorg / histogram

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

Implement over-allocation for histograms with growing axes #278

Open HDembinski opened 4 years ago

HDembinski commented 4 years ago

Histograms with a growing axes should allocate more space than needed, similar to vector's push_back. This requires adding an extra field on an axis to query the spare capacity. A storage is then only resized if the spare capacity is exceeded.

HDembinski commented 4 years ago

We then need a reserve() on the axis and shrink_to_fit() to the histogram.