OpenVDB  12.0.0
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
Stats Class Reference

This class computes statistics (minimum value, maximum value, mean, variance and standard deviation) of a population of floating-point values. More...

#include <openvdb/math/Stats.h>

Inherits Extrema.

Public Member Functions

 Stats ()
 
void add (double val)
 Add a single sample. More...
 
void add (double val, uint64_t n)
 Add n samples with constant value val. More...
 
void add (const Stats &other)
 Add the samples from the other Stats instance. More...
 
void print (const std::string &name="", std::ostream &strm=std::cout, int precision=3) const
 Print statistics to the specified output stream. More...
 
void add (const Extrema &other)
 Add the samples from the other Stats instance. More...
 
uint64_t size () const
 Return the size of the population, i.e., the total number of samples. More...
 
double min () const
 Return the minimum value. More...
 
double max () const
 Return the maximum value. More...
 
double range () const
 Return the range defined as the maximum value minus the minimum value. More...
 
double avg () const
 Return the arithmetic mean, i.e. average, value. More...
 
double mean () const
 Return the arithmetic mean, i.e. average, value. More...
 
double var () const
 Return the population variance. More...
 
double variance () const
 Return the population variance. More...
 
double std () const
 Return the standard deviation (=Sqrt(variance)) as defined from the (biased) population variance. More...
 
double stdDev () const
 Return the standard deviation (=Sqrt(variance)) as defined from the (biased) population variance. More...
 

Protected Member Functions

void join (const Extrema &other)
 

Protected Attributes

double mAvg
 
double mAux
 
uint64_t mSize
 
double mMin
 
double mMax
 

Detailed Description

This class computes statistics (minimum value, maximum value, mean, variance and standard deviation) of a population of floating-point values.

variance = Mean[ (X-Mean[X])^2 ] = Mean[X^2] - Mean[X]^2, standard deviation = sqrt(variance)

Note
This class employs incremental computation and double precision.

Constructor & Destructor Documentation

Stats ( )
inline

Member Function Documentation

void add ( const Extrema other)
inlineinherited

Add the samples from the other Stats instance.

void add ( double  val)
inline

Add a single sample.

void add ( double  val,
uint64_t  n 
)
inline

Add n samples with constant value val.

void add ( const Stats other)
inline

Add the samples from the other Stats instance.

double avg ( ) const
inline

Return the arithmetic mean, i.e. average, value.

void join ( const Extrema other)
inlineprotectedinherited
double max ( ) const
inlineinherited

Return the maximum value.

double mean ( ) const
inline

Return the arithmetic mean, i.e. average, value.

double min ( ) const
inlineinherited

Return the minimum value.

void print ( const std::string &  name = "",
std::ostream &  strm = std::cout,
int  precision = 3 
) const
inline

Print statistics to the specified output stream.

double range ( ) const
inlineinherited

Return the range defined as the maximum value minus the minimum value.

uint64_t size ( ) const
inlineinherited

Return the size of the population, i.e., the total number of samples.

double std ( ) const
inline

Return the standard deviation (=Sqrt(variance)) as defined from the (biased) population variance.

double stdDev ( ) const
inline

Return the standard deviation (=Sqrt(variance)) as defined from the (biased) population variance.

double var ( ) const
inline

Return the population variance.

Note
The unbiased sample variance = population variance *
double variance ( ) const
inline

Return the population variance.

Note
The unbiased sample variance = population variance *

Member Data Documentation

double mAux
protected
double mAvg
protected
double mMax
protectedinherited
double mMin
protectedinherited
uint64_t mSize
protectedinherited