nag_rand_logical (g05tbc) generates a vector of pseudorandom logical values – Nag_TRUE with probability and Nag_FALSE with probability .
nag_rand_logical (g05tbc) generates
logical values
from the relation
where
is a pseudorandom number from a uniform distribution over
, generated by
nag_rand_basic (g05sac) using the values of
state as input to this function.
One of the initialization functions
nag_rand_init_repeatable (g05kfc) (for a repeatable sequence if computed sequentially) or
nag_rand_init_nonrepeatable (g05kgc) (for a non-repeatable sequence) must be called prior to the first call to nag_rand_logical (g05tbc).
Not applicable.
nag_rand_logical (g05tbc) is threaded by NAG for parallel execution in multithreaded implementations of the NAG Library.
Please consult the
x06 Chapter Introduction for information on how to control and interrogate the OpenMP environment used within this function. Please also consult the
Users' Note for your implementation for any additional implementation-specific information.
None.
This example prints the first
pseudorandom logical values generated by nag_rand_logical (g05tbc) after initialization by
nag_rand_init_repeatable (g05kfc), when the probability of a Nag_TRUE value is
.
None.