KrisLibrary  1.0.0
Public Member Functions | Public Attributes | List of all members
StatCollector Struct Reference

Collects statistics (min,max,mean,stddev,etc) on floating-point data. More...

#include <StatCollector.h>

Public Member Functions

void operator<< (double x)
 
void collect (double x)
 
void weightedCollect (double x, double weight)
 
int number () const
 
double minimum () const
 
double maximum () const
 
double average () const
 
double variance () const
 
double stddev () const
 
void clear ()
 
bool Load (std::istream &in)
 
bool Save (std::ostream &out) const
 
void Print (std::ostream &out) const
 

Public Attributes

double n
 
double xmin
 
double xmax
 
double sum
 
double sumsquared
 

Detailed Description

Collects statistics (min,max,mean,stddev,etc) on floating-point data.

Collects datapoints incrementally and keeps statistics in a constant-sized structure.

There is a risk of numerical overflow and precision errors in the stddev and variance methods, when collecting many large values.

Print prints a concise, human-readable representation. Load and Save can be used for loading/saving to disk.

See also optimization/DistributionCollector.h


The documentation for this struct was generated from the following files: