Public Member Functions | Private Types | Private Attributes

distribution_t< T > Class Template Reference
[Utility Library]

Basic distribution template. More...

#include <distribution.h>

List of all members.

Public Member Functions

 distribution_t (void) throw ()
void clear (void) throw ()
void addSample (IN T x)
long size (void) const throw ()
getValueAtPercentile (IN float p) const throw ()
 note that 0 < p < 1
getValueAtIndex (IN int idx) const throw ()
 given a sample index, return its value.
float getPercentileAtValue (IN T x) const throw ()

Private Types

typedef std::map< T, int > map_t

Private Attributes

map_t m_map
long m_count

Detailed Description

template<class T>
class distribution_t< T >

Basic distribution template.

You can add samples, then query to find percentiles etc.

Definition at line 42 of file distribution.h.


Member Typedef Documentation

template<class T>
typedef std::map<T, int> distribution_t< T >::map_t [private]

Definition at line 115 of file distribution.h.


Constructor & Destructor Documentation

template<class T>
distribution_t< T >::distribution_t ( void   )  throw () [inline]

Definition at line 44 of file distribution.h.


Member Function Documentation

template<class T>
void distribution_t< T >::clear ( void   )  throw () [inline]

Definition at line 46 of file distribution.h.

template<class T>
void distribution_t< T >::addSample ( IN T  x  )  [inline]

Definition at line 51 of file distribution.h.

template<class T>
long distribution_t< T >::size ( void   )  const throw () [inline]

Definition at line 62 of file distribution.h.

template<class T>
T distribution_t< T >::getValueAtPercentile ( IN float  p  )  const throw () [inline]

note that 0 < p < 1

Definition at line 65 of file distribution.h.

template<class T>
T distribution_t< T >::getValueAtIndex ( IN int  idx  )  const throw () [inline]

given a sample index, return its value.

Samples are ordered by size, so the smallest will have idx = 0.

Definition at line 85 of file distribution.h.

template<class T>
float distribution_t< T >::getPercentileAtValue ( IN T  x  )  const throw () [inline]

Definition at line 102 of file distribution.h.


Member Data Documentation

template<class T>
map_t distribution_t< T >::m_map [private]

Definition at line 117 of file distribution.h.

template<class T>
long distribution_t< T >::m_count [private]

Definition at line 118 of file distribution.h.


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