public class Ranmar extends RandomSeedable implements java.io.Serializable
Source code is available.
Modifier and Type | Field and Description |
---|---|
static int |
BIG_PRIME
The 46,009,220nd prime number,
he largest prime less than 9*108.
|
(package private) double |
c |
(package private) double |
cd |
(package private) double |
cm |
static int |
DEFSEED
Default seed.
|
(package private) int |
i97 |
(package private) int |
j97 |
(package private) double[] |
u |
(package private) double[] |
uvec |
BMoutput
Constructor and Description |
---|
Ranmar()
Initialize Ranmar with a default seed taken from Marsaglia and
Zaman's paper.
|
Ranmar(java.util.Date d)
Seed RANMAR from the clock.
|
Ranmar(int ijkl)
Initialize Ranmar with a specified integer seed
|
Ranmar(long ijkl)
Initialize Ranmar with a specified long seed
|
Modifier and Type | Method and Description |
---|---|
(package private) void |
ranmarin(int ijkl)
Internal methods: ranmarin is the initialization code for the
generator.
|
double |
raw()
The generator
|
void |
raw(double[] d,
int n)
A version of the generator for filling arrays, inlined for speed
|
ClockSeed, ClockSeed
double c
double cd
double cm
double[] u
double[] uvec
int i97
int j97
public static int DEFSEED
DEFSEED=54217137
public static int BIG_PRIME
BIG_PRIME
isn't commensurate
with any regular period.
BIG_PRIME= 899999963
public Ranmar(int ijkl)
ijkl
- seed integer; Ranmar(int ijkl) takes uses
ijkl modulus BIG_PRIME as a seed for RANMAR.public Ranmar(long ijkl)
ijkl
- seed long; Ranmar(long ijkl) takes uses
ijkl modulus BIG_PRIME as a seed for RANMAR.public Ranmar()
Ranmar(54217137).
public Ranmar(java.util.Date d)
RandomElement e=new Ranmar(new Date());
d
- a Date object to seed Ranmar with, typically new Date()
void ranmarin(int ijkl)
public final double raw()
raw
in class RandomElement
RandomJava
public final void raw(double[] d, int n)
raw
in class RandomElement
d
- an array of doubles to be filledn
- size of the array