17 double delta = x - mean;
21 sqdiff_sum += delta * (x - mean);
24 unsigned get_count() const { return count; }
25 double get_sum() const { return sum; }
26 double get_mean() const { return mean; }
27 double get_variance() const { return sqdiff_sum / count; }
28 double get_stddev() const { return sqrt(get_variance()); }
32 double sum; // sum of x_i
33 double mean; // mean of x_i
34 double sqdiff_sum; // sum of (x_i - mean)^2
37 #endif // !STATISTICS_H