KrisLibrary  1.0.0
Public Member Functions | Public Attributes | List of all members
Statistics::Histogram Class Reference

1-D histogram class More...

#include <Histogram.h>

Public Member Functions

void Clear ()
 Creates one big bucket.
 
void Resize (Real split)
 Creates buckets (-inf,split],(split,inf)
 
void Resize (size_t n, Real a, Real b)
 Creates n uniformly spaced buckets betwen a,b.
 
void ResizeToFit (const std::vector< Real > &data, size_t n)
 Creates n uniformly spaced buckets between the min and max of the data.
 
void Fill (Real val=0)
 Fills all buckets with the given value.
 
void Calculate (const std::vector< Real > &data)
 Calculates the histogram of the data.
 
void GetRange (int bucket, Real &min, Real &max) const
 
int GetBucket (Real val) const
 
void AddBucket (Real val, Real num=1)
 
Real GetBucketCount (int bucket) const
 
Real NumObservations () const
 

Public Attributes

std::vector< Real > divs
 
std::vector< Real > buckets
 divs.size()+1 buckets (-inf,x0),[x1,x2),...,[xn-1,xn),[xn,inf)
 

Detailed Description

1-D histogram class


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