![]() |
Prev | Next |
include <mztuni.hpp>
s = mztuni_seed(seed)
u = mztuni()
CD = 7654321./167777216.
Using this value in mztuni
does not produce the values in Table 4 of the reference.
Replacing the value above
by the value below does produce the values in Table 4:
CD = 7654321./16777216.
mat2cpp
, this routine
is not in the mat2cpp
namespace and has its own include file.
seed
has prototype
size_t seed
and is used to seed the random number generator.
The function call
CALL RSTART(I, J, K, L)
in the reference above corresponds to
seed = (((L-1)*168 + K-1)*168 + J-1)*168 + I + 1
Note the restriction that
I
,
J
,
K
and
L
are between 1
and 168
and not all equal to 1
; i.e.,
3 <= seed <= 796594177
seed
is equal to one,
the current time is used to choose the actual seed between three
and 796594177.
This actual seed is then used to seed the random number generator.
seed
is equal to zero,
no action is taken.
This case is useful for retrieving the previous seed used
to seed the random number generator.
s
has prototype
size_t s
It is the previous seed that was used to seed the random number generator.
If
seed > 0
,
the
s
corresponds to this call to mztuni_seed
.
u
has prototype
double u
It is sample of a random variable that is uniformly distributed between
the values zero and one.
mztuni
.