Initialize sum_sq before using it

or the standard deviation would be incorrect.
This commit is contained in:
Gary Ching-Pang Lin 2014-08-05 17:33:12 +08:00
parent 24ab750fba
commit 2eb363cea5
1 changed files with 1 additions and 1 deletions

View File

@ -23,7 +23,7 @@ public:
double sum_sq;
LogHistogramSampler() = delete;
LogHistogramSampler(int _bins) : sum(0.0) {
LogHistogramSampler(int _bins) : sum(0.0), sum_sq(0.0) {
assert(_bins > 0);
bins.resize(_bins + 1, 0);