Public Member Functions | Private Attributes | List of all members
ecl::CumulativeStatistics< T, typename ecl::enable_if< ecl::is_float< T > >::type > Class Template Reference

#include <cumulative_statistics.hpp>

Public Member Functions

void clear ()
 
 CumulativeStatistics ()
 
mean () const
 Current cumulative calculation of mean. More...
 
void push_back (const T &x)
 
size () const
 
variance () const
 Current cumulative calculation of variance. More...
 

Private Attributes

new_mean
 
new_variance
 
number_of_data
 
old_mean
 
old_variance
 

Detailed Description

template<typename T>
class ecl::CumulativeStatistics< T, typename ecl::enable_if< ecl::is_float< T > >::type >

Calculate cumulative mean and variance (i.e. without storage).

Definition at line 41 of file cumulative_statistics.hpp.

Constructor & Destructor Documentation

◆ CumulativeStatistics()

template<typename T >
ecl::CumulativeStatistics< T, typename ecl::enable_if< ecl::is_float< T > >::type >::CumulativeStatistics ( )
inline

Definition at line 43 of file cumulative_statistics.hpp.

Member Function Documentation

◆ clear()

template<typename T >
void ecl::CumulativeStatistics< T, typename ecl::enable_if< ecl::is_float< T > >::type >::clear ( )
inline

Definition at line 45 of file cumulative_statistics.hpp.

◆ mean()

template<typename T >
T ecl::CumulativeStatistics< T, typename ecl::enable_if< ecl::is_float< T > >::type >::mean ( ) const
inline

Current cumulative calculation of mean.

Returns
T or 0.0 if there is not yet data.

Definition at line 83 of file cumulative_statistics.hpp.

◆ push_back()

template<typename T >
void ecl::CumulativeStatistics< T, typename ecl::enable_if< ecl::is_float< T > >::type >::push_back ( const T &  x)
inline

Catch the new data and update the cumulative calculations.

TODO it uses a float as a counter to increase the longevity of the cumulative calculation, however it really ought to handle the number_of_data rolling over problem.

Parameters
x: new data

Definition at line 55 of file cumulative_statistics.hpp.

◆ size()

template<typename T >
T ecl::CumulativeStatistics< T, typename ecl::enable_if< ecl::is_float< T > >::type >::size ( ) const
inline

Number of data used for statistics

Returns
T

Definition at line 77 of file cumulative_statistics.hpp.

◆ variance()

template<typename T >
T ecl::CumulativeStatistics< T, typename ecl::enable_if< ecl::is_float< T > >::type >::variance ( ) const
inline

Current cumulative calculation of variance.

Returns
T or 0.0 if there is not yet data.

Definition at line 89 of file cumulative_statistics.hpp.

Member Data Documentation

◆ new_mean

template<typename T >
T ecl::CumulativeStatistics< T, typename ecl::enable_if< ecl::is_float< T > >::type >::new_mean
private

Definition at line 94 of file cumulative_statistics.hpp.

◆ new_variance

template<typename T >
T ecl::CumulativeStatistics< T, typename ecl::enable_if< ecl::is_float< T > >::type >::new_variance
private

Definition at line 94 of file cumulative_statistics.hpp.

◆ number_of_data

template<typename T >
T ecl::CumulativeStatistics< T, typename ecl::enable_if< ecl::is_float< T > >::type >::number_of_data
private

Definition at line 92 of file cumulative_statistics.hpp.

◆ old_mean

template<typename T >
T ecl::CumulativeStatistics< T, typename ecl::enable_if< ecl::is_float< T > >::type >::old_mean
private

Definition at line 93 of file cumulative_statistics.hpp.

◆ old_variance

template<typename T >
T ecl::CumulativeStatistics< T, typename ecl::enable_if< ecl::is_float< T > >::type >::old_variance
private

Definition at line 93 of file cumulative_statistics.hpp.


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


ecl_statistics
Author(s): Daniel Stonier
autogenerated on Mon Feb 28 2022 22:18:40