#include <customdistribution.h>
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 |
|
|
Definition at line 183 of file customdistribution.h. |
|
||||||||||||
|
Definition at line 167 of file customdistribution.h. |
|
||||||||||
|
O(N) algorithm.
Definition at line 97 of file customdistribution.h. |
|
||||||||||
|
O(log N) algorithm.
Definition at line 109 of file customdistribution.h. |
|
||||||||||
|
Definition at line 82 of file customdistribution.h. |
|
|
Cumulative Distribution Function.
Definition at line 91 of file customdistribution.h. |
|
|
Definition at line 93 of file customdistribution.h. |
|
|
Definition at line 92 of file customdistribution.h. |
1.3.6