libjmmcg  release_579_6_g8cffd
A C++ library containing an eclectic mix of useful, advanced components.
jmmcg::LIBJMMCG_VER_NAMESPACE::ave_deviation_meter< MeteredObjType > Class Template Reference

A class used to compute the arithmetic mean and mean-average deviation [1] of a series of events. More...

#include <ave_deviation_meter.hpp>

Public Types

using atomic_counter_type = ppd::atomic_ctr< MeteredObjType, ppd::api_lock_traits< ppd::platform_api, ppd::sequential_mode > >
 
using value_type = typename atomic_counter_type::value_type
 The type of the object upon which the events will be recorded. More...
 

Public Member Functions

constexpr ave_deviation_meter () noexcept(true) FORCE_INLINE
 
constexpr ave_deviation_meter (const value_type val) noexcept(true) FORCE_INLINE
 
constexpr ave_deviation_meter (value_type const val, double const dev) noexcept(true) FORCE_INLINE
 
 ave_deviation_meter (ave_deviation_meter const &rm) noexcept(true) FORCE_INLINE
 
 ~ave_deviation_meter () noexcept(true) FORCE_INLINE
 
ave_deviation_meter &__fastcall operator= (ave_deviation_meter const &rm) noexcept(true)
 
ave_deviation_meter &__fastcall operator+= (ave_deviation_meter const &rm) noexcept(true)
 
ave_deviation_meter &__fastcall update (value_type const new_val) noexcept(true)
 Record a new event that occurred. More...
 
constexpr value_type __fastcall FORCE_INLINE min () const noexcept(true)
 Return the minimum of the samples taken. More...
 
constexpr value_type __fastcall FORCE_INLINE arithmetic_mean () const noexcept(true)
 Return the arithmetic mean of the samples taken. More...
 
constexpr value_type __fastcall FORCE_INLINE max () const noexcept(true)
 Return the maximum of the samples taken. More...
 
constexpr value_type __fastcall FORCE_INLINE total () const noexcept(true)
 Return the total of all of the samples taken. More...
 
constexpr double __fastcall FORCE_INLINE deviation () const noexcept(true)
 Return the average deviation of the samples taken. More...
 
constexpr double __fastcall FORCE_INLINE deviation_percentage () const noexcept(true)
 Return the average deviation, as a percent of the mean, of the samples taken. More...
 
constexpr unsigned short FORCE_INLINE percent () const noexcept(true)
 Return the average deviation as a percentage of the arithmetic mean. More...
 
tstring __fastcall to_string () const noexcept(false)
 
tstring __fastcall to_csv () const noexcept(false)
 

Detailed Description

template<typename MeteredObjType>
class jmmcg::LIBJMMCG_VER_NAMESPACE::ave_deviation_meter< MeteredObjType >

A class used to compute the arithmetic mean and mean-average deviation [1] of a series of events.

Note that if this class is used in a multi-threaded manner, it is not thread-safe, so these invariants are not guaranteed.

[1] \see invariant()

Definition at line 40 of file ave_deviation_meter.hpp.

Member Typedef Documentation

◆ atomic_counter_type

template<typename MeteredObjType >
using jmmcg::LIBJMMCG_VER_NAMESPACE::ave_deviation_meter< MeteredObjType >::atomic_counter_type = ppd::atomic_ctr<MeteredObjType, ppd::api_lock_traits<ppd::platform_api, ppd::sequential_mode> >

This is an overly-complicated way of saying "although this might look atomic - I want a sequential version" so it is just the MeteredObjType. std::atomic with program-consistency is not used, because it introduces a lock prefix, which would slow the program being measured. Speed has been traded off for reliable numbers...

Definition at line 45 of file ave_deviation_meter.hpp.

◆ value_type

template<typename MeteredObjType >
using jmmcg::LIBJMMCG_VER_NAMESPACE::ave_deviation_meter< MeteredObjType >::value_type = typename atomic_counter_type::value_type

The type of the object upon which the events will be recorded.

Definition at line 47 of file ave_deviation_meter.hpp.

Constructor & Destructor Documentation

◆ ave_deviation_meter() [1/4]

template<typename MeteredObjType >
constexpr jmmcg::LIBJMMCG_VER_NAMESPACE::ave_deviation_meter< MeteredObjType >::ave_deviation_meter
inlineconstexprnoexcept

Definition at line 66 of file ave_deviation_meter_impl.hpp.

◆ ave_deviation_meter() [2/4]

◆ ave_deviation_meter() [3/4]

template<typename MeteredObjType >
constexpr jmmcg::LIBJMMCG_VER_NAMESPACE::ave_deviation_meter< MeteredObjType >::ave_deviation_meter ( value_type const  val,
double const  dev 
)
inlineconstexprnoexcept

Definition at line 85 of file ave_deviation_meter_impl.hpp.

◆ ave_deviation_meter() [4/4]

◆ ~ave_deviation_meter()

template<typename MeteredObjType >
jmmcg::LIBJMMCG_VER_NAMESPACE::ave_deviation_meter< MeteredObjType >::~ave_deviation_meter
inlinenoexcept

