19 Histogram(
int nbins,
float min,
float max)
20 : min_(min), max_(max), histogram_(nbins) {}
21 Histogram(
float min,
float max,
const std::vector<uint64_t>& bins)
22 : min_(min), max_(max), histogram_(bins) {}
24 void Add(
float f, uint64_t cnt = 1);
31 void Add(
const float* f,
int len);
46 const std::vector<uint64_t>* GetHistogram()
const {
52 std::vector<uint64_t> histogram_;
53 std::vector<uint64_t> per_thread_histogram_;
63 void Add(
const float* f,
int len);
77 std::vector<Histogram> histograms_;
81 std::unique_ptr<Histogram> final_histogram_;
An equi-width histogram where the spread of bins change over time when we see new min or max values...
bin_width = (max - min)/nbins ith bin (zero-based indexing) contains [i*bin_width, (i+1)*bin_width) with an exception that (nbins - 1)th bin contains [(nbins-1)*bin_width, nbins*bin_width]
void Finalize()
Reduce per-thread histogram.