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

sheep::CustomDistribution< int > Class Template Reference

#include <customdistribution.h>

List of all members.

Public Member Functions

 CustomDistribution (const int densities[], int size)
 CustomDistribution (const std::vector< int > &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< int > m_cdf
 Cumulative Distribution Function.

int m_upper_bound
int m_max

template<>
class sheep::CustomDistribution< int >


Member Function Documentation

sheep::CustomDistribution< int >::CustomDistribution const std::vector< int > &  densities  )  [inline]
 

Definition at line 183 of file customdistribution.h.

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

Definition at line 167 of file customdistribution.h.

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

O(N) algorithm.

Definition at line 97 of file customdistribution.h.

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

O(log N) algorithm.

Definition at line 109 of file customdistribution.h.

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

Definition at line 82 of file customdistribution.h.


Member Data Documentation

std::vector<int> sheep::CustomDistribution< int >::m_cdf [private]
 

Cumulative Distribution Function.

Definition at line 91 of file customdistribution.h.

int sheep::CustomDistribution< int >::m_max [private]
 

Definition at line 93 of file customdistribution.h.

int sheep::CustomDistribution< int >::m_upper_bound [private]
 

Definition at line 92 of file customdistribution.h.


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