84 int low_pair =
zero - 1;
85 for (
int i =
zero - 1;
i >= bottom_half;
i--) {
87 if (low_pair - 1 >= 0)
91 assert(low_pair == 0 || low_pair == -1 || low_pair == -2);
93 for (
int i = bottom_half - 1;
i >= 0;
i--)
98 for (
int i =
zero;
i < top_half;
i++) {
100 if (high_pair + 1 <
size)
104 assert(high_pair ==
size || high_pair ==
size + 1);
106 for (
int i = top_half;
i <
size;
i++)
119 const bool even = ((
size - 1) % 2) == 0;
128 for (
int i = pair;
i >=
zero; --
i) {
135 for (
int i =
zero - 1;
i >= 0;
i--)
157 int half = (
size + 1) / 2;
160 for (
int i = 0;
i < half;
i++) {
166 assert(pair ==
size || pair ==
size + 1);
168 for (
int i = half;
i <
size;
i++)
204 logs += std::log(
val) * number;
211 int b_size = hs->
size();
212 assert(
size() == b_size);
225 for (uint32_t
i = 0;
i < b_size;
i++)
Counter min_val
The smallest value sampled.
Counter sum
The current sum.
Counter samples
The number of samples.
VCounter cvec
Counter for each bucket.
Counter underflow
The number of values sampled less than min.
Counter squares
The sum of squares.
void sample(Counter val, int number)
Add a value to the distribution for the given number of times.
Counter min_track
The minimum value to track.
Counter bucket_size
The number of entries in each bucket.
Counter overflow
The number of values sampled more than max.
Counter max_val
The largest value sampled.
Counter max_track
The maximum value to track.
Templatized storage and interface for a histogram stat.
Counter sum
The current sum.
Counter samples
The number of samples.
void add(HistStor *other)
Adds the contents of the given storage to this storage.
void growUp()
Given a bucket size B, and a range of values [0, N], this function doubles the bucket size to double ...
Counter min_bucket
Lower bound of the first bucket's range.
void growOut()
Given a bucket size B, and a range of values [M, N], where M < 0, this function doubles the bucket si...
Counter bucket_size
The number of entries in each bucket.
size_type size() const
Return the number of buckets in this distribution.
VCounter cvec
Counter for each bucket.
bool zero() const
Returns true if any calls to sample have been made.
void sample(Counter val, int number)
Add a value to the distribution for the given number of times.
void growDown()
Given a bucket size B, and a range of values [0, N], this function doubles the bucket size to double ...
Counter logs
The sum of logarithm of each sample, used to compute geometric mean.
Counter max_bucket
Lower bound of the last bucket's range.
Counter squares
The sum of squares.
double Counter
All counters are of 64-bit values.
Copyright (c) 2024 - Pranith Kumar Copyright (c) 2020 Inria All rights reserved.