A thread-safe interface for STL style pesudo random number generators (PRNG).
More...
|
| engine_type & | GetEngine () |
| | Get a reference to the underlying random number engine (mersenne twister). More...
|
| |
| template<typename FloatT > |
| std::enable_if< std::is_floating_point< FloatT >::value, FloatT >::type | Uniform (FloatT min, FloatT max, bool minIncluded, bool maxIncluded) |
| | Get a random uniform number in the specified range. More...
|
| |
| template<typename FloatT = double> |
| std::enable_if< std::is_floating_point< FloatT >::value, FloatT >::type | Uniform (FloatT min=0.0, FloatT max=1.0) |
| | Get a random uniform number in the specified range [min, max). More...
|
| |
| template<typename IntegerT > |
| std::enable_if< std::is_integral< IntegerT >::value, IntegerT >::type | Uniform (IntegerT inclMin, IntegerT inclMax) |
| | Get a random uniform number from a discrete distribution [inclMin, inclMax]. More...
|
| |
| template<typename FloatT = double> |
| bool | Bool (FloatT probability=0.5) |
| | Return a boolean. More...
|
| |
| template<typename FloatT = double> |
| FloatT | Normal (FloatT mean=0.0, FloatT sigma=1.0) |
| | Draw from a gaussian / normal distribution. More...
|
| |
|
template<typename FloatT = double> |
| FloatT | StudentT (FloatT n=1.0, FloatT mean=0.0, FloatT sigma=1.0) |
| |
| template<typename FloatT > |
| FloatT | Exponential (FloatT tau) |
| | Draw from an exponential distribution according to exp(-t/tau). More...
|
| |
| template<typename IntegerT = uint32_t> |
| std::enable_if< std::is_integral< IntegerT >::value, IntegerT >::type | Poisson (double mean) |
| | Draw an integer value from a poisson distribution. More...
|
| |
| template<typename FloatT > |
| std::enable_if< std::is_floating_point< FloatT >::value, FloatT >::type | Poisson (FloatT mean) |
| | Draw a float value (cast from integer) from a poisson distribution. More...
|
| |
| template<typename ProbRangeT , typename IndexType = uint32_t> |
| IndexType | Discrete (const ProbRangeT &probabilities) |
| | Produces integers in the range [0, n) with the probability of producing each value is specified by the parameters of the distribution. More...
|
| |
| template<typename DistributionT > |
| DistributionT::result_type | FromDistribution (DistributionT &dist=DistributionT()) |
| | Draw from a custom distribution. More...
|
| |
| template<typename DistributionT , typename VectorT , typename MatrixT > |
| VectorT | FromMultiVariateDistribution (DistributionT &dist, const VectorT &mean, const MatrixT &cholesky) |
| | Draw from a custom multivariate distribution. More...
|
| |
| template<typename DistributionT , typename VectorT > |
| VectorT | FromMultiVariateDistribution (DistributionT &dist, const VectorT &mean, const VectorT &sigma) |
| | Draw from a custom multivariate distribution without correlations. More...
|
| |
| result_type | operator() () |
| | Invokes the underlying random number generator. More...
|
| |
template<typename EngineT>
class vmcmc::RandomPrototype< EngineT >
A thread-safe interface for STL style pesudo random number generators (PRNG).
Each thread accesses it's own static instance of a PRNG, which is realized using the thread_local keyword. In order for each new PRNG instance to be constructed with a new seed, a global variable Random::sSeed (initially to be set with Random::Seed), is incremented and used in each PRNG's constructor.
- Template Parameters
-
| EngineT | Underlying random number generator (e.g. std::mt19937). |