summaryrefslogtreecommitdiffhomepage
path: root/api/variance.hpp
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2017-03-20 06:06:07 +0100
committerStanislaw Halik <sthalik@misaki.pl>2017-03-20 06:06:07 +0100
commit761fe827269d4cf34d33caadbef37d885cccc615 (patch)
tree514fc952b35594a16dda1e09f29db4df5810ef8e /api/variance.hpp
parentf23980100d12f4d707a585d5222f680850cc4e8c (diff)
api/variance: expose size parameter
Diffstat (limited to 'api/variance.hpp')
-rw-r--r--api/variance.hpp7
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++;