|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcern.colt.PersistentObject
edu.cornell.lassp.houle.RngPack.RandomElement
edu.cornell.lassp.houle.RngPack.RandomSeedable
edu.cornell.lassp.houle.RngPack.Ranmar
public class Ranmar
RANMAR is a lagged Fibonacci generator proposed by Marsaglia and
Zaman and is a good research grade generator. This version of RANMAR
is based on the paper by James, which is a good reference for the properties
of RANMAR and several other generators.
REFERENCES:
F. James, Comp. Phys. Comm. 60 (1990) p 329-344
and was originally described in
G. Marsaglia, A. Zaman and W.-W Tsang, Stat. Prob. Lett
9 (1990) p 35. More
info .
Source code is available.
| Field Summary | |
|---|---|
static int |
BIG_PRIME
The 46,009,220nd prime number, he largest prime less than 9*108. |
static int |
DEFSEED
Default seed. |
| Constructor Summary | |
|---|---|
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 |
|
| Method Summary | |
|---|---|
java.lang.Object |
clone()
Returns a copy of the receiver; the copy will produce identical sequences. |
double |
raw()
Returns a uniformly distributed pseudo-random double in the range (0,1). |
void |
raw(double[] d,
int n)
A version of the generator for filling arrays, inlined 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, gaussian, gaussian, powlaw, raw, uniform |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static int BIG_PRIME
BIG_PRIME isn't commensurate with any regular period.
BIG_PRIME= 899999963
public static int DEFSEED
DEFSEED=54217137
| Constructor Detail |
|---|
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()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.| Method Detail |
|---|
public java.lang.Object clone()
clone in class PersistentObjectpublic final double raw()
raw in class RandomElementRandomJava
public final void raw(double[] d,
int n)
raw in class RandomElementd - an array of doubles to be filledn - size of the array
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||