HeadersAn 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. MLCG1MLCG2MLCG1::result_typeconst boolconstexpr result_typeReturns the smallest value that the generator can produce constexpr result_typeReturns the largest value that the generator can produce voidSeeds an additive_combine_engine using the default seeds of the two base generators. voidresult_typeSeeds an additive_combine_engine, using seed as the seed for both base generators. voidSeedSeq &Seeds an additive_combine_engine, using seq to seed both base generators.See the warning on the corresponding constructor. voidtypename MLCG1::result_typetypename MLCG2::result_typeSeeds an additive_combine generator, using seed1 and seed2 as the seeds to the first and second base generators, respectively. voidIt &ItSeeds 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_typeReturns the next value of the generator. voidIterIterFills a range with random values voidboost::uintmax_tAdvances the state of the generator by z. Constructs an additive_combine_engine using the default constructors of the two base generators. result_typeConstructs 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_typetypename MLCG2::result_typeConstructs an additive_combine_engine, using seed1 and seed2 as the constructor argument to the first and second base generators, respectively. It &ItContructs 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 boolconst additive_combine_engine &const additive_combine_engine &Returns: true iff the two additive_combine_engines will produce the same sequence of values. friend boolconst 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 >>doubleInstantiations 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_distributionRealTypeReturns the p parameter of the distribution. RealType0.5Constructs 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 boolconst param_type &const param_type &Returns true if the two sets of parameters are equal. friend boolconst param_type &const param_type &Returns true if the two sets of parameters are different. intboolRealTypeReturns: The "p" parameter of the distribution. boolReturns the smallest value that the distribution can produce. boolReturns the largest value that the distribution can produce. param_typeReturns the parameters of the distribution. voidconst param_type &Sets the parameters of the distribution. voidEffects: Subsequent uses of the distribution do not depend on values produced by any engine prior to invoking reset. boolEngine &Returns: a random variate distributed according to the bernoulli_distribution . boolEngine &const param_type &Returns: a random variate distributed according to the bernoulli_distribution with parameters specified by param. const RealType &0.5Constructs 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 boolconst bernoulli_distribution &const bernoulli_distribution &Returns true iff the two distributions will produce identical sequences of values given equal generators. friend boolconst bernoulli_distribution &const bernoulli_distribution &Returns true iff the two distributions will produce different sequences of values given equal generators. doubleThe 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_distributionRealTypeReturns the "alpha" parameter of the distribtuion. RealTypeReturns the "beta" parameter of the distribution. RealType1.0RealType1.0Constructs 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 boolconst param_type &const param_type &Returns true if the two sets of parameters are the same. friend boolconst param_type &const param_type &Returns true if the two sets of parameters are the different. RealTypeRealTypeRealTypeURNG &Returns a random variate distributed according to the beta distribution. RealTypeURNG &const param_type &Returns a random variate distributed accordint to the beta distribution with parameters specified by param. RealTypeReturns the "alpha" parameter of the distribution. RealTypeReturns the "beta" parameter of the distribution. RealTypeReturns the smallest value that the distribution can produce. RealTypeReturns the largest value that the distribution can produce. param_typeReturns the parameters of the distribution. voidconst param_type &Sets the parameters of the distribution. voidEffects: Subsequent uses of the distribution do not depend on values produced by any engine prior to invoking reset. RealType1.0RealType1.0Constructs 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 boolconst beta_distribution &const beta_distribution &Returns true if the two instances of beta_distribution will return identical sequences of values given equal generators. friend boolconst beta_distribution &const beta_distribution &Returns true if the two instances of beta_distribution will return different sequences of values given equal generators. intdoubleThe 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_distributionIntTypeReturns the t parameter of the distribution. RealTypeReturns the p parameter of the distribution. IntType1RealType0.5Construct 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 > ¶m_type &Reads the parameters of the distribution from a std::istream. friend boolconst param_type &const param_type &Returns true if the parameters have the same values. friend boolconst param_type &const param_type &Returns true if the parameters have different values. IntTypeRealTypeIntTypeURNG &Returns a random variate distributed according to the binomial distribution. IntTypeURNG &const param_type &Returns a random variate distributed according to the binomial distribution with parameters specified by param. IntTypeReturns the t parameter of the distribution. RealTypeReturns the p parameter of the distribution. IntTypeReturns the smallest value that the distribution can produce. IntTypeReturns the largest value that the distribution can produce. param_typeReturns the parameters of the distribution. voidconst param_type &Sets parameters of the distribution. voidEffects: Subsequent uses of the distribution do not depend on values produced by any engine prior to invoking reset. IntType1RealType0.5Construct 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 boolconst binomial_distribution &const binomial_distribution &Returns true if the two distributions will produce the same sequence of values, given equal generators. friend boolconst binomial_distribution &const binomial_distribution &Returns true if the two distributions could produce different sequences of values, given equal generators. doubleThe 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_distributionRealTypeReturns the median of the distribution. RealTypeReturns the sigma parameter of the distribution. RealTypeReturns the median of the distribution. RealTypeReturns the sigma parameter of the distribution. RealType0.0RealType1.0Constructs 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 boolconst param_type &const param_type &Returns true if the two sets of parameters are equal. friend boolconst param_type &const param_type &Returns true if the two sets of parameters are different. RealTypeRealTypeRealTypeReturns: the "median" parameter of the distribution RealTypeReturns: the "sigma" parameter of the distribution RealTypeReturns: the "median" parameter of the distribution RealTypeReturns: the "sigma" parameter of the distribution RealTypeReturns the smallest value that the distribution can produce. RealTypeReturns the largest value that the distribution can produce. param_typevoidconst param_type &voidEffects: Subsequent uses of the distribution do not depend on values produced by any engine prior to invoking reset. result_typeEngine &Returns: A random variate distributed according to the cauchy distribution. result_typeEngine &const param_type &Returns: A random variate distributed according to the cauchy distribution with parameters specified by param. RealType0.0RealType1.0Constructs 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 boolconst cauchy_distribution &const cauchy_distribution &Returns true if the two distributions will produce identical sequences of values, given equal generators. friend boolconst cauchy_distribution &const cauchy_distribution &Returns true if the two distributions may produce different sequences of values, given equal generators. doubleThe 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_distributionRealTypeReturns the n parameter of the distribution. RealType1Construct 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 > ¶m_type &Reads the parameters of the distribution from a std::istream. friend boolconst param_type &const param_type &Returns true if the parameters have the same values. friend boolconst param_type &const param_type &Returns true if the parameters have different values. RealTypeRealTypeRealTypeURNG &Returns a random variate distributed according to the chi squared distribution. RealTypeURNG &const param_type &Returns a random variate distributed according to the chi squared distribution with parameters specified by param. RealTypeReturns the n parameter of the distribution. RealTypeReturns the smallest value that the distribution can produce. RealTypeReturns the largest value that the distribution can produce. param_typeReturns the parameters of the distribution. voidconst param_type &Sets parameters of the distribution. voidEffects: Subsequent uses of the distribution do not depend on values produced by any engine prior to invoking reset. RealType1Construct 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 boolconst chi_squared_distribution &const chi_squared_distribution &Returns true if the two distributions will produce the same sequence of values, given equal generators. friend boolconst chi_squared_distribution &const chi_squared_distribution &Returns true if the two distributions could produce different sequences of values, given equal generators. std::size_tstd::size_tThe 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 UniformRandomNumberGeneratorbase_type::result_typeconst std::size_tconst std::size_tconst boolconst std::size_tconst std::size_tvoiddefault seeds the underlying generator. voidseed_typeSeeds the underlying generator with s. voidSeedSeq &Seeds the underlying generator with seq. voidIt &ItSeeds the underlying generator with first and last. const base_type &Returns the underlying engine. result_typeReturns the next value of the generator. voidboost::uintmax_tvoidItItUses 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_typeCreates a new discard_block_engine and seeds the underlying generator with valueSeedSeq &Creates a new discard_block_engine and seeds the underlying generator with seqIt &ItCreates a new discard_block_engine and seeds the underlying generator with first and last. constexpr result_typeReturns the smallest value that the generator can produce. This is the same as the minimum of the underlying generator. constexpr result_typeReturns 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 boolconst discard_block_engine &const discard_block_engine &Returns true if the two generators will produce identical sequences. friend boolconst discard_block_engine &const discard_block_engine &Returns true if the two generators will produce different sequences. intdoubleThe 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_distributionstd::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$. IterIterIf 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_tdoubledoubleFuncIf 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 boolconst param_type &const param_type &Returns true if the two sets of parameters are the same. friend boolconst param_type &const param_type &Returns true if the two sets of parameters are different. WeightTypeIntTypeIntTypeURNG &Returns a value distributed according to the parameters of the discrete_distribution. IntTypeURNG &const param_type &Returns a value distributed according to the parameters specified by param. result_typeReturns the smallest value that the distribution can produce. result_typeReturns 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, givendiscrete_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_typeReturns the parameters of the distribution. voidconst param_type &Sets the parameters of the distribution. voidEffects: 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$. IterIterConstructs 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 distributiondiscrete_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_tdoubledoubleFuncConstructs 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::istreamfriend boolconst discrete_distribution &const discrete_distribution &Returns true if the two distributions will return the same sequence of values, when passed equal generators. friend boolconst discrete_distribution &const discrete_distribution &Returns true if the two distributions may return different sequences of values, when passed equal generators. doubleThe 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_distributionRealTypeReturns the lambda parameter of the distribution. RealType1.0Constructs 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 boolconst param_type &const param_type &Returns true if the two sets of parameters are equal. friend boolconst param_type &const param_type &Returns true if the two sets of parameters are different. RealTypeRealTypeRealTypeReturns the lambda parameter of the distribution. RealTypeReturns the smallest value that the distribution can produce. RealTypeReturns the largest value that the distribution can produce. param_typeReturns the parameters of the distribution. voidconst param_type &Sets the parameters of the distribution. voidEffects: Subsequent uses of the distribution do not depend on values produced by any engine prior to invoking reset. result_typeEngine &Returns a random variate distributed according to the exponential distribution. result_typeEngine &const param_type &Returns a random variate distributed according to the exponential distribution with parameters specified by param. RealType1.0Constructs 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 boolconst exponential_distribution &const exponential_distribution &Returns true iff the two distributions will produce identical sequences of values given equal generators. friend boolconst exponential_distribution &const exponential_distribution &Returns true iff the two distributions will produce different sequences of values given equal generators. doubleThe 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_distributionRealTypeReturns the "a" parameter of the distribtuion. RealTypeReturns the "b" parameter of the distribution. RealType1.0RealType1.0Constructs 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 boolconst param_type &const param_type &Returns true if the two sets of parameters are the same. friend boolconst param_type &const param_type &Returns true if the two sets of parameters are the different. RealTypeRealTypeRealTypeURNG &Returns a random variate distributed according to the extreme_value_distribution. RealTypeURNG &const param_type &Returns a random variate distributed accordint to the extreme value distribution with parameters specified by param. RealTypeReturns the "a" parameter of the distribution. RealTypeReturns the "b" parameter of the distribution. RealTypeReturns the smallest value that the distribution can produce. RealTypeReturns the largest value that the distribution can produce. param_typeReturns the parameters of the distribution. voidconst param_type &Sets the parameters of the distribution. voidEffects: Subsequent uses of the distribution do not depend on values produced by any engine prior to invoking reset. RealType1.0RealType1.0Constructs 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 boolconst 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 boolconst 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. default_faure_prime_tableInstantiations of class template faure_engine model a quasi-random number generator . The faure_engine uses the algorithm described in
Henri Faure, Discrepance de suites associees a un systeme de numeration (en dimension s), Acta Arithmetica, Volume 41, 1982, pages 337-351.
Bennett Fox, Algorithm 647: Implementation and Relative Efficiency of Quasirandom Sequence Generators, ACM Transactions on Mathematical Software, Volume 12, Number 4, December 1986, pages 362-376.
In the following documentation X denotes the concrete class of the template faure_engine returning objects of type RealType, u and v are the values of X.Some member functions may throw exceptions of type std::bad_alloc. RealTypefriend boolconst faure_engine &const faure_engine &Returns true if the two generators will produce identical sequences of outputs. friend boolconst faure_engine &const faure_engine &Returns true if the two generators will produce different sequences of outputs. friend std::basic_ostream< CharT, Traits > &std::basic_ostream< CharT, Traits > &const faure_engine &Writes the textual representation of the generator to a std::ostream. friend std::basic_istream< CharT, Traits > &std::basic_istream< CharT, Traits > &const faure_engine &Reads the textual representation of the generator from a std::istream. constexpr result_typeReturns: Tight lower bound on the set of values returned by operator().Throws: nothing. constexpr result_typeReturns: Tight upper bound on the set of values returned by operator().Throws: nothing. voidSeqSizeT0Effects: Effectively sets the quasi-random number generator state to the init-th vector in the s-dimensional quasi-random domain, where s == X::dimension(). X u, v;
for(int i = 0; i < N; ++i)
for( std::size_t j = 0; j < u.dimension(); ++j )
u();
v.seed(N);
assert(u() == v());
Throws: bad_alloc. std::size_tReturns: The dimension of of the quasi-random domain.Throws: nothing. result_typeReturns: Returns a successive element of an s-dimensional (s = X::dimension()) vector at each invocation. When all elements are exhausted, X::operator() begins anew with the starting element of a subsequent s-dimensional vector.Throws: range_error. voidboost::uintmax_tEffects: Advances *this state as if z consecutive X::operator() invocations were executed. X u = v;
for(int i = 0; i < N; ++i)
u();
v.discard(N);
assert(u() == v());
Throws: range_error. Throws: bad_alloc. std::size_tEffects: Constructs the s-dimensional default Faure quasi-random number generator.Throws: bad_alloc, invalid_argument. This specialization of faure_engine supports up to 1117 dimensions.
However, it is possible to provide your own prime table to faure_engine should the default one be insufficient. faure_engine< double, boost::uint_least64_t, default_faure_prime_table >doubleThe 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_distributionRealTypeReturns the "m" parameter of the distribtuion. RealTypeReturns the "n" parameter of the distribution. RealType1.0RealType1.0Constructs 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 boolconst param_type &const param_type &Returns true if the two sets of parameters are the same. friend boolconst param_type &const param_type &Returns true if the two sets of parameters are the different. RealTypeRealTypeRealTypeURNG &Returns a random variate distributed according to the F distribution. RealTypeURNG &const param_type &Returns a random variate distributed according to the F distribution with parameters specified by param. RealTypeReturns the "m" parameter of the distribution. RealTypeReturns the "n" parameter of the distribution. RealTypeReturns the smallest value that the distribution can produce. RealTypeReturns the largest value that the distribution can produce. param_typeReturns the parameters of the distribution. voidconst param_type &Sets the parameters of the distribution. voidEffects: Subsequent uses of the distribution do not depend on values produced by any engine prior to invoking reset. RealType1.0RealType1.0Constructs 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 boolconst 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 boolconst 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. doubleThe 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_distributionRealTypeReturns the "alpha" parameter of the distribution. RealTypeReturns the "beta" parameter of the distribution. const RealType &1.0const RealType &1.0Constructs 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 > ¶m_type &Reads the parameters from a std::istream. friend boolconst param_type &const param_type &Returns true if the two sets of parameters are the same. friend boolconst param_type &const param_type &Returns true if the two sets fo parameters are different. RealTypeRealTypeRealTypeReturns the "alpha" paramter of the distribution. RealTypeReturns the "beta" parameter of the distribution. RealTypeReturns the smallest value that the distribution can produce. RealTypeparam_typeReturns the parameters of the distribution. voidconst param_type &Sets the parameters of the distribution. voidEffects: Subsequent uses of the distribution do not depend on values produced by any engine prior to invoking reset. result_typeEngine &Returns a random variate distributed according to the gamma distribution. RealTypeURNG &const param_type &const result_type &1.0const result_type &1.0Creates 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 boolconst gamma_distribution &const gamma_distribution &Returns true if the two distributions will produce identical sequences of random variates given equal generators. friend boolconst gamma_distribution &const gamma_distribution &Returns true if the two distributions can produce different sequences of random variates, given equal generators. RealTypestd::size_tURNG &Returns a value uniformly distributed in the range [0, 1) with at least bits random bits. intdoubleAn 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_distributionRealTypeReturns the p parameter of the distribution. RealType0.5Constructs 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 boolconst param_type &const param_type &Returns true if the two sets of parameters are equal. friend boolconst param_type &const param_type &Returns true if the two sets of parameters are different. RealTypeIntTypeRealTypeReturns: the distribution parameter pIntTypeReturns the smallest value that the distribution can produce. IntTypeReturns the largest value that the distribution can produce. param_typeReturns the parameters of the distribution. voidconst param_type &Sets the parameters of the distribution. voidEffects: Subsequent uses of the distribution do not depend on values produced by any engine prior to invoking reset. result_typeEngine &Returns a random variate distributed according to the geometric_distribution. result_typeEngine &const param_type &Returns a random variate distributed according to the geometric distribution with parameters specified by param. const RealType &0.5Contructs 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 boolconst geometric_distribution &const geometric_distribution &Returns true if the two distributions will produce identical sequences of values given equal generators. friend boolconst geometric_distribution &const geometric_distribution &Returns true if the two distributions may produce different sequences of values given equal generators. doubleThe hyperexponential distribution is a real-valued continuous distribution with two parameters, the phase probability vectorprobs and the rate vectorrates.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):Generate a random variable $U$$U$ uniformly distribution on the interval $(0,1)$$(0,1)$.Use $U$$U$ to select the appropriate $\lambda_i$$\lambda_i$ (e.g., the alias method can possibly be used for this step).Generate an exponentially distributed random variable $X$$X$ with rate parameter $\lambda_i$$\lambda_i$.Return $X$$X$.
References:A.O. Allen, Probability, Statistics, and Queuing Theory with Computer Science Applications, Second Edition, Academic Press, 1990.Boost C++ Libraries, Boost.Math / Statistical Distributions: Hyperexponential Distribution, Online: http://www.boost.org/doc/libs/release/libs/math/doc/html/dist.html , 2014.D.G. Feitelson, Workload Modeling for Computer Systems Performance Evaluation, Cambridge University Press, 2014A. 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.H.T. Papadopolous, C. Heavey and J. Browne, Queueing Theory in Manufacturing Systems Analysis and Design, Chapman & Hall/CRC, 1993, p. 35.R.F. Rosin, Determining a computing center environment, Communications of the ACM 8(7):463-468, 1965.K.S. Trivedi, Probability and Statistics with Reliability, Queueing, and Computer Science Applications, John Wiley & Sons, Inc., 2002.J. Tyszer, Object-Oriented Computer Simulation of Discrete-Event Systems, Springer, 1999.Wikipedia, Hyperexponential Distribution, Online: http://en.wikipedia.org/wiki/Hyperexponential_distribution , 2014.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_distributionstd::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]).ProbIterTThe 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. ProbIterTThe 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. RateIterTThe iterator to the beginning of the range of non-negative real elements representing the rates. RateIterTThe 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:ISO, ISO/IEC 14882-2014: Information technology - Programming languages - C++, 2014Must 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 *0Constructs 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]). RateIterTThe iterator to the beginning of the range of non-negative real elements representing the rates. RateIterTThe 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 *0Constructs 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:ISO, ISO/IEC 14882-2014: Information technology - Programming languages - C++, 2014Must 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:ISO, ISO/IEC 14882-2014: Information technology - Programming languages - C++, 2014std::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:ISO, ISO/IEC 14882-2014: Information technology - Programming languages - C++, 2014friend 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 boolconst param_type &const param_type &Returns true if the two sets of parameters are the same. friend boolconst param_type &const param_type &Returns true if the two sets of parameters are the different. RealTRealTRealTMust 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. RealTMust 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_tReturns 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. RealTReturns the smallest value that the distribution can produce. RealTReturns the largest value that the distribution can produce. param_typeReturns the parameters of the distribution. voidparam_type const &Sets the parameters of the distribution. voidEffects: 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]).ProbIterTThe 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. ProbIterTThe 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. RateIterTThe iterator to the beginning of the range of non-negative real elements representing the rates. RateIterTThe 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:ISO, ISO/IEC 14882-2014: Information technology - Programming languages - C++, 2014Must 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 *0Constructs 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]). RateIterTThe iterator to the beginning of the range of non-negative real elements representing the rates. RateIterTThe 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 *0Constructs 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:ISO, ISO/IEC 14882-2014: Information technology - Programming languages - C++, 2014Must 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:ISO, ISO/IEC 14882-2014: Information technology - Programming languages - C++, 2014std::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:ISO, ISO/IEC 14882-2014: Information technology - Programming languages - C++, 2014friend 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 boolconst hyperexponential_distribution &const hyperexponential_distribution &Returns true if the two instances of hyperexponential_distribution will return identical sequences of values given equal generators. friend boolconst 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_tAn 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 EngineUIntTypeEngine::result_typeconst boolconstexpr result_typeReturns the smallest value that the generator can produce. constexpr result_typeReturns the largest value that the generator can produce. voidSeeds an independent_bits_engine using the default seed of the base generator. voidbase_result_typeSeeds an independent_bits_engine, using seed as the seed for the base generator. voidSeedSeq &Seeds an independent_bits_engine, using seq to seed the base generator. voidIt &ItSeeds 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_typeReturns the next value of the generator. voidIterIterFills a range with random values voidboost::uintmax_tAdvances 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_typeConstructs 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 &ItContructs 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 boolconst independent_bits_engine &const independent_bits_engine &Returns: true iff the two independent_bits_engines will produce the same sequence of values. friend boolconst independent_bits_engine &const independent_bits_engine &Returns: true iff the two independent_bits_engines will produce different sequences of values. IntTypeIntTypeIntTypeInstantiations 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. IntTypeconst boolconst result_typeconst result_typeconst result_typeconst IntTypeconstexpr result_typeconstexpr result_typevoidCalls seed(default_seed) voidIntTypeIf 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). voidSeedSeq &Seeds an inversive_congruential_engine using values from a SeedSeq. voidIt &Itseeds 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. IntTypeReturns the next output of the generator. voidIterIterFills a range with random values voidboost::uintmax_tAdvances the state of the generator by z. Constructs an inversive_congruential_engine, seeding it with the default seed. IntTypeConstructs 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 &ItConstructs 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 boolconst inversive_congruential_engine &const inversive_congruential_engine &Returns true if the two generators will produce identical sequences of outputs. friend boolconst 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 >intunsigned intunsigned intInstantiations 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. RealTypeconst boolconst intconst unsigned intconst unsigned intconst boost::uint32_tvoidCalls seed(default_seed). voidboost::uint32_tConstructs 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. voidSeedSeq &Seeds this lagged_fibonacci_01_engine using values produced by seq.generate. voidIt &ItSeeds 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_typeReturns the next value of the generator. voidIterIterFills a range with random values voidboost::uintmax_tAdvances the state of the generator by z. Constructs a lagged_fibonacci_01 generator and calls seed(). uint32_tConstructs a lagged_fibonacci_01 generator and calls seed(value). SeedSeq &Constructs a lagged_fibonacci_01 generator and calls seed(gen). It &Itconstexpr result_typeReturns the smallest value that the generator can produce. constexpr result_typeReturns 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 boolconst lagged_fibonacci_01_engine &const lagged_fibonacci_01_engine &Returns true if the two generators will produce identical sequences of outputs. friend boolconst lagged_fibonacci_01_engine &const lagged_fibonacci_01_engine &Returns true if the two generators will produce different sequences of outputs. intunsigned intunsigned intInstantiations 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. UIntTypeconst boolconst intconst unsigned intconst unsigned intconst UIntTypeconstexpr result_typeReturns the smallest value that the generator can produce. constexpr result_typeReturns the largest value that the generator can produce. voidCalls seed(default_seed). voidUIntTypeSets the state of the generator to values produced by a minstd_rand0 generator. voidSeedSeq &Sets the state of the generator using values produced by seq. voidIt &ItSets 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_typeReturns the next value of the generator. voidIterIterFills a range with random values voidboost::uintmax_tAdvances the state of the generator by z. Creates a new lagged_fibonacci_engine and calls seed(). UIntTypeCreates a new lagged_fibonacci_engine and calls seed(value). SeedSeq &Creates a new lagged_fibonacci_engine and calls seed(seq). It &ItCreates 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 boolconst lagged_fibonacci_engine &const lagged_fibonacci_engine &Returns true if the two generators will produce identical sequences of outputs. friend boolconst lagged_fibonacci_engine &const lagged_fibonacci_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 >doubleThe 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_distributionRealTypeReturns the "mean" parameter of the distribtuion. RealTypeReturns the "beta" parameter of the distribution. RealType0.0RealType1.0Constructs 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 boolconst param_type &const param_type &Returns true if the two sets of parameters are the same. friend boolconst param_type &const param_type &Returns true if the two sets of parameters are the different. RealTypeRealTypeRealTypeURNG &Returns a random variate distributed according to the laplace distribution. RealTypeURNG &const param_type &Returns a random variate distributed accordint to the laplace distribution with parameters specified by param. RealTypeReturns the "mean" parameter of the distribution. RealTypeReturns the "beta" parameter of the distribution. RealTypeReturns the smallest value that the distribution can produce. RealTypeReturns the largest value that the distribution can produce. param_typeReturns the parameters of the distribution. voidconst param_type &Sets the parameters of the distribution. voidEffects: Subsequent uses of the distribution do not depend on values produced by any engine prior to invoking reset. RealType0.0RealType1.0Constructs 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 boolconst laplace_distribution &const laplace_distribution &Returns true if the two instances of laplace_distribution will return identical sequences of values given equal generators. friend boolconst laplace_distribution &const laplace_distribution &Returns true if the two instances of laplace_distribution will return different sequences of values given equal generators. IntTypeIntTypeIntTypeInstantiations 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. IntTypeconst boolconst IntTypeconst IntTypeconst IntTypeconst IntTypevoidCalls seed(default_seed) voidIntTypeIf 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). voidSeedSeq &Seeds a linear_congruential_engine using values from a SeedSeq. voidIt &Itseeds 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. IntTypeReturns the next value of the linear_congruential_engine. voidIterIterFills a range with random values voidboost::uintmax_tAdvances the state of the generator by z. Constructs a linear_congruential_engine, using the default seed IntTypeConstructs 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 &ItConstructs 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. constexpr result_typeReturns the smallest value that the linear_congruential_engine can produce. constexpr result_typeReturns 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_tconst boolconstexpr uint32_tReturns the smallest value that the generator can produce constexpr uint32_tReturns the largest value that the generator can produce voidSeeds the generator with the default seed. voidresult_typeChanges the current value x(n) of the generator to (x0 << 16) | 0x330e. voidIt &ItSeeds the generator using values from an iterator range, and updates first to point one past the last value consumed. voidSeedSeq &Seeds the generator with values produced by seq.generate(). uint32_tReturns the next value of the generator. voidboost::uintmax_tAdvances the state of the generator by z. voidIterIterFills a range with random values Seeds the generator with the default seed. result_typeConstructs a rand48 generator with x(0) := (x0 << 16) | 0x330e. SeedSeq &Seeds the generator with values produced by seq.generate(). It &ItSeeds 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 boolconst rand48 &const rand48 &Returns true if the two generators will produce identical sequences of values. friend boolconst 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 >intintintintInstatiations 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.
UIntTypeconst boolconst intconst intconst intconst intconst UIntTypeconstexpr result_typeReturns the smallest value that the generator can produce. constexpr result_typeReturns the largest value that the generator can produce. voidSeeds a linear_feedback_shift_engine with the default seed. voidUIntTypeSeeds a linear_feedback_shift_engine with s0. voidSeedSeq &Seeds a linear_feedback_shift_engine with values produced by seq.generate(). voidIt &ItSeeds a linear_feedback_shift_engine with values from the range [first, last). result_typeReturns the next value of the generator. voidIterIterFills a range with random values voidboost::uintmax_tAdvances the state of the generator by z. Constructs a linear_feedback_shift_engine, using the default seed. UIntTypeConstructs a linear_feedback_shift_engine, seeding it with s0. SeedSeq &Constructs a linear_feedback_shift_engine, seeding it with seq. It &ItConstructs 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 boolconst linear_feedback_shift_engine &const linear_feedback_shift_engine &Returns true if the two generators will produce identical sequences of outputs. friend boolconst linear_feedback_shift_engine &const linear_feedback_shift_engine &Returns true if the two generators will produce different sequences of outputs. doubleInstantiations 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_distributionRealTypeReturns the "m" parameter of the distribution. RealTypeReturns the "s" parameter of the distribution. RealType0.0RealType1.0Constructs 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 boolconst param_type &const param_type &Returns true if the two sets of parameters are equal. friend boolconst param_type &const param_type &Returns true if the two sets of parameters are different. normal_distribution< RealType >::input_typeRealTypeRealTypeReturns the m parameter of the distribution. RealTypeReturns the s parameter of the distribution. RealTypeReturns the smallest value that the distribution can produce. RealTypeReturns the largest value that the distribution can produce. param_typeReturns the parameters of the distribution. voidconst param_type &Sets the parameters of the distribution. voidEffects: Subsequent uses of the distribution do not depend on values produced by any engine prior to invoking reset. result_typeEngine &Returns a random variate distributed according to the lognormal distribution. result_typeEngine &const param_type &Returns a random variate distributed according to the lognormal distribution with parameters specified by param. RealType0.0RealType1.0Constructs 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 boolconst lognormal_distribution &const lognormal_distribution &Returns true if the two distributions will produce identical sequences of values given equal generators. friend boolconst lognormal_distribution &const lognormal_distribution &Returns true if the two distributions may produce different sequences of values given equal generators. std::size_tstd::size_tstd::size_tstd::size_tUIntTypestd::size_tUIntTypestd::size_tUIntTypestd::size_tUIntTypestd::size_tUIntTypeInstantiations 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. UIntTypeconst std::size_tconst std::size_tconst std::size_tconst std::size_tconst UIntTypeconst std::size_tconst UIntTypeconst std::size_tconst UIntTypeconst std::size_tconst UIntTypeconst std::size_tconst UIntTypeconst UIntTypeconst UIntTypeconst std::size_tconst std::size_tconst UIntTypeconst std::size_tconst UIntTypeconst std::size_tconst boolvoidCalls seed(default_seed). voidUIntTypeSets 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(). voidSeeqSeq &Seeds a mersenne_twister_engine using values produced by seq.generate(). voidIt &ItSets the state of the generator using values from an iterator range. result_typeProduces the next value of the generator. voidIterIterFills a range with random values voidboost::uintmax_tAdvances the state of the generator by z steps. Equivalent tofor(unsigned long long i = 0; i < z; ++i) {
gen();
}
Constructs a mersenne_twister_engine and calls seed(). UIntTypeConstructs a mersenne_twister_engine and calls seed(value). It &ItSeedSeq &Constructs a mersenne_twister_engine and calls seed(gen). The copy constructor will always be preferred over the templated constructor. constexpr result_typeReturns the smallest value that the generator can produce. constexpr result_typeReturns 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::ostreamfriend std::basic_istream< CharT, Traits > &std::basic_istream< CharT, Traits > &mersenne_twister_engine &Reads a mersenne_twister_engine from a std::istreamfriend boolconst 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 boolconst 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 >intunsigned intboost::int64_tInstantiations of class template mixmax_engine model, pseudo-random number generator . It uses the MIXMAX generator algorithms from:
G.K.Savvidy and N.G.Ter-Arutyunian, On the Monte Carlo simulation of physical systems, J.Comput.Phys. 97, 566 (1991); Preprint EPI-865-16-86, Yerevan, Jan. 1986 http://dx.doi.org/10.1016/0021-9991(91)90015-DK.Savvidy The MIXMAX random number generator Comp. Phys. Commun. 196 (2015), pp 161–165 http://dx.doi.org/10.1016/j.cpc.2015.06.003K.Savvidy and G.Savvidy Spectrum and Entropy of C-systems. MIXMAX random number generator Chaos, Solitons & Fractals, Volume 91, (2016) pp. 33–38 http://dx.doi.org/10.1016/j.chaos.2016.05.003
The generator crucially depends on the choice of the parameters. The valid sets of parameters are from the published papers above. boost::array< boost::uint64_t, Ndim >boost::uint64_tintboost::uint64_tconst boost::uint64_tconst boost::uint64_tconst boolconst intThe main internal parameter, size of the defining MIXMAX matrix. BOOST_STATIC_CONSTEXPR result_typeBOOST_STATIC_CONSTEXPR result_typevoidboost::uint64_tdefault_seedseed with one 64-bit seed voidIt &ItSets the state of the generator using values from an iterator range. voidSeeqSeq &Sets the state of the generator using values from a seed_seq. boost::uint64_treturn one uint64 between min=0 and max=2^61-1 voidIterIterFills a range with random values voidboost::uint64_tdiscard n steps, required in boost::random Constructor, unit vector as initial state, acted on by A^2^512. boost::uint64_tConstructor, one 64-bit seed. < constructor, one uint64_t seed, random numbers are statistically independent from any two distinct seeds, e.g. consecutive seeds are ok uint32_tuint32_tuint32_tuint32_tConstructor, four 32-bit seeds for 128-bit seeding flexibility. It &ItSeedSeq &friend std::basic_ostream< CharT, Traits > &std::basic_ostream< CharT, Traits > &const mixmax_engine &save the state of the RNG to a stream friend std::basic_istream< CharT, Traits > &std::basic_istream< CharT, Traits > &mixmax_engine &read the state of the RNG from a stream boost::uint64_tboost::uint64_tboost::uint64_tboost::uint64_tvoidrng_state_t *unsigned intvoidrng_state_t *uint32_tuint32_tuint32_tuint32_tboost::uint64_tboost::uint64_t *boost::uint64_tboost::uint64_tboost::uint64_t *boost::uint64_t *uint32_tuint32_tuint32_tuint32_tboost::uint64_tboost::uint64_tboost::uint64_tboost::uint64_tboost::uint64_tboost::uint64_tboost::uint64_tInstantiation with a valid parameter set. mixmax_engine< 17, 36, 0 >intdoubleThe 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_distributionIntTypeReturns the k parameter of the distribution. RealTypeReturns the p parameter of the distribution. IntType1RealType0.5Construct 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 > ¶m_type &Reads the parameters of the distribution from a std::istream. friend boolconst param_type &const param_type &Returns true if the parameters have the same values. friend boolconst param_type &const param_type &Returns true if the parameters have different values. IntTypeRealTypeIntTypeURNG &Returns a random variate distributed according to the negative binomial distribution. IntTypeURNG &const param_type &Returns a random variate distributed according to the negative binomial distribution with parameters specified by param. IntTypeReturns the k parameter of the distribution. RealTypeReturns the p parameter of the distribution. IntTypeReturns the smallest value that the distribution can produce. IntTypeReturns the largest value that the distribution can produce. param_typeReturns the parameters of the distribution. voidconst param_type &Sets parameters of the distribution. voidEffects: Subsequent uses of the distribution do not depend on values produced by any engine prior to invoking reset. IntType1RealType0.5Construct 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 boolconst negative_binomial_distribution &const negative_binomial_distribution &Returns true if the two distributions will produce the same sequence of values, given equal generators. friend boolconst negative_binomial_distribution &const negative_binomial_distribution &Returns true if the two distributions could produce different sequences of values, given equal generators. unsigneddefault_niederreiter_base2_tableInstantiations of class template niederreiter_base2_engine model a quasi-random number generator . The niederreiter_base2_engine uses the algorithm described in
niederreiter_base2_engine skips trivial zeroes at the start of the sequence. For example, the beginning of the 2-dimensional Niederreiter base 2 sequence in uniform_01 distribution will look like this: 0.5, 0.5,
0.75, 0.25,
0.25, 0.75,
0.375, 0.375,
0.875, 0.875,
...
In the following documentation X denotes the concrete class of the template niederreiter_base2_engine returning objects of type UIntType, u and v are the values of X.Some member functions may throw exceptions of type std::range_error. This happens when the quasi-random domain is exhausted and the generator cannot produce any more values. The length of the low discrepancy sequence is given by $L=Dimension \times (2^{w} - 1)$$L=Dimension \times (2^{w} - 1)$. UIntTypestd::size_tReturns: The dimension of of the quasi-random domain.Throws: nothing. voidThrows: nothing. Effects: Resets the quasi-random number generator state to the one given by the default construction. Equivalent to u.seed(0). voidUIntTypeThrows: range_error. Effects: Effectively sets the quasi-random number generator state to the init-th vector in the s-dimensional quasi-random domain, where s == X::dimension(). X u, v;
for(int i = 0; i < N; ++i)
for( std::size_t j = 0; j < u.dimension(); ++j )
u();
v.seed(N);
assert(u() == v());
result_typeReturns: Returns a successive element of an s-dimensional (s = X::dimension()) vector at each invocation. When all elements are exhausted, X::operator() begins anew with the starting element of a subsequent s-dimensional vector.Throws: range_error. voidboost::uintmax_tEffects: Advances *this state as if z consecutive X::operator() invocations were executed. X u = v;
for(int i = 0; i < N; ++i)
u();
v.discard(N);
assert(u() == v());
Throws: range_error. std::size_tEffects: Constructs the default s-dimensional Niederreiter base 2 quasi-random number generator.Throws: bad_alloc, invalid_argument, range_error. constexpr result_typeReturns: Tight lower bound on the set of values returned by operator().Throws: nothing. constexpr result_typeReturns: Tight upper bound on the set of values returned by operator().Throws: nothing. friend boolconst niederreiter_base2_engine &const niederreiter_base2_engine &Returns true if the two generators will produce identical sequences of outputs. friend boolconst niederreiter_base2_engine &const niederreiter_base2_engine &Returns true if the two generators will produce different sequences of outputs. friend std::basic_ostream< CharT, Traits > &std::basic_ostream< CharT, Traits > &const niederreiter_base2_engine &Writes the textual representation of the generator to a std::ostream. friend std::basic_istream< CharT, Traits > &std::basic_istream< CharT, Traits > &const niederreiter_base2_engine &Reads the textual representation of the generator from a std::istream. This specialization of niederreiter_base2_engine supports up to 4720 dimensions.
Binary irreducible polynomials (primes in the ring GF(2)[X], evaluated at X=2) were generated while condition max(prime) < 216 was satisfied.There are exactly 4720 such primes, which yields a Niederreiter base 2 table for 4720 dimensions.However, it is possible to provide your own table to niederreiter_base2_engine should the default one be insufficient. niederreiter_base2_engine< boost::uint_least64_t, 64u, default_niederreiter_base2_table >doubleThe 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_distributionRealTypeReturns the k parameter of the distribution RealTypeReturns the lambda parameter of the distribution RealType1RealType1Constructs 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 boolconst param_type &const param_type &Returns true if the parameters have the same values. friend boolconst param_type &const param_type &Returns true if the parameters have different values. RealTypeRealTypeRealTypeURNG &const param_type &Returns a random variate distributed according to the non central chi squared distribution specified by param. RealTypeURNG &Returns a random variate distributed according to the non central chi squared distribution. RealTypeReturns the k parameter of the distribution. RealTypeReturns the lambda parameter of the distribution. param_typeReturns the parameters of the distribution. voidconst param_type &Sets parameters of the distribution. voidResets the distribution, so that subsequent uses does not depend on values already produced by it. RealTypeReturns the smallest value that the distribution can produce. RealTypeReturns the largest value that the distribution can produce. RealType1RealType1Construct 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 boolconst 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 boolconst 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. doubleInstantiations 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_distributionRealTypeReturns the mean of the distribution. RealTypeReturns the standand deviation of the distribution. RealType0.0RealType1.0Constructs 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 boolconst param_type &const param_type &Returns true if the two sets of parameters are the same. friend boolconst param_type &const param_type &Returns true if the two sets of parameters are the different. RealTypeRealTypeRealTypeReturns the mean of the distribution. RealTypeReturns the standard deviation of the distribution. RealTypeReturns the smallest value that the distribution can produce. RealTypeReturns the largest value that the distribution can produce. param_typeReturns the parameters of the distribution. voidconst param_type &Sets the parameters of the distribution. voidEffects: Subsequent uses of the distribution do not depend on values produced by any engine prior to invoking reset. result_typeEngine &Returns a normal variate. result_typeURNG &const param_type &Returns a normal variate with parameters specified by param. const RealType &0.0const RealType &1.0Constructs 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 boolconst normal_distribution &const normal_distribution &Returns true if the two instances of normal_distribution will return identical sequences of values given equal generators. friend boolconst normal_distribution &const normal_distribution &Returns true if the two instances of normal_distribution will return different sequences of values given equal generators. doubledoubleThe class piecewise_constant_distribution models a random distribution . piecewise_constant_distributionfriend 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 boolconst param_type &const param_type &Returns true if the two sets of parameters are the same. friend boolconst 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). IntervalIterIntervalIterWeightIterConstructs 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 > &FConstructs 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_tRealTypeRealTypeFConstructs 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_tRealTypeRealTypeURNG &Returns a value distributed according to the parameters of the piecewist_constant_distribution. RealTypeURNG &const param_type &Returns a value distributed according to the parameters specified by param. result_typeReturns the smallest value that the distribution can produce. result_typeReturns 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_typeReturns the parameters of the distribution. voidconst param_type &Sets the parameters of the distribution. voidEffects: 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). IntervalIterIntervalIterWeightIterConstructs 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 >FConstructs 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_tRealTypeRealTypeFConstructs 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::istreamfriend boolconst 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 boolconst piecewise_constant_distribution &const piecewise_constant_distribution &Returns true if the two distributions may return different sequences of values, when passed equal generators. doubleThe class piecewise_linear_distribution models a random distribution . piecewise_linear_distributionfriend 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 boolconst param_type &const param_type &Returns true if the two sets of parameters are the same. friend boolconst 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). IntervalIterIntervalIterWeightIterConstructs 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 > &FConstructs 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_tRealTypeRealTypeFConstructs 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_tRealTypeRealTypeURNG &Returns a value distributed according to the parameters of the piecewise_linear_distribution. RealTypeURNG &const param_type &Returns a value distributed according to the parameters specified by param. result_typeReturns the smallest value that the distribution can produce. result_typeReturns 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_typeReturns the parameters of the distribution. voidconst param_type &Sets the parameters of the distribution. voidEffects: 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). IntervalIterIntervalIterWeightIterConstructs 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 >FConstructs 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_tRealTypeRealTypeFConstructs 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::istreamfriend boolconst 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 boolconst piecewise_linear_distribution &const piecewise_linear_distribution &Returns true if the two distributions may return different sequences of values, when passed equal generators. intdoubleAn 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_distributionRealTypeRealType1Construct 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 > ¶m_type &Reads the parameters of the distribution from a std::istream. friend boolconst param_type &const param_type &Returns true if the parameters have the same values. friend boolconst param_type &const param_type &Returns true if the parameters have different values. IntTypeRealTypeIntTypeURNG &Returns a random variate distributed according to the poisson distribution. IntTypeURNG &const param_type &Returns a random variate distributed according to the poisson distribution with parameters specified by param. RealTypeReturns the "mean" parameter of the distribution. IntTypeReturns the smallest value that the distribution can produce. IntTypeReturns the largest value that the distribution can produce. param_typeReturns the parameters of the distribution. voidconst param_type &Sets parameters of the distribution. voidEffects: Subsequent uses of the distribution do not depend on values produced by any engine prior to invoking reset. RealType1Constructs 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 boolconst poisson_distribution &const poisson_distribution &Returns true if the two distributions will produce the same sequence of values, given equal generators. friend boolconst poisson_distribution &const poisson_distribution &Returns true if the two distributions could produce different sequences of values, given equal generators. noncopyableClass 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 LinuxOn 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 WindowsOn the Windows operating system, token is interpreted as the name of a cryptographic service provider. By default random_device uses MS_DEF_PROV.PerformanceThe 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.Platformtime per invocation [microseconds] Windows 2.9 Linux 1.7 The measurement error is estimated at +/- 1 usec. unsigned intconst boolconstexpr result_typeReturns the smallest value that the random_device can produce. constexpr result_typeReturns the largest value that the random_device can produce. doubleReturns: 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 intReturns a random value in the range [min, max]. voidIterIterFills 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. longInstantiations 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. URNGIntTypeIntTyperesult_typeargument_typeReturns 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_tvoidIterIterFills 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_tReturns the size of the sequence. voidIterWrites 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. IterIterInitializes the sequence from an iterator range. const Range &Initializes the sequence from Boost.Range range. std::size_tInstatiations 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. UniformRandomNumberGeneratorbase_type::result_typeconst boolconst std::size_tconst std::size_tvoidvoidresult_typeInvokes 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. voidSeedSeq &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. voidIt &Itconst base_type &result_typevoidboost::uintmax_tAdvances the generator by z steps. voidIterIterFills 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_typeConstructs 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 &Itconstexpr result_typeReturns the smallest value that the generator can produce. constexpr result_typeReturns 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 boolconst shuffle_order_engine &const shuffle_order_engine &Returns true if the two generators will produce identical sequences. friend boolconst 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 >unsigneddefault_sobol_tableInstantiations of class template sobol_engine model a quasi-random number generator . The sobol_engine uses the algorithm described in
sobol_engine skips trivial zeroes at the start of the sequence. For example, the beginning of the 2-dimensional Sobol sequence in uniform_01 distribution will look like this: 0.5, 0.5,
0.75, 0.25,
0.25, 0.75,
0.375, 0.375,
0.875, 0.875,
...
In the following documentation X denotes the concrete class of the template sobol_engine returning objects of type UIntType, u and v are the values of X.Some member functions may throw exceptions of type std::range_error. This happens when the quasi-random domain is exhausted and the generator cannot produce any more values. The length of the low discrepancy sequence is given by $L=Dimension \times (2^{w} - 1)$$L=Dimension \times (2^{w} - 1)$. UIntTypestd::size_tReturns: The dimension of of the quasi-random domain.Throws: nothing. voidThrows: nothing. Effects: Resets the quasi-random number generator state to the one given by the default construction. Equivalent to u.seed(0). voidUIntTypeThrows: range_error. Effects: Effectively sets the quasi-random number generator state to the init-th vector in the s-dimensional quasi-random domain, where s == X::dimension(). X u, v;
for(int i = 0; i < N; ++i)
for( std::size_t j = 0; j < u.dimension(); ++j )
u();
v.seed(N);
assert(u() == v());
result_typeReturns: Returns a successive element of an s-dimensional (s = X::dimension()) vector at each invocation. When all elements are exhausted, X::operator() begins anew with the starting element of a subsequent s-dimensional vector.Throws: range_error. voidboost::uintmax_tEffects: Advances *this state as if z consecutive X::operator() invocations were executed. X u = v;
for(int i = 0; i < N; ++i)
u();
v.discard(N);
assert(u() == v());
Throws: range_error. std::size_tEffects: Constructs the default s-dimensional Sobol quasi-random number generator.Throws: bad_alloc, invalid_argument, range_error. constexpr result_typeReturns: Tight lower bound on the set of values returned by operator().Throws: nothing. constexpr result_typeReturns: Tight upper bound on the set of values returned by operator().Throws: nothing. friend boolconst sobol_engine &const sobol_engine &Returns true if the two generators will produce identical sequences of outputs. friend boolconst sobol_engine &const sobol_engine &Returns true if the two generators will produce different sequences of outputs. friend std::basic_ostream< CharT, Traits > &std::basic_ostream< CharT, Traits > &const sobol_engine &Writes the textual representation of the generator to a std::ostream. friend std::basic_istream< CharT, Traits > &std::basic_istream< CharT, Traits > &const sobol_engine &Reads the textual representation of the generator from a std::istream. This specialization of sobol_engine supports up to 3667 dimensions.
Data on the primitive binary polynomials a and the corresponding starting values m for Sobol sequences in up to 21201 dimensions was taken from
S. Joe and F. Y. Kuo, Constructing Sobol sequences with better two-dimensional projections, SIAM J. Sci. Comput. 30, 2635-2654 (2008).
See the original tables up to dimension 21201: https://web.archive.org/web/20170802022909/http://web.maths.unsw.edu.au/~fkuo/sobol/new-joe-kuo-6.21201For practical reasons the default table uses only the subset of binary polynomials a < 216.However, it is possible to provide your own table to sobol_engine should the default one be insufficient. sobol_engine< boost::uint_least64_t, 64u, default_sobol_table >doubleThe 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_distributionRealTypeReturns the number of degrees of freedom of the distribution. RealType1.0Constructs 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 boolconst param_type &const param_type &Returns true if the two sets of parameters are the same. friend boolconst param_type &const param_type &Returns true if the two sets of parameters are the different. RealTypeRealTypeRealTypeURNG &Returns a random variate distributed according to the Student t distribution. RealTypeURNG &const param_type &Returns a random variate distributed accordint to the Student t distribution with parameters specified by param. RealTypeReturns the number of degrees of freedom. RealTypeReturns the smallest value that the distribution can produce. RealTypeReturns the largest value that the distribution can produce. param_typeReturns the parameters of the distribution. voidconst param_type &Sets the parameters of the distribution. voidEffects: Subsequent uses of the distribution do not depend on values produced by any engine prior to invoking reset. RealType1.0Constructs 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 boolconst 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 boolconst 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_tstd::size_tstd::size_tInstantiations 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.
RealTypeconst boolconst std::size_tconst std::size_tconst std::size_tconst boost::uint32_tvoidSeeds the generator with the default seed. voidboost::uint32_tSeeds the generator with value. voidSeedSeq &Seeds the generator with values produced by seq.generate(). voidIt &ItSeeds 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_typeReturns the next value of the generator. voidboost::uintmax_tAdvances the state of the generator by z. voidIterIterFills a range with random values. Creates a new subtract_with_carry_01_engine using the default seed. boost::uint32_tCreates 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 &ItCreates 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. constexpr result_typeReturns the smallest value that the generator can produce. constexpr result_typeReturns 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 boolconst subtract_with_carry_01_engine &const subtract_with_carry_01_engine &Returns true if the two generators will produce identical sequences. friend boolconst subtract_with_carry_01_engine &const subtract_with_carry_01_engine &Returns true if the two generators will produce different sequences. std::size_tstd::size_tstd::size_tInstantiations 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.
IntTypeconst std::size_tconst std::size_tconst std::size_tconst uint32_tconst boolconst result_typevoidSeeds the generator with the default seed. voidIntTypevoidSeedSeq &Seeds the generator with values produced by seq.generate(). voidIt &ItSeeds 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_typeReturns the next value of the generator. voidboost::uintmax_tAdvances the state of the generator by z. voidItItFills a range with random values. Constructs a new subtract_with_carry_engine and seeds it with the default seed. IntTypeConstructs 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 &ItConstructs 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. constexpr result_typeReturns the smallest value that the generator can produce. constexpr result_typeReturns 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 boolconst subtract_with_carry_engine &const subtract_with_carry_engine &Returns true if the two generators will produce identical sequences of values. friend boolconst subtract_with_carry_engine &const subtract_with_carry_engine &Returns true if the two generators will produce different sequences of values. 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 >integral_constant< bool, boost::is_integral< T >::value||(std::numeric_limits< T >::is_integer)>Traits class that indicates whether type T is an integer. integral_constant< 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. 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 typeshould 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 typeshould 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. doubleInstantiations 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_distributionRealTypeReturns the minimum value of the distribution. RealTypeReturns the mode of the distribution. RealTypeReturns the maximum value of the distribution. RealType0.0RealType0.5RealType1.0Constructs 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 boolconst param_type &const param_type &Returns true if the two sets of parameters are equal. friend boolconst param_type &const param_type &Returns true if the two sets of parameters are different. RealTypeRealTyperesult_typeReturns the a parameter of the distribution result_typeReturns the b parameter of the distribution result_typeReturns the c parameter of the distribution RealTypeReturns the smallest value that the distribution can produce. RealTypeReturns the largest value that the distribution can produce. param_typeReturns the parameters of the distribution. voidconst param_type &Sets the parameters of the distribution. voidEffects: Subsequent uses of the distribution do not depend on values produced by any engine prior to invoking reset. result_typeEngine &Returns a random variate distributed according to the triangle distribution. result_typeEngine &const param_type &Returns a random variate distributed according to the triangle distribution with parameters specified by param. RealType0.0RealType0.5RealType1.0Constructs 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 boolconst triangle_distribution &const triangle_distribution &Returns true if the two distributions will produce identical sequences of values given equal generators. friend boolconst triangle_distribution &const triangle_distribution &Returns true if the two distributions may produce different sequences of values given equal generators. doubleThe 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. RealTypeRealTyperesult_typeresult_typevoidresult_typeEngine &intThe 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_distributionIntTypeReturns the minimum value of the distribution. IntTypeReturns the maximum value of the distribution. IntType0IntType(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 boolconst param_type &const param_type &Returns true if the two sets of parameters are equal. friend boolconst param_type &const param_type &Returns true if the two sets of parameters are different. IntTypeIntTypeIntTypeReturns the minimum value of the distribution IntTypeReturns the maximum value of the distribution IntTypeReturns the minimum value of the distribution IntTypeReturns the maximum value of the distribution param_typeReturns the parameters of the distribution. voidconst param_type &Sets the parameters of the distribution. voidEffects: Subsequent uses of the distribution do not depend on values produced by any engine prior to invoking reset. result_typeEngine &Returns an integer uniformly distributed in the range [min, max]. result_typeEngine &const param_type &Returns an integer uniformly distributed in the range [param.a(), param.b()]. IntType0IntType(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 boolconst uniform_int_distribution &const uniform_int_distribution &Returns true if the two distributions will produce identical sequences of values given equal generators. friend boolconst uniform_int_distribution &const uniform_int_distribution &Returns true if the two distributions may produce different sequences of values given equal generators. doublestd::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_sphereintReturns the dimension of the sphere. int2Constructs 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 boolconst param_type &const param_type &Returns true if the two sets of parameters are equal. friend boolconst param_type &const param_type &Returns true if the two sets of parameters are different. RealTypeContintReturns the dimension of the sphere. param_typeReturns the parameters of the distribution. voidconst param_type &Sets the parameters of the distribution. result_typeReturns 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_typeReturns 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. voidEffects: 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_typeEngine &const param_type &Returns a point uniformly distributed over the surface of a sphere of dimension param.dim(). int2Constructs 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 boolconst uniform_on_sphere &const uniform_on_sphere &Returns true if the two distributions will produce identical sequences of values, given equal generators. friend boolconst uniform_on_sphere &const uniform_on_sphere &Returns true if the two distributions may produce different sequences of values, given equal generators. doubleThe 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_distributionRealTypeReturns the minimum value of the distribution. RealTypeReturns the maximum value of the distribution. RealType0.0RealType1.0Constructs 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 boolconst param_type &const param_type &Returns true if the two sets of parameters are equal. friend boolconst param_type &const param_type &Returns true if the two sets of parameters are different. RealTypeRealTypeRealTypeReturns the minimum value of the distribution RealTypeReturns the maximum value of the distribution RealTypeReturns the minimum value of the distribution RealTypeReturns the maximum value of the distribution param_typeReturns the parameters of the distribution. voidconst param_type &Sets the parameters of the distribution. voidEffects: Subsequent uses of the distribution do not depend on values produced by any engine prior to invoking reset. result_typeEngine &Returns a value uniformly distributed in the range [min, max). result_typeEngine &const param_type &Returns a value uniformly distributed in the range [param.a(), param.b()). RealType0.0RealType1.0Constructs 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 boolconst uniform_real_distribution &const uniform_real_distribution &Returns true if the two distributions will produce identical sequences of values given equal generators. friend boolconst uniform_real_distribution &const uniform_real_distribution &Returns true if the two distributions may produce different sequences of values given equal generators. intThe 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_smallintIntTypeReturns the minimum value. IntTypeReturns the maximum value. IntType0IntType9constructs 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 boolconst param_type &const param_type &Returns true if the two sets of parameters are equal. friend boolconst param_type &const param_type &Returns true if the two sets of parameters are different. IntTypeIntTyperesult_typeReturns the minimum value of the distribution. result_typeReturns the maximum value of the distribution. result_typeReturns the minimum value of the distribution. result_typeReturns the maximum value of the distribution. param_typeReturns the parameters of the distribution. voidconst param_type &Sets the parameters of the distribution. voidEffects: Subsequent uses of the distribution do not depend on values produced by any engine prior to invoking reset. result_typeEngine &Returns a value uniformly distributed in the range [min(), max()]. result_typeEngine &const param_type &Returns a value uniformly distributed in the range [param.a(), param.b()]. IntType0IntType9Constructs 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 boolconst uniform_smallint &const uniform_smallint &Returns true if the two distributions will produce identical sequences of values given equal generators. friend boolconst 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_typeEngineDistributionDistribution::result_typeresult_typeReturns: distribution()(engine()) result_typeconst 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_typePrecondition: distribution().min() is well-formedReturns: distribution().min() result_typePrecondition: distribution().max() is well-formedReturns: distribution().max() EngineDistributionConstructs 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. doubleThe 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_distributionRealTypeReturns the "a" parameter of the distribtuion. RealTypeReturns the "b" parameter of the distribution. RealType1.0RealType1.0Constructs 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 boolconst param_type &const param_type &Returns true if the two sets of parameters are the same. friend boolconst param_type &const param_type &Returns true if the two sets of parameters are the different. RealTypeRealTypeRealTypeURNG &Returns a random variate distributed according to the weibull_distribution. RealTypeURNG &const param_type &Returns a random variate distributed accordint to the Weibull distribution with parameters specified by param. RealTypeReturns the "a" parameter of the distribution. RealTypeReturns the "b" parameter of the distribution. RealTypeReturns the smallest value that the distribution can produce. RealTypeReturns the largest value that the distribution can produce. param_typeReturns the parameters of the distribution. voidconst param_type &Sets the parameters of the distribution. voidEffects: Subsequent uses of the distribution do not depend on values produced by any engine prior to invoking reset. RealType1.0RealType1.0Constructs 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 boolconst weibull_distribution &const weibull_distribution &Returns true if the two instances of weibull_distribution will return identical sequences of values given equal generators. friend boolconst weibull_distribution &const weibull_distribution &Returns true if the two instances of weibull_distribution will return different sequences of values given equal generators. intintInstantiations 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. URNG1URNG2base1_type::result_typeconst boolconst intconst intvoidCalls seed() for both base generators. voidresult_typeseeds both base generators with v. voidSeedSeq &seeds both base generators with values produced by seq. voidIt &Itseeds 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_typeReturns the next value of the generator. voidIterIterFills a range with random values voidboost::uintmax_tAdvances 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_typeConstructs 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 &ItConstructs 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. constexpr result_typeReturns the smallest value that the generator can produce. constexpr result_typeReturns 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 boolconst xor_combine_engine &const xor_combine_engine &Returns true if the two generators will produce identical sequences. friend boolconst xor_combine_engine &const xor_combine_engine &Returns true if the two generators will produce different sequences.