1#ifndef XRPL_TEST_CSF_HISTOGRAM_H_INCLUDED
2#define XRPL_TEST_CSF_HISTOGRAM_H_INCLUDED
25template <
class T,
class Compare = std::less<T>>
79 for (
auto const& [bin, count] :
counts_)
95 assert(p >= 0 && p <= 1);
103 while (it !=
counts_.end() && cumsum < pos)
106 cumsum += it->second;
T avg() const
Histogram average.
void insert(T const &s)
Insert an sample.
T maxValue() const
Maximum observed value.
T minValue() const
Minimum observed value.
T percentile(float p) const
Calculate the given percentile of the distribution.
std::size_t numBins() const
The number of distinct samples (bins)
std::size_t size() const
The number of samples.
std::map< T, std::size_t, Compare > counts_
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.