diff options
-rw-r--r-- | base/statistics.cc | 6 | ||||
-rw-r--r-- | base/statistics.hh | 6 |
2 files changed, 8 insertions, 4 deletions
diff --git a/base/statistics.cc b/base/statistics.cc index 5c1844327..5f21e4de7 100644 --- a/base/statistics.cc +++ b/base/statistics.cc @@ -886,14 +886,18 @@ DistDisplay(ostream &stream, const string &name, const string &desc, } #endif +/** + * @todo get rid of the ugly hack **Ignore for total + */ void FancyDisplay(ostream &stream, const string &name, const string &desc, int precision, FormatFlags flags, result_t mean, - result_t variance) + result_t variance, result_t total) { result_t stdev = isnan(variance) ? NAN : sqrt(variance); PrintOne(stream, mean, name + NAMESEP + "mean", desc, precision, flags); PrintOne(stream, stdev, name + NAMESEP + "stdev", desc, precision, flags); + PrintOne(stream, total, "**Ignore: " + name + NAMESEP + "TOT", desc, precision, flags); } BinBase::BinBase() diff --git a/base/statistics.hh b/base/statistics.hh index aa3489727..fc3252782 100644 --- a/base/statistics.hh +++ b/base/statistics.hh @@ -1309,7 +1309,7 @@ struct DistStor void FancyDisplay(std::ostream &stream, const std::string &name, const std::string &desc, int precision, FormatFlags flags, - result_t mean, result_t variance); + result_t mean, result_t variance, result_t total); /** * Templatized storage and interface for a distribution that calculates mean @@ -1369,16 +1369,16 @@ struct FancyStor result_t mean = NAN; result_t variance = NAN; + result_t ftot = total; if (total != 0) { result_t fsum = sum; result_t fsq = squares; - result_t ftot = total; mean = fsum / ftot; variance = (ftot * fsq - (fsum * fsum)) / (ftot * (ftot - 1.0)); } - FancyDisplay(stream, name, desc, precision, flags, mean, variance); + FancyDisplay(stream, name, desc, precision, flags, mean, variance, ftot); } /** |