# Headers

An instantiation of class template ``additive_combine_engine`` models a pseudo-random number generator . It combines two multiplicative `linear_congruential_engine` number generators, i.e. those with `c` = 0. It is described in

> "Efficient and Portable Combined Random Number Generators", Pierre L'Ecuyer, Communications of the ACM, Vol. 31, No. 6, June 1988, pp. 742-749, 774

The template parameters MLCG1 and MLCG2 shall denote two different `linear_congruential_engine` number generators, each with c = 0. Each invocation returns a random number X(n) := (MLCG1(n) - MLCG2(n)) mod (m1 - 1), where m1 denotes the modulus of MLCG1.

MLCG1
MLCG2
MLCG1::result_type
const bool
result_type

Returns the smallest value that the generator can produce

result_type

Returns the largest value that the generator can produce

void

Seeds an ``additive_combine_engine`` using the default seeds of the two base generators.

void `result_type`

Seeds an ``additive_combine_engine``, using `seed` as the seed for both base generators.

void `SeedSeq &`

Seeds an ``additive_combine_engine``, using `seq` to seed both base generators.

See the warning on the corresponding constructor.

void `typename MLCG1::result_type` `typename MLCG2::result_type`

Seeds an `additive_combine` generator, using `seed1` and `seed2` as the seeds to the first and second base generators, respectively.

void `It &` `It`

Seeds an ``additive_combine_engine`` with values from the range defined by the input iterators first and last. first will be modified to point to the element after the last one used.

Throws: `std::invalid_argument` if the input range is too small.

Exception Safety: Basic

result_type

Returns the next value of the generator.

void `Iter` `Iter`

Fills a range with random values

void `boost::uintmax_t`

Advances the state of the generator by `z`.

Constructs an ``additive_combine_engine`` using the default constructors of the two base generators.

result_type

Constructs an ``additive_combine_engine``, using seed as the constructor argument for both base generators.

SeedSeq &

Constructs an ``additive_combine_engine``, using seq as the constructor argument for both base generators.

The semantics of this function are liable to change. A ``seed_seq`` is designed to generate all the seeds in one shot, but this seeds the two base engines independantly and probably ends up giving the same sequence to both.

typename MLCG1::result_type
typename MLCG2::result_type

Constructs an ``additive_combine_engine``, using `seed1` and `seed2` as the constructor argument to the first and second base generators, respectively.

It &
It

Contructs an ``additive_combine_engine`` with values from the range defined by the input iterators first and last. first will be modified to point to the element after the last one used.

Throws: `std::invalid_argument` if the input range is too small.

Exception Safety: Basic

friend std::basic_ostream< CharT, Traits > & `std::basic_ostream< CharT, Traits > &` `const `additive_combine_engine` &`

Writes the state of an ``additive_combine_engine`` to a `std::ostream`. The textual representation of an ``additive_combine_engine`` is the textual representation of the first base generator followed by the textual representation of the second base generator.

friend std::basic_istream< CharT, Traits > & `std::basic_istream< CharT, Traits > &` `const `additive_combine_engine` &`

Reads the state of an ``additive_combine_engine`` from a `std::istream`.

friend bool `const `additive_combine_engine` &` `const `additive_combine_engine` &`

Returns: true iff the two `additive_combine_engines` will produce the same sequence of values.

friend bool `const `additive_combine_engine` &` `const `additive_combine_engine` &`

Returns: true iff the two `additive_combine_engines` will produce different sequences of values.

The specialization `ecuyer1988` was suggested in

> "Efficient and Portable Combined Random Number Generators", Pierre L'Ecuyer, Communications of the ACM, Vol. 31, No. 6, June 1988, pp. 742-749, 774

`additive_combine_engine`< `linear_congruential_engine`< uint32_t, 40014, 0, 2147483563 >, `linear_congruential_engine`< uint32_t, 40692, 0, 2147483399 >>
double

Instantiations of class template `bernoulli_distribution` model a random distribution . Such a random distribution produces bool values distributed with probabilities P(true) = p and P(false) = 1-p. p is the parameter of the distribution.

`bernoulli_distribution`
RealType

Returns the p parameter of the distribution.

RealType
0.5

Constructs the parameters of the distribution.

Requires: 0 <= p <= 1

friend std::basic_ostream< CharT, Traits > & `std::basic_ostream< CharT, Traits > &` `const `param_type` &`

Writes the parameters to a std::ostream.

friend std::basic_istream< CharT, Traits > & `std::basic_istream< CharT, Traits > &` `const `param_type` &`

Reads the parameters from a std::istream.

friend bool `const `param_type` &` `const `param_type` &`

Returns true if the two sets of parameters are equal.

friend bool `const `param_type` &` `const `param_type` &`

Returns true if the two sets of parameters are different.

int
bool
RealType

Returns: The "p" parameter of the distribution.

bool

Returns the smallest value that the distribution can produce.

bool

Returns the largest value that the distribution can produce.

`param_type`

Returns the parameters of the distribution.

void `const `param_type` &`

Sets the parameters of the distribution.

void

Effects: Subsequent uses of the distribution do not depend on values produced by any engine prior to invoking reset.

bool `Engine &`

Returns: a random variate distributed according to the `bernoulli_distribution` .

bool `Engine &` `const `param_type` &`

Returns: a random variate distributed according to the `bernoulli_distribution` with parameters specified by param.

const RealType &
0.5

Constructs a `bernoulli_distribution` object. p is the parameter of the distribution.

Requires: 0 <= p <= 1

const `param_type` &

Constructs `bernoulli_distribution` from its parameters

friend std::basic_ostream< CharT, Traits > & `std::basic_ostream< CharT, Traits > &` `const `bernoulli_distribution` &`

Writes the parameters of the distribution to a `std::ostream`.

friend std::basic_istream< CharT, Traits > & `std::basic_istream< CharT, Traits > &` `const `bernoulli_distribution` &`

Reads the parameters of the distribution from a `std::istream`.

friend bool `const `bernoulli_distribution` &` `const `bernoulli_distribution` &`

Returns true iff the two distributions will produce identical sequences of values given equal generators.

friend bool `const `bernoulli_distribution` &` `const `bernoulli_distribution` &`

Returns true iff the two distributions will produce different sequences of values given equal generators.

double

The beta distribution is a real-valued distribution which produces values in the range [0, 1]. It has two parameters, alpha and beta.

It has $\displaystyle p(x) = \frac{x^{\alpha-1}(1-x)^{\beta-1}}{B(\alpha, \beta)}$$\displaystyle p(x) = \frac{x^{\alpha-1}(1-x)^{\beta-1}}{B(\alpha, \beta)}$.

`beta_distribution`
RealType

Returns the "alpha" parameter of the distribtuion.

RealType

Returns the "beta" parameter of the distribution.

RealType
1.0
RealType
1.0

Constructs a ``param_type`` from the "alpha" and "beta" parameters of the distribution.

Requires: alpha > 0, beta > 0

friend std::basic_ostream< CharT, Traits > & `std::basic_ostream< CharT, Traits > &` `const `param_type` &`

Writes a ``param_type`` to a `std::ostream`.

friend std::basic_istream< CharT, Traits > & `std::basic_istream< CharT, Traits > &` `const `param_type` &`

Reads a ``param_type`` from a `std::istream`.

friend bool `const `param_type` &` `const `param_type` &`

Returns true if the two sets of parameters are the same.

friend bool `const `param_type` &` `const `param_type` &`

Returns true if the two sets of parameters are the different.

RealType
RealType
RealType `URNG &`

Returns a random variate distributed according to the beta distribution.

RealType `URNG &` `const `param_type` &`

Returns a random variate distributed accordint to the beta distribution with parameters specified by `param`.

RealType

Returns the "alpha" parameter of the distribution.

RealType

Returns the "beta" parameter of the distribution.

RealType

Returns the smallest value that the distribution can produce.

RealType

Returns the largest value that the distribution can produce.

`param_type`

Returns the parameters of the distribution.

void `const `param_type` &`

Sets the parameters of the distribution.

void

Effects: Subsequent uses of the distribution do not depend on values produced by any engine prior to invoking reset.

RealType
1.0
RealType
1.0

Constructs an ``beta_distribution`` from its "alpha" and "beta" parameters.

Requires: alpha > 0, beta > 0

const `param_type` &

Constructs an ``beta_distribution`` from its parameters.

friend std::basic_ostream< CharT, Traits > & `std::basic_ostream< CharT, Traits > &` `const `beta_distribution` &`

Writes an ``beta_distribution`` to a `std::ostream`.

friend std::basic_istream< CharT, Traits > & `std::basic_istream< CharT, Traits > &` `const `beta_distribution` &`

Reads an ``beta_distribution`` from a `std::istream`.

friend bool `const `beta_distribution` &` `const `beta_distribution` &`

Returns true if the two instances of ``beta_distribution`` will return identical sequences of values given equal generators.

friend bool `const `beta_distribution` &` `const `beta_distribution` &`

Returns true if the two instances of ``beta_distribution`` will return different sequences of values given equal generators.

int
double

The binomial distribution is an integer valued distribution with two parameters, `t` and `p`. The values of the distribution are within the range [0,t].

The distribution function is $\displaystyle P(k) = {t \choose k}p^k(1-p)^{t-k}$$\displaystyle P(k) = {t \choose k}p^k(1-p)^{t-k}$.

The algorithm used is the BTRD algorithm described in

> "The generation of binomial random variates", Wolfgang Hormann, Journal of Statistical Computation and Simulation, Volume 46, Issue 1 & 2 April 1993 , pages 101 - 110

`binomial_distribution`
IntType

Returns the `t` parameter of the distribution.

RealType

Returns the `p` parameter of the distribution.

IntType
1
RealType
0.5

Construct a `param_type` object. `t` and `p` are the parameters of the distribution.

Requires: t >=0 && 0 <= p <= 1

friend std::basic_ostream< CharT, Traits > & `std::basic_ostream< CharT, Traits > &` `const `param_type` &`

Writes the parameters of the distribution to a `std::ostream`.

friend std::basic_istream< CharT, Traits > & `std::basic_istream< CharT, Traits > &` ``param_type` &`

Reads the parameters of the distribution from a `std::istream`.

friend bool `const `param_type` &` `const `param_type` &`

Returns true if the parameters have the same values.

friend bool `const `param_type` &` `const `param_type` &`

Returns true if the parameters have different values.

IntType
RealType
IntType `URNG &`

Returns a random variate distributed according to the binomial distribution.

IntType `URNG &` `const `param_type` &`

Returns a random variate distributed according to the binomial distribution with parameters specified by `param`.

IntType

Returns the `t` parameter of the distribution.

RealType

Returns the `p` parameter of the distribution.

IntType

Returns the smallest value that the distribution can produce.

IntType

Returns the largest value that the distribution can produce.

`param_type`

Returns the parameters of the distribution.

void `const `param_type` &`

Sets parameters of the distribution.

void

Effects: Subsequent uses of the distribution do not depend on values produced by any engine prior to invoking reset.

IntType
1
RealType
0.5

Construct a ``binomial_distribution`` object. `t` and `p` are the parameters of the distribution.

Requires: t >=0 && 0 <= p <= 1

const `param_type` &

Construct an ``binomial_distribution`` object from the parameters.

friend std::basic_ostream< CharT, Traits > & `std::basic_ostream< CharT, Traits > &` `const `binomial_distribution` &`

Writes the parameters of the distribution to a `std::ostream`.

friend std::basic_istream< CharT, Traits > & `std::basic_istream< CharT, Traits > &` ``binomial_distribution` &`

Reads the parameters of the distribution from a `std::istream`.

friend bool `const `binomial_distribution` &` `const `binomial_distribution` &`

Returns true if the two distributions will produce the same sequence of values, given equal generators.

friend bool `const `binomial_distribution` &` `const `binomial_distribution` &`

Returns true if the two distributions could produce different sequences of values, given equal generators.

double

The cauchy distribution is a continuous distribution with two parameters, median and sigma.

It has $\displaystyle p(x) = \frac{\sigma}{\pi(\sigma^2 + (x-m)^2)}$$\displaystyle p(x) = \frac{\sigma}{\pi(\sigma^2 + (x-m)^2)}$

`cauchy_distribution`
RealType

Returns the median of the distribution.

RealType

Returns the sigma parameter of the distribution.

RealType

Returns the median of the distribution.

RealType

Returns the sigma parameter of the distribution.

RealType
0.0
RealType
1.0

Constructs the parameters of the cauchy distribution.

friend std::basic_ostream< CharT, Traits > & `std::basic_ostream< CharT, Traits > &` `const `param_type` &`

Writes the parameters to a std::ostream.

friend std::basic_istream< CharT, Traits > & `std::basic_istream< CharT, Traits > &` `const `param_type` &`

Reads the parameters from a std::istream.

friend bool `const `param_type` &` `const `param_type` &`

Returns true if the two sets of parameters are equal.

friend bool `const `param_type` &` `const `param_type` &`

Returns true if the two sets of parameters are different.

RealType
RealType
RealType

Returns: the "median" parameter of the distribution

RealType

Returns: the "sigma" parameter of the distribution

RealType

Returns: the "median" parameter of the distribution

RealType

Returns: the "sigma" parameter of the distribution

RealType

Returns the smallest value that the distribution can produce.

RealType

Returns the largest value that the distribution can produce.

`param_type`
void `const `param_type` &`
void

Effects: Subsequent uses of the distribution do not depend on values produced by any engine prior to invoking reset.

result_type `Engine &`

Returns: A random variate distributed according to the cauchy distribution.

result_type `Engine &` `const `param_type` &`

Returns: A random variate distributed according to the cauchy distribution with parameters specified by param.

RealType
0.0
RealType
1.0

Constructs a `cauchy_distribution` with the paramters `median` and `sigma`.

const `param_type` &

Constructs a `cauchy_distribution` from it's parameters.

friend std::basic_ostream< CharT, Traits > & `std::basic_ostream< CharT, Traits > &` `const `cauchy_distribution` &`

Writes the distribution to a `std::ostream`.

friend std::basic_istream< CharT, Traits > & `std::basic_istream< CharT, Traits > &` `const `cauchy_distribution` &`

Reads the distribution from a `std::istream`.

friend bool `const `cauchy_distribution` &` `const `cauchy_distribution` &`

Returns true if the two distributions will produce identical sequences of values, given equal generators.

friend bool `const `cauchy_distribution` &` `const `cauchy_distribution` &`

Returns true if the two distributions may produce different sequences of values, given equal generators.

double

The chi squared distribution is a real valued distribution with one parameter, `n`. The distribution produces values > 0.

The distribution function is $\displaystyle P(x) = \frac{x^{(n/2)-1}e^{-x/2}}{\Gamma(n/2)2^{n/2}}$$\displaystyle P(x) = \frac{x^{(n/2)-1}e^{-x/2}}{\Gamma(n/2)2^{n/2}}$.

`chi_squared_distribution`
RealType

Returns the `n` parameter of the distribution.

RealType
1

Construct a `param_type` object. `n` is the parameter of the distribution.

Requires: t >=0 && 0 <= p <= 1

friend std::basic_ostream< CharT, Traits > & `std::basic_ostream< CharT, Traits > &` `const `param_type` &`

Writes the parameters of the distribution to a `std::ostream`.

friend std::basic_istream< CharT, Traits > & `std::basic_istream< CharT, Traits > &` ``param_type` &`

Reads the parameters of the distribution from a `std::istream`.

friend bool `const `param_type` &` `const `param_type` &`

Returns true if the parameters have the same values.

friend bool `const `param_type` &` `const `param_type` &`

Returns true if the parameters have different values.

RealType
RealType
RealType `URNG &`

Returns a random variate distributed according to the chi squared distribution.

RealType `URNG &` `const `param_type` &`

Returns a random variate distributed according to the chi squared distribution with parameters specified by `param`.

RealType

Returns the `n` parameter of the distribution.

RealType

Returns the smallest value that the distribution can produce.

RealType

Returns the largest value that the distribution can produce.

`param_type`

Returns the parameters of the distribution.

void `const `param_type` &`

Sets parameters of the distribution.

void

Effects: Subsequent uses of the distribution do not depend on values produced by any engine prior to invoking reset.

RealType
1

Construct a ``chi_squared_distribution`` object. `n` is the parameter of the distribution.

Requires: t >=0 && 0 <= p <= 1

const `param_type` &

Construct an ``chi_squared_distribution`` object from the parameters.

friend std::basic_ostream< CharT, Traits > & `std::basic_ostream< CharT, Traits > &` `const `chi_squared_distribution` &`

Writes the parameters of the distribution to a `std::ostream`.

friend std::basic_istream< CharT, Traits > & `std::basic_istream< CharT, Traits > &` ``chi_squared_distribution` &`

Reads the parameters of the distribution from a `std::istream`.

friend bool `const `chi_squared_distribution` &` `const `chi_squared_distribution` &`

Returns true if the two distributions will produce the same sequence of values, given equal generators.

friend bool `const `chi_squared_distribution` &` `const `chi_squared_distribution` &`

Returns true if the two distributions could produce different sequences of values, given equal generators.

std::size_t
std::size_t

The class template `discard_block_engine` is a model of pseudo-random number generator . It modifies another generator by discarding parts of its output. Out of every block of `p` results, the first `r` will be returned and the rest discarded.

Requires: 0 < p <= r

UniformRandomNumberGenerator
base_type::result_type
const std::size_t
const std::size_t
const bool
const std::size_t
const std::size_t
void

default seeds the underlying generator.

void `seed_type`

Seeds the underlying generator with s.

void `SeedSeq &`

Seeds the underlying generator with seq.

void `It &` `It`

Seeds the underlying generator with first and last.

const base_type &

Returns the underlying engine.

result_type

Returns the next value of the generator.

void `boost::uintmax_t`
void `It` `It`

Uses the default seed for the base generator.

const base_type &

Constructs a new `discard_block_engine` with a copy of rng.

base_type &&

Constructs a new `discard_block_engine` with rng.

seed_type

Creates a new `discard_block_engine` and seeds the underlying generator with `value`

SeedSeq &

Creates a new `discard_block_engine` and seeds the underlying generator with `seq`

It &
It

Creates a new `discard_block_engine` and seeds the underlying generator with first and last.

result_type

Returns the smallest value that the generator can produce. This is the same as the minimum of the underlying generator.

result_type

Returns the largest value that the generator can produce. This is the same as the maximum of the underlying generator.

friend std::basic_ostream< CharT, Traits > & `std::basic_ostream< CharT, Traits > &` `const `discard_block_engine` &`

Writes a `discard_block_engine` to a `std::ostream`.

friend std::basic_istream< CharT, Traits > & `std::basic_istream< CharT, Traits > &` ``discard_block_engine` &`

Reads a `discard_block_engine` from a `std::istream`.

friend bool `const `discard_block_engine` &` `const `discard_block_engine` &`

Returns true if the two generators will produce identical sequences.

friend bool `const `discard_block_engine` &` `const `discard_block_engine` &`

Returns true if the two generators will produce different sequences.

int
double

The class ``discrete_distribution`` models a random distribution . It produces integers in the range [0, n) with the probability of producing each value is specified by the parameters of the distribution.

`discrete_distribution`
std::vector< WeightType >

Returns a vector containing the probabilities of each possible value of the distribution.

Constructs a ``param_type`` object, representing a distribution with $p(0) = 1$$p(0) = 1$ and $p(k|k>0) = 0$$p(k|k>0) = 0$.

