|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectedu.cornell.lassp.houle.RngPack.RandomElement
edu.cornell.lassp.houle.RngPack.RandomSeedable
edu.cornell.lassp.houle.RngPack.Ranecu
Ranecu is an advanced multiplicative linear congruential random number
generator with a period of aproximately 1018.
Ranecu is a direct translation from Fortran of the RANECU
subroutine
published in the paper
F. James, Comp. Phys. Comm. 60 (1990) p 329-344
The algorithm was originally described in
P. L'Ecuyer, Commun. ACM. 1988 (1988) p 742
Source code is available.
Field Summary | |
static int |
DEFSEED1
default iseed1 = 12345 |
static int |
DEFSEED2
default iseed2 = 67890 |
Constructor Summary | |
Ranecu()
Initialize |
|
Ranecu(Date d)
|
|
Ranecu(int s1,
int s2)
Initialize |
|
Ranecu(long l)
|
Method Summary | |
long |
getSeed()
|
double |
raw()
The abstract method that must be defined to make a working RandomElement. |
void |
raw(double[] d,
int n)
This is an inline version that returns an array of doubles for speed. |
Methods inherited from class edu.cornell.lassp.houle.RngPack.RandomSeedable |
ClockSeed, ClockSeed |
Methods inherited from class edu.cornell.lassp.houle.RngPack.RandomElement |
choose, choose, clone, coin, coin, gaussian, gaussian, powlaw, raw, uniform |
Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static int DEFSEED1
public static int DEFSEED2
Constructor Detail |
public Ranecu()
public Ranecu(int s1, int s2)
Ranecu(s1*(long) Integer.MAX_VALUE)+s2)
s1
- seed integer 1 (MSW)s2
- seed integer 2 (LSW)public Ranecu(long l)
public Ranecu(Date d)
Method Detail |
public final double raw()
RandomElement
RandomJava
for an example of how to do this.
raw
in class RandomElement
RandomElement.raw()
public final void raw(double[] d, int n)
raw
in class RandomElement
d
- array to be filled with doublesn
- number of doubles to generatepublic long getSeed()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |