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

2-D histogram class More...

#include <Histogram2D.h>

Public Types

typedef Real Point[2]
 
typedef int Index[2]
 
typedef size_t Size[2]
 

Public Member Functions

void Clear ()
 Creates one big bucket.
 
void Resize (size_t m, size_t n, Real a1, Real b1, Real a2, Real b2)
 Creates mxn uniformly spaced buckets betwen [a1,b1]x[a2,b2].
 
void Resize (const Size dims, const Point min, const Point max)
 
void ResizeToFit (const std::vector< Real > &data1, const std::vector< Real > &data2, size_t m, size_t n)
 Creates mxn uniformly spaced buckets between the min/max of data1,data2.
 
void ResizeToFit (const std::vector< Point > &data, const Size dims)
 
void Fill (Real val=0)
 Fills all buckets with the given value.
 
void Calculate (const std::vector< Point > &data)
 Calculates the histogram of the data.
 
void Calculate (const std::vector< Real > &data1, const std::vector< Real > &data2)
 Calculates the histogram of the data, given as (data1[i],data2[i])
 
void GetRange (const Index bucket, Point min, Point max) const
 
void GetBucket (const Point val, Index bucket) const
 
void GetBucket (Real v1, Real v2, Index bucket) const
 
void AddBucket (const Point val, Real num=1)
 
void AddBucket (Real v1, Real v2, Real num=1)
 
Real GetBucketCount (Index bucket) const
 
Real NumObservations () const
 

Public Attributes

std::vector< Real > div1
 
std::vector< Real > div2
 
Array2D< Real > buckets
 (div1.size()+1) x (div2.size()+1) buckets
 

Detailed Description

2-D histogram class


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