33#include "timemory/tpls/cereal/cereal.hpp"
62 static constexpr uint32_t version = 0;
68template <
typename Tp,
typename Up>
88 template <
typename Vp>
109 , m_sum(
std::move(val))
146 auto compute_variance = [&]() {
153 return compute_variance();
273 os <<
"[sum: " << obj.
get_sum() <<
"] [mean: " << _mean
276 <<
"] [count: " << obj.
get_count() <<
"]";
291 template <
typename Archive>
292 void save(Archive& ar,
const unsigned int)
const
295 ar(cereal::make_nvp(
"sum", m_sum), cereal::make_nvp(
"count", m_cnt),
296 cereal::make_nvp(
"min", m_min), cereal::make_nvp(
"max", m_max),
297 cereal::make_nvp(
"sqr", m_sqr), cereal::make_nvp(
"mean", _mean),
301 template <
typename Archive>
302 void load(Archive& ar,
const unsigned int)
304 ar(cereal::make_nvp(
"sum", m_sum), cereal::make_nvp(
"min", m_min),
305 cereal::make_nvp(
"max", m_max), cereal::make_nvp(
"sqr", m_sqr),
306 cereal::make_nvp(
"count", m_cnt));
318template <
typename Tp>
327template <
typename Tp>
336template <
typename Tp>
::tim::statistics< Tp > max(::tim::statistics< Tp > lhs, const Tp &rhs)
::tim::statistics< Tp > min(::tim::statistics< Tp > lhs, const Tp &rhs)
::tim::statistics< tuple<> > & operator+=(::tim::statistics< tuple<> > &_lhs, const Tp &)
type_list sqr(type_list<>)
the namespace provides overloads to output complex data types w/ streams
const std::string std::ostream * os
Struct for performing math operations on complex data structures without using globally overload oper...
static decltype(auto) sqr(const type &_v)
static decltype(auto) abs(const type &_v)
static decltype(auto) sqrt(const type &_v)
static decltype(auto) max(const type &_l, const V &_r)
static decltype(auto) min(const type &_l, const V &_r)
static decltype(auto) minus(type &_l, const V &_r)
static decltype(auto) plus(type &_l, const V &_r)
static decltype(auto) multiply(type &_l, const V &_r)
static decltype(auto) divide(type &_l, const V &_r)
A generic class for statistical accumulation. It uses the timemory math overloads to enable statistic...
statistics(const statistics &)=default
const value_type & get_sqr() const
statistics & operator-=(const value_type &val)
const value_type & get_sum() const
friend std::ostream & operator<<(std::ostream &os, const statistics &obj)
statistics(statistics &&) noexcept=default
void load(Archive &ar, const unsigned int)
statistics & operator-=(const statistics &rhs)
statistics(value_type &&val)
statistics & operator+=(const statistics &rhs)
void save(Archive &ar, const unsigned int) const
value_type get_variance() const
statistics & operator/=(const value_type &val)
friend statistics operator+(const statistics &lhs, const statistics &rhs)
const value_type & get_max() const
const value_type & get_min() const
statistics & operator=(const value_type &val)
statistics & operator+=(const value_type &val)
int64_t get_count() const
statistics & operator*=(const value_type &val)
value_type get_mean() const
friend statistics operator-(const statistics &lhs, const statistics &rhs)
value_type get_stddev() const