|
NAG[g05kec] NAG[nag_rngs_logical] - Pseudo-random logical (boolean) value, seeds and generator number passed explicitly
|
|
Calling Sequence
g05kec(p, igen, iseed, 'fail'=fail)
nag_rngs_logical(. . .)
Parameters
|
p - float;
|
|
|
On entry: must contain the probability of nag_rngs_logical (g05kec) returning a true result.
|
|
Constraint: . .
|
|
|
iseed - Vector(1.. , datatype=integer[kernelopts('wordsize')/8]);
|
|
|
On entry: contains values which define the current state of the selected generator.
|
|
On exit: contains updated values defining the new state of the selected generator.
|
|
|
'fail'=fail - table; (optional)
|
|
|
The NAG error argument, see the documentation for NagError.
|
|
|
|
Description
|
|
|
Description
|
|
nag_rngs_logical (g05kec) returns the logical value of the relation
where is a pseudo-random number from a uniform distribution over , generated by g05kac (nag_rngs_basic) using the values of igen and iseed as input to this function.
One of the initialization functions g05kbc (nag_rngs_init_repeatable) (for a repeatable sequence if computed sequentially) or g05kcc (nag_rngs_init_nonrepeatable) (for a non-repeatable sequence) must be called prior to the first call to nag_rngs_logical (g05kec).
|
|
Error Indicators and Warnings
|
|
"NE_BAD_PARAM"
On entry, argument had an illegal value.
"NE_INTERNAL_ERROR"
An internal error has occurred in this function. Check the function call and any array sizes. If the call is correct then please consult NAG for assistance.
"NE_REAL"
On entry, or : .
|
|
|
Examples
|
|
>
|
p := 0.6:
igen := 1:
iseed := Vector([1762543, 9324783, 42344, 742355], datatype=integer[kernelopts('wordsize')/8]):
NAG:-g05kec(p, igen, iseed);
|
|
|
Download Help Document
Was this information helpful?