nag_rngs_uniform (g05lgc) generates a vector of pseudorandom numbers uniformly distributed over the interval .
If
and
, nag_rngs_uniform (g05lgc) returns the next
values
from a uniform
generator (see
nag_rngs_basic (g05kac) for details).
For other values of
and
, nag_rngs_uniform (g05lgc) applies the transformation
The function ensures that the values
lie in the closed interval
.
If computing sequentially and using the same generator, nag_rngs_uniform (g05lgc) always generates exactly the same pseudorandom numbers as would
consecutive calls of
nag_rngs_basic (g05kac) and on many machines is likely to be much faster.
One of the initialization functions
nag_rngs_init_repeatable (g05kbc) (for a repeatable sequence if computed sequentially) or
nag_rngs_init_nonrepeatable (g05kcc) (for a non-repeatable sequence) must be called prior to the first call to nag_rngs_uniform (g05lgc).
Not applicable.
None.
This example prints five pseudorandom numbers from a uniform distribution between
and
, generated by a single call to nag_rngs_uniform (g05lgc), after initialization by
nag_rngs_init_repeatable (g05kbc).
None.