Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

sheep::CustomDistribution< T > Class Template Reference

#include <customdistribution.h>

List of all members.

Public Member Functions

 CustomDistribution (const T densities[], int size)
 CustomDistribution (const std::vector< T > &densities)
template<typename RNG> int RandomInt (RNG &rng) const

Private Member Functions

template<typename RNG> int random_int_linear (RNG &rng) const
 O(N) algorithm.

template<typename RNG> int random_int_log (RNG &rng) const
 O(log N) algorithm.


Private Attributes

std::vector< T > m_cdf
 Cumulative Distribution Function.

int m_upper_bound
m_max

template<typename T>
class sheep::CustomDistribution< T >


Constructor & Destructor Documentation

template<typename T>
sheep::CustomDistribution< T >::CustomDistribution const T  densities[],
int  size
[inline]
 

Definition at line 139 of file customdistribution.h.

template<typename T>
sheep::CustomDistribution< T >::CustomDistribution const std::vector< T > &  densities  )  [inline]
 

Definition at line 153 of file customdistribution.h.


Member Function Documentation

template<typename T>
template<typename RNG>
int sheep::CustomDistribution< T >::random_int_linear RNG &  rng  )  const [inline, private]
 

O(N) algorithm.

Definition at line 56 of file customdistribution.h.

References sheep::CustomDistribution< T >::m_cdf, and sheep::CustomDistribution< T >::m_upper_bound.

template<typename T>
template<typename RNG>
int sheep::CustomDistribution< T >::random_int_log RNG &  rng  )  const [inline, private]
 

O(log N) algorithm.

Definition at line 68 of file customdistribution.h.

References sheep::CustomDistribution< T >::m_cdf.

template<typename T>
template<typename RNG>
int sheep::CustomDistribution< T >::RandomInt RNG &  rng  )  const [inline]
 

Definition at line 41 of file customdistribution.h.

References sheep::CustomDistribution< T >::m_cdf.


Member Data Documentation

template<typename T>
std::vector<T> sheep::CustomDistribution< T >::m_cdf [private]
 

Cumulative Distribution Function.

Definition at line 50 of file customdistribution.h.

Referenced by sheep::CustomDistribution< T >::random_int_linear(), sheep::CustomDistribution< T >::random_int_log(), and sheep::CustomDistribution< T >::RandomInt().

template<typename T>
T sheep::CustomDistribution< T >::m_max [private]
 

Definition at line 52 of file customdistribution.h.

template<typename T>
int sheep::CustomDistribution< T >::m_upper_bound [private]
 

Definition at line 51 of file customdistribution.h.

Referenced by sheep::CustomDistribution< T >::random_int_linear().


The documentation for this class was generated from the following file:
Generated on Tue May 11 01:31:54 2004 for toxic by doxygen 1.3.6