CFEL - ASG Software Suite  2.5.0
CASS
Public Types | Public Member Functions | Private Attributes | List of all members
cass::CummulativeStatisticsCalculator< Type > Class Template Reference

statistics calculator for a cummulative statistic More...

#include <statistics_calculator.hpp>

+ Inheritance diagram for cass::CummulativeStatisticsCalculator< Type >:
+ Collaboration diagram for cass::CummulativeStatisticsCalculator< Type >:

Public Types

typedef Type value_type
 define the value type More...
 
typedef size_t counter_type
 define the type of the counter More...
 

Public Member Functions

 CummulativeStatisticsCalculator ()
 default constructor More...
 
void addDatum (const value_type &datum)
 add a datum to the distribution More...
 
template<class InputIterator >
void addDistribution (InputIterator first, InputIterator last)
 add a number of dati to the distribution More...
 
value_type mean () const
 retrieve the mean of the distribution More...
 
value_type variance () const
 retrieve the variance of the distribution More...
 
value_type stdv () const
 retrieve the standart deviation of the distribution More...
 
value_type sum () const
 retrieve the sum of all dati that have been added More...
 
counter_type count () const
 retrieve the number of datum that have been added More...
 
void reset ()
 reset the statistics More...
 

Private Attributes

value_type _sum
 the sum of all dati More...
 
value_type _mean
 the current mean value More...
 
value_type _tmp
 the current intermediate value that one calcs the stdv from More...
 
counter_type _N
 counter to see how many values have been added to the statistics More...
 

Detailed Description

template<typename Type>
class cass::CummulativeStatisticsCalculator< Type >

statistics calculator for a cummulative statistic

This class is based on Knuths algorithm

Donald E. Knuth (1998). The Art of Computer Programming, volume 2: Seminumerical Algorithms, 3rd edn., p. 232. Boston: Addison-Wesley.

Template Parameters
typeof the values for the average, defines the precision
Author
Lutz Foucar

Definition at line 33 of file statistics_calculator.hpp.

Member Typedef Documentation

template<typename Type>
typedef size_t cass::CummulativeStatisticsCalculator< Type >::counter_type

define the type of the counter

Definition at line 40 of file statistics_calculator.hpp.

template<typename Type>
typedef Type cass::CummulativeStatisticsCalculator< Type >::value_type

define the value type

Definition at line 37 of file statistics_calculator.hpp.

Constructor & Destructor Documentation

template<typename Type>
cass::CummulativeStatisticsCalculator< Type >::CummulativeStatisticsCalculator ( )
inline

default constructor

resets the values.

Definition at line 46 of file statistics_calculator.hpp.

Member Function Documentation

template<typename Type>
void cass::CummulativeStatisticsCalculator< Type >::addDatum ( const value_type datum)
inline

add a datum to the distribution

Parameters
datumThe datum to be added

Definition at line 55 of file statistics_calculator.hpp.

Referenced by cass::CummulativeStatisticsCalculator< value_type >::addDistribution(), and cass::pp204::getBoxStatistics().

template<typename Type>
template<class InputIterator >
void cass::CummulativeStatisticsCalculator< Type >::addDistribution ( InputIterator  first,
InputIterator  last 
)
inline

add a number of dati to the distribution

Adds all elements between first and last to the distribution, but not the last

Parameters
firstThe first in the range to be added
lastThe element after last to be added

Definition at line 73 of file statistics_calculator.hpp.

Referenced by cass::pp82::cummulativeStatistics(), and cass::CummulativeStatisticsNoOutlier< Type >::updateStat().

template<typename Type>
counter_type cass::CummulativeStatisticsCalculator< Type >::count ( ) const
inline

retrieve the number of datum that have been added

Returns
counts

Definition at line 120 of file statistics_calculator.hpp.

Referenced by cass::pp204::getBoxStatistics().

template<typename Type>
value_type cass::CummulativeStatisticsCalculator< Type >::mean ( ) const
inline

retrieve the mean of the distribution

Returns
mean of the distribution

Definition at line 84 of file statistics_calculator.hpp.

Referenced by cass::pp204::getBoxStatistics(), cass::pp82::loadSettings(), and cass::CummulativeStatisticsNoOutlier< Type >::updateStat().

template<typename Type>
void cass::CummulativeStatisticsCalculator< Type >::reset ( )
inline
template<typename Type>
value_type cass::CummulativeStatisticsCalculator< Type >::stdv ( ) const
inline

retrieve the standart deviation of the distribution

Returns
standart deviation of the distribution

Definition at line 102 of file statistics_calculator.hpp.

Referenced by cass::pp204::getBoxStatistics(), cass::pp82::loadSettings(), and cass::CummulativeStatisticsNoOutlier< Type >::updateStat().

template<typename Type>
value_type cass::CummulativeStatisticsCalculator< Type >::sum ( ) const
inline

retrieve the sum of all dati that have been added

Returns
sum of all dati

Definition at line 111 of file statistics_calculator.hpp.

Referenced by cass::pp82::loadSettings().

template<typename Type>
value_type cass::CummulativeStatisticsCalculator< Type >::variance ( ) const
inline

retrieve the variance of the distribution

Returns
variance of the distribution

Definition at line 93 of file statistics_calculator.hpp.

Referenced by cass::pp82::loadSettings(), and cass::CummulativeStatisticsCalculator< value_type >::stdv().

Member Data Documentation

template<typename Type>
value_type cass::CummulativeStatisticsCalculator< Type >::_mean
private
template<typename Type>
counter_type cass::CummulativeStatisticsCalculator< Type >::_N
private
template<typename Type>
value_type cass::CummulativeStatisticsCalculator< Type >::_sum
private
template<typename Type>
value_type cass::CummulativeStatisticsCalculator< Type >::_tmp
private

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