diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2017-03-20 06:06:07 +0100 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2017-03-20 06:06:07 +0100 |
commit | 761fe827269d4cf34d33caadbef37d885cccc615 (patch) | |
tree | 514fc952b35594a16dda1e09f29db4df5810ef8e /api | |
parent | f23980100d12f4d707a585d5222f680850cc4e8c (diff) |
api/variance: expose size parameter
Diffstat (limited to 'api')
-rw-r--r-- | api/variance.hpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/api/variance.hpp b/api/variance.hpp index 55060b02..7a83154c 100644 --- a/api/variance.hpp +++ b/api/variance.hpp @@ -1,6 +1,7 @@ #pragma once #include <cmath> +#include <cinttypes> // no copyright information other than the attribution below. @@ -20,13 +21,17 @@ class variance { double m_old, m_new, s_old, s_new; - unsigned long cnt; + std::uintptr_t cnt; public: + using size_type = std::uintptr_t; + variance() : cnt(0) {} void clear() { *this = variance(); } + size_type count() { return cnt; } + void input(double x) { cnt++; |