diff --git a/lib/StatArray.hpp b/lib/StatArray.hpp index b0334e3..9f03a81 100644 --- a/lib/StatArray.hpp +++ b/lib/StatArray.hpp @@ -53,7 +53,6 @@ public: // statistics void bin(Index binSize); T mean(const Index pos = 0, const Index n = -1) const; - T mean(void) const; T covariance(const StatArray &array, const Index pos = 0, const Index n = -1) const; T covarianceMatrix(const StatArray &array, const Index pos = 0, @@ -155,13 +154,12 @@ T StatArray::mean(const Index pos, const Index n) const { T result = T(); const Index m = (n >= 0) ? n : size(); - + if (m) { result = this->segment(pos+os, m).redux(&ReducOp::sum); } - - return result/static_cast(n); + return result/static_cast(m); } template