TOBI SignalServer  0.1
tobiss::Statistics Class Reference

Class to calculate various (univariate) runtime statistics. More...

#include <statistics.h>

Public Member Functions

 Statistics (bool buffer_data=false, size_t window_size=1)
 Constructor.
virtual ~Statistics ()
 Destructor.
void update (double x)
 Update statistics with a new sample.
void print (std::ostream &out=std::cout, bool print_everything=false)
 Print statistics to specified stream (used to keep the former interface consistency).
void printAll (std::ostream &out=std::cout)
 Print all statistics to specified stream.
void printWindowStatistics (std::ostream &out=std::cout)
 Print only window statistics to specified stream.
void printFastStatistics (std::ostream &out=std::cout)
 Print only runtime statistics (mean, min, max, and adaptive statistics) to specified stream.
void reset ()
 Set everything to initial values.
void setUpdateCoefficient (double coeff)
 Set the update coefficient.
double get_mean ()
double get_var ()
 Get the variance.
double get_median ()
 Get the median.
double get_min ()
double get_max ()
double get_adaptive_mean ()
double get_adaptive_var ()
double get_window_mean ()
double get_window_median ()
 Get the median of the last values within the given window.
double get_window_min ()
double get_window_max ()
double get_window_var ()
 Get the variance of the last values within the given window.

Protected Member Functions

void getSamples (size_t buffersize, std::list< double >::iterator begin, std::list< double >::iterator end)
 Returns iterators to a range of the sample buffer buffer.

Private Member Functions

void sort_win_buffer ()
 Sort the samples in the window buffer.
void sort_sample_buffer ()
 Sort ALL recorded samples.

Static Private Member Functions

template<typename T >
static void delptr (T ptr)

Private Attributes

boost::circular_buffer< double > window_buffer_
boost::circular_buffer< double > window_buffer_sorted_
std::list< double > sample_buffer_
double N
double update_coefficient_
double mean_
double var_
double min_
double max_
double adaptive_mean_
double adaptive_var_
bool buffer_data_
size_t window_size_
bool win_buf_is_sorted_
bool sample_buf_is_sorted_

Detailed Description

Class to calculate various (univariate) runtime statistics.

Definition at line 53 of file statistics.h.


The documentation for this class was generated from the following file:
 All Data Structures Files Functions Variables