Main Page | Modules | Class Hierarchy | Class List | Directories | Class Members | Related Pages | Examples

Histogram< T > Class Template Reference
[StatisticalDataStructures]

Class for creating a histogram summarizing a data set. More...

#include <Histogram.h>

List of all members.

Public Types

typedef std::vector< HistogramBin<
T > * >::iterator 
bin_iterator

Public Member Functions

 Histogram (const Histogram< T > &toCopy)
 Histogram (const T boundaries[], int count, bool finite=false) throw ( InvalidHistogramException )
 Create a new Histogram with the given boundaries.
 Histogram (const T &start, const T &end, const T &interval, bool finite=false) throw ( InvalidHistogramException )
 Create a new Histogram with the given range and interval.
void addValue (const T &value) throw ( ValueOutOfRangeException )
 add a value to the histogram
void clear (void)
 Clear the values of the bins.
int size (void) const
 get the number of bins in the Histogram
double getValue (int binIdx) const
 get the value of the bin at a particular index
const HistogramBin< T > & getBin (int binIdx) const
 get a reference to a particular bin


Detailed Description

template<class T>
class Histogram< T >

Class for creating a histogram summarizing a data set.

Note:
For now, histograms are static - init'd at creation. Doesn't need to stay that way, but that's all I need for now, and I'd like to go looking for a good complete library to replace my ad-hoc stats classes before I go overboard in adding functionality.
Todo:
Histogram<T>( const T& lower, const T& upper, const T& increment, bool finite = false );
Examples:

test_hist.cc.


Constructor & Destructor Documentation

template<class T>
Histogram< T >::Histogram const T  boundaries[],
int  count,
bool  finite = false
throw ( InvalidHistogramException )
 

Create a new Histogram with the given boundaries.

Parameters:
bounds Array of boundaries; a boundary will be included in the lower bin
count Size of bounds
finite Whether the range of the Histogram is finite; default infinite (special bins for (-inf, low] and (high, +inf)
Exceptions:
InvalidHistogramException Thrown if a Histogram with too few boundaries is specified - an infinite Histogram requires at least one boundary, a finite one at least two.

template<class T>
Histogram< T >::Histogram const T &  start,
const T &  end,
const T &  interval,
bool  finite = false
throw ( InvalidHistogramException )
 

Create a new Histogram with the given range and interval.

Parameters:
start start of first bin (non-inclusive)
end end of last bin (inclusive)
interval width of bins
finite Whether the range of the Histogram is finite; default infinite (special bins for (-inf, low] and (high, +inf)
Exceptions:
InvalidHistogramException Thrown if a Histogram with too few boundaries is specified - an infinite Histogram requires at least one boundary, a finite one at least two.


Member Function Documentation

template<class T>
void Histogram< T >::addValue const T &  value  )  throw ( ValueOutOfRangeException )
 

add a value to the histogram

Parameters:
value value to add
ValueOutOfRangeException value added is not within the range of a finite Histogram

template<class T>
const HistogramBin< T > & Histogram< T >::getBin int  binIdx  )  const
 

get a reference to a particular bin

Parameters:
binIdx index of the bin in question

template<class T>
double Histogram< T >::getValue int  binIdx  )  const
 

get the value of the bin at a particular index

Parameters:
binIdx index of the bin in question


The documentation for this class was generated from the following files:
Generated on Thu Apr 5 01:02:37 2007 for ANTARES by  doxygen 1.4.2