36 #include <cugar/basic/types.h> 54 Variance_estimator& operator=(
const Variance_estimator& other)
57 m_mean = other.m_mean;
63 Variance_estimator& operator+=(
const float x)
66 const T delta = x - m_mean;
67 m_mean += delta / m_n;
68 const T delta2 = x - m_mean;
74 float mean()
const {
return m_mean; }
77 float variance()
const {
return m_n > 1 ? m_M2 / (m_n - 1) : 0.0f; }
Define a vector_view POD type and plain_view() for std::vector.
Definition: diff.h:38
Definition: variance.h:48