#include <customdistribution.h>
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 |
| T | m_max |
|
||||||||||||||||
|
Definition at line 139 of file customdistribution.h. |
|
||||||||||
|
Definition at line 153 of file customdistribution.h. |
|
||||||||||||||
|
O(N) algorithm.
Definition at line 56 of file customdistribution.h. References sheep::CustomDistribution< T >::m_cdf, and sheep::CustomDistribution< T >::m_upper_bound. |
|
||||||||||||||
|
O(log N) algorithm.
Definition at line 68 of file customdistribution.h. References sheep::CustomDistribution< T >::m_cdf. |
|
||||||||||||||
|
Definition at line 41 of file customdistribution.h. References sheep::CustomDistribution< T >::m_cdf. |
|
|||||
|
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(). |
|
|||||
|
Definition at line 52 of file customdistribution.h. |
|
|||||
|
Definition at line 51 of file customdistribution.h. Referenced by sheep::CustomDistribution< T >::random_int_linear(). |
1.3.6