66 for (uint32_t
i = 0;
i < bins;
i++) {
80 uint32_t t_bins =
m_data.size();
82 for (uint32_t
i = 0;
i < t_bins/2;
i++) {
85 for (uint32_t
i = t_bins/2;
i < t_bins;
i++) {
116 uint32_t t_bins =
m_data.size();
130 uint32_t t_bins =
m_data.size();
132 if (hist.
getBins() != t_bins) {
136 fatal(
"Histograms with different number of bins "
137 "cannot be combined!");
148 for (
int j = 0; j < hist.
getData(0); j++) {
152 for (uint32_t
i = 1;
i < t_bins;
i++) {
153 for (
int j = 0; j < hist.
getData(
i); j++) {
167 for (uint32_t
i = 0;
i < t_bins;
i++) {
173 fatal(
"Don't know how to combine log and linear histograms!");
189 return sqrt(variance);
212 out <<
"[binsize: log2 ";
216 out <<
"max: " <<
m_max <<
" ";
217 out <<
"count: " <<
m_count <<
" ";
220 out <<
"average: NaN |";
221 out <<
"standard deviation: NaN |";
229 if (multiplier == 1.0) {
232 out <<
" " << double(
m_data[
i]) * multiplier;
double getStandardDeviation() const
void print(std::ostream &out) const
uint64_t getSquaredTotal() const
uint64_t getData(int index) const
void printWithMultiplier(std::ostream &out, double multiplier) const
uint64_t m_sumSquaredSamples
std::vector< uint64_t > m_data
void printPercent(std::ostream &out) const
Histogram(int binsize=1, uint32_t bins=50)
static constexpr std::enable_if_t< std::is_integral_v< T >, int > floorLog2(T x)
#define fatal(...)
This implements a cprintf based fatal() function.
bool node_less_then_eq(const Histogram *n1, const Histogram *n2)
Copyright (c) 2024 - Pranith Kumar Copyright (c) 2020 Inria All rights reserved.