HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
openvdb::OPENVDB_VERSION_NAME::math::Histogram Class Reference

This class computes a histogram, with a fixed interval width, of a population of floating-point values. More...

#include <Stats.h>

Public Member Functions

 Histogram (double min, double max, size_t numBins=10)
 Construct with given minimum and maximum values and the given bin count. More...
 
 Histogram (const Stats &s, size_t numBins=10)
 Construct with the given bin count and with minimum and maximum values taken from a Stats object. More...
 
bool add (double val, uint64_t n=1)
 Add n samples with constant value val, provided that the val falls within this histogram's value range. More...
 
bool add (const Histogram &other)
 Add all the contributions from the other histogram, provided that it has the same configuration as this histogram. More...
 
size_t numBins () const
 Return the number of bins in this histogram. More...
 
double min () const
 Return the lower bound of this histogram's value range. More...
 
double max () const
 Return the upper bound of this histogram's value range. More...
 
double min (int n) const
 Return the minimum value in the nth bin. More...
 
double max (int n) const
 Return the maximum value in the nth bin. More...
 
uint64_t count (int n) const
 Return the number of samples in the nth bin. More...
 
uint64_t size () const
 Return the population size, i.e., the total number of samples. More...
 
void print (const std::string &name="", std::ostream &strm=std::cout) const
 Print the histogram to the specified output stream. More...
 

Detailed Description

This class computes a histogram, with a fixed interval width, of a population of floating-point values.

Definition at line 279 of file Stats.h.

Constructor & Destructor Documentation

openvdb::OPENVDB_VERSION_NAME::math::Histogram::Histogram ( double  min,
double  max,
size_t  numBins = 10 
)
inline

Construct with given minimum and maximum values and the given bin count.

Definition at line 283 of file Stats.h.

openvdb::OPENVDB_VERSION_NAME::math::Histogram::Histogram ( const Stats s,
size_t  numBins = 10 
)
inline

Construct with the given bin count and with minimum and maximum values taken from a Stats object.

Definition at line 297 of file Stats.h.

Member Function Documentation

bool openvdb::OPENVDB_VERSION_NAME::math::Histogram::add ( double  val,
uint64_t  n = 1 
)
inline

Add n samples with constant value val, provided that the val falls within this histogram's value range.

Returns
true if the sample value falls within this histogram's value range.

Definition at line 312 of file Stats.h.

bool openvdb::OPENVDB_VERSION_NAME::math::Histogram::add ( const Histogram other)
inline

Add all the contributions from the other histogram, provided that it has the same configuration as this histogram.

Definition at line 322 of file Stats.h.

uint64_t openvdb::OPENVDB_VERSION_NAME::math::Histogram::count ( int  n) const
inline

Return the number of samples in the nth bin.

Definition at line 342 of file Stats.h.

double openvdb::OPENVDB_VERSION_NAME::math::Histogram::max ( ) const
inline

Return the upper bound of this histogram's value range.

Definition at line 336 of file Stats.h.

double openvdb::OPENVDB_VERSION_NAME::math::Histogram::max ( int  n) const
inline

Return the maximum value in the nth bin.

Definition at line 340 of file Stats.h.

double openvdb::OPENVDB_VERSION_NAME::math::Histogram::min ( ) const
inline

Return the lower bound of this histogram's value range.

Definition at line 334 of file Stats.h.

double openvdb::OPENVDB_VERSION_NAME::math::Histogram::min ( int  n) const
inline

Return the minimum value in the nth bin.

Definition at line 338 of file Stats.h.

size_t openvdb::OPENVDB_VERSION_NAME::math::Histogram::numBins ( ) const
inline

Return the number of bins in this histogram.

Definition at line 332 of file Stats.h.

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

Print the histogram to the specified output stream.

Definition at line 347 of file Stats.h.

uint64_t openvdb::OPENVDB_VERSION_NAME::math::Histogram::size ( void  ) const
inline

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

Definition at line 344 of file Stats.h.


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