A simple class for dynamically calculating certain statistics such as Mean, Variance, Standard Deviation, and Average. More...
#include <runningstats.h>
Public Types | |
typedef std::vector< RunningStats > | List |
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 |
RunningStats & | operator= (const RunningStats &stats) |
Sets equal to. |
A simple class for dynamically calculating certain statistics such as Mean, Variance, Standard Deviation, and Average.
Definition at line 68 of file runningstats.h.
typedef std::vector<RunningStats> CxUtils::RunningStats::List |
Definition at line 71 of file runningstats.h.
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.
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 |
Definition at line 164 of file runningstats.cpp.
double RunningStats::Median | ( | ) | const |
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.
[in] | value | Data 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 |
Definition at line 231 of file runningstats.cpp.
double RunningStats::Variance | ( | ) | const |
Definition at line 220 of file runningstats.cpp.