public class Ranmar extends RandomSeedable implements Serializable
Source code is available.
| Modifier and Type | Field and Description |
|---|---|
static int |
BIG_PRIME
The 46,009,220nd prime number,
he largest prime less than 9*108.
|
static int |
DEFSEED
Default seed.
|
| Constructor and Description |
|---|
Ranmar()
Initialize Ranmar with a default seed taken from Marsaglia and
Zaman's paper.
|
Ranmar(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
|
| Modifier and Type | Method and Description |
|---|---|
double |
raw()
The generator
|
void |
raw(double[] d,
int n)
A version of the generator for filling arrays, inlined for speed
|
ClockSeed, ClockSeedpublic static int DEFSEED
DEFSEED=54217137public static int BIG_PRIME
BIG_PRIME isn't commensurate
with any regular period.
BIG_PRIME= 899999963public 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.public Ranmar()
Ranmar(54217137).public Ranmar(Date d)
RandomElement e=new Ranmar(new Date());
d - a Date object to seed Ranmar with, typically new Date()public final double raw()
raw in class RandomElementRandomJavapublic final void raw(double[] d,
int n)
raw in class RandomElementd - an array of doubles to be filledn - size of the arrayCopyright © 2015. All rights reserved.