/* * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. * * Copyright 2010 Danny Robson */ #ifndef __UTIL_STATS_HPP #define __UTIL_STATS_HPP #include namespace util { namespace stats { // Undefined until at least one value has been added. template struct accumulator { accumulator (); void reset (void); void add (T); void add (const accumulator &); size_t count; T min; T max; T sum; T range (void) const; T mean (void) const; }; template std::ostream& operator<< (std::ostream&, const accumulator&); } } #endif