Definition at line 104 of file ave_deviation_meter_impl.hpp.

Member Function Documentation

◆ arithmetic_mean()

template<typename MeteredObjType >
constexpr ave_deviation_meter< MeteredObjType >::value_type jmmcg::LIBJMMCG_VER_NAMESPACE::ave_deviation_meter< MeteredObjType >::arithmetic_mean
inlineconstexprnoexcept

Return the arithmetic mean of the samples taken.

Definition at line 157 of file ave_deviation_meter_impl.hpp.

◆ deviation()

template<typename MeteredObjType >
constexpr double jmmcg::LIBJMMCG_VER_NAMESPACE::ave_deviation_meter< MeteredObjType >::deviation
inlineconstexprnoexcept

Return the average deviation of the samples taken.

Note that when using this value you should round to one significant figure.

Returns
The average deviation.

Definition at line 172 of file ave_deviation_meter_impl.hpp.

◆ deviation_percentage()

template<typename MeteredObjType >
constexpr double jmmcg::LIBJMMCG_VER_NAMESPACE::ave_deviation_meter< MeteredObjType >::deviation_percentage
inlineconstexprnoexcept

Return the average deviation, as a percent of the mean, of the samples taken.

Note that when using this value you should round to one significant figure.

Returns
The average deviation as a percentage.

Definition at line 177 of file ave_deviation_meter_impl.hpp.

Referenced by jmmcg::LIBJMMCG_VER_NAMESPACE::ave_deviation_meter< MeteredObjType >::percent(), and jmmcg::LIBJMMCG_VER_NAMESPACE::ave_deviation_meter< MeteredObjType >::to_csv().

◆ max()

template<typename MeteredObjType >
constexpr ave_deviation_meter< MeteredObjType >::value_type jmmcg::LIBJMMCG_VER_NAMESPACE::ave_deviation_meter< MeteredObjType >::max
inlineconstexprnoexcept

Return the maximum of the samples taken.

Definition at line 162 of file ave_deviation_meter_impl.hpp.

◆ min()

template<typename MeteredObjType >
constexpr ave_deviation_meter< MeteredObjType >::value_type jmmcg::LIBJMMCG_VER_NAMESPACE::ave_deviation_meter< MeteredObjType >::min
inlineconstexprnoexcept

Return the minimum of the samples taken.

Definition at line 152 of file ave_deviation_meter_impl.hpp.

◆ operator+=()

template<typename MeteredObjType >
ave_deviation_meter< MeteredObjType > & jmmcg::LIBJMMCG_VER_NAMESPACE::ave_deviation_meter< MeteredObjType >::operator+= ( ave_deviation_meter< MeteredObjType > const &  rm)
inlinenoexcept

Definition at line 120 of file ave_deviation_meter_impl.hpp.

◆ operator=()

template<typename MeteredObjType >
ave_deviation_meter< MeteredObjType > & jmmcg::LIBJMMCG_VER_NAMESPACE::ave_deviation_meter< MeteredObjType >::operator= ( ave_deviation_meter< MeteredObjType > const &  rm)
inlinenoexcept

Definition at line 108 of file ave_deviation_meter_impl.hpp.

◆ percent()

template<typename MeteredObjType >
constexpr unsigned short jmmcg::LIBJMMCG_VER_NAMESPACE::ave_deviation_meter< MeteredObjType >::percent
inlineconstexprnoexcept

Return the average deviation as a percentage of the arithmetic mean.

Definition at line 182 of file ave_deviation_meter_impl.hpp.

References jmmcg::LIBJMMCG_VER_NAMESPACE::ave_deviation_meter< MeteredObjType >::deviation_percentage().

◆ to_csv()

template<typename MeteredObjType >
tstring jmmcg::LIBJMMCG_VER_NAMESPACE::ave_deviation_meter< MeteredObjType >::to_csv
inlinenoexcept

◆ to_string()

template<typename MeteredObjType >
tstring jmmcg::LIBJMMCG_VER_NAMESPACE::ave_deviation_meter< MeteredObjType >::to_string
inlinenoexcept

Definition at line 187 of file ave_deviation_meter_impl.hpp.

◆ total()

template<typename MeteredObjType >
constexpr ave_deviation_meter< MeteredObjType >::value_type jmmcg::LIBJMMCG_VER_NAMESPACE::ave_deviation_meter< MeteredObjType >::total
inlineconstexprnoexcept

Return the total of all of the samples taken.

Definition at line 167 of file ave_deviation_meter_impl.hpp.

◆ update()

template<typename MeteredObjType >
ave_deviation_meter< MeteredObjType > & jmmcg::LIBJMMCG_VER_NAMESPACE::ave_deviation_meter< MeteredObjType >::update ( value_type const  new_val)
inlinenoexcept

Record a new event that occurred.

This will update the minimum, maximum, running arithmetic mean and average-deviation measurements.

Definition at line 136 of file ave_deviation_meter_impl.hpp.


The documentation for this class was generated from the following files: