All Classes Namespaces Files Functions Variables Typedefs Enumerations Friends Macros Pages
Public Member Functions | List of all members
paal::average_accumulator< ValueType, CounterType > Class Template Reference

helper class facilitating counting average More...

#include <accumulate_functors.hpp>

Public Member Functions

template<class Archive >
void serialize (Archive &ar, const unsigned int version)
 serialize
 
 average_accumulator (ValueType value=ValueType{}, CounterType cnt=CounterType{})
 
bool operator== (average_accumulator other) const
 operator==
 
void add_value (ValueType value, CounterType cnt=1)
 
average_accumulatoroperator+= (const average_accumulator &accumulator)
 
ValueType get_accumulated_value () const
 
CounterType get_count () const
 
bool empty () const
 
template<typename ReturnType = double>
ReturnType get_average_unsafe () const
 
template<typename ReturnType = double>
ReturnType get_average (ReturnType default_value=ReturnType{}) const
 

Detailed Description

template<typename ValueType = double, typename CounterType = std::size_t>
class paal::average_accumulator< ValueType, CounterType >

helper class facilitating counting average

Definition at line 72 of file accumulate_functors.hpp.

Constructor & Destructor Documentation

template<typename ValueType = double, typename CounterType = std::size_t>
paal::average_accumulator< ValueType, CounterType >::average_accumulator ( ValueType  value = ValueType{},
CounterType  cnt = CounterType{} 
)
inline
Parameters
value
cnt

Definition at line 90 of file accumulate_functors.hpp.

Member Function Documentation

template<typename ValueType = double, typename CounterType = std::size_t>
void paal::average_accumulator< ValueType, CounterType >::add_value ( ValueType  value,
CounterType  cnt = 1 
)
inline
Parameters
value
cnt

Definition at line 107 of file accumulate_functors.hpp.

template<typename ValueType = double, typename CounterType = std::size_t>
bool paal::average_accumulator< ValueType, CounterType >::empty ( ) const
inline
Returns

Definition at line 145 of file accumulate_functors.hpp.

template<typename ValueType = double, typename CounterType = std::size_t>
ValueType paal::average_accumulator< ValueType, CounterType >::get_accumulated_value ( ) const
inline
Returns

Definition at line 127 of file accumulate_functors.hpp.

template<typename ValueType = double, typename CounterType = std::size_t>
template<typename ReturnType = double>
ReturnType paal::average_accumulator< ValueType, CounterType >::get_average ( ReturnType  default_value = ReturnType{}) const
inline
Parameters
default_value
Returns

Definition at line 167 of file accumulate_functors.hpp.

template<typename ValueType = double, typename CounterType = std::size_t>
template<typename ReturnType = double>
ReturnType paal::average_accumulator< ValueType, CounterType >::get_average_unsafe ( ) const
inline
Returns

Definition at line 155 of file accumulate_functors.hpp.

template<typename ValueType = double, typename CounterType = std::size_t>
CounterType paal::average_accumulator< ValueType, CounterType >::get_count ( ) const
inline
Returns

Definition at line 136 of file accumulate_functors.hpp.

template<typename ValueType = double, typename CounterType = std::size_t>
average_accumulator& paal::average_accumulator< ValueType, CounterType >::operator+= ( const average_accumulator< ValueType, CounterType > &  accumulator)
inline
Parameters
accumulator

Definition at line 117 of file accumulate_functors.hpp.


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