Random

xt::random::seed

xt::random::seed

Set seed for random number generator. A common practice to get a ‘real’ random number is to use:

#include <ctime>

...

xt::random::seed(time(NULL));

xt::random::rand

xt::random::rand

xt::random::randint

xt::random::randint

xt::random::randn

xt::random::randn

xt::random::binomial

xt::random::binomial

xt::random::geometric

xt::random::geometric

xt::random::negative_binomial

xt::random::negative_binomial

xt::random::poisson

xt::random::poisson

xt::random::exponential

xt::random::exponential

xt::random::gamma

xt::random::gamma

Produces (an array of) random positive floating-point values, distributed according to the probability density:

\[P(x) = x^{\alpha-1} \frac{e^{-x / \beta}}{\beta^\alpha \; \Gamma(\alpha)}\]

where \(\alpha\) is the shape (also known as \(k\)) and \(\beta\) the scale (also known as \(\theta\)), and \(\Gamma\) is the Gamma function.

Note

Do not confuse the first argument of xt::random, the shape of the output array, with the parameter \(alpha\).

xt::random::weibull

xt::random::weibull

xt::random::extreme_value

xt::random::extreme_value

xt::random::lognormal

xt::random::lognormal

xt::random::cauchy

xt::random::cauchy

xt::random::fisher_f

xt::random::fisher_f

xt::random::student_t

xt::random::student_t

xt::random::choice

xt::random::choice

xt::random::shuffle

xt::random::shuffle

xt::random::permutation

xt::random::permutation