11 , min(std::numeric_limits<double>::infinity())
12 , max(-std::numeric_limits<double>::infinity())
19 double delta = x - mean;
27 sqdiff_sum += delta * (x - mean);
30 unsigned get_count() const { return count; }
31 double get_min() const { return min; }
32 double get_max() const { return max; }
33 double get_sum() const { return sum; }
34 double get_mean() const { return mean; }
35 double get_variance() const { return sqdiff_sum / count; }
36 double get_stddev() const { return std::sqrt(get_variance()); }
40 double min; // min of x_i
41 double max; // max of x_i
42 double sum; // sum of x_i
43 double mean; // mean of x_i
44 double sqdiff_sum; // sum of (x_i - mean)^2
47 #endif // !STATISTICS_H