|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.jscience.measure.random.RandomElement
org.jscience.measure.random.RandomSeedable
org.jscience.measure.random.MarsagliaGenerator
public class MarsagliaGenerator
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.
| 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 | |
|---|---|
MarsagliaGenerator()
Initialize Ranmar with a default seed taken from Marsaglia and Zaman's paper. |
|
MarsagliaGenerator(java.util.Date d)
Seed RANMAR from the clock. |
|
MarsagliaGenerator(int ijkl)
Initialize Ranmar with a specified integer seed |
|
MarsagliaGenerator(long ijkl)
Initialize Ranmar with a specified long seed |
|
| Method Summary | |
|---|---|
double |
nextDouble()
The generator |
void |
nextDouble(double[] d,
int n)
A version of the generator for filling arrays, inlined for speed |
| Methods inherited from class org.jscience.measure.random.RandomSeedable |
|---|
ClockSeed, ClockSeed |
| Methods inherited from class org.jscience.measure.random.RandomElement |
|---|
choose, choose, clone, coin, coin, gaussian, gaussian, nextDouble, powlaw, uniform |
| Methods inherited from class java.lang.Object |
|---|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static int DEFSEED
DEFSEED=54217137
public static int BIG_PRIME
BIG_PRIME isn't commensurate
with any regular period.
BIG_PRIME= 899999963
| Constructor Detail |
|---|
public MarsagliaGenerator(int ijkl)
ijkl - seed integer; Ranmar(int ijkl) takes uses
ijkl modulus BIG_PRIME as a seed for RANMAR.public MarsagliaGenerator(long ijkl)
ijkl - seed long; Ranmar(long ijkl) takes uses
ijkl modulus BIG_PRIME as a seed for RANMAR.public MarsagliaGenerator()
Ranmar(54217137).
public MarsagliaGenerator(java.util.Date d)
RandomElement e=new Ranmar(new Date());
d - a Date object to seed Ranmar with, typically new Date()| Method Detail |
|---|
public final double nextDouble()
nextDouble in interface RandomGenerator
public final void nextDouble(double[] d,
int n)
nextDouble 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 | ||||||||