Public Types | Public Member Functions

CxUtils::RunningStats Class Reference

A simple class for dynamically calculating certain statistics such as Mean, Variance, Standard Deviation, and Average. More...

#include <runningstats.h>

List of all members.

Public Types

typedef std::vector< RunningStatsList

Public Member Functions

 RunningStats ()
 Constructor.
 RunningStats (const RunningStats &stats)
 Copy constructor.
 ~RunningStats ()
 Destructor.
void Clear ()
 Resets the running statistics.
void SetCount (const unsigned int count)
void SetMean (const double mean)
void SetStandardDeviation (const double std)
 Resets the standard deviation.
void Push (const double value)
 Adds a new metric to the running statistics.
unsigned int GetNumberOfValues () const
double Mean () const
double Median () const
double Variance () const
double StandardDeviation () const
RunningStatsoperator= (const RunningStats &stats)
 Sets equal to.

Detailed Description

A simple class for dynamically calculating certain statistics such as Mean, Variance, Standard Deviation, and Average.

Definition at line 68 of file runningstats.h.


Member Typedef Documentation

Definition at line 71 of file runningstats.h.


Constructor & Destructor Documentation

RunningStats::RunningStats (  )

Constructor.

Definition at line 65 of file runningstats.cpp.

RunningStats::RunningStats ( const RunningStats stats )

Copy constructor.

Definition at line 77 of file runningstats.cpp.

RunningStats::~RunningStats (  )

Destructor.

Definition at line 89 of file runningstats.cpp.


Member Function Documentation

void RunningStats::Clear (  )

Resets the running statistics.

Definition at line 99 of file runningstats.cpp.

unsigned int CxUtils::RunningStats::GetNumberOfValues (  ) const [inline]

Definition at line 80 of file runningstats.h.

double RunningStats::Mean (  ) const
Returns:
The mean of the data points.

Definition at line 164 of file runningstats.cpp.

double RunningStats::Median (  ) const
Returns:
The median of the data points.

Definition at line 175 of file runningstats.cpp.

RunningStats & RunningStats::operator= ( const RunningStats stats )

Sets equal to.

Definition at line 242 of file runningstats.cpp.

void RunningStats::Push ( const double  value )

Adds a new metric to the running statistics.

Parameters:
[in]valueData value to add to the running statistics.

Definition at line 118 of file runningstats.cpp.

void CxUtils::RunningStats::SetCount ( const unsigned int  count ) [inline]

Definition at line 76 of file runningstats.h.

void CxUtils::RunningStats::SetMean ( const double  mean ) [inline]

Definition at line 77 of file runningstats.h.

void RunningStats::SetStandardDeviation ( const double  std )

Resets the standard deviation.

Definition at line 146 of file runningstats.cpp.

double RunningStats::StandardDeviation (  ) const
Returns:
The standard deviation of the data points.

Definition at line 231 of file runningstats.cpp.

double RunningStats::Variance (  ) const
Returns:
The variance of the data points.

Definition at line 220 of file runningstats.cpp.


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines