1
0
mirror of https://github.com/aportelli/LatAnalyze.git synced 2024-09-20 05:25:37 +01:00

StatArray: ambiguity removed in mean function

This commit is contained in:
Antonin Portelli 2015-03-20 16:05:11 +00:00
parent d93f75dac6
commit b90d410e6b

View File

@ -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<T, os> &array, const Index pos = 0,
const Index n = -1) const;
T covarianceMatrix(const StatArray<T, os> &array, const Index pos = 0,
@ -155,13 +154,12 @@ T StatArray<T, os>::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<T>);
}
return result/static_cast<double>(n);
return result/static_cast<double>(m);
}
template <typename T, Index os>