From 761fe827269d4cf34d33caadbef37d885cccc615 Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Mon, 20 Mar 2017 06:06:07 +0100 Subject: api/variance: expose size parameter --- api/variance.hpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'api') 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 +#include // 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++; -- cgit v1.2.3