My Project
Public Member Functions | Private Attributes | List of all members
osl::stat::Average Class Reference

incrementaly maintain average of data sequence More...

#include <average.h>

Inheritance diagram for osl::stat::Average:
osl::stat::Variance

Public Member Functions

 Average ()
 
double add (const double &x)
 Add an element x.
 
void merge (const Average &r)
 
void clear (double a=0.0, int e=0)
 
double average () const
 
int numElements () const
 

Private Attributes

double mean
 
int elements
 

Detailed Description

incrementaly maintain average of data sequence

Definition at line 13 of file average.h.

Constructor & Destructor Documentation

◆ Average()

osl::stat::Average::Average ( )
inline

Definition at line 19 of file average.h.

Member Function Documentation

◆ add()

double osl::stat::Average::add ( const double &  x)
inline

Add an element x.

Returns
difference between x and (old) mean

Definition at line 27 of file average.h.

References elements, and mean.

Referenced by osl::stat::Ratio::add(), osl::stat::Variance::add(), and osl::stat::TwoDimensionalStatistics::Data::add().

◆ average()

double osl::stat::Average::average ( ) const
inline

Definition at line 48 of file average.h.

References mean.

Referenced by osl::stat::Ratio::ratio().

◆ clear()

void osl::stat::Average::clear ( double  a = 0.0,
int  e = 0 
)
inline

Definition at line 42 of file average.h.

References elements, and mean.

Referenced by osl::stat::Ratio::clear(), and osl::stat::TwoDimensionalStatistics::Data::clear().

◆ merge()

void osl::stat::Average::merge ( const Average r)
inline

Definition at line 34 of file average.h.

References elements, and mean.

Referenced by osl::stat::TwoDimensionalStatistics::Data::merge().

◆ numElements()

int osl::stat::Average::numElements ( ) const
inline

Definition at line 49 of file average.h.

References elements.

Referenced by osl::stat::Ratio::~Ratio().

Member Data Documentation

◆ elements

int osl::stat::Average::elements
private

Definition at line 16 of file average.h.

Referenced by add(), clear(), merge(), and numElements().

◆ mean

double osl::stat::Average::mean
private

Definition at line 15 of file average.h.

Referenced by add(), average(), clear(), and merge().


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