|
|||||||||
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.Ranlux
RANLUX is an advanced pseudo-random number generator based on the
RCARRY algorithm proposed in 1991 by Marsaglia and Zaman.
RCARRY
used a subtract-and-borrow algorithm with a period on the order of
10171 but still had detectable correlations between
numbers. Martin Luescher proposed the RANLUX
algorithm in 1993; RANLUX generates pseudo-random numbers using
RCARRY but throws away numbers to destroy correlations.
Thus RANLUX trades execution speed for quality; by choosing a
larger luxury setting one gets better random numbers slower.
By the tests availible at the time it was proposed,
RANLUX at the default luxury setting appears to be a
significant advance quality over previous
generators.
LUXURY LEVELS | ||
level | p | |
0 | 24 | equivalent to the original RCARRY of Marsaglia and Zaman, very long period, but fails many tests. |
1 | 48 | considerable improvement in quality over level 0, now passes the gap test, but still fails spectral test. |
2 | 97 | passes all known tests, but theoretically still defective. |
3 | 223 | DEFAULT VALUE. Any theoretically possible correlations have very small chance of being observed. |
4 | 389 | highest possible luxury, all 24 bits chaotic. |
Ranlux()
Ranlux(0,0)
Ranlux(389,1)
Ranlux(75,0)
Source code is available.
Field Summary | |
static int |
lxdflt
Default luxury level: lxdflt=3 |
static int |
maxlev
Maximum luxury level: maxlev=4 |
Constructor Summary | |
Ranlux()
Default initialization of RANLUX. |
|
Ranlux(Date d)
Initialize RANLUX with default luxury level and a Date object. |
|
Ranlux(int ins)
Initialize RANLUX with default luxury level and a specified seed. |
|
Ranlux(int lux,
Date d)
Initialize RANLUX with specified luxury level and a Date object. |
|
Ranlux(int lux,
int ins)
Initialize RANLUX with specified luxury level and seed. |
|
Ranlux(int lux,
long ins)
Initialize RANLUX with specified luxury level and seed. |
|
Ranlux(long ins)
Initialize RANLUX with default luxury level and a specified seed. |
Method Summary | |
double |
raw()
The random number generator. |
void |
setDiag(boolean b)
Turns diagnostic messages on and off. |
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, raw, uniform |
Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final int maxlev
maxlev=4
public static final int lxdflt
lxdflt=3
Constructor Detail |
public Ranlux()
jsdflt=314159265
and luxury level 3.
public Ranlux(int lux, int ins)
lux
- luxury level from 0-4.ins
- seed, a positive integer.public Ranlux(int lux, long ins)
lux
- luxury level from 0-4.ins
- seed, a positive long.public Ranlux(int ins)
ins
- seed, a positive integerpublic Ranlux(long ins)
ins
- seed, a positive integerpublic Ranlux(int lux, Date d)
RandomElement e = Ranlux(4,new Date());
lux
- luxury level from 0-4.d
- date used to generate seedpublic Ranlux(Date d)
RandomElement e = Ranlux(new Date());
d
- date used to generate seedMethod Detail |
public void setDiag(boolean b)
b
- diagnostic message statuspublic final double raw()
raw
in class RandomElement
RandomJava
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |