public class MRG32k3a extends java.lang.Object implements RandomNumber
Modifier and Type | Field and Description |
---|---|
static double |
a12 |
static long |
A12 |
static double |
a13n |
static long |
A13N |
static double |
a21 |
static long |
A21 |
static double |
a23n |
static long |
A23N |
private double[] |
Cg |
static long |
DIVISOR |
private boolean |
initialized |
static double |
m1 |
static long |
M1 |
static double |
m2 |
static long |
M2 |
private static double |
MULTIPLIER |
static double |
norm |
private long[] |
originalSeeds |
private long[] |
s |
private long |
s10 |
private long |
s11 |
private long |
s12 |
private long |
s20 |
private long |
s21 |
private long |
s22 |
private long |
seed |
Constructor and Description |
---|
MRG32k3a() |
Modifier and Type | Method and Description |
---|---|
double |
draw()
Draws a random number and returns it as U(0,1)
|
long |
drawLong()
Draws a random number and returns it as an integer.
|
double |
getMultiplier()
Returns the value for this RandomNumber needed to scale
a number produced by drawLong to result in U(0,1).
|
long |
getSeed()
Returns the current (not original) seed for this RandomNumber.
|
long[] |
getSeeds()
Gets the current (not original) value of the seeds for this RandomNumber.
|
void |
resetSeed()
Resets seed to last setSeed() value
|
void |
setSeed(long seed)
Set the random number seed for this RandomNumber.
|
void |
setSeeds(long[] seeds)
Sets the seeds of this RandomNumber to the given values.
|
public static final double norm
public static final double m1
public static final double m2
public static final double a12
public static final double a13n
public static final double a21
public static final double a23n
private long seed
private long[] originalSeeds
public static final long DIVISOR
public static final long M1
public static final long M2
public static final long A12
public static final long A13N
public static final long A21
public static final long A23N
private static final double MULTIPLIER
private boolean initialized
private long[] s
private long s10
private long s11
private long s12
private long s20
private long s21
private long s22
private double[] Cg
public long drawLong()
RandomNumber
drawLong
in interface RandomNumber
public double draw()
RandomNumber
draw
in interface RandomNumber
public double getMultiplier()
RandomNumber
getMultiplier
in interface RandomNumber
public long getSeed()
RandomNumber
getSeed
in interface RandomNumber
public void setSeed(long seed)
RandomNumber
setSeed
in interface RandomNumber
seed
- The new random number seedpublic void resetSeed()
RandomNumber
resetSeed
in interface RandomNumber
public void setSeeds(long[] seeds)
RandomNumber
setSeeds
in interface RandomNumber
seeds
- The new array of seedspublic long[] getSeeds()
RandomNumber
getSeeds
in interface RandomNumber