HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
openvdb::OPENVDB_VERSION_NAME::math::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 <Stats.h>

+ Inheritance diagram for openvdb::OPENVDB_VERSION_NAME::math::Stats:

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...
 
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...
 
- Public Member Functions inherited from openvdb::OPENVDB_VERSION_NAME::math::Extrema
 Extrema ()
 Constructor. More...
 
void add (double val)
 Add a single sample. More...
 
void add (double val, uint64_t n)
 Add n samples with constant value val. 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...
 
void add (const Extrema &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 extrema to the specified output stream. More...
 

Protected Attributes

double mAvg
 
double mAux
 
- Protected Attributes inherited from openvdb::OPENVDB_VERSION_NAME::math::Extrema
uint64_t mSize
 
double mMin
 
double mMax
 

Additional Inherited Members

- Protected Member Functions inherited from openvdb::OPENVDB_VERSION_NAME::math::Extrema
void join (const Extrema &other)
 

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.

Definition at line 195 of file Stats.h.

Constructor & Destructor Documentation

openvdb::OPENVDB_VERSION_NAME::math::Stats::Stats ( )
inline

Definition at line 198 of file Stats.h.

Member Function Documentation

void openvdb::OPENVDB_VERSION_NAME::math::Stats::add ( double  val)
inline

Add a single sample.

Definition at line 206 of file Stats.h.

void openvdb::OPENVDB_VERSION_NAME::math::Stats::add ( double  val,
uint64_t  n 
)
inline

Add n samples with constant value val.

Definition at line 215 of file Stats.h.

void openvdb::OPENVDB_VERSION_NAME::math::Stats::add ( const Stats other)
inline

Add the samples from the other Stats instance.

Definition at line 225 of file Stats.h.

double openvdb::OPENVDB_VERSION_NAME::math::Stats::avg ( ) const
inline

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

Definition at line 238 of file Stats.h.

double openvdb::OPENVDB_VERSION_NAME::math::Stats::mean ( ) const
inline

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

Definition at line 239 of file Stats.h.

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

Print statistics to the specified output stream.

Definition at line 258 of file Stats.h.

double openvdb::OPENVDB_VERSION_NAME::math::Stats::std ( ) const
inline

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

Definition at line 253 of file Stats.h.

double openvdb::OPENVDB_VERSION_NAME::math::Stats::stdDev ( ) const
inline

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

Definition at line 254 of file Stats.h.

double openvdb::OPENVDB_VERSION_NAME::math::Stats::var ( ) const
inline

Return the population variance.

Note
The unbiased sample variance = population variance *

Definition at line 246 of file Stats.h.

double openvdb::OPENVDB_VERSION_NAME::math::Stats::variance ( ) const
inline

Return the population variance.

Note
The unbiased sample variance = population variance *

Definition at line 247 of file Stats.h.

Member Data Documentation

double openvdb::OPENVDB_VERSION_NAME::math::Stats::mAux
protected

Definition at line 283 of file Stats.h.

double openvdb::OPENVDB_VERSION_NAME::math::Stats::mAvg
protected

Definition at line 283 of file Stats.h.


The documentation for this class was generated from the following file: