PropWare  3.0.0.229 C++ objects and CMake build system for Parallax Propeller
Random Number Generators
Collaboration diagram for Random Number Generators:

## Modules

Random Number Distributions

Discrete Distributions

int x

## Detailed Description

Produces random numbers on a given distribution function using a non-uniform random number generation engine.

Todo:
the engine_value_type needs to be studied more carefully.

Constructs a variate generator with the uniform random number generator __eng for the random distribution __dist.

Exceptions
 Any exceptions which may thrown by the copy constructors of the _Engine or _Dist objects.

Gets the next generated value on the distribution.

WTF?

Gets a reference to the underlying uniform random number generator object.

Gets a const reference to the underlying uniform random number generator object.

Gets a reference to the underlying random distribution.

Gets a const reference to the underlying random distribution.

Gets the closed lower bound of the distribution interval.

Gets the closed upper bound of the distribution interval.

These classes define objects which provide random or pseudorandom numbers, either from a discrete or a continuous interval. The random number generator supplied as a part of this library are all uniform random number generators which provide a sequence of random number uniformly distributed over their range.

A number generator is a function object with an operator() that takes zero arguments and returns a number.

A compliant random number generator must satisfy the following requirements.

 To be documented.

## ◆ x

 _M_p Current index of x

#include <Simple-Libraries/Learn/Examples/Badge/01 Display/07 Box and Lines.c>

The type of the generated random value.

Constructs a default-initialized % subtract_with_carry random number generator.

Constructs an explicitly seeded % subtract_with_carry random number generator.

Constructs a subtract_with_carry random number generator engine seeded from the generator function __g.

Parameters
 __g The seed generator function.

Seeds the initial state $$x_0$$ of the random number generator.

N1688[4.19] modifies this as follows. If __value == 0, sets value to 19780503. In any case, with a linear congruential generator lcg(i) having parameters $$m_{lcg} = 2147483563, a_{lcg} = 40014, c_{lcg} = 0, and lcg(0) = value$$, sets $$x_{-r} \dots x_{-1}$$ to $$lcg(1) \bmod m \dots lcg(r) \bmod m$$ respectively. If $$x_{-1} = 0$$ set carry to 1, otherwise sets carry to 0.

Seeds the initial state $$x_0$$ of the % subtract_with_carry random number generator.

Gets the inclusive minimum value of the range of random integers returned by this generator.

Gets the inclusive maximum value of the range of random integers returned by this generator.

Gets the next random number in the sequence.

Compares two % subtract_with_carry random number generator objects of the same type for equality.

Parameters
 __lhs A % subtract_with_carry random number generator object. __rhs Another % subtract_with_carry random number generator object.
Returns
true if the two objects are equal, false otherwise.

Compares two % subtract_with_carry random number generator objects of the same type for inequality.

Parameters
 __lhs A % subtract_with_carry random number generator object. __rhs Another % subtract_with_carry random number generator object.
Returns
true if the two objects are not equal, false otherwise.

Inserts the current state of a % subtract_with_carry random number generator engine __x into the output stream __os.

Parameters
 __os An output stream. __x A % subtract_with_carry random number generator engine.
Returns
The output stream with the state of __x inserted or in an error state.

Extracts the current state of a % subtract_with_carry random number generator engine __x from the input stream __is.

Parameters
 __is An input stream. __x A % subtract_with_carry random number generator engine.
Returns
The input stream with the state of __x extracted or in an error state.

The Marsaglia-Zaman generator (floats version).

Examples
Queue_Demo.cpp.

Definition at line 13 of file 07 Box and Lines.c.