Iter
Iter

If `first` == `last`, equivalent to the default constructor. Otherwise, the values of the range represent weights for the possible values of the distribution.

const std::initializer_list< WeightType > &

If wl.size() == 0, equivalent to the default constructor. Otherwise, the values of the `initializer_list` represent weights for the possible values of the distribution.

const Range &

If the range is empty, equivalent to the default constructor. Otherwise, the elements of the range represent weights for the possible values of the distribution.

std::size_t
double
double
Func

If nw is zero, equivalent to the default constructor. Otherwise, the range of the distribution is [0, nw), and the weights are found by calling fw with values evenly distributed between $\mbox{xmin} + \delta/2$$\mbox{xmin} + \delta/2$ and $\mbox{xmax} - \delta/2$$\mbox{xmax} - \delta/2$, where $\delta = (\mbox{xmax} - \mbox{xmin})/\mbox{nw}$$\delta = (\mbox{xmax} - \mbox{xmin})/\mbox{nw}$.

friend std::basic_ostream< CharT, Traits > & `std::basic_ostream< CharT, Traits > &` `const `param_type` &`

Writes the parameters to a `std::ostream`.

friend std::basic_istream< CharT, Traits > & `std::basic_istream< CharT, Traits > &` `const `param_type` &`

Reads the parameters from a `std::istream`.

friend bool `const `param_type` &` `const `param_type` &`

Returns true if the two sets of parameters are the same.

friend bool `const `param_type` &` `const `param_type` &`

Returns true if the two sets of parameters are different.

WeightType
IntType
IntType `URNG &`

Returns a value distributed according to the parameters of the `discrete_distribution`.

IntType `URNG &` `const `param_type` &`

Returns a value distributed according to the parameters specified by param.

result_type

Returns the smallest value that the distribution can produce.

result_type

Returns the largest value that the distribution can produce.

std::vector< WeightType >

Returns a vector containing the probabilities of each value of the distribution. For example, given

    discrete_distribution<> dist = { 1, 4, 5 };
    std::vector<double> p = dist.param();

the vector, p will contain {0.1, 0.4, 0.5}.

If `WeightType` is integral, then the weights will be returned unchanged.

`param_type`

Returns the parameters of the distribution.

void `const `param_type` &`

Sets the parameters of the distribution.

void

Effects: Subsequent uses of the distribution do not depend on values produced by any engine prior to invoking reset.

Creates a new ``discrete_distribution`` object that has $p(0) = 1$$p(0) = 1$ and $p(i|i>0) = 0$$p(i|i>0) = 0$.

Iter
Iter

Constructs a `discrete_distribution` from an iterator range. If `first` == `last`, equivalent to the default constructor. Otherwise, the values of the range represent weights for the possible values of the distribution.

std::initializer_list< WeightType >

Constructs a ``discrete_distribution`` from a `std::initializer_list`. If the `initializer_list` is empty, equivalent to the default constructor. Otherwise, the values of the `initializer_list` represent weights for the possible values of the distribution. For example, given the distribution

    discrete_distribution<> dist{1, 4, 5};

The probability of a 0 is 1/10, the probability of a 1 is 2/5, the probability of a 2 is 1/2, and no other values are possible.

const Range &

Constructs a `discrete_distribution` from a Boost.Range range. If the range is empty, equivalent to the default constructor. Otherwise, the values of the range represent weights for the possible values of the distribution.

std::size_t
double
double
Func

Constructs a `discrete_distribution` that approximates a function. If nw is zero, equivalent to the default constructor. Otherwise, the range of the distribution is [0, nw), and the weights are found by calling fw with values evenly distributed between $\mbox{xmin} + \delta/2$$\mbox{xmin} + \delta/2$ and $\mbox{xmax} - \delta/2$$\mbox{xmax} - \delta/2$, where $\delta = (\mbox{xmax} - \mbox{xmin})/\mbox{nw}$$\delta = (\mbox{xmax} - \mbox{xmin})/\mbox{nw}$.

const `param_type` &

Constructs a `discrete_distribution` from its parameters.

friend std::basic_ostream< CharT, Traits > & `std::basic_ostream< CharT, Traits > &` `const `discrete_distribution` &`

Writes a distribution to a `std::ostream`.

friend std::basic_istream< CharT, Traits > & `std::basic_istream< CharT, Traits > &` `const `discrete_distribution` &`

Reads a distribution from a `std::istream`

friend bool `const `discrete_distribution` &` `const `discrete_distribution` &`

Returns true if the two distributions will return the same sequence of values, when passed equal generators.

friend bool `const `discrete_distribution` &` `const `discrete_distribution` &`

Returns true if the two distributions may return different sequences of values, when passed equal generators.

double

The exponential distribution is a model of random distribution with a single parameter lambda.

It has $\displaystyle p(x) = \lambda e^{-\lambda x}$$\displaystyle p(x) = \lambda e^{-\lambda x}$

The implementation uses the "ziggurat" algorithm, as described in

> "The Ziggurat Method for Generating Random Variables", George Marsaglia and Wai Wan Tsang, Journal of Statistical Software Volume 5, Number 8 (2000), 1-7.

`exponential_distribution`
RealType

Returns the lambda parameter of the distribution.

RealType
1.0

Constructs parameters with a given lambda.

Requires: lambda > 0

friend std::basic_ostream< CharT, Traits > & `std::basic_ostream< CharT, Traits > &` `const `param_type` &`

Writes the parameters to a `std::ostream`.

friend std::basic_istream< CharT, Traits > & `std::basic_istream< CharT, Traits > &` `const `param_type` &`

Reads the parameters from a `std::istream`.

friend bool `const `param_type` &` `const `param_type` &`

Returns true if the two sets of parameters are equal.

friend bool `const `param_type` &` `const `param_type` &`

Returns true if the two sets of parameters are different.

RealType
RealType
RealType

Returns the lambda parameter of the distribution.

RealType

Returns the smallest value that the distribution can produce.

RealType

Returns the largest value that the distribution can produce.

`param_type`

Returns the parameters of the distribution.

void `const `param_type` &`

Sets the parameters of the distribution.

void

Effects: Subsequent uses of the distribution do not depend on values produced by any engine prior to invoking reset.

result_type `Engine &`

Returns a random variate distributed according to the exponential distribution.

result_type `Engine &` `const `param_type` &`

Returns a random variate distributed according to the exponential distribution with parameters specified by param.

RealType
1.0

Constructs an `exponential_distribution` with a given lambda.

Requires: lambda > 0

const `param_type` &

Constructs an `exponential_distribution` from its parameters

friend std::basic_ostream< CharT, Traits > & `std::basic_ostream< CharT, Traits > &` `const `exponential_distribution` &`

Writes the distribution to a std::ostream.

friend std::basic_istream< CharT, Traits > & `std::basic_istream< CharT, Traits > &` `const `exponential_distribution` &`

Reads the distribution from a std::istream.

friend bool `const `exponential_distribution` &` `const `exponential_distribution` &`

Returns true iff the two distributions will produce identical sequences of values given equal generators.

friend bool `const `exponential_distribution` &` `const `exponential_distribution` &`

Returns true iff the two distributions will produce different sequences of values given equal generators.

double

The extreme value distribution is a real valued distribution with two parameters a and b.

It has $\displaystyle p(x) = \frac{1}{b}e^{\frac{a-x}{b} - e^\frac{a-x}{b}}$$\displaystyle p(x) = \frac{1}{b}e^{\frac{a-x}{b} - e^\frac{a-x}{b}}$.

`extreme_value_distribution`
RealType

Returns the "a" parameter of the distribtuion.

RealType

Returns the "b" parameter of the distribution.

RealType
1.0
RealType
1.0

Constructs a ``param_type`` from the "a" and "b" parameters of the distribution.

Requires: b > 0

friend std::basic_ostream< CharT, Traits > & `std::basic_ostream< CharT, Traits > &` `const `param_type` &`

Writes a ``param_type`` to a `std::ostream`.

friend std::basic_istream< CharT, Traits > & `std::basic_istream< CharT, Traits > &` `const `param_type` &`

Reads a ``param_type`` from a `std::istream`.

friend bool `const `param_type` &` `const `param_type` &`

Returns true if the two sets of parameters are the same.

friend bool `const `param_type` &` `const `param_type` &`

Returns true if the two sets of parameters are the different.

RealType
RealType
RealType `URNG &`

Returns a random variate distributed according to the ``extreme_value_distribution``.

RealType `URNG &` `const `param_type` &`

Returns a random variate distributed accordint to the extreme value distribution with parameters specified by `param`.

RealType

Returns the "a" parameter of the distribution.

RealType

Returns the "b" parameter of the distribution.

RealType

Returns the smallest value that the distribution can produce.

RealType

Returns the largest value that the distribution can produce.

`param_type`

Returns the parameters of the distribution.

void `const `param_type` &`

Sets the parameters of the distribution.

void

Effects: Subsequent uses of the distribution do not depend on values produced by any engine prior to invoking reset.

RealType
1.0
RealType
1.0

Constructs an ``extreme_value_distribution`` from its "a" and "b" parameters.

Requires: b > 0

const `param_type` &

Constructs an ``extreme_value_distribution`` from its parameters.

friend std::basic_ostream< CharT, Traits > & `std::basic_ostream< CharT, Traits > &` `const `extreme_value_distribution` &`

Writes an ``extreme_value_distribution`` to a `std::ostream`.

friend std::basic_istream< CharT, Traits > & `std::basic_istream< CharT, Traits > &` `const `extreme_value_distribution` &`

Reads an ``extreme_value_distribution`` from a `std::istream`.

friend bool `const `extreme_value_distribution` &` `const `extreme_value_distribution` &`

Returns true if the two instances of ``extreme_value_distribution`` will return identical sequences of values given equal generators.

friend bool `const `extreme_value_distribution` &` `const `extreme_value_distribution` &`

Returns true if the two instances of ``extreme_value_distribution`` will return different sequences of values given equal generators.

double

The Fisher F distribution is a real valued distribution with two parameters m and n.

It has $\displaystyle p(x) = \frac{\Gamma((m+n)/2)}{\Gamma(m/2)\Gamma(n/2)} \left(\frac{m}{n}\right)^{m/2} x^{(m/2)-1} \left(1+\frac{mx}{n}\right)^{-(m+n)/2} $$\displaystyle p(x) = \frac{\Gamma((m+n)/2)}{\Gamma(m/2)\Gamma(n/2)} \left(\frac{m}{n}\right)^{m/2} x^{(m/2)-1} \left(1+\frac{mx}{n}\right)^{-(m+n)/2} $.

`fisher_f_distribution`
RealType

Returns the "m" parameter of the distribtuion.

RealType

Returns the "n" parameter of the distribution.

RealType
1.0
RealType
1.0

Constructs a ``param_type`` from the "m" and "n" parameters of the distribution.

Requires: m > 0 and n > 0

friend std::basic_ostream< CharT, Traits > & `std::basic_ostream< CharT, Traits > &` `const `param_type` &`

Writes a ``param_type`` to a `std::ostream`.

friend std::basic_istream< CharT, Traits > & `std::basic_istream< CharT, Traits > &` `const `param_type` &`

Reads a ``param_type`` from a `std::istream`.

friend bool `const `param_type` &` `const `param_type` &`

Returns true if the two sets of parameters are the same.

friend bool `const `param_type` &` `const `param_type` &`

Returns true if the two sets of parameters are the different.

RealType
RealType
RealType `URNG &`

Returns a random variate distributed according to the F distribution.

RealType `URNG &` `const `param_type` &`

Returns a random variate distributed according to the F distribution with parameters specified by `param`.

RealType

Returns the "m" parameter of the distribution.

RealType

Returns the "n" parameter of the distribution.

RealType

Returns the smallest value that the distribution can produce.

RealType

Returns the largest value that the distribution can produce.

`param_type`

Returns the parameters of the distribution.

void `const `param_type` &`

Sets the parameters of the distribution.

void

Effects: Subsequent uses of the distribution do not depend on values produced by any engine prior to invoking reset.

RealType
1.0
RealType
1.0

Constructs a ``fisher_f_distribution`` from its "m" and "n" parameters.

Requires: m > 0 and n > 0

const `param_type` &

Constructs an ``fisher_f_distribution`` from its parameters.

friend std::basic_ostream< CharT, Traits > & `std::basic_ostream< CharT, Traits > &` `const `fisher_f_distribution` &`

Writes an ``fisher_f_distribution`` to a `std::ostream`.

friend std::basic_istream< CharT, Traits > & `std::basic_istream< CharT, Traits > &` `const `fisher_f_distribution` &`

Reads an ``fisher_f_distribution`` from a `std::istream`.

friend bool `const `fisher_f_distribution` &` `const `fisher_f_distribution` &`

Returns true if the two instances of ``fisher_f_distribution`` will return identical sequences of values given equal generators.

friend bool `const `fisher_f_distribution` &` `const `fisher_f_distribution` &`

Returns true if the two instances of ``fisher_f_distribution`` will return different sequences of values given equal generators.

double

The gamma distribution is a continuous distribution with two parameters alpha and beta. It produces values > 0.

It has $\displaystyle p(x) = x^{\alpha-1}\frac{e^{-x/\beta}}{\beta^\alpha\Gamma(\alpha)}$$\displaystyle p(x) = x^{\alpha-1}\frac{e^{-x/\beta}}{\beta^\alpha\Gamma(\alpha)}$.

`gamma_distribution`
RealType

Returns the "alpha" parameter of the distribution.

RealType

Returns the "beta" parameter of the distribution.

const RealType &
1.0
const RealType &
1.0

Constructs a ``param_type`` object from the "alpha" and "beta" parameters.

Requires: alpha > 0 && beta > 0

friend std::basic_ostream< CharT, Traits > & `std::basic_ostream< CharT, Traits > &` `const `param_type` &`

Writes the parameters to a `std::ostream`.

friend std::basic_istream< CharT, Traits > & `std::basic_istream< CharT, Traits > &` ``param_type` &`

Reads the parameters from a `std::istream`.

friend bool `const `param_type` &` `const `param_type` &`

Returns true if the two sets of parameters are the same.

friend bool `const `param_type` &` `const `param_type` &`

Returns true if the two sets fo parameters are different.

RealType
RealType
RealType

Returns the "alpha" paramter of the distribution.

RealType

Returns the "beta" parameter of the distribution.

RealType

Returns the smallest value that the distribution can produce.

RealType
`param_type`

Returns the parameters of the distribution.

void `const `param_type` &`

Sets the parameters of the distribution.

void

Effects: Subsequent uses of the distribution do not depend on values produced by any engine prior to invoking reset.

result_type `Engine &`

Returns a random variate distributed according to the gamma distribution.

RealType `URNG &` `const `param_type` &`
const result_type &
1.0
const result_type &
1.0

Creates a new `gamma_distribution` with parameters "alpha" and "beta".

Requires: alpha > 0 && beta > 0

const `param_type` &

Constructs a ``gamma_distribution`` from its parameters.

friend std::basic_ostream< CharT, Traits > & `std::basic_ostream< CharT, Traits > &` `const `gamma_distribution` &`

Writes a ``gamma_distribution`` to a `std::ostream`.

friend std::basic_istream< CharT, Traits > & `std::basic_istream< CharT, Traits > &` ``gamma_distribution` &`

Reads a ``gamma_distribution`` from a `std::istream`.

friend bool `const `gamma_distribution` &` `const `gamma_distribution` &`

Returns true if the two distributions will produce identical sequences of random variates given equal generators.

friend bool `const `gamma_distribution` &` `const `gamma_distribution` &`

Returns true if the two distributions can produce different sequences of random variates, given equal generators.

RealType std::size_t `URNG &`

Returns a value uniformly distributed in the range [0, 1) with at least `bits` random bits.

int
double

An instantiation of the class template ``geometric_distribution`` models a random distribution . The distribution produces positive integers which are the number of bernoulli trials with probability `p` required to get one that fails.

For the geometric distribution, $p(i) = p(1-p)^{i}$$p(i) = p(1-p)^{i}$.

This distribution has been updated to match the C++ standard. Its behavior has changed from the original boost::geometric_distribution. A backwards compatible wrapper is provided in namespace boost.

`geometric_distribution`
RealType

Returns the p parameter of the distribution.

RealType
0.5

Constructs the parameters with p.

friend std::basic_ostream< CharT, Traits > & `std::basic_ostream< CharT, Traits > &` `const `param_type` &`

Writes the parameters to a std::ostream.

friend std::basic_istream< CharT, Traits > & `std::basic_istream< CharT, Traits > &` `const `param_type` &`

Reads the parameters from a std::istream.

friend bool `const `param_type` &` `const `param_type` &`

Returns true if the two sets of parameters are equal.

friend bool `const `param_type` &` `const `param_type` &`

Returns true if the two sets of parameters are different.

RealType
IntType
RealType

Returns: the distribution parameter `p`

IntType

Returns the smallest value that the distribution can produce.

IntType

Returns the largest value that the distribution can produce.

`param_type`

Returns the parameters of the distribution.

void `const `param_type` &`

Sets the parameters of the distribution.

void

Effects: Subsequent uses of the distribution do not depend on values produced by any engine prior to invoking reset.

result_type `Engine &`

Returns a random variate distributed according to the `geometric_distribution`.

result_type `Engine &` `const `param_type` &`

Returns a random variate distributed according to the geometric distribution with parameters specified by param.

const RealType &
0.5

Contructs a new `geometric_distribution` with the paramter `p`.

Requires: 0 < p < 1

const `param_type` &

Constructs a new `geometric_distribution` from its parameters.

friend std::basic_ostream< CharT, Traits > & `std::basic_ostream< CharT, Traits > &` `const `geometric_distribution` &`

Writes the distribution to a `std::ostream`.

friend std::basic_istream< CharT, Traits > & `std::basic_istream< CharT, Traits > &` `const `geometric_distribution` &`

Reads the distribution from a `std::istream`.

friend bool `const `geometric_distribution` &` `const `geometric_distribution` &`

Returns true if the two distributions will produce identical sequences of values given equal generators.

friend bool `const `geometric_distribution` &` `const `geometric_distribution` &`

Returns true if the two distributions may produce different sequences of values given equal generators.

double

The hyperexponential distribution is a real-valued continuous distribution with two parameters, the phase probability vector `probs` and the rate vector `rates`.

A $k$$k$-phase hyperexponential distribution is a mixture of $k$$k$ exponential distributions. For this reason, it is also referred to as mixed exponential distribution or parallel $k$$k$-phase exponential distribution.

A $k$$k$-phase hyperexponential distribution is characterized by two parameters, namely a phase probability vector $\mathbf{\alpha}=(\alpha_1,\ldots,\alpha_k)$$\mathbf{\alpha}=(\alpha_1,\ldots,\alpha_k)$ and a rate vector $\mathbf{\lambda}=(\lambda_1,\ldots,\lambda_k)$$\mathbf{\lambda}=(\lambda_1,\ldots,\lambda_k)$.

A $k$$k$-phase hyperexponential distribution is frequently used in queueing theory to model the distribution of the superposition of $k$$k$ independent events, like, for instance, the service time distribution of a queueing station with $k$$k$ servers in parallel where the $i$$i$-th server is chosen with probability $\alpha_i$$\alpha_i$ and its service time distribution is an exponential distribution with rate $\lambda_i$$\lambda_i$ (Allen,1990; Papadopolous et al.,1993; Trivedi,2002).

For instance, CPUs service-time distribution in a computing system has often been observed to possess such a distribution (Rosin,1965). Also, the arrival of different types of customer to a single queueing station is often modeled as a hyperexponential distribution (Papadopolous et al.,1993). Similarly, if a product manufactured in several parallel assemply lines and the outputs are merged, the failure density of the overall product is likely to be hyperexponential (Trivedi,2002).

Finally, since the hyperexponential distribution exhibits a high Coefficient of Variation (CoV), that is a CoV > 1, it is especially suited to fit empirical data with large CoV (Feitelson,2014; Wolski et al.,2013) and to approximate long-tail probability distributions (Feldmann et al.,1998).

See (Boost,2014) for more information and examples.

A $k$$k$-phase hyperexponential distribution has a probability density function

#

\[ f(x) = \sum_{i=1}^k \alpha_i \lambda_i e^{-x\lambda_i} \]\[ f(x) = \sum_{i=1}^k \alpha_i \lambda_i e^{-x\lambda_i} \] where:

- $k$$k$ is the number of phases and also the size of the input vector parameters,

- $\mathbf{\alpha}=(\alpha_1,\ldots,\alpha_k)$$\mathbf{\alpha}=(\alpha_1,\ldots,\alpha_k)$ is the phase probability vector parameter, and

- $\mathbf{\lambda}=(\lambda_1,\ldots,\lambda_k)$$\mathbf{\lambda}=(\lambda_1,\ldots,\lambda_k)$ is the rate vector parameter.

Given a $k$$k$-phase hyperexponential distribution with phase probability vector $\mathbf{\alpha}$$\mathbf{\alpha}$ and rate vector $\mathbf{\lambda}$$\mathbf{\lambda}$, the random variate generation algorithm consists of the following steps (Tyszer,1999):

1. Generate a random variable $U$$U$ uniformly distribution on the interval $(0,1)$$(0,1)$.

2. Use $U$$U$ to select the appropriate $\lambda_i$$\lambda_i$ (e.g., the alias method can possibly be used for this step).

3. Generate an exponentially distributed random variable $X$$X$ with rate parameter $\lambda_i$$\lambda_i$.

4. Return $X$$X$.

References:

1. A.O. Allen, Probability, Statistics, and Queuing Theory with Computer Science Applications, Second Edition, Academic Press, 1990.

2. Boost C++ Libraries, Boost.Math / Statistical Distributions: Hyperexponential Distribution, Online: http://www.boost.org/doc/libs/release/libs/math/doc/html/dist.html , 2014.

3. D.G. Feitelson, Workload Modeling for Computer Systems Performance Evaluation, Cambridge University Press, 2014

4. A. Feldmann and W. Whitt, Fitting mixtures of exponentials to long-tail distributions to analyze network performance models, Performance Evaluation 31(3-4):245, doi:10.1016/S0166-5316(97)00003-5, 1998.

5. H.T. Papadopolous, C. Heavey and J. Browne, Queueing Theory in Manufacturing Systems Analysis and Design, Chapman & Hall/CRC, 1993, p. 35.

6. R.F. Rosin, Determining a computing center environment, Communications of the ACM 8(7):463-468, 1965.

7. K.S. Trivedi, Probability and Statistics with Reliability, Queueing, and Computer Science Applications, John Wiley & Sons, Inc., 2002.

8. J. Tyszer, Object-Oriented Computer Simulation of Discrete-Event Systems, Springer, 1999.

9. Wikipedia, Hyperexponential Distribution, Online: http://en.wikipedia.org/wiki/Hyperexponential_distribution , 2014.

10. Wolfram Mathematica, Hyperexponential Distribution, Online: http://reference.wolfram.com/language/ref/HyperexponentialDistribution.html , 2014.

Marco Guazzone (marco.guazzone@gmail.com)

The parameters of a hyperexponential distribution.

Stores the phase probability vector and the rate vector of the hyperexponential distribution.

Marco Guazzone (marco.guazzone@gmail.com)

`hyperexponential_distribution`
std::vector< RealT >

Gets the phase probability vector parameter of the distribtuion.

The returned probabilities are the normalized version of the ones passed at construction time.

The phase probability vector parameter of the distribution.

std::vector< RealT >

Gets the rate vector parameter of the distribtuion.

The rate vector parameter of the distribution.

Constructs a ``param_type`` with the default parameters of the distribution.

Must meet the requirements of `InputIterator` concept (ISO,2014,sec. 24.2.3 [input.iterators]).

Must meet the requirements of `InputIterator` concept (ISO,2014,sec. 24.2.3 [input.iterators]).

ProbIterT

The iterator to the beginning of the range of non-negative real elements representing the phase probabilities; if elements don't sum to 1, they are normalized.

ProbIterT

The iterator to the ending of the range of non-negative real elements representing the phase probabilities; if elements don't sum to 1, they are normalized.

RateIterT

The iterator to the beginning of the range of non-negative real elements representing the rates.

RateIterT

The iterator to the ending of the range of non-negative real elements representing the rates.

Constructs a ``param_type`` from the phase probability vector and rate vector parameters of the distribution.

The phase probability vector parameter is given by the range defined by [prob_first, prob_last) iterator pair, and the rate vector parameter is given by the range defined by [rate_first, rate_last) iterator pair.

References:

1. ISO, ISO/IEC 14882-2014: Information technology - Programming languages - C++, 2014

Must meet the requirements of Range concept.

Must meet the requirements of Range concept.

ProbRangeT const &

The range of non-negative real elements representing the phase probabilities; if elements don't sum to 1, they are normalized.

RateRangeT const &

The range of positive real elements representing the rates.

typename boost::disable_if_c< boost::has_pre_increment< ProbRangeT >::value||boost::has_pre_increment< RateRangeT >::value >::type *
0

Constructs a ``param_type`` from the phase probability vector and rate vector parameters of the distribution.

The phase probability vector parameter is given by the range defined by prob_range, and the rate vector parameter is given by the range defined by rate_range.

The final `disable_if` parameter is an implementation detail that differentiates between this two argument constructor and the iterator-based two argument constructor described below.

Must meet the requirements of `InputIterator` concept (ISO,2014,sec. 24.2.3 [input.iterators]).

RateIterT

The iterator to the beginning of the range of non-negative real elements representing the rates.

RateIterT

The iterator to the ending of the range of non-negative real elements representing the rates.

typename boost::enable_if_c< boost::has_pre_increment< RateIterT >::value >::type *
0

Constructs a ``param_type`` from the rate vector parameter of the distribution and with equal phase probabilities.

The rate vector parameter is given by the range defined by [rate_first, rate_last) iterator pair, and the phase probability vector parameter is set to the equal phase probabilities (i.e., to a vector of the same length $k$$k$ of the rate vector and with each element set to $1.0/k$$1.0/k$).

The final `disable_if` parameter is an implementation detail that differentiates between this two argument constructor and the range-based two argument constructor described above.

References:

1. ISO, ISO/IEC 14882-2014: Information technology - Programming languages - C++, 2014

Must meet the requirements of Range concept.

RateRangeT const &

The range of positive real elements representing the rates.

Constructs a ``param_type`` from the "rates" parameters of the distribution and with equal phase probabilities.

The rate vector parameter is given by the range defined by rate_range, and the phase probability vector parameter is set to the equal phase probabilities (i.e., to a vector of the same length $k$$k$ of the rate vector and with each element set to $1.0/k$$1.0/k$).

std::initializer_list< RealT >

The initializer list for inizializing the phase probability vector.

std::initializer_list< RealT >

The initializer list for inizializing the rate vector.

Constructs a ``param_type`` from the phase probability vector and rate vector parameters of the distribution.

The phase probability vector parameter is given by the brace-init-list (ISO,2014,sec. 8.5.4 [dcl.init.list]) defined by l1, and the rate vector parameter is given by the brace-init-list (ISO,2014,sec. 8.5.4 [dcl.init.list]) defined by l2.

References:

1. ISO, ISO/IEC 14882-2014: Information technology - Programming languages - C++, 2014

std::initializer_list< RealT >

The initializer list for inizializing the rate vector.

Constructs a ``param_type`` from the rate vector parameter of the distribution and with equal phase probabilities.

The rate vector parameter is given by the brace-init-list (ISO,2014,sec. 8.5.4 [dcl.init.list]) defined by l1, and the phase probability vector parameter is set to the equal phase probabilities (i.e., to a vector of the same length $k$$k$ of the rate vector and with each element set to $1.0/k$$1.0/k$).

References:

1. ISO, ISO/IEC 14882-2014: Information technology - Programming languages - C++, 2014

friend std::basic_ostream< CharT, Traits > & `std::basic_ostream< CharT, Traits > &` `const `param_type` &`

Writes a ``param_type`` to a `std::ostream`.

friend std::basic_istream< CharT, Traits > & `std::basic_istream< CharT, Traits > &` `const `param_type` &`

Reads a ``param_type`` from a `std::istream`.

friend bool `const `param_type` &` `const `param_type` &`

Returns true if the two sets of parameters are the same.

friend bool `const `param_type` &` `const `param_type` &`

Returns true if the two sets of parameters are the different.

RealT
RealT
RealT

Must meet the requirements of uniform random number generator .

URNG &

A uniform random number generator object.

Gets a random variate distributed according to the hyperexponential distribution.

A random variate distributed according to the hyperexponential distribution.

RealT

Must meet the requirements of uniform random number generator .

URNG &

A uniform random number generator object.

const `param_type` &

A distribution parameter object.

Gets a random variate distributed according to the hyperexponential distribution with parameters specified by `param`.

A random variate distributed according to the hyperexponential distribution. distribution with parameters specified by `param`.

std::size_t

Returns the number of phases of the distribution.

std::vector< RealT >

Returns the phase probability vector parameter of the distribution.

std::vector< RealT >

Returns the rate vector parameter of the distribution.

RealT

Returns the smallest value that the distribution can produce.

RealT

Returns the largest value that the distribution can produce.

`param_type`

Returns the parameters of the distribution.

void ``param_type` const &`

Sets the parameters of the distribution.

void

Effects: Subsequent uses of the distribution do not depend on values produced by any engine prior to invoking reset.

Constructs a 1-phase ``hyperexponential_distribution`` (i.e., an exponential distribution) with rate 1.

Must meet the requirements of `InputIterator` concept (ISO,2014,sec. 24.2.3 [input.iterators]).

Must meet the requirements of `InputIterator` concept (ISO,2014,sec. 24.2.3 [input.iterators]).

ProbIterT

The iterator to the beginning of the range of non-negative real elements representing the phase probabilities; if elements don't sum to 1, they are normalized.

ProbIterT

The iterator to the ending of the range of non-negative real elements representing the phase probabilities; if elements don't sum to 1, they are normalized.

RateIterT

The iterator to the beginning of the range of non-negative real elements representing the rates.

RateIterT

The iterator to the ending of the range of non-negative real elements representing the rates.

Constructs a ``hyperexponential_distribution`` from the phase probability vector and rate vector parameters of the distribution.

The phase probability vector parameter is given by the range defined by [prob_first, prob_last) iterator pair, and the rate vector parameter is given by the range defined by [rate_first, rate_last) iterator pair.

References:

1. ISO, ISO/IEC 14882-2014: Information technology - Programming languages - C++, 2014

Must meet the requirements of Range concept.

Must meet the requirements of Range concept.

ProbRangeT const &

The range of non-negative real elements representing the phase probabilities; if elements don't sum to 1, they are normalized.

RateRangeT const &

The range of positive real elements representing the rates.

typename boost::disable_if_c< boost::has_pre_increment< ProbRangeT >::value||boost::has_pre_increment< RateRangeT >::value >::type *
0

Constructs a ``hyperexponential_distribution`` from the phase probability vector and rate vector parameters of the distribution.

The phase probability vector parameter is given by the range defined by prob_range, and the rate vector parameter is given by the range defined by rate_range.

The final `disable_if` parameter is an implementation detail that differentiates between this two argument constructor and the iterator-based two argument constructor described below.

Must meet the requirements of `InputIterator` concept (ISO,2014,sec. 24.2.3 [input.iterators]).

RateIterT

The iterator to the beginning of the range of non-negative real elements representing the rates.

RateIterT

The iterator to the ending of the range of non-negative real elements representing the rates.

typename boost::enable_if_c< boost::has_pre_increment< RateIterT >::value >::type *
0

Constructs a ``hyperexponential_distribution`` from the rate vector parameter of the distribution and with equal phase probabilities.

The rate vector parameter is given by the range defined by [rate_first, rate_last) iterator pair, and the phase probability vector parameter is set to the equal phase probabilities (i.e., to a vector of the same length $k$$k$ of the rate vector and with each element set to $1.0/k$$1.0/k$).

The final `disable_if` parameter is an implementation detail that differentiates between this two argument constructor and the range-based two argument constructor described above.

References:

1. ISO, ISO/IEC 14882-2014: Information technology - Programming languages - C++, 2014

Must meet the requirements of Range concept.

RateRangeT const &

The range of positive real elements representing the rates.

Constructs a ``param_type`` from the "rates" parameters of the distribution and with equal phase probabilities.

The rate vector parameter is given by the range defined by rate_range, and the phase probability vector parameter is set to the equal phase probabilities (i.e., to a vector of the same length $k$$k$ of the rate vector and with each element set to $1.0/k$$1.0/k$).

param_type
const &

The parameters of the distribution.

Constructs a ``hyperexponential_distribution`` from its parameters.

std::initializer_list< RealT > const &

The initializer list for inizializing the phase probability vector.

std::initializer_list< RealT > const &

The initializer list for inizializing the rate vector.

Constructs a ``hyperexponential_distribution`` from the phase probability vector and rate vector parameters of the distribution.

The phase probability vector parameter is given by the brace-init-list (ISO,2014,sec. 8.5.4 [dcl.init.list]) defined by l1, and the rate vector parameter is given by the brace-init-list (ISO,2014,sec. 8.5.4 [dcl.init.list]) defined by l2.

References:

1. ISO, ISO/IEC 14882-2014: Information technology - Programming languages - C++, 2014

std::initializer_list< RealT > const &

The initializer list for inizializing the rate vector.

Constructs a ``hyperexponential_distribution`` from the rate vector parameter of the distribution and with equal phase probabilities.

The rate vector parameter is given by the brace-init-list (ISO,2014,sec. 8.5.4 [dcl.init.list]) defined by l1, and the phase probability vector parameter is set to the equal phase probabilities (i.e., to a vector of the same length $k$$k$ of the rate vector and with each element set to $1.0/k$$1.0/k$).

References:

1. ISO, ISO/IEC 14882-2014: Information technology - Programming languages - C++, 2014

friend std::basic_ostream< CharT, Traits > & `std::basic_ostream< CharT, Traits > &` `const `hyperexponential_distribution` &`

Writes an ``hyperexponential_distribution`` to a `std::ostream`.

friend std::basic_istream< CharT, Traits > & `std::basic_istream< CharT, Traits > &` `const `hyperexponential_distribution` &`

Reads an ``hyperexponential_distribution`` from a `std::istream`.

friend bool `const `hyperexponential_distribution` &` `const `hyperexponential_distribution` &`

Returns true if the two instances of ``hyperexponential_distribution`` will return identical sequences of values given equal generators.

friend bool `const `hyperexponential_distribution` &` `const `hyperexponential_distribution` &`

Returns true if the two instances of ``hyperexponential_distribution`` will return different sequences of values given equal generators.

std::size_t

An instantiation of class template ``independent_bits_engine`` model a pseudo-random number generator . It generates random numbers distributed between [0, 2^w) by combining one or more invocations of the base engine.

Requires: 0 < w <= std::numeric_limits<UIntType>::digits

Engine
UIntType
Engine::result_type
const bool
result_type

Returns the smallest value that the generator can produce.

result_type

Returns the largest value that the generator can produce.

void

Seeds an ``independent_bits_engine`` using the default seed of the base generator.

void `base_result_type`

Seeds an ``independent_bits_engine``, using `seed` as the seed for the base generator.

void `SeedSeq &`

Seeds an ``independent_bits_engine``, using `seq` to seed the base generator.

void `It &` `It`

Seeds an ``independent_bits_engine`` with values from the range defined by the input iterators first and last. first will be modified to point to the element after the last one used.

Throws: `std::invalid_argument` if the input range is too small.

Exception Safety: Basic

result_type

Returns the next value of the generator.

void `Iter` `Iter`

Fills a range with random values

void `boost::uintmax_t`

Advances the state of the generator by `z`.

const base_type &

Constructs an ``independent_bits_engine`` using the default constructor of the base generator.

base_result_type

Constructs an ``independent_bits_engine``, using seed as the constructor argument for both base generators.

SeedSeq &

Constructs an ``independent_bits_engine``, using seq as the constructor argument for the base generator.

const base_type &

Constructs an ``independent_bits_engine`` by copying `base`.

It &
It

Contructs an ``independent_bits_engine`` with values from the range defined by the input iterators first and last. first will be modified to point to the element after the last one used.

Throws: `std::invalid_argument` if the input range is too small.

Exception Safety: Basic

friend std::basic_ostream< CharT, Traits > & `std::basic_ostream< CharT, Traits > &` `const `independent_bits_engine` &`

Writes the textual representation if the generator to a `std::ostream`. The textual representation of the engine is the textual representation of the base engine.

friend std::basic_istream< CharT, Traits > & `std::basic_istream< CharT, Traits > &` `const `independent_bits_engine` &`

Reads the state of an ``independent_bits_engine`` from a `std::istream`.

friend bool `const `independent_bits_engine` &` `const `independent_bits_engine` &`

Returns: true iff the two `independent_bits_engines` will produce the same sequence of values.

friend bool `const `independent_bits_engine` &` `const `independent_bits_engine` &`

Returns: true iff the two `independent_bits_engines` will produce different sequences of values.

IntType
IntType
IntType

Instantiations of class template ``inversive_congruential_engine`` model a pseudo-random number generator . It uses the inversive congruential algorithm (ICG) described in

> "Inversive pseudorandom number generators: concepts, results and links", Peter Hellekalek, In: "Proceedings of the 1995 Winter Simulation Conference", C. Alexopoulos, K. Kang, W.R. Lilegdon, and D. Goldsman (editors), 1995, pp. 255-262. ftp://random.mat.sbg.ac.at/pub/data/wsc95.ps

The output sequence is defined by x(n+1) = (a*inv(x(n)) - b) (mod p), where x(0), a, b, and the prime number p are parameters of the generator. The expression inv(k) denotes the multiplicative inverse of k in the field of integer numbers modulo p, with inv(0) := 0.

The template parameter IntType shall denote a signed integral type large enough to hold p; a, b, and p are the parameters of the generators. The template parameter val is the validation value checked by validation.

The implementation currently uses the Euclidian Algorithm to compute the multiplicative inverse. Therefore, the inversive generators are about 10-20 times slower than the others (see section"performance"). However, the paper talks of only 3x slowdown, so the Euclidian Algorithm is probably not optimal for calculating the multiplicative inverse.

IntType
const bool
const result_type
const result_type
const result_type
const IntType
result_type
result_type
void

Calls seed(default_seed)

void `IntType`

If c mod m is zero and x0 mod m is zero, changes the current value of the generator to 1. Otherwise, changes it to x0 mod m. If c is zero, distinct seeds in the range [1,m) will leave the generator in distinct states. If c is not zero, the range is [0,m).

void `SeedSeq &`

Seeds an ``inversive_congruential_engine`` using values from a SeedSeq.

void `It &` `It`

seeds an ``inversive_congruential_engine`` with values taken from the itrator range [first, last) and adjusts `first` to point to the element after the last one used. If there are not enough elements, throws `std::invalid_argument`.

`first` and `last` must be input iterators.

IntType

Returns the next output of the generator.

void `Iter` `Iter`

Fills a range with random values

void `boost::uintmax_t`

Advances the state of the generator by `z`.

Constructs an ``inversive_congruential_engine``, seeding it with the default seed.

IntType

Constructs an ``inversive_congruential_engine``, seeding it with `x0`.

SeedSeq &

Constructs an ``inversive_congruential_engine``, seeding it with values produced by a call to `seq.generate()`.

It &
It

Constructs an ``inversive_congruential_engine``, seeds it with values taken from the itrator range [first, last), and adjusts first to point to the element after the last one used. If there are not enough elements, throws `std::invalid_argument`.

first and last must be input iterators.

friend std::basic_ostream< CharT, Traits > & `std::basic_ostream< CharT, Traits > &` `const `inversive_congruential_engine` &`

Writes the textual representation of the generator to a `std::ostream`.

friend std::basic_istream< CharT, Traits > & `std::basic_istream< CharT, Traits > &` `const `inversive_congruential_engine` &`

Reads the textual representation of the generator from a `std::istream`.

friend bool `const `inversive_congruential_engine` &` `const `inversive_congruential_engine` &`

Returns true if the two generators will produce identical sequences of outputs.

friend bool `const `inversive_congruential_engine` &` `const `inversive_congruential_engine` &`

Returns true if the two generators will produce different sequences of outputs.

The specialization hellekalek1995 was suggested in

> "Inversive pseudorandom number generators: concepts, results and links", Peter Hellekalek, In: "Proceedings of the 1995 Winter Simulation Conference", C. Alexopoulos, K. Kang, W.R. Lilegdon, and D. Goldsman (editors), 1995, pp. 255-262. ftp://random.mat.sbg.ac.at/pub/data/wsc95.ps

`inversive_congruential_engine`< uint32_t, 9102, 2147483647-36884165, 2147483647 >
int
unsigned int
unsigned int

Instantiations of class template `lagged_fibonacci_engine` model a pseudo-random number generator . It uses a lagged Fibonacci algorithm with two lags `p` and `q:` x(i) = x(i-p) + x(i-q) (mod 2w) with p > q.

UIntType
const bool
const int
const unsigned int
const unsigned int
const UIntType
result_type

Returns the smallest value that the generator can produce.

result_type

Returns the largest value that the generator can produce.

void

Calls `seed(default_seed)`.

void `UIntType`

Sets the state of the generator to values produced by a `minstd_rand0` generator.

void `SeedSeq &`

Sets the state of the generator using values produced by seq.

void `It &` `It`

Sets the state of the generator to values from the iterator range [first, last). If there are not enough elements in the range [first, last) throws `std::invalid_argument`.

result_type

Returns the next value of the generator.

void `Iter` `Iter`

Fills a range with random values

void `boost::uintmax_t`

Advances the state of the generator by `z`.

Creates a new ``lagged_fibonacci_engine`` and calls `seed()`.

UIntType

Creates a new ``lagged_fibonacci_engine`` and calls `seed(value)`.

SeedSeq &

Creates a new ``lagged_fibonacci_engine`` and calls `seed(seq)`.

It &
It

Creates a new ``lagged_fibonacci_engine`` and calls `seed(first, last)`.

friend std::basic_ostream< CharT, Traits > & `std::basic_ostream< CharT, Traits > &` `const `lagged_fibonacci_engine` &`

Writes the textual representation of the generator to a `std::ostream`.

friend std::basic_istream< CharT, Traits > & `std::basic_istream< CharT, Traits > &` `const `lagged_fibonacci_engine` &`

Reads the textual representation of the generator from a `std::istream`.

friend bool `const `lagged_fibonacci_engine` &` `const `lagged_fibonacci_engine` &`

Returns true if the two generators will produce identical sequences of outputs.

friend bool `const `lagged_fibonacci_engine` &` `const `lagged_fibonacci_engine` &`

Returns true if the two generators will produce different sequences of outputs.

int
unsigned int
unsigned int

Instantiations of class template `lagged_fibonacci_01` model a pseudo-random number generator . It uses a lagged Fibonacci algorithm with two lags `p` and `q`, evaluated in floating-point arithmetic: x(i) = x(i-p) + x(i-q) (mod 1) with p > q. See

> "Uniform random number generators for supercomputers", Richard Brent, Proc. of Fifth Australian Supercomputer Conference, Melbourne, Dec. 1992, pp. 704-706.

The quality of the generator crucially depends on the choice of the parameters. User code should employ one of the sensibly parameterized generators such as `lagged_fibonacci607` instead.

The generator requires considerable amounts of memory for the storage of its state array. For example, `lagged_fibonacci607` requires about 4856 bytes and `lagged_fibonacci44497` requires about 350 KBytes.

RealType
const bool
const int
const unsigned int
const unsigned int
const boost::uint32_t
void

Calls seed(default_seed).

void `boost::uint32_t`

Constructs a `minstd_rand0` generator with the constructor parameter value and calls seed with it. Distinct seeds in the range [1, 2147483647) will produce generators with different states. Other seeds will be equivalent to some seed within this range. See `linear_congruential_engine` for details.

void `SeedSeq &`

Seeds this ``lagged_fibonacci_01_engine`` using values produced by `seq.generate`.

void `It &` `It`

Seeds this ``lagged_fibonacci_01_engine`` using values from the iterator range [first, last). If there are not enough elements in the range, throws `std::invalid_argument`.

result_type

Returns the next value of the generator.

void `Iter` `Iter`

Fills a range with random values

void `boost::uintmax_t`

Advances the state of the generator by `z`.

Constructs a `lagged_fibonacci_01` generator and calls `seed()`.

uint32_t

Constructs a `lagged_fibonacci_01` generator and calls `seed(value)`.

SeedSeq &

Constructs a `lagged_fibonacci_01` generator and calls `seed(gen)`.

It &
It
result_type

Returns the smallest value that the generator can produce.

result_type

Returns the upper bound of the generators outputs.

friend std::basic_ostream< CharT, Traits > & `std::basic_ostream< CharT, Traits > &` `const `lagged_fibonacci_01_engine` &`

Writes the textual representation of the generator to a `std::ostream`.

friend std::basic_istream< CharT, Traits > & `std::basic_istream< CharT, Traits > &` `const `lagged_fibonacci_01_engine` &`

Reads the textual representation of the generator from a `std::istream`.

friend bool `const `lagged_fibonacci_01_engine` &` `const `lagged_fibonacci_01_engine` &`

Returns true if the two generators will produce identical sequences of outputs.

friend bool `const `lagged_fibonacci_01_engine` &` `const `lagged_fibonacci_01_engine` &`

Returns true if the two generators will produce different sequences of outputs.

The specializations lagged_fibonacci607 ... lagged_fibonacci44497 use well tested lags.

See

> "On the Periods of Generalized Fibonacci Recurrences", Richard P. Brent Computer Sciences Laboratory Australian National University, December 1992

The lags used here can be found in

> "Uniform random number generators for supercomputers", Richard Brent, Proc. of Fifth Australian Supercomputer Conference, Melbourne, Dec. 1992, pp. 704-706.

`lagged_fibonacci_01_engine`< double, 48, 607, 273 >

The specializations lagged_fibonacci607 ... lagged_fibonacci44497 use well tested lags.

See

> "On the Periods of Generalized Fibonacci Recurrences", Richard P. Brent Computer Sciences Laboratory Australian National University, December 1992

The lags used here can be found in

> "Uniform random number generators for supercomputers", Richard Brent, Proc. of Fifth Australian Supercomputer Conference, Melbourne, Dec. 1992, pp. 704-706.

`lagged_fibonacci_01_engine`< double, 48, 1279, 418 >

The specializations lagged_fibonacci607 ... lagged_fibonacci44497 use well tested lags.

See

> "On the Periods of Generalized Fibonacci Recurrences", Richard P. Brent Computer Sciences Laboratory Australian National University, December 1992

The lags used here can be found in

> "Uniform random number generators for supercomputers", Richard Brent, Proc. of Fifth Australian Supercomputer Conference, Melbourne, Dec. 1992, pp. 704-706.

`lagged_fibonacci_01_engine`< double, 48, 2281, 1252 >

The specializations lagged_fibonacci607 ... lagged_fibonacci44497 use well tested lags.

See

> "On the Periods of Generalized Fibonacci Recurrences", Richard P. Brent Computer Sciences Laboratory Australian National University, December 1992

The lags used here can be found in

> "Uniform random number generators for supercomputers", Richard Brent, Proc. of Fifth Australian Supercomputer Conference, Melbourne, Dec. 1992, pp. 704-706.

`lagged_fibonacci_01_engine`< double, 48, 3217, 576 >

The specializations lagged_fibonacci607 ... lagged_fibonacci44497 use well tested lags.

See

> "On the Periods of Generalized Fibonacci Recurrences", Richard P. Brent Computer Sciences Laboratory Australian National University, December 1992

The lags used here can be found in

> "Uniform random number generators for supercomputers", Richard Brent, Proc. of Fifth Australian Supercomputer Conference, Melbourne, Dec. 1992, pp. 704-706.

`lagged_fibonacci_01_engine`< double, 48, 4423, 2098 >

The specializations lagged_fibonacci607 ... lagged_fibonacci44497 use well tested lags.

See

> "On the Periods of Generalized Fibonacci Recurrences", Richard P. Brent Computer Sciences Laboratory Australian National University, December 1992

The lags used here can be found in

> "Uniform random number generators for supercomputers", Richard Brent, Proc. of Fifth Australian Supercomputer Conference, Melbourne, Dec. 1992, pp. 704-706.

`lagged_fibonacci_01_engine`< double, 48, 9689, 5502 >

The specializations lagged_fibonacci607 ... lagged_fibonacci44497 use well tested lags.

See

> "On the Periods of Generalized Fibonacci Recurrences", Richard P. Brent Computer Sciences Laboratory Australian National University, December 1992

The lags used here can be found in

> "Uniform random number generators for supercomputers", Richard Brent, Proc. of Fifth Australian Supercomputer Conference, Melbourne, Dec. 1992, pp. 704-706.

`lagged_fibonacci_01_engine`< double, 48, 19937, 9842 >

The specializations lagged_fibonacci607 ... lagged_fibonacci44497 use well tested lags.

See

> "On the Periods of Generalized Fibonacci Recurrences", Richard P. Brent Computer Sciences Laboratory Australian National University, December 1992

The lags used here can be found in

> "Uniform random number generators for supercomputers", Richard Brent, Proc. of Fifth Australian Supercomputer Conference, Melbourne, Dec. 1992, pp. 704-706.

`lagged_fibonacci_01_engine`< double, 48, 23209, 13470 >

The specializations lagged_fibonacci607 ... lagged_fibonacci44497 use well tested lags.

See

> "On the Periods of Generalized Fibonacci Recurrences", Richard P. Brent Computer Sciences Laboratory Australian National University, December 1992

The lags used here can be found in

> "Uniform random number generators for supercomputers", Richard Brent, Proc. of Fifth Australian Supercomputer Conference, Melbourne, Dec. 1992, pp. 704-706.

`lagged_fibonacci_01_engine`< double, 48, 44497, 21034 >
double

The laplace distribution is a real-valued distribution with two parameters, mean and beta.

It has $\displaystyle p(x) = \frac{e^-{\frac{|x-\mu|}{\beta}}}{2\beta}$$\displaystyle p(x) = \frac{e^-{\frac{|x-\mu|}{\beta}}}{2\beta}$.

`laplace_distribution`
RealType

Returns the "mean" parameter of the distribtuion.

RealType

Returns the "beta" parameter of the distribution.

RealType
0.0
RealType
1.0

Constructs a ``param_type`` from the "mean" and "beta" parameters of the distribution.

friend std::basic_ostream< CharT, Traits > & `std::basic_ostream< CharT, Traits > &` `const `param_type` &`

Writes a ``param_type`` to a `std::ostream`.

friend std::basic_istream< CharT, Traits > & `std::basic_istream< CharT, Traits > &` `const `param_type` &`

Reads a ``param_type`` from a `std::istream`.

friend bool `const `param_type` &` `const `param_type` &`

Returns true if the two sets of parameters are the same.

friend bool `const `param_type` &` `const `param_type` &`

Returns true if the two sets of parameters are the different.

RealType
RealType
RealType `URNG &`

Returns a random variate distributed according to the laplace distribution.

RealType `URNG &` `const `param_type` &`

Returns a random variate distributed accordint to the laplace distribution with parameters specified by `param`.

RealType

Returns the "mean" parameter of the distribution.

RealType

Returns the "beta" parameter of the distribution.

RealType

Returns the smallest value that the distribution can produce.

RealType

Returns the largest value that the distribution can produce.

`param_type`

Returns the parameters of the distribution.

void `const `param_type` &`

Sets the parameters of the distribution.

void

Effects: Subsequent uses of the distribution do not depend on values produced by any engine prior to invoking reset.

RealType
0.0
RealType
1.0

Constructs an ``laplace_distribution`` from its "mean" and "beta" parameters.

const `param_type` &

Constructs an ``laplace_distribution`` from its parameters.

friend std::basic_ostream< CharT, Traits > & `std::basic_ostream< CharT, Traits > &` `const `laplace_distribution` &`

Writes an ``laplace_distribution`` to a `std::ostream`.

friend std::basic_istream< CharT, Traits > & `std::basic_istream< CharT, Traits > &` `const `laplace_distribution` &`

Reads an ``laplace_distribution`` from a `std::istream`.

friend bool `const `laplace_distribution` &` `const `laplace_distribution` &`

Returns true if the two instances of ``laplace_distribution`` will return identical sequences of values given equal generators.

friend bool `const `laplace_distribution` &` `const `laplace_distribution` &`

Returns true if the two instances of ``laplace_distribution`` will return different sequences of values given equal generators.

IntType
IntType
IntType

Instantiations of class template `linear_congruential_engine` model a pseudo-random number generator . Linear congruential pseudo-random number generators are described in:

> "Mathematical methods in large-scale computing units", D. H. Lehmer, Proc. 2nd Symposium on Large-Scale Digital Calculating Machines, Harvard University Press, 1951, pp. 141-146

Let x(n) denote the sequence of numbers returned by some pseudo-random number generator. Then for the linear congruential generator, x(n+1) := (a * x(n) + c) mod m. Parameters for the generator are x(0), a, c, m. The template parameter IntType shall denote an integral type. It must be large enough to hold values a, c, and m. The template parameters a and c must be smaller than m.

Note: The quality of the generator crucially depends on the choice of the parameters. User code should use one of the sensibly parameterized generators such as minstd_rand instead.

IntType
const bool
const IntType
const IntType
const IntType
const IntType
void

Calls seed(default_seed)

void `IntType`

If c mod m is zero and x0 mod m is zero, changes the current value of the generator to 1. Otherwise, changes it to x0 mod m. If c is zero, distinct seeds in the range [1,m) will leave the generator in distinct states. If c is not zero, the range is [0,m).

void `SeedSeq &`

Seeds a ``linear_congruential_engine`` using values from a SeedSeq.

void `It &` `It`

seeds a ``linear_congruential_engine`` with values taken from the itrator range [first, last) and adjusts `first` to point to the element after the last one used. If there are not enough elements, throws `std::invalid_argument`.

`first` and `last` must be input iterators.

IntType

Returns the next value of the ``linear_congruential_engine``.

void `Iter` `Iter`

Fills a range with random values

void `boost::uintmax_t`

Advances the state of the generator by `z`.

Constructs a ``linear_congruential_engine``, using the default seed

IntType

Constructs a ``linear_congruential_engine``, seeding it with `x0`.

SeedSeq &

Constructs a ``linear_congruential_engine``, seeding it with values produced by a call to `seq.generate()`.

It &
It

Constructs a ``linear_congruential_engine`` and seeds it with values taken from the itrator range [first, last) and adjusts first to point to the element after the last one used. If there are not enough elements, throws `std::invalid_argument`.

first and last must be input iterators.

result_type

Returns the smallest value that the ``linear_congruential_engine`` can produce.

result_type

Returns the largest value that the ``linear_congruential_engine`` can produce.

friend std::basic_ostream< CharT, Traits > & `std::basic_ostream< CharT, Traits > &` `const `linear_congruential_engine` &`

Writes a ``linear_congruential_engine`` to a `std::ostream`.

friend std::basic_istream< CharT, Traits > & `std::basic_istream< CharT, Traits > &` ``linear_congruential_engine` &`

Reads a ``linear_congruential_engine`` from a `std::istream`.

Class ``rand48`` models a pseudo-random number generator . It uses the linear congruential algorithm with the parameters a = 0x5DEECE66D, c = 0xB, m = 2**48. It delivers identical results to the `lrand48()` function available on some systems (assuming lcong48 has not been called).

It is only available on systems where `uint64_t` is provided as an integral type, so that for example static in-class constants and/or enum definitions with large `uint64_t` numbers work.

boost::uint32_t
const bool
uint32_t

Returns the smallest value that the generator can produce

uint32_t

Returns the largest value that the generator can produce

void

Seeds the generator with the default seed.

void `result_type`

Changes the current value x(n) of the generator to (x0 << 16) | 0x330e.

void `It &` `It`

Seeds the generator using values from an iterator range, and updates first to point one past the last value consumed.

void `SeedSeq &`

Seeds the generator with values produced by `seq.generate()`.

uint32_t

Returns the next value of the generator.

void `boost::uintmax_t`

Advances the state of the generator by `z`.

void `Iter` `Iter`

Fills a range with random values

Seeds the generator with the default seed.

result_type

Constructs a `rand48` generator with x(0) := (x0 << 16) | 0x330e.

SeedSeq &

Seeds the generator with values produced by `seq.generate()`.

It &
It

Seeds the generator using values from an iterator range, and updates first to point one past the last value consumed.

friend std::basic_ostream< CharT, Traits > & `std::basic_ostream< CharT, Traits > &` `const `rand48` &`

Writes a ``rand48`` to a `std::ostream`.

friend std::basic_istream< CharT, Traits > & `std::basic_istream< CharT, Traits > &` ``rand48` &`

Reads a ``rand48`` from a `std::istream`.

friend bool `const `rand48` &` `const `rand48` &`

Returns true if the two generators will produce identical sequences of values.

friend bool `const `rand48` &` `const `rand48` &`

Returns true if the two generators will produce different sequences of values.

The specialization `minstd_rand0` was originally suggested in

> A pseudo-random number generator for the System/360, P.A. Lewis, A.S. Goodman, J.M. Miller, IBM Systems Journal, Vol. 8, No. 2, 1969, pp. 136-146

It is examined more closely together with `minstd_rand` in

> "Random Number Generators: Good ones are hard to find", Stephen K. Park and Keith W. Miller, Communications of the ACM, Vol. 31, No. 10, October 1988, pp. 1192-1201

`linear_congruential_engine`< uint32_t, 16807, 0, 2147483647 >

The specialization `minstd_rand` was suggested in

> "Random Number Generators: Good ones are hard to find", Stephen K. Park and Keith W. Miller, Communications of the ACM, Vol. 31, No. 10, October 1988, pp. 1192-1201

`linear_congruential_engine`< uint32_t, 48271, 0, 2147483647 >
int
int
int
int

Instatiations of `linear_feedback_shift` model a pseudo-random number generator . It was originally proposed in

> "Random numbers generated by linear recurrence modulo two.", Tausworthe, R. C.(1965), Mathematics of Computation 19, 201-209.

UIntType
const bool
const int
const int
const int
const int
const UIntType
result_type

Returns the smallest value that the generator can produce.

result_type

Returns the largest value that the generator can produce.

void

Seeds a ``linear_feedback_shift_engine`` with the default seed.

void `UIntType`

Seeds a ``linear_feedback_shift_engine`` with `s0`.

void `SeedSeq &`

Seeds a ``linear_feedback_shift_engine`` with values produced by `seq.generate()`.

void `It &` `It`

Seeds a ``linear_feedback_shift_engine`` with values from the range [first, last).

result_type

Returns the next value of the generator.

void `Iter` `Iter`

Fills a range with random values

void `boost::uintmax_t`

Advances the state of the generator by `z`.

Constructs a ``linear_feedback_shift_engine``, using the default seed.

UIntType

Constructs a ``linear_feedback_shift_engine``, seeding it with s0.

SeedSeq &

Constructs a ``linear_feedback_shift_engine``, seeding it with seq.

It &
It

Constructs a ``linear_feedback_shift_engine``, seeding it with values from the range [first, last).

friend std::basic_ostream< CharT, Traits > & `std::basic_ostream< CharT, Traits > &` `const `linear_feedback_shift_engine` &`

Writes the textual representation of the generator to a `std::ostream`.

friend std::basic_istream< CharT, Traits > & `std::basic_istream< CharT, Traits > &` `const `linear_feedback_shift_engine` &`

Reads the textual representation of the generator from a `std::istream`.

friend bool `const `linear_feedback_shift_engine` &` `const `linear_feedback_shift_engine` &`

Returns true if the two generators will produce identical sequences of outputs.

friend bool `const `linear_feedback_shift_engine` &` `const `linear_feedback_shift_engine` &`

Returns true if the two generators will produce different sequences of outputs.

double

Instantiations of class template `lognormal_distribution` model a random distribution . Such a distribution produces random numbers with $\displaystyle p(x) = \frac{1}{x s \sqrt{2\pi}} e^{\frac{-\left(\log(x)-m\right)^2}{2s^2}}$$\displaystyle p(x) = \frac{1}{x s \sqrt{2\pi}} e^{\frac{-\left(\log(x)-m\right)^2}{2s^2}}$ for x > 0.

This distribution has been updated to match the C++ standard. Its behavior has changed from the original boost::lognormal_distribution. A backwards compatible version is provided in namespace boost.

`lognormal_distribution`
RealType

Returns the "m" parameter of the distribution.

RealType

Returns the "s" parameter of the distribution.

RealType
0.0
RealType
1.0

Constructs the parameters of a `lognormal_distribution`.

friend std::basic_ostream< CharT, Traits > & `std::basic_ostream< CharT, Traits > &` `const `param_type` &`

Writes the parameters to a std::ostream.

friend std::basic_istream< CharT, Traits > & `std::basic_istream< CharT, Traits > &` `const `param_type` &`

Reads the parameters from a std::istream.

friend bool `const `param_type` &` `const `param_type` &`

Returns true if the two sets of parameters are equal.

friend bool `const `param_type` &` `const `param_type` &`

Returns true if the two sets of parameters are different.

`normal_distribution`< RealType >::input_type
RealType
RealType

Returns the m parameter of the distribution.

RealType

Returns the s parameter of the distribution.

RealType

Returns the smallest value that the distribution can produce.

RealType

Returns the largest value that the distribution can produce.

`param_type`

Returns the parameters of the distribution.

void `const `param_type` &`

Sets the parameters of the distribution.

void

Effects: Subsequent uses of the distribution do not depend on values produced by any engine prior to invoking reset.

result_type `Engine &`

Returns a random variate distributed according to the lognormal distribution.

result_type `Engine &` `const `param_type` &`

Returns a random variate distributed according to the lognormal distribution with parameters specified by param.

RealType
0.0
RealType
1.0

Constructs a `lognormal_distribution`. `m` and `s` are the parameters of the distribution.

const `param_type` &

Constructs a `lognormal_distribution` from its parameters.

friend std::basic_ostream< CharT, Traits > & `std::basic_ostream< CharT, Traits > &` `const `lognormal_distribution` &`

Writes the distribution to a `std::ostream`.

friend std::basic_istream< CharT, Traits > & `std::basic_istream< CharT, Traits > &` `const `lognormal_distribution` &`

Reads the distribution from a `std::istream`.

friend bool `const `lognormal_distribution` &` `const `lognormal_distribution` &`

Returns true if the two distributions will produce identical sequences of values given equal generators.

friend bool `const `lognormal_distribution` &` `const `lognormal_distribution` &`

Returns true if the two distributions may produce different sequences of values given equal generators.

std::size_t
std::size_t
std::size_t
std::size_t
UIntType
std::size_t
UIntType
std::size_t
UIntType
std::size_t
UIntType
std::size_t
UIntType

Instantiations of class template `mersenne_twister_engine` model a pseudo-random number generator . It uses the algorithm described in

> "Mersenne Twister: A 623-dimensionally equidistributed uniform pseudo-random number generator", Makoto Matsumoto and Takuji Nishimura, ACM Transactions on Modeling and Computer Simulation: Special Issue on Uniform Random Number Generation, Vol. 8, No. 1, January 1998, pp. 3-30.

The boost variant has been implemented from scratch and does not derive from or use mt19937.c provided on the above WWW site. However, it was verified that both produce identical output.

The seeding from an integer was changed in April 2005 to address a weakness.

The quality of the generator crucially depends on the choice of the parameters. User code should employ one of the sensibly parameterized generators such as `mt19937` instead.

The generator requires considerable amounts of memory for the storage of its state array. For example, `mt11213b` requires about 1408 bytes and `mt19937` requires about 2496 bytes.

UIntType
const std::size_t
const std::size_t
const std::size_t
const std::size_t
const UIntType
const std::size_t
const UIntType
const std::size_t
const UIntType
const std::size_t
const UIntType
const std::size_t
const UIntType
const UIntType
const UIntType
const std::size_t
const std::size_t
const UIntType
const std::size_t
const UIntType
const std::size_t
const bool
void

Calls `seed(default_seed)`.

void `UIntType`

Sets the state x(0) to v mod 2w. Then, iteratively, sets x(i) to (i + f * (x(i-1) xor (x(i-1) rshift w-2))) mod 2w for i = 1 .. n-1. x(n) is the first value to be returned by operator().

void `SeeqSeq &`

Seeds a `mersenne_twister_engine` using values produced by seq.generate().

void `It &` `It`

Sets the state of the generator using values from an iterator range.

result_type

Produces the next value of the generator.

void `Iter` `Iter`

Fills a range with random values

void `boost::uintmax_t`

Advances the state of the generator by `z` steps. Equivalent to

    for(unsigned long long i = 0; i < z; ++i) {
        gen();
    }

Constructs a ``mersenne_twister_engine`` and calls `seed()`.

UIntType

Constructs a ``mersenne_twister_engine`` and calls `seed(value)`.

It &
It
SeedSeq &

Constructs a `mersenne_twister_engine` and calls `seed(gen)`.

The copy constructor will always be preferred over the templated constructor.

result_type

Returns the smallest value that the generator can produce.

result_type

Returns the largest value that the generator can produce.

friend std::basic_ostream< CharT, Traits > & `std::basic_ostream< CharT, Traits > &` `const `mersenne_twister_engine` &`

Writes a `mersenne_twister_engine` to a `std::ostream`

friend std::basic_istream< CharT, Traits > & `std::basic_istream< CharT, Traits > &` ``mersenne_twister_engine` &`

Reads a `mersenne_twister_engine` from a `std::istream`

friend bool `const `mersenne_twister_engine` &` `const `mersenne_twister_engine` &`

Returns true if the two generators are in the same state, and will thus produce identical sequences.

friend bool `const `mersenne_twister_engine` &` `const `mersenne_twister_engine` &`

Returns true if the two generators are in different states.

The specializations `mt11213b` and `mt19937` are from

> "Mersenne Twister: A 623-dimensionally equidistributed uniform pseudo-random number generator", Makoto Matsumoto and Takuji Nishimura, ACM Transactions on Modeling and Computer Simulation: Special Issue on Uniform Random Number Generation, Vol. 8, No. 1, January 1998, pp. 3-30.

`mersenne_twister_engine`< uint32_t, 32, 351, 175, 19, 0xccab8ee7, 11, 0xffffffff, 7, 0x31b6ab00, 15, 0xffe50000, 17, 1812433253 >

The specializations `mt11213b` and `mt19937` are from

> "Mersenne Twister: A 623-dimensionally equidistributed uniform pseudo-random number generator", Makoto Matsumoto and Takuji Nishimura, ACM Transactions on Modeling and Computer Simulation: Special Issue on Uniform Random Number Generation, Vol. 8, No. 1, January 1998, pp. 3-30.

`mersenne_twister_engine`< uint32_t, 32, 624, 397, 31, 0x9908b0df, 11, 0xffffffff, 7, 0x9d2c5680, 15, 0xefc60000, 18, 1812433253 >
`mersenne_twister_engine`< uint64_t, 64, 312, 156, 31, 0xb5026f5aa96619e9ull, 29, 0x5555555555555555ull, 17, 0x71d67fffeda60000ull, 37, 0xfff7eee000000000ull, 43, 6364136223846793005ull >
int
double

The negative binomial distribution is an integer valued distribution with two parameters, `k` and `p`. The distribution produces non-negative values.

The distribution function is $\displaystyle P(i) = {k+i-1\choose i}p^k(1-p)^i$$\displaystyle P(i) = {k+i-1\choose i}p^k(1-p)^i$.

This implementation uses a gamma-poisson mixture.

`negative_binomial_distribution`
IntType

Returns the `k` parameter of the distribution.

RealType

Returns the `p` parameter of the distribution.

IntType
1
RealType
0.5

Construct a `param_type` object. `k` and `p` are the parameters of the distribution.

Requires: k >=0 && 0 <= p <= 1

friend std::basic_ostream< CharT, Traits > & `std::basic_ostream< CharT, Traits > &` `const `param_type` &`

Writes the parameters of the distribution to a `std::ostream`.

friend std::basic_istream< CharT, Traits > & `std::basic_istream< CharT, Traits > &` ``param_type` &`

Reads the parameters of the distribution from a `std::istream`.

friend bool `const `param_type` &` `const `param_type` &`

Returns true if the parameters have the same values.

friend bool `const `param_type` &` `const `param_type` &`

Returns true if the parameters have different values.

IntType
RealType
IntType `URNG &`

Returns a random variate distributed according to the negative binomial distribution.

IntType `URNG &` `const `param_type` &`

Returns a random variate distributed according to the negative binomial distribution with parameters specified by `param`.

IntType

Returns the `k` parameter of the distribution.

RealType

Returns the `p` parameter of the distribution.

IntType

Returns the smallest value that the distribution can produce.

IntType

Returns the largest value that the distribution can produce.

`param_type`

Returns the parameters of the distribution.

void `const `param_type` &`

Sets parameters of the distribution.

void

Effects: Subsequent uses of the distribution do not depend on values produced by any engine prior to invoking reset.

IntType
1
RealType
0.5

Construct a ``negative_binomial_distribution`` object. `k` and `p` are the parameters of the distribution.

Requires: k >=0 && 0 <= p <= 1

const `param_type` &

Construct an ``negative_binomial_distribution`` object from the parameters.

friend std::basic_ostream< CharT, Traits > & `std::basic_ostream< CharT, Traits > &` `const `negative_binomial_distribution` &`

Writes the parameters of the distribution to a `std::ostream`.

friend std::basic_istream< CharT, Traits > & `std::basic_istream< CharT, Traits > &` ``negative_binomial_distribution` &`

Reads the parameters of the distribution from a `std::istream`.

friend bool `const `negative_binomial_distribution` &` `const `negative_binomial_distribution` &`

Returns true if the two distributions will produce the same sequence of values, given equal generators.

friend bool `const `negative_binomial_distribution` &` `const `negative_binomial_distribution` &`

Returns true if the two distributions could produce different sequences of values, given equal generators.

double

The noncentral chi-squared distribution is a real valued distribution with two parameter, `k` and `lambda`. The distribution produces values > 0.

This is the distribution of the sum of squares of k Normal distributed variates each with variance one and $\lambda$$\lambda$ the sum of squares of the normal means.

The distribution function is $\displaystyle P(x) = \frac{1}{2} e^{-(x+\lambda)/2} \left( \frac{x}{\lambda} \right)^{k/4-1/2} I_{k/2-1}( \sqrt{\lambda x} )$$\displaystyle P(x) = \frac{1}{2} e^{-(x+\lambda)/2} \left( \frac{x}{\lambda} \right)^{k/4-1/2} I_{k/2-1}( \sqrt{\lambda x} )$. where $\displaystyle I_\nu(z)$$\displaystyle I_\nu(z)$ is a modified Bessel function of the first kind.

The algorithm is taken from

> "Monte Carlo Methods in Financial Engineering", Paul Glasserman, 2003, XIII, 596 p, Stochastic Modelling and Applied Probability, Vol. 53, ISBN 978-0-387-21617-1, p 124, Fig. 3.5.

`non_central_chi_squared_distribution`
RealType

Returns the `k` parameter of the distribution

RealType

Returns the `lambda` parameter of the distribution

RealType
1
RealType
1

Constructs the parameters of a `non_central_chi_squared_distribution`. `k` and `lambda` are the parameter of the distribution.

Requires: k > 0 && lambda > 0

friend std::basic_ostream< CharT, Traits > & `std::basic_ostream< CharT, Traits > &` `const `param_type` &`

Writes the parameters of the distribution to a `std::ostream`.

friend std::basic_istream< CharT, Traits > & `std::basic_istream< CharT, Traits > &` `const `param_type` &`

Reads the parameters of the distribution from a `std::istream`.

friend bool `const `param_type` &` `const `param_type` &`

Returns true if the parameters have the same values.

friend bool `const `param_type` &` `const `param_type` &`

Returns true if the parameters have different values.

RealType
RealType
RealType `URNG &` `const `param_type` &`

Returns a random variate distributed according to the non central chi squared distribution specified by `param`.

RealType `URNG &`

Returns a random variate distributed according to the non central chi squared distribution.

RealType

Returns the `k` parameter of the distribution.

RealType

Returns the `lambda` parameter of the distribution.

`param_type`

Returns the parameters of the distribution.

void `const `param_type` &`

Sets parameters of the distribution.

void

Resets the distribution, so that subsequent uses does not depend on values already produced by it.

RealType

Returns the smallest value that the distribution can produce.

RealType

Returns the largest value that the distribution can produce.

RealType
1
RealType
1

Construct a ``non_central_chi_squared_distribution`` object. `k` and `lambda` are the parameter of the distribution.

Requires: k > 0 && lambda > 0

const `param_type` &

Construct a ``non_central_chi_squared_distribution`` object from the parameter.

friend std::basic_ostream< CharT, Traits > & `std::basic_ostream< CharT, Traits > &` `const `non_central_chi_squared_distribution` &`

Writes the parameters of the distribution to a `std::ostream`.

friend std::basic_istream< CharT, Traits > & `std::basic_istream< CharT, Traits > &` `const `non_central_chi_squared_distribution` &`

reads the parameters of the distribution from a `std::istream`.

friend bool `const `non_central_chi_squared_distribution` &` `const `non_central_chi_squared_distribution` &`

Returns true if two distributions have the same parameters and produce the same sequence of random numbers given equal generators.

friend bool `const `non_central_chi_squared_distribution` &` `const `non_central_chi_squared_distribution` &`

Returns true if two distributions have different parameters and/or can produce different sequences of random numbers given equal generators.

double

Instantiations of class template `normal_distribution` model a random distribution . Such a distribution produces random numbers `x` distributed with probability density function $\displaystyle p(x) = \frac{1}{\sqrt{2\pi}\sigma} e^{-\frac{(x-\mu)^2}{2\sigma^2}} $$\displaystyle p(x) = \frac{1}{\sqrt{2\pi}\sigma} e^{-\frac{(x-\mu)^2}{2\sigma^2}} $, where mean and sigma are the parameters of the distribution.

The implementation uses the "ziggurat" algorithm, as described in

> "The Ziggurat Method for Generating Random Variables", George Marsaglia and Wai Wan Tsang, Journal of Statistical Software, Volume 5, Number 8 (2000), 1-7.

`normal_distribution`
RealType

Returns the mean of the distribution.

RealType

Returns the standand deviation of the distribution.

RealType
0.0
RealType
1.0

Constructs a ``param_type`` with a given mean and standard deviation.

Requires: sigma >= 0

friend std::basic_ostream< CharT, Traits > & `std::basic_ostream< CharT, Traits > &` `const `param_type` &`

Writes a ``param_type`` to a `std::ostream`.

friend std::basic_istream< CharT, Traits > & `std::basic_istream< CharT, Traits > &` `const `param_type` &`

Reads a ``param_type`` from a `std::istream`.

friend bool `const `param_type` &` `const `param_type` &`

Returns true if the two sets of parameters are the same.

friend bool `const `param_type` &` `const `param_type` &`

Returns true if the two sets of parameters are the different.

RealType
RealType
RealType

Returns the mean of the distribution.

RealType

Returns the standard deviation of the distribution.

RealType

Returns the smallest value that the distribution can produce.

RealType

Returns the largest value that the distribution can produce.

`param_type`

Returns the parameters of the distribution.

void `const `param_type` &`

Sets the parameters of the distribution.

void

Effects: Subsequent uses of the distribution do not depend on values produced by any engine prior to invoking reset.

result_type `Engine &`

Returns a normal variate.

result_type `URNG &` `const `param_type` &`

Returns a normal variate with parameters specified by `param`.

const RealType &
0.0
const RealType &
1.0

Constructs a ``normal_distribution`` object. `mean` and `sigma` are the parameters for the distribution.

Requires: sigma >= 0

const `param_type` &

Constructs a ``normal_distribution`` object from its parameters.

friend std::basic_ostream< CharT, Traits > & `std::basic_ostream< CharT, Traits > &` `const `normal_distribution` &`

Writes a ``normal_distribution`` to a `std::ostream`.

friend std::basic_istream< CharT, Traits > & `std::basic_istream< CharT, Traits > &` `const `normal_distribution` &`

Reads a ``normal_distribution`` from a `std::istream`.

friend bool `const `normal_distribution` &` `const `normal_distribution` &`

Returns true if the two instances of ``normal_distribution`` will return identical sequences of values given equal generators.

friend bool `const `normal_distribution` &` `const `normal_distribution` &`

Returns true if the two instances of ``normal_distribution`` will return different sequences of values given equal generators.

double
double

The class ``piecewise_constant_distribution`` models a random distribution .

`piecewise_constant_distribution`
friend std::basic_ostream< CharT, Traits > & `std::basic_ostream< CharT, Traits > &` `const `param_type` &`

Writes the parameters to a `std::ostream`.

friend std::basic_istream< CharT, Traits > & `std::basic_istream< CharT, Traits > &` `const `param_type` &`

Reads the parameters from a `std::istream`.

friend bool `const `param_type` &` `const `param_type` &`

Returns true if the two sets of parameters are the same.

friend bool `const `param_type` &` `const `param_type` &`

Returns true if the two sets of parameters are different.

std::vector< RealType >

Returns a vector containing the interval boundaries.

std::vector< RealType >

Returns a vector containing the probability densities over all the intervals of the distribution.

Constructs a ``param_type`` object, representing a distribution that produces values uniformly distributed in the range [0, 1).

IntervalIter
IntervalIter
WeightIter

Constructs a ``param_type`` object from two iterator ranges containing the interval boundaries and the interval weights. If there are less than two boundaries, then this is equivalent to the default constructor and creates a single interval, [0, 1).

The values of the interval boundaries must be strictly increasing, and the number of weights must be one less than the number of interval boundaries. If there are extra weights, they are ignored.

const std::initializer_list< T > &
F

Constructs a ``param_type`` object from an initializer_list containing the interval boundaries and a unary function specifying the weights. Each weight is determined by calling the function at the midpoint of the corresponding interval.

If the initializer_list contains less than two elements, this is equivalent to the default constructor and the distribution will produce values uniformly distributed in the range [0, 1).

const IntervalRange &
const WeightRange &

Constructs a ``param_type`` object from Boost.Range ranges holding the interval boundaries and the weights. If there are less than two interval boundaries, this is equivalent to the default constructor and the distribution will produce values uniformly distributed in the range [0, 1). The number of weights must be one less than the number of interval boundaries.

std::size_t
RealType
RealType
F

Constructs the parameters for a distribution that approximates a function. The range of the distribution is [xmin, xmax). This range is divided into nw equally sized intervals and the weights are found by calling the unary function f on the midpoints of the intervals.

std::size_t
RealType
RealType `URNG &`

Returns a value distributed according to the parameters of the piecewist_constant_distribution.

RealType `URNG &` `const `param_type` &`

Returns a value distributed according to the parameters specified by param.

result_type

Returns the smallest value that the distribution can produce.

result_type

Returns the largest value that the distribution can produce.

std::vector< RealType >

Returns a vector containing the probability density over each interval.

std::vector< RealType >

Returns a vector containing the interval boundaries.

`param_type`

Returns the parameters of the distribution.

void `const `param_type` &`

Sets the parameters of the distribution.

void

Effects: Subsequent uses of the distribution do not depend on values produced by any engine prior to invoking reset.

Creates a new ``piecewise_constant_distribution`` with a single interval, [0, 1).

IntervalIter
IntervalIter
WeightIter

Constructs a `piecewise_constant_distribution` from two iterator ranges containing the interval boundaries and the interval weights. If there are less than two boundaries, then this is equivalent to the default constructor and creates a single interval, [0, 1).

The values of the interval boundaries must be strictly increasing, and the number of weights must be one less than the number of interval boundaries. If there are extra weights, they are ignored.

For example,

    double intervals[] = { 0.0, 1.0, 4.0 };
    double weights[] = { 1.0, 1.0 };
    piecewise_constant_distribution<> dist(
        &intervals[0], &intervals[0] + 3, &weights[0]);

The distribution has a 50% chance of producing a value between 0 and 1 and a 50% chance of producing a value between 1 and 4.

std::initializer_list< T >
F

Constructs a `piecewise_constant_distribution` from an initializer_list containing the interval boundaries and a unary function specifying the weights. Each weight is determined by calling the function at the midpoint of the corresponding interval.

If the initializer_list contains less than two elements, this is equivalent to the default constructor and the distribution will produce values uniformly distributed in the range [0, 1).

const IntervalsRange &
const WeightsRange &

Constructs a `piecewise_constant_distribution` from Boost.Range ranges holding the interval boundaries and the weights. If there are less than two interval boundaries, this is equivalent to the default constructor and the distribution will produce values uniformly distributed in the range [0, 1). The number of weights must be one less than the number of interval boundaries.

std::size_t
RealType
RealType
F

Constructs a `piecewise_constant_distribution` that approximates a function. The range of the distribution is [xmin, xmax). This range is divided into nw equally sized intervals and the weights are found by calling the unary function f on the midpoints of the intervals.

const `param_type` &

Constructs a `piecewise_constant_distribution` from its parameters.

friend std::basic_ostream< CharT, Traits > & `std::basic_ostream< CharT, Traits > &` `const `piecewise_constant_distribution` &`

Writes a distribution to a `std::ostream`.

friend std::basic_istream< CharT, Traits > & `std::basic_istream< CharT, Traits > &` `const `piecewise_constant_distribution` &`

Reads a distribution from a `std::istream`

friend bool `const `piecewise_constant_distribution` &` `const `piecewise_constant_distribution` &`

Returns true if the two distributions will return the same sequence of values, when passed equal generators.

friend bool `const `piecewise_constant_distribution` &` `const `piecewise_constant_distribution` &`

Returns true if the two distributions may return different sequences of values, when passed equal generators.

double

The class ``piecewise_linear_distribution`` models a random distribution .

`piecewise_linear_distribution`
friend std::basic_ostream< CharT, Traits > & `std::basic_ostream< CharT, Traits > &` `const `param_type` &`

Writes the parameters to a `std::ostream`.

friend std::basic_istream< CharT, Traits > & `std::basic_istream< CharT, Traits > &` `const `param_type` &`

Reads the parameters from a `std::istream`.

friend bool `const `param_type` &` `const `param_type` &`

Returns true if the two sets of parameters are the same.

friend bool `const `param_type` &` `const `param_type` &`

Returns true if the two sets of parameters are different.

std::vector< RealType >

Returns a vector containing the interval boundaries.

std::vector< RealType >

Returns a vector containing the probability densities at all the interval boundaries.

Constructs a ``param_type`` object, representing a distribution that produces values uniformly distributed in the range [0, 1).

IntervalIter
IntervalIter
WeightIter

Constructs a ``param_type`` object from two iterator ranges containing the interval boundaries and weights at the boundaries. If there are fewer than two boundaries, then this is equivalent to the default constructor and the distribution will produce values uniformly distributed in the range [0, 1).

The values of the interval boundaries must be strictly increasing, and the number of weights must be the same as the number of interval boundaries. If there are extra weights, they are ignored.

const std::initializer_list< T > &
F

Constructs a ``param_type`` object from an initializer_list containing the interval boundaries and a unary function specifying the weights at the boundaries. Each weight is determined by calling the function at the corresponding point.

If the initializer_list contains fewer than two elements, this is equivalent to the default constructor and the distribution will produce values uniformly distributed in the range [0, 1).

const IntervalRange &
const WeightRange &

Constructs a ``param_type`` object from Boost.Range ranges holding the interval boundaries and the weights at the boundaries. If there are fewer than two interval boundaries, this is equivalent to the default constructor and the distribution will produce values uniformly distributed in the range [0, 1). The number of weights must be equal to the number of interval boundaries.

std::size_t
RealType
RealType
F

Constructs the parameters for a distribution that approximates a function. The range of the distribution is [xmin, xmax). This range is divided into nw equally sized intervals and the weights are found by calling the unary function f on the boundaries of the intervals.

std::size_t
RealType
RealType `URNG &`

Returns a value distributed according to the parameters of the `piecewise_linear_distribution`.

RealType `URNG &` `const `param_type` &`

Returns a value distributed according to the parameters specified by param.

result_type

Returns the smallest value that the distribution can produce.

result_type

Returns the largest value that the distribution can produce.

std::vector< RealType >

Returns a vector containing the probability densities at the interval boundaries.

std::vector< RealType >

Returns a vector containing the interval boundaries.

`param_type`

Returns the parameters of the distribution.

void `const `param_type` &`

Sets the parameters of the distribution.

void

Effects: Subsequent uses of the distribution do not depend on values produced by any engine prior to invoking reset.

Creates a new ``piecewise_linear_distribution`` that produces values uniformly distributed in the range [0, 1).

IntervalIter
IntervalIter
WeightIter

Constructs a `piecewise_linear_distribution` from two iterator ranges containing the interval boundaries and the weights at the boundaries. If there are fewer than two boundaries, then this is equivalent to the default constructor and creates a distribution that produces values uniformly distributed in the range [0, 1).

The values of the interval boundaries must be strictly increasing, and the number of weights must be equal to the number of interval boundaries. If there are extra weights, they are ignored.

For example,

    double intervals[] = { 0.0, 1.0, 2.0 };
    double weights[] = { 0.0, 1.0, 0.0 };
    piecewise_constant_distribution<> dist(
        &intervals[0], &intervals[0] + 3, &weights[0]);

produces a triangle distribution.

std::initializer_list< T >
F

Constructs a `piecewise_linear_distribution` from an initializer_list containing the interval boundaries and a unary function specifying the weights. Each weight is determined by calling the function at the corresponding interval boundary.

If the initializer_list contains fewer than two elements, this is equivalent to the default constructor and the distribution will produce values uniformly distributed in the range [0, 1).

const IntervalsRange &
const WeightsRange &

Constructs a `piecewise_linear_distribution` from Boost.Range ranges holding the interval boundaries and the weights. If there are fewer than two interval boundaries, this is equivalent to the default constructor and the distribution will produce values uniformly distributed in the range [0, 1). The number of weights must be equal to the number of interval boundaries.

std::size_t
RealType
RealType
F

Constructs a `piecewise_linear_distribution` that approximates a function. The range of the distribution is [xmin, xmax). This range is divided into nw equally sized intervals and the weights are found by calling the unary function f on the interval boundaries.

const `param_type` &

Constructs a `piecewise_linear_distribution` from its parameters.

friend std::basic_ostream< CharT, Traits > & `std::basic_ostream< CharT, Traits > &` `const `piecewise_linear_distribution` &`

Writes a distribution to a `std::ostream`.

friend std::basic_istream< CharT, Traits > & `std::basic_istream< CharT, Traits > &` `const `piecewise_linear_distribution` &`

Reads a distribution from a `std::istream`

friend bool `const `piecewise_linear_distribution` &` `const `piecewise_linear_distribution` &`

Returns true if the two distributions will return the same sequence of values, when passed equal generators.

friend bool `const `piecewise_linear_distribution` &` `const `piecewise_linear_distribution` &`

Returns true if the two distributions may return different sequences of values, when passed equal generators.

int
double

An instantiation of the class template ``poisson_distribution`` is a model of random distribution . The poisson distribution has $p(i) = \frac{e^{-\lambda}\lambda^i}{i!}$$p(i) = \frac{e^{-\lambda}\lambda^i}{i!}$

This implementation is based on the PTRD algorithm described

> "The transformed rejection method for generating Poisson random variables", Wolfgang Hormann, Insurance: Mathematics and Economics Volume 12, Issue 1, February 1993, Pages 39-45

`poisson_distribution`
RealType
RealType
1

Construct a `param_type` object with the parameter "mean"

Requires: mean > 0

friend std::basic_ostream< CharT, Traits > & `std::basic_ostream< CharT, Traits > &` `const `param_type` &`

Writes the parameters of the distribution to a `std::ostream`.

friend std::basic_istream< CharT, Traits > & `std::basic_istream< CharT, Traits > &` ``param_type` &`

Reads the parameters of the distribution from a `std::istream`.

friend bool `const `param_type` &` `const `param_type` &`

Returns true if the parameters have the same values.

friend bool `const `param_type` &` `const `param_type` &`

Returns true if the parameters have different values.

IntType
RealType
IntType `URNG &`

Returns a random variate distributed according to the poisson distribution.

IntType `URNG &` `const `param_type` &`

Returns a random variate distributed according to the poisson distribution with parameters specified by param.

RealType

Returns the "mean" parameter of the distribution.

IntType

Returns the smallest value that the distribution can produce.

IntType

Returns the largest value that the distribution can produce.

`param_type`

Returns the parameters of the distribution.

void `const `param_type` &`

Sets parameters of the distribution.

void

Effects: Subsequent uses of the distribution do not depend on values produced by any engine prior to invoking reset.

RealType
1

Constructs a ``poisson_distribution`` with the parameter `mean`.

Requires: mean > 0

const `param_type` &

Construct an ``poisson_distribution`` object from the parameters.

friend std::basic_ostream< CharT, Traits > & `std::basic_ostream< CharT, Traits > &` `const `poisson_distribution` &`

Writes the parameters of the distribution to a `std::ostream`.

friend std::basic_istream< CharT, Traits > & `std::basic_istream< CharT, Traits > &` ``poisson_distribution` &`

Reads the parameters of the distribution from a `std::istream`.

friend bool `const `poisson_distribution` &` `const `poisson_distribution` &`

Returns true if the two distributions will produce the same sequence of values, given equal generators.

friend bool `const `poisson_distribution` &` `const `poisson_distribution` &`

Returns true if the two distributions could produce different sequences of values, given equal generators.

noncopyable

Class `random_device` models a non-deterministic random number generator . It uses one or more implementation-defined stochastic processes to generate a sequence of uniformly distributed non-deterministic random numbers. For those environments where a non-deterministic random number generator is not available, class `random_device` must not be implemented. See

> "Randomness Recommendations for Security", D. Eastlake, S. Crocker, J. Schiller, Network Working Group, RFC 1750, December 1994

for further discussions.

Some operating systems abstract the computer hardware enough to make it difficult to non-intrusively monitor stochastic processes. However, several do provide a special device for exactly this purpose. It seems to be impossible to emulate the functionality using Standard C++ only, so users should be aware that this class may not be available on all platforms.

Implementation Note for Linux

On the Linux operating system, token is interpreted as a filesystem path. It is assumed that this path denotes an operating system pseudo-device which generates a stream of non-deterministic random numbers. The pseudo-device should never signal an error or end-of-file. Otherwise, `std::ios_base::failure` is thrown. By default, `random_device` uses the /dev/urandom pseudo-device to retrieve the random numbers. Another option would be to specify the /dev/random pseudo-device, which blocks on reads if the entropy pool has no more random bits available.

Implementation Note for Windows

On the Windows operating system, token is interpreted as the name of a cryptographic service provider. By default `random_device` uses MS_DEF_PROV.

Performance

The test program nondet_random_speed.cpp measures the execution times of the random_device.hpp implementation of the above algorithms in a tight loop. The performance has been evaluated on an Intel(R) Core(TM) i7 CPU Q 840 @ 1.87GHz, 1867 Mhz with Visual C++ 2010, Microsoft Windows 7 Professional and with gcc 4.4.5, Ubuntu Linux 2.6.35-25-generic.

Platform | time per invocation [microseconds]
Windows | 2.9
Linux | 1.7

The measurement error is estimated at +/- 1 usec.

unsigned int
const bool
result_type

Returns the smallest value that the `random_device` can produce.

result_type

Returns the largest value that the `random_device` can produce.

double

Returns: An entropy estimate for the random numbers returned by operator(), in the range min() to log2( max()+1). A deterministic random number generator (e.g. a pseudo-random number engine) has entropy 0.

Throws: Nothing.

unsigned int

Returns a random value in the range [min, max].

void `Iter` `Iter`

Fills a range with random 32-bit values.

Constructs a ``random_device``, optionally using the default device.

const std::string &

Constructs a ``random_device``, optionally using the given token as an access specification (for example, a URL) to some implementation-defined service for monitoring a stochastic process.

long

Instantiations of class template `random_number_generator` model a RandomNumberGenerator (std:25.2.11 [lib.alg.random.shuffle]). On each invocation, it returns a uniformly distributed integer in the range [0..n).

The template parameter IntType shall denote some integer-like value type.

URNG
IntType
IntType
result_type `argument_type`

Returns a value in the range [0, n)

base_type &

Constructs a `random_number_generator` functor with the given uniform random number generator as the underlying source of random numbers.

`subtract_with_carry_engine`< uint32_t, 24, 10, 24 >
`subtract_with_carry_01_engine`< float, 24, 10, 24 >
`subtract_with_carry_01_engine`< double, 48, 10, 24 >

The ranlux family of generators are described in

> "A portable high-quality random number generator for lattice field theory calculations", M. Luescher, Computer Physics Communications, 79 (1994) pp 100-110.

The levels are given in

> "RANLUX: A Fortran implementation of the high-quality pseudorandom number generator of Luescher", F. James, Computer Physics Communications 79 (1994) 111-114

`discard_block_engine`< `ranlux_base`, 223, 24 >

The ranlux family of generators are described in

> "A portable high-quality random number generator for lattice field theory calculations", M. Luescher, Computer Physics Communications, 79 (1994) pp 100-110.

The levels are given in

> "RANLUX: A Fortran implementation of the high-quality pseudorandom number generator of Luescher", F. James, Computer Physics Communications 79 (1994) 111-114

`discard_block_engine`< `ranlux_base`, 389, 24 >

The ranlux family of generators are described in

> "A portable high-quality random number generator for lattice field theory calculations", M. Luescher, Computer Physics Communications, 79 (1994) pp 100-110.

The levels are given in

> "RANLUX: A Fortran implementation of the high-quality pseudorandom number generator of Luescher", F. James, Computer Physics Communications 79 (1994) 111-114

`discard_block_engine`< `ranlux_base_01`, 223, 24 >

The ranlux family of generators are described in

> "A portable high-quality random number generator for lattice field theory calculations", M. Luescher, Computer Physics Communications, 79 (1994) pp 100-110.

The levels are given in

> "RANLUX: A Fortran implementation of the high-quality pseudorandom number generator of Luescher", F. James, Computer Physics Communications 79 (1994) 111-114

`discard_block_engine`< `ranlux_base_01`, 389, 24 >

The ranlux family of generators are described in

> "A portable high-quality random number generator for lattice field theory calculations", M. Luescher, Computer Physics Communications, 79 (1994) pp 100-110.

The levels are given in

> "RANLUX: A Fortran implementation of the high-quality pseudorandom number generator of Luescher", F. James, Computer Physics Communications 79 (1994) 111-114

`discard_block_engine`< `ranlux64_base_01`, 223, 24 >

The ranlux family of generators are described in

> "A portable high-quality random number generator for lattice field theory calculations", M. Luescher, Computer Physics Communications, 79 (1994) pp 100-110.

The levels are given in

> "RANLUX: A Fortran implementation of the high-quality pseudorandom number generator of Luescher", F. James, Computer Physics Communications 79 (1994) 111-114

`discard_block_engine`< `ranlux64_base_01`, 389, 24 >
`subtract_with_carry_engine`< uint64_t, 48, 10, 24 >

The ranlux family of generators are described in

> "A portable high-quality random number generator for lattice field theory calculations", M. Luescher, Computer Physics Communications, 79 (1994) pp 100-110.

The levels are given in

> "RANLUX: A Fortran implementation of the high-quality pseudorandom number generator of Luescher", F. James, Computer Physics Communications 79 (1994) 111-114

`discard_block_engine`< `ranlux64_base`, 223, 24 >

The ranlux family of generators are described in

> "A portable high-quality random number generator for lattice field theory calculations", M. Luescher, Computer Physics Communications, 79 (1994) pp 100-110.

The levels are given in

> "RANLUX: A Fortran implementation of the high-quality pseudorandom number generator of Luescher", F. James, Computer Physics Communications 79 (1994) 111-114

`discard_block_engine`< `ranlux64_base`, 389, 24 >
`subtract_with_carry_engine`< uint32_t, 24, 10, 24 >
`subtract_with_carry_engine`< uint64_t, 48, 5, 12 >
`discard_block_engine`< `ranlux24_base`, 223, 23 >
`discard_block_engine`< `ranlux48_base`, 389, 11 >

The class ``seed_seq`` stores a sequence of 32-bit words for seeding a pseudo-random number generator . These words will be combined to fill the entire state of the generator.

boost::uint_least32_t
void `Iter` `Iter`

Fills a range with 32-bit values based on the stored sequence.

Requires: Iter must be a Random Access Iterator whose value type is an unsigned integral type at least 32 bits wide.

std::size_t

Returns the size of the sequence.

void `Iter`

Writes the stored sequence to iter.

Initializes a `seed_seq` to hold an empty sequence.

const std::initializer_list< T > &

Initializes the sequence from an initializer_list.

Iter
Iter

Initializes the sequence from an iterator range.

const Range &

Initializes the sequence from Boost.Range range.

std::size_t

Instatiations of class template ``shuffle_order_engine`` model a pseudo-random number generator . It mixes the output of some (usually `linear_congruential_engine`) uniform random number generator to get better statistical properties. The algorithm is described in

> "Improving a poor random number generator", Carter Bays and S.D. Durham, ACM Transactions on Mathematical Software, Vol 2, No. 1, March 1976, pp. 59-64. http://doi.acm.org/10.1145/355666.355670

The output of the base generator is buffered in an array of length k. Every output X(n) has a second role: It gives an index into the array where X(n+1) will be retrieved. Used array elements are replaced with fresh output from the base generator.

Template parameters are the base generator and the array length k, which should be around 100.

UniformRandomNumberGenerator
base_type::result_type
const bool
const std::size_t
const std::size_t
void
void `result_type`

Invokes the one-argument seed method of the base generator with the parameter seed and re-initializes the internal buffer array.

Complexity: Exactly k+1 invocations of the base generator.

void `SeedSeq &`

Invokes the one-argument seed method of the base generator with the parameter seq and re-initializes the internal buffer array.

Complexity: Exactly k+1 invocations of the base generator.

void `It &` `It`
const base_type &
result_type
void `boost::uintmax_t`

Advances the generator by z steps.

void `Iter` `Iter`

Fills a range with pseudo-random values.

Constructs a ``shuffle_order_engine`` by invoking the default constructor of the base generator.

Complexity: Exactly k+1 invocations of the base generator.

result_type

Constructs a `shuffle_output_engine` by invoking the one-argument constructor of the base generator with the parameter seed.

Complexity: Exactly k+1 invocations of the base generator.

SeedSeq &
const base_type &

Constructs a `shuffle_output_engine` by using a copy of the provided generator.

Precondition: The template argument UniformRandomNumberGenerator shall denote a CopyConstructible type.

Complexity: Exactly k+1 invocations of the base generator.

base_type &&
It &
It
result_type

Returns the smallest value that the generator can produce.

result_type

Returns the largest value that the generator can produce.

friend std::basic_ostream< CharT, Traits > & `std::basic_ostream< CharT, Traits > &` `const `shuffle_order_engine` &`

Writes a ``shuffle_order_engine`` to a `std::ostream`.

friend std::basic_istream< CharT, Traits > & `std::basic_istream< CharT, Traits > &` `const `shuffle_order_engine` &`

Reads a ``shuffle_order_engine`` from a `std::istream`.

friend bool `const `shuffle_order_engine` &` `const `shuffle_order_engine` &`

Returns true if the two generators will produce identical sequences.

friend bool `const `shuffle_order_engine` &` `const `shuffle_order_engine` &`

Returns true if the two generators will produce different sequences.

According to Harry Erwin (private e-mail), the specialization `kreutzer1986` was suggested in:

> "System Simulation: Programming Styles and Languages (International Computer Science Series)", Wolfgang Kreutzer, Addison-Wesley, December 1986.

`shuffle_order_engine`< `linear_congruential_engine`< uint32_t, 1366, 150889, 714025 >, 97 >

The specialization `knuth_b` is specified by the C++ standard. It is described in

> "The Art of Computer Programming, Second Edition, Volume 2, Seminumerical Algorithms", Donald Knuth, Addison-Wesley, 1981.

`shuffle_order_engine`< `minstd_rand0`, 256 >
double

The Student t distribution is a real valued distribution with one parameter n, the number of degrees of freedom.

It has $\displaystyle p(x) = \frac{1}{\sqrt{n\pi}} \frac{\Gamma((n+1)/2)}{\Gamma(n/2)} \left(1+\frac{x^2}{n}\right)^{-(n+1)/2} $$\displaystyle p(x) = \frac{1}{\sqrt{n\pi}} \frac{\Gamma((n+1)/2)}{\Gamma(n/2)} \left(1+\frac{x^2}{n}\right)^{-(n+1)/2} $.

`student_t_distribution`
RealType

Returns the number of degrees of freedom of the distribution.

RealType
1.0

Constructs a ``param_type`` with "n" degrees of freedom.

Requires: n > 0

friend std::basic_ostream< CharT, Traits > & `std::basic_ostream< CharT, Traits > &` `const `param_type` &`

Writes a ``param_type`` to a `std::ostream`.

friend std::basic_istream< CharT, Traits > & `std::basic_istream< CharT, Traits > &` `const `param_type` &`

Reads a ``param_type`` from a `std::istream`.

friend bool `const `param_type` &` `const `param_type` &`

Returns true if the two sets of parameters are the same.

friend bool `const `param_type` &` `const `param_type` &`

Returns true if the two sets of parameters are the different.

RealType
RealType
RealType `URNG &`

Returns a random variate distributed according to the Student t distribution.

RealType `URNG &` `const `param_type` &`

Returns a random variate distributed accordint to the Student t distribution with parameters specified by `param`.

RealType

Returns the number of degrees of freedom.

RealType

Returns the smallest value that the distribution can produce.

RealType

Returns the largest value that the distribution can produce.

`param_type`

Returns the parameters of the distribution.

void `const `param_type` &`

Sets the parameters of the distribution.

void

Effects: Subsequent uses of the distribution do not depend on values produced by any engine prior to invoking reset.

RealType
1.0

Constructs an ``student_t_distribution`` with "n" degrees of freedom.

Requires: n > 0

const `param_type` &

Constructs an ``student_t_distribution`` from its parameters.

friend std::basic_ostream< CharT, Traits > & `std::basic_ostream< CharT, Traits > &` `const `student_t_distribution` &`

Writes a ``student_t_distribution`` to a `std::ostream`.

friend std::basic_istream< CharT, Traits > & `std::basic_istream< CharT, Traits > &` `const `student_t_distribution` &`

Reads a ``student_t_distribution`` from a `std::istream`.

friend bool `const `student_t_distribution` &` `const `student_t_distribution` &`

Returns true if the two instances of ``student_t_distribution`` will return identical sequences of values given equal generators.

friend bool `const `student_t_distribution` &` `const `student_t_distribution` &`

Returns true if the two instances of ``student_t_distribution`` will return different sequences of values given equal generators.

std::size_t
std::size_t
std::size_t

Instantiations of ``subtract_with_carry_engine`` model a pseudo-random number generator . The algorithm is described in

> "A New Class of Random Number Generators", George Marsaglia and Arif Zaman, Annals of Applied Probability, Volume 1, Number 3 (1991), 462-480.

IntType
const std::size_t
const std::size_t
const std::size_t
const uint32_t
const bool
const result_type
void

Seeds the generator with the default seed.

void `IntType`
void `SeedSeq &`

Seeds the generator with values produced by `seq.generate()`.

void `It &` `It`

Seeds the generator with values from a range. Updates `first` to point one past the last consumed value. If the range does not contain enough elements to fill the entire state of the generator, throws `std::invalid_argument`.

result_type

Returns the next value of the generator.

void `boost::uintmax_t`

Advances the state of the generator by `z`.

void `It` `It`

Fills a range with random values.

Constructs a new ``subtract_with_carry_engine`` and seeds it with the default seed.

IntType

Constructs a new ``subtract_with_carry_engine`` and seeds it with `value`.

SeedSeq &

Constructs a new ``subtract_with_carry_engine`` and seeds it with values produced by `seq.generate()`.

It &
It

Constructs a new ``subtract_with_carry_engine`` and seeds it with values from a range. first is updated to point one past the last value consumed. If there are not enough elements in the range to fill the entire state of the generator, throws `std::invalid_argument`.

result_type

Returns the smallest value that the generator can produce.

result_type

Returns the largest value that the generator can produce.

friend std::basic_ostream< CharT, Traits > & `std::basic_ostream< CharT, Traits > &` `const `subtract_with_carry_engine` &`

Writes a ``subtract_with_carry_engine`` to a `std::ostream`.

friend std::basic_istream< CharT, Traits > & `std::basic_istream< CharT, Traits > &` `const `subtract_with_carry_engine` &`

Reads a ``subtract_with_carry_engine`` from a `std::istream`.

friend bool `const `subtract_with_carry_engine` &` `const `subtract_with_carry_engine` &`

Returns true if the two generators will produce identical sequences of values.

friend bool `const `subtract_with_carry_engine` &` `const `subtract_with_carry_engine` &`

Returns true if the two generators will produce different sequences of values.

std::size_t
std::size_t
std::size_t

Instantiations of `subtract_with_carry_01_engine` model a pseudo-random number generator . The algorithm is described in

> "A New Class of Random Number Generators", George Marsaglia and Arif Zaman, Annals of Applied Probability, Volume 1, Number 3 (1991), 462-480.

RealType
const bool
const std::size_t
const std::size_t
const std::size_t
const boost::uint32_t
void

Seeds the generator with the default seed.

void `boost::uint32_t`

Seeds the generator with `value`.

void `SeedSeq &`

Seeds the generator with values produced by `seq.generate()`.

void `It &` `It`

Seeds the generator with values from a range. Updates first to point one past the last consumed element. If there are not enough elements in the range to fill the entire state, throws `std::invalid_argument`.

result_type

Returns the next value of the generator.

void `boost::uintmax_t`

Advances the state of the generator by `z`.

void `Iter` `Iter`

Fills a range with random values.

Creates a new `subtract_with_carry_01_engine` using the default seed.

boost::uint32_t

Creates a new `subtract_with_carry_01_engine` and seeds it with value.

SeedSeq &

Creates a new `subtract_with_carry_01_engine` and seeds with values produced by seq.generate().

It &
It

Creates a new `subtract_with_carry_01_engine` and seeds it with values from a range. Advances first to point one past the last consumed value. If the range does not contain enough elements to fill the entire state, throws `std::invalid_argument`.

result_type

Returns the smallest value that the generator can produce.

result_type

Returns the largest value that the generator can produce.

friend std::basic_ostream< CharT, Traits > & `std::basic_ostream< CharT, Traits > &` `const `subtract_with_carry_01_engine` &`

Writes a `subtract_with_carry_01_engine` to a `std::ostream`.

friend std::basic_istream< CharT, Traits > & `std::basic_istream< CharT, Traits > &` `const `subtract_with_carry_01_engine` &`

Reads a `subtract_with_carry_01_engine` from a `std::istream`.

friend bool `const `subtract_with_carry_01_engine` &` `const `subtract_with_carry_01_engine` &`

Returns true if the two generators will produce identical sequences.

friend bool `const `subtract_with_carry_01_engine` &` `const `subtract_with_carry_01_engine` &`

Returns true if the two generators will produce different sequences.

The specialization taus88 was suggested in

> "Maximally Equidistributed Combined Tausworthe Generators", Pierre L'Ecuyer, Mathematics of Computation, Volume 65, Number 213, January 1996, Pages 203-213

`xor_combine_engine`< `xor_combine_engine`< `linear_feedback_shift_engine`< uint32_t, 32, 31, 13, 12 >, 0, `linear_feedback_shift_engine`< uint32_t, 32, 29, 2, 4 >, 0 >, 0, `linear_feedback_shift_engine`< uint32_t, 32, 28, 3, 17 >, 0 >
Converts the argument type T to an unsigned type.

This trait has a single member `type` which is the unsigned type corresponding to T. Note that if T is signed, then member `type` should define a type with one more bit precision than T. For built-in types this trait defaults to `boost::make_unsigned<T>::type`. For user defined types it simply asserts that the argument type T is an unsigned integer (using std::numeric_limits). User defined specializations may be provided for other cases.

Converts the argument type T to either an unsigned type or an unbounded integer type.

This trait has a single member `type` which is either the unsigned type corresponding to T or an unbounded integer type. This trait is used to generate types suitable for the calculation of a range: as a result if T is signed, then member `type` should define a type with one more bit precision than T. For built-in types this trait defaults to `boost::make_unsigned<T>::type`. For user defined types it simply asserts that the argument type T is either an unbounded integer, or an unsigned one (using std::numeric_limits). User defined specializations may be provided for other cases.

mpl::bool_< boost::is_integral< T >::value||(std::numeric_limits< T >::is_integer)>
Traits class that indicates whether type T is an integer.
mpl::bool_< boost::is_signed< T >::value||(std::numeric_limits< T >::is_specialized &&std::numeric_limits< T >::is_integer &&std::numeric_limits< T >::is_signed)>
Traits class that indicates whether type T is a signed integer.
double

Instantiations of ``triangle_distribution`` model a random distribution . A ``triangle_distribution`` has three parameters, `a`, `b`, and `c`, which are the smallest, the most probable and the largest values of the distribution respectively.

`triangle_distribution`
RealType

Returns the minimum value of the distribution.

RealType

Returns the mode of the distribution.

RealType

Returns the maximum value of the distribution.

RealType
0.0
RealType
0.5
RealType
1.0

Constructs the parameters of a ``triangle_distribution``.

friend std::basic_ostream< CharT, Traits > & `std::basic_ostream< CharT, Traits > &` `const `param_type` &`

Writes the parameters to a `std::ostream`.

friend std::basic_istream< CharT, Traits > & `std::basic_istream< CharT, Traits > &` `const `param_type` &`

Reads the parameters from a `std::istream`.

friend bool `const `param_type` &` `const `param_type` &`

Returns true if the two sets of parameters are equal.

friend bool `const `param_type` &` `const `param_type` &`

Returns true if the two sets of parameters are different.

RealType
RealType
result_type

Returns the `a` parameter of the distribution

result_type

Returns the `b` parameter of the distribution

result_type

Returns the `c` parameter of the distribution

RealType

Returns the smallest value that the distribution can produce.

RealType

Returns the largest value that the distribution can produce.

`param_type`

Returns the parameters of the distribution.

void `const `param_type` &`

Sets the parameters of the distribution.

void

Effects: Subsequent uses of the distribution do not depend on values produced by any engine prior to invoking reset.

result_type `Engine &`

Returns a random variate distributed according to the triangle distribution.

result_type `Engine &` `const `param_type` &`

Returns a random variate distributed according to the triangle distribution with parameters specified by param.

RealType
0.0
RealType
0.5
RealType
1.0

Constructs a ``triangle_distribution`` with the parameters `a`, `b`, and `c`.

Preconditions: a <= b <= c.

const `param_type` &

Constructs a ``triangle_distribution`` from its parameters.

friend std::basic_ostream< CharT, Traits > & `std::basic_ostream< CharT, Traits > &` `const `triangle_distribution` &`

Writes the distribution to a `std::ostream`.

friend std::basic_istream< CharT, Traits > & `std::basic_istream< CharT, Traits > &` `const `triangle_distribution` &`

Reads the distribution from a `std::istream`.

friend bool `const `triangle_distribution` &` `const `triangle_distribution` &`

Returns true if the two distributions will produce identical sequences of values given equal generators.

friend bool `const `triangle_distribution` &` `const `triangle_distribution` &`

Returns true if the two distributions may produce different sequences of values given equal generators.

double

The distribution function `uniform_01` models a random distribution . On each invocation, it returns a random floating-point value uniformly distributed in the range [0..1).

The template parameter RealType shall denote a float-like value type with support for binary operators +, -, and /.

Note: The current implementation is buggy, because it may not fill all of the mantissa with random bits. I'm unsure how to fill a (to-be-invented) `boost::bigfloat` class with random bits efficiently. It's probably time for a traits class.

RealType
RealType
result_type
result_type
void
result_type `Engine &`
int

The class template `uniform_int_distribution` models a random distribution . On each invocation, it returns a random integer value uniformly distributed in the set of integers {min, min+1, min+2, ..., max}.

The template parameter IntType shall denote an integer-like value type.

`uniform_int_distribution`
IntType

Returns the minimum value of the distribution.

IntType

Returns the maximum value of the distribution.

IntType
0
IntType
(std::numeric_limits< IntType >::max)()

Constructs the parameters of a `uniform_int_distribution`.

Requires min <= max

friend std::basic_ostream< CharT, Traits > & `std::basic_ostream< CharT, Traits > &` `const `param_type` &`

Writes the parameters to a `std::ostream`.

friend std::basic_istream< CharT, Traits > & `std::basic_istream< CharT, Traits > &` `const `param_type` &`

Reads the parameters from a `std::istream`.

friend bool `const `param_type` &` `const `param_type` &`

Returns true if the two sets of parameters are equal.

friend bool `const `param_type` &` `const `param_type` &`

Returns true if the two sets of parameters are different.

IntType
IntType
IntType

Returns the minimum value of the distribution

IntType

Returns the maximum value of the distribution

IntType

Returns the minimum value of the distribution

IntType

Returns the maximum value of the distribution

`param_type`

Returns the parameters of the distribution.

void `const `param_type` &`

Sets the parameters of the distribution.

void

Effects: Subsequent uses of the distribution do not depend on values produced by any engine prior to invoking reset.

result_type `Engine &`

Returns an integer uniformly distributed in the range [min, max].

result_type `Engine &` `const `param_type` &`

Returns an integer uniformly distributed in the range [param.a(), param.b()].

IntType
0
IntType
(std::numeric_limits< IntType >::max)()

Constructs a `uniform_int_distribution`. `min` and `max` are the parameters of the distribution.

Requires: min <= max

const `param_type` &

Constructs a `uniform_int_distribution` from its parameters.

friend std::basic_ostream< CharT, Traits > & `std::basic_ostream< CharT, Traits > &` `const `uniform_int_distribution` &`

Writes the distribution to a `std::ostream`.

friend std::basic_istream< CharT, Traits > & `std::basic_istream< CharT, Traits > &` `const `uniform_int_distribution` &`

Reads the distribution from a `std::istream`.

friend bool `const `uniform_int_distribution` &` `const `uniform_int_distribution` &`

Returns true if the two distributions will produce identical sequences of values given equal generators.

friend bool `const `uniform_int_distribution` &` `const `uniform_int_distribution` &`

Returns true if the two distributions may produce different sequences of values given equal generators.

double
std::vector<RealType>

Instantiations of class template `uniform_on_sphere` model a random distribution . Such a distribution produces random numbers uniformly distributed on the unit sphere of arbitrary dimension `dim`. The `Cont` template parameter must be a STL-like container type with begin and end operations returning non-const ForwardIterators of type `Cont::iterator`.

`uniform_on_sphere`
int

Returns the dimension of the sphere.

int
2

Constructs the parameters of a `uniform_on_sphere` distribution, given the dimension of the sphere.

friend std::basic_ostream< CharT, Traits > & `std::basic_ostream< CharT, Traits > &` `const `param_type` &`

Writes the parameters to a `std::ostream`.

friend std::basic_istream< CharT, Traits > & `std::basic_istream< CharT, Traits > &` `const `param_type` &`

Reads the parameters from a `std::istream`.

friend bool `const `param_type` &` `const `param_type` &`

Returns true if the two sets of parameters are equal.

friend bool `const `param_type` &` `const `param_type` &`

Returns true if the two sets of parameters are different.

RealType
Cont
int

Returns the dimension of the sphere.

`param_type`

Returns the parameters of the distribution.

void `const `param_type` &`

Sets the parameters of the distribution.

result_type

Returns the smallest value that the distribution can produce. Note that this is required to approximate the standard library's requirements. The behavior is defined according to lexicographical comparison so that for a container type of std::vector, dist.min() <= x <= dist.max() where x is any value produced by the distribution.

result_type

Returns the largest value that the distribution can produce. Note that this is required to approximate the standard library's requirements. The behavior is defined according to lexicographical comparison so that for a container type of std::vector, dist.min() <= x <= dist.max() where x is any value produced by the distribution.

void

Effects: Subsequent uses of the distribution do not depend on values produced by any engine prior to invoking reset.

const result_type & `Engine &`

Returns a point uniformly distributed over the surface of a sphere of dimension dim().

result_type `Engine &` `const `param_type` &`

Returns a point uniformly distributed over the surface of a sphere of dimension param.dim().

int
2

Constructs a ``uniform_on_sphere`` distribution. `dim` is the dimension of the sphere.

Requires: dim >= 0

const `param_type` &

Constructs a ``uniform_on_sphere`` distribution from its parameters.

friend std::basic_ostream< CharT, Traits > & `std::basic_ostream< CharT, Traits > &` `const `uniform_on_sphere` &`

Writes the distribution to a `std::ostream`.

friend std::basic_istream< CharT, Traits > & `std::basic_istream< CharT, Traits > &` `const `uniform_on_sphere` &`

Reads the distribution from a `std::istream`.

friend bool `const `uniform_on_sphere` &` `const `uniform_on_sphere` &`

Returns true if the two distributions will produce identical sequences of values, given equal generators.

friend bool `const `uniform_on_sphere` &` `const `uniform_on_sphere` &`

Returns true if the two distributions may produce different sequences of values, given equal generators.

double

The class template `uniform_real_distribution` models a random distribution . On each invocation, it returns a random floating-point value uniformly distributed in the range [min..max).

`uniform_real_distribution`
RealType

Returns the minimum value of the distribution.

RealType

Returns the maximum value of the distribution.

RealType
0.0
RealType
1.0

Constructs the parameters of a `uniform_real_distribution`.

Requires min <= max

friend std::basic_ostream< CharT, Traits > & `std::basic_ostream< CharT, Traits > &` `const `param_type` &`

Writes the parameters to a `std::ostream`.

friend std::basic_istream< CharT, Traits > & `std::basic_istream< CharT, Traits > &` `const `param_type` &`

Reads the parameters from a `std::istream`.

friend bool `const `param_type` &` `const `param_type` &`

Returns true if the two sets of parameters are equal.

friend bool `const `param_type` &` `const `param_type` &`

Returns true if the two sets of parameters are different.

RealType
RealType
RealType

Returns the minimum value of the distribution

RealType

Returns the maximum value of the distribution

RealType

Returns the minimum value of the distribution

RealType

Returns the maximum value of the distribution

`param_type`

Returns the parameters of the distribution.

void `const `param_type` &`

Sets the parameters of the distribution.

void

Effects: Subsequent uses of the distribution do not depend on values produced by any engine prior to invoking reset.

result_type `Engine &`

Returns a value uniformly distributed in the range [min, max).

result_type `Engine &` `const `param_type` &`

Returns a value uniformly distributed in the range [param.a(), param.b()).

RealType
0.0
RealType
1.0

Constructs a `uniform_real_distribution`. `min` and `max` are the parameters of the distribution.

Requires: min <= max

const `param_type` &

Constructs a `uniform_real_distribution` from its parameters.

friend std::basic_ostream< CharT, Traits > & `std::basic_ostream< CharT, Traits > &` `const `uniform_real_distribution` &`

Writes the distribution to a `std::ostream`.

friend std::basic_istream< CharT, Traits > & `std::basic_istream< CharT, Traits > &` `const `uniform_real_distribution` &`

Reads the distribution from a `std::istream`.

friend bool `const `uniform_real_distribution` &` `const `uniform_real_distribution` &`

Returns true if the two distributions will produce identical sequences of values given equal generators.

friend bool `const `uniform_real_distribution` &` `const `uniform_real_distribution` &`

Returns true if the two distributions may produce different sequences of values given equal generators.

int

The distribution function `uniform_smallint` models a random distribution . On each invocation, it returns a random integer value uniformly distributed in the set of integer numbers {min, min+1, min+2, ..., max}. It assumes that the desired range (max-min+1) is small compared to the range of the underlying source of random numbers and thus makes no attempt to limit quantization errors.

Let $r_{\mathtt{out}} = (\mbox{max}-\mbox{min}+1)$$r_{\mathtt{out}} = (\mbox{max}-\mbox{min}+1)$ the desired range of integer numbers, and let $r_{\mathtt{base}}$$r_{\mathtt{base}}$ be the range of the underlying source of random numbers. Then, for the uniform distribution, the theoretical probability for any number i in the range $r_{\mathtt{out}}$$r_{\mathtt{out}}$ will be $\displaystyle p_{\mathtt{out}}(i) = \frac{1}{r_{\mathtt{out}}}$$\displaystyle p_{\mathtt{out}}(i) = \frac{1}{r_{\mathtt{out}}}$. Likewise, assume a uniform distribution on $r_{\mathtt{base}}$$r_{\mathtt{base}}$ for the underlying source of random numbers, i.e. $\displaystyle p_{\mathtt{base}}(i) = \frac{1}{r_{\mathtt{base}}}$$\displaystyle p_{\mathtt{base}}(i) = \frac{1}{r_{\mathtt{base}}}$. Let $p_{\mathtt{out\_s}}(i)$$p_{\mathtt{out\_s}}(i)$ denote the random distribution generated by ``uniform_smallint``. Then the sum over all i in $r_{\mathtt{out}}$$r_{\mathtt{out}}$ of $\displaystyle \left(\frac{p_{\mathtt{out\_s}}(i)}{p_{\mathtt{out}}(i)} - 1\right)^2$$\displaystyle \left(\frac{p_{\mathtt{out\_s}}(i)}{p_{\mathtt{out}}(i)} - 1\right)^2$ shall not exceed $\displaystyle \frac{r_{\mathtt{out}}}{r_{\mathtt{base}}^2} (r_{\mathtt{base}} \mbox{ mod } r_{\mathtt{out}}) (r_{\mathtt{out}} - r_{\mathtt{base}} \mbox{ mod } r_{\mathtt{out}})$$\displaystyle \frac{r_{\mathtt{out}}}{r_{\mathtt{base}}^2} (r_{\mathtt{base}} \mbox{ mod } r_{\mathtt{out}}) (r_{\mathtt{out}} - r_{\mathtt{base}} \mbox{ mod } r_{\mathtt{out}})$.

The template parameter IntType shall denote an integer-like value type.

The property above is the square sum of the relative differences in probabilities between the desired uniform distribution $p_{\mathtt{out}}(i)$$p_{\mathtt{out}}(i)$ and the generated distribution $p_{\mathtt{out\_s}}(i)$$p_{\mathtt{out\_s}}(i)$. The property can be fulfilled with the calculation $(\mbox{base\_rng} \mbox{ mod } r_{\mathtt{out}})$$(\mbox{base\_rng} \mbox{ mod } r_{\mathtt{out}})$, as follows: Let $r = r_{\mathtt{base}} \mbox{ mod } r_{\mathtt{out}}$$r = r_{\mathtt{base}} \mbox{ mod } r_{\mathtt{out}}$. The base distribution on $r_{\mathtt{base}}$$r_{\mathtt{base}}$ is folded onto the range $r_{\mathtt{out}}$$r_{\mathtt{out}}$. The numbers i < r have assigned $\displaystyle \left\lfloor\frac{r_{\mathtt{base}}}{r_{\mathtt{out}}}\right\rfloor+1$$\displaystyle \left\lfloor\frac{r_{\mathtt{base}}}{r_{\mathtt{out}}}\right\rfloor+1$ numbers of the base distribution, the rest has only $\displaystyle \left\lfloor\frac{r_{\mathtt{base}}}{r_{\mathtt{out}}}\right\rfloor$$\displaystyle \left\lfloor\frac{r_{\mathtt{base}}}{r_{\mathtt{out}}}\right\rfloor$. Therefore, $\displaystyle p_{\mathtt{out\_s}}(i) = \left(\left\lfloor\frac{r_{\mathtt{base}}} {r_{\mathtt{out}}}\right\rfloor+1\right) / r_{\mathtt{base}}$$\displaystyle p_{\mathtt{out\_s}}(i) = \left(\left\lfloor\frac{r_{\mathtt{base}}} {r_{\mathtt{out}}}\right\rfloor+1\right) / r_{\mathtt{base}}$ for i < r and $\displaystyle p_{\mathtt{out\_s}}(i) = \left\lfloor\frac{r_{\mathtt{base}}} {r_{\mathtt{out}}}\right\rfloor/r_{\mathtt{base}}$$\displaystyle p_{\mathtt{out\_s}}(i) = \left\lfloor\frac{r_{\mathtt{base}}} {r_{\mathtt{out}}}\right\rfloor/r_{\mathtt{base}}$ otherwise. Substituting this in the above sum formula leads to the desired result.

Note: The upper bound for $(r_{\mathtt{base}} \mbox{ mod } r_{\mathtt{out}}) (r_{\mathtt{out}} - r_{\mathtt{base}} \mbox{ mod } r_{\mathtt{out}})$$(r_{\mathtt{base}} \mbox{ mod } r_{\mathtt{out}}) (r_{\mathtt{out}} - r_{\mathtt{base}} \mbox{ mod } r_{\mathtt{out}})$ is $\displaystyle \frac{r_{\mathtt{out}}^2}{4}$$\displaystyle \frac{r_{\mathtt{out}}^2}{4}$. Regarding the upper bound for the square sum of the relative quantization error of $\displaystyle \frac{r_\mathtt{out}^3}{4r_{\mathtt{base}}^2}$$\displaystyle \frac{r_\mathtt{out}^3}{4r_{\mathtt{base}}^2}$, it seems wise to either choose $r_{\mathtt{base}}$$r_{\mathtt{base}}$ so that $r_{\mathtt{base}} > 10r_{\mathtt{out}}^2$$r_{\mathtt{base}} > 10r_{\mathtt{out}}^2$ or ensure that $r_{\mathtt{base}}$$r_{\mathtt{base}}$ is divisible by $r_{\mathtt{out}}$$r_{\mathtt{out}}$.

`uniform_smallint`
IntType

Returns the minimum value.

IntType

Returns the maximum value.

IntType
0
IntType
9

constructs the parameters of a ``uniform_smallint`` distribution.

friend std::basic_ostream< CharT, Traits > & `std::basic_ostream< CharT, Traits > &` `const `param_type` &`

Writes the parameters to a `std::ostream`.

friend std::basic_istream< CharT, Traits > & `std::basic_istream< CharT, Traits > &` `const `param_type` &`

Reads the parameters from a `std::istream`.

friend bool `const `param_type` &` `const `param_type` &`

Returns true if the two sets of parameters are equal.

friend bool `const `param_type` &` `const `param_type` &`

Returns true if the two sets of parameters are different.

IntType
IntType
result_type

Returns the minimum value of the distribution.

result_type

Returns the maximum value of the distribution.

result_type

Returns the minimum value of the distribution.

result_type

Returns the maximum value of the distribution.

`param_type`

Returns the parameters of the distribution.

void `const `param_type` &`

Sets the parameters of the distribution.

void

Effects: Subsequent uses of the distribution do not depend on values produced by any engine prior to invoking reset.

result_type `Engine &`

Returns a value uniformly distributed in the range [min(), max()].

result_type `Engine &` `const `param_type` &`

Returns a value uniformly distributed in the range [param.a(), param.b()].

IntType
0
IntType
9

Constructs a ``uniform_smallint``. `min` and `max` are the lower and upper bounds of the output range, respectively.

const `param_type` &

Constructs a ``uniform_smallint`` from its parameters.

friend std::basic_ostream< CharT, Traits > & `std::basic_ostream< CharT, Traits > &` `const `uniform_smallint` &`

Writes the distribution to a `std::ostream`.

friend std::basic_istream< CharT, Traits > & `std::basic_istream< CharT, Traits > &` `const `uniform_smallint` &`

Reads the distribution from a `std::istream`.

friend bool `const `uniform_smallint` &` `const `uniform_smallint` &`

Returns true if the two distributions will produce identical sequences of values given equal generators.

friend bool `const `uniform_smallint` &` `const `uniform_smallint` &`

Returns true if the two distributions may produce different sequences of values given equal generators.

A random variate generator is used to join a random number generator together with a random number distribution. Boost.Random provides a vast choice of generators as well as distributions .

The argument for the template parameter Engine shall be of the form U, U&, or U*, where U models a uniform random number generator . Then, the member engine_value_type names U (not the pointer or reference to U).

Specializations of ``variate_generator`` satisfy the requirements of CopyConstructible. They also satisfy the requirements of Assignable unless the template parameter Engine is of the form U&.

The complexity of all functions specified in this section is constant. No function described in this section except the constructor throws an exception.

helper_type::value_type
Engine
Distribution
Distribution::result_type
result_type

Returns: distribution()(engine())

result_type `const T &`

Returns: distribution()(engine(), value).

engine_value_type &

Returns: A reference to the associated uniform random number generator.

const engine_value_type &

Returns: A reference to the associated uniform random number generator.

distribution_type &

Returns: A reference to the associated random distribution .

const distribution_type &

Returns: A reference to the associated random distribution.

result_type

Precondition: distribution().min() is well-formed

Returns: distribution().min()

result_type

Precondition: distribution().max() is well-formed

Returns: distribution().max()

Engine
Distribution

Constructs a ``variate_generator`` object with the associated uniform random number generator eng and the associated random distribution d.

Throws: If and what the copy constructor of Engine or Distribution throws.

double

The Weibull distribution is a real valued distribution with two parameters a and b, producing values >= 0.

It has $\displaystyle p(x) = \frac{a}{b}\left(\frac{x}{b}\right)^{a-1}e^{-\left(\frac{x}{b}\right)^a}$$\displaystyle p(x) = \frac{a}{b}\left(\frac{x}{b}\right)^{a-1}e^{-\left(\frac{x}{b}\right)^a}$.

`weibull_distribution`
RealType

Returns the "a" parameter of the distribtuion.

RealType

Returns the "b" parameter of the distribution.

RealType
1.0
RealType
1.0

Constructs a ``param_type`` from the "a" and "b" parameters of the distribution.

Requires: a > 0 && b > 0

friend std::basic_ostream< CharT, Traits > & `std::basic_ostream< CharT, Traits > &` `const `param_type` &`

Writes a ``param_type`` to a `std::ostream`.

friend std::basic_istream< CharT, Traits > & `std::basic_istream< CharT, Traits > &` `const `param_type` &`

Reads a ``param_type`` from a `std::istream`.

friend bool `const `param_type` &` `const `param_type` &`

Returns true if the two sets of parameters are the same.

friend bool `const `param_type` &` `const `param_type` &`

Returns true if the two sets of parameters are the different.

RealType
RealType
RealType `URNG &`

Returns a random variate distributed according to the ``weibull_distribution``.

RealType `URNG &` `const `param_type` &`

Returns a random variate distributed accordint to the Weibull distribution with parameters specified by `param`.

RealType

Returns the "a" parameter of the distribution.

RealType

Returns the "b" parameter of the distribution.

RealType

Returns the smallest value that the distribution can produce.

RealType

Returns the largest value that the distribution can produce.

`param_type`

Returns the parameters of the distribution.

void `const `param_type` &`

Sets the parameters of the distribution.

void

Effects: Subsequent uses of the distribution do not depend on values produced by any engine prior to invoking reset.

RealType
1.0
RealType
1.0

Constructs a ``weibull_distribution`` from its "a" and "b" parameters.

Requires: a > 0 && b > 0

const `param_type` &

Constructs a ``weibull_distribution`` from its parameters.

friend std::basic_ostream< CharT, Traits > & `std::basic_ostream< CharT, Traits > &` `const `weibull_distribution` &`

Writes a ``weibull_distribution`` to a `std::ostream`.

friend std::basic_istream< CharT, Traits > & `std::basic_istream< CharT, Traits > &` `const `weibull_distribution` &`

Reads a ``weibull_distribution`` from a `std::istream`.

friend bool `const `weibull_distribution` &` `const `weibull_distribution` &`

Returns true if the two instances of ``weibull_distribution`` will return identical sequences of values given equal generators.

friend bool `const `weibull_distribution` &` `const `weibull_distribution` &`

Returns true if the two instances of ``weibull_distribution`` will return different sequences of values given equal generators.

int
int

Instantiations of ``xor_combine_engine`` model a pseudo-random number generator . To produce its output it invokes each of the base generators, shifts their results and xors them together.

URNG1
URNG2
base1_type::result_type
const bool
const int
const int
void

Calls `seed()` for both base generators.

void `result_type`

`seeds` both base generators with `v`.

void `SeedSeq &`

`seeds` both base generators with values produced by `seq`.

void `It &` `It`

seeds both base generators with values from the iterator range [first, last) and changes first to point to the element after the last one used. If there are not enough elements in the range to seed both generators, throws `std::invalid_argument`.

const base1_type &

Returns the first base generator.

const base2_type &

Returns the second base generator.

result_type

Returns the next value of the generator.

void `Iter` `Iter`

Fills a range with random values

void `boost::uintmax_t`

Advances the state of the generator by `z`.

Constructors a ``xor_combine_engine`` by default constructing both base generators.

const base1_type &
const base2_type &

Constructs a `xor_combine` by copying two base generators.

result_type

Constructs a ``xor_combine_engine``, seeding both base generators with `v`.

The exact algorithm used by this function may change in the future.

SeedSeq &

Constructs a ``xor_combine_engine``, seeding both base generators with values produced by `seq`.

It &
It

Constructs a ``xor_combine_engine``, seeding both base generators with values from the iterator range [first, last) and changes first to point to the element after the last one used. If there are not enough elements in the range to seed both generators, throws `std::invalid_argument`.

result_type

Returns the smallest value that the generator can produce.

result_type

Returns the largest value that the generator can produce.

friend std::basic_ostream< CharT, Traits > & `std::basic_ostream< CharT, Traits > &` `const `xor_combine_engine` &`

Writes the textual representation of the generator to a `std::ostream`.

friend std::basic_istream< CharT, Traits > & `std::basic_istream< CharT, Traits > &` `const `xor_combine_engine` &`

Reads the textual representation of the generator from a `std::istream`.

friend bool `const `xor_combine_engine` &` `const `xor_combine_engine` &`

Returns true if the two generators will produce identical sequences.

friend bool `const `xor_combine_engine` &` `const `xor_combine_engine` &`

Returns true if the two generators will produce different sequences.