Discrete Distribution, generates random number according to given pmf from uniform RVs.
More...
#include <discrete_distribution.h>
Discrete Distribution, generates random number according to given pmf from uniform RVs.
Follows distribution style of Boost::random library. copy safe.
MTMCSim::discrete_distribution::discrete_distribution |
( |
) | |
|
|
inline |
MTMCSim::discrete_distribution::discrete_distribution |
( |
unsigned int |
n_, |
|
|
const vector< double > & |
prob_ |
|
) |
| |
Constructor.
Alphabet {0,1,..., n-1}
MTMCSim::discrete_distribution::discrete_distribution |
( |
unsigned int |
n_, |
|
|
const vector< double > & |
prob_, |
|
|
const vector< double > & |
val_ |
|
) |
| |
Constructor.
- Parameters
-
n_ | alphabet size |
prob_ | pmf |
val_ | discrete alphabet values, the size should equal to n_ |
int MTMCSim::discrete_distribution::consumeUniRV |
( |
) | |
const |
|
inline |
Number of Uniform RV need to generate one RV.
double MTMCSim::discrete_distribution::getMean |
( |
) | |
const |
|
inline |
double MTMCSim::discrete_distribution::getStdev |
( |
) | |
const |
|
inline |
void MTMCSim::discrete_distribution::loadTab |
( |
string & |
tabStr) | |
|
template<typename Engine >
double MTMCSim::discrete_distribution::operator() |
( |
Engine & |
engine) | |
const |
Random number generation operator.
- Parameters
-
engine | a uniform pseudorandom number generator that satisfies boost::random concept |
void MTMCSim::discrete_distribution::setDistribution |
( |
unsigned int |
n_, |
|
|
const vector< double > & |
prob_ |
|
) |
| |
void MTMCSim::discrete_distribution::setDistributionWOGenTab |
( |
unsigned int |
n_, |
|
|
const vector< double > & |
prob_ |
|
) |
| |
void MTMCSim::discrete_distribution::tabToStr |
( |
string & |
tabStr) | |
|
The documentation for this class was generated from the following files: