public class RandomCMWC extends RandomEngine
Implementation of CMWC4096 (Complementary-multiply-with-carry) random number generator by George Marsaglia. The period is approximately 2^131086.
Paper: Marsaglia, George. 2003. Random number generators. Journal of Modern Applied Statistical Methods, 2(1): 2-13. (link)
Weakness: The quality is dependent upon the choice of seed. Some seed actually may weaken the algorithm significantly. A known good seed is 362436. Marsaglia suggested that any seed less than 809430660 is fine, but many detractors criticize that it is not necessarily so.
| Constructor and Description | 
|---|
RandomCMWC()  | 
| Modifier and Type | Method and Description | 
|---|---|
RandomCMWC | 
clone()  | 
double | 
nextDouble()  | 
float | 
nextFloat()  | 
double | 
nextGaussian()  | 
int | 
nextInt()  | 
int | 
nextInt(int n)  | 
long | 
nextLong()  | 
long | 
nextLong(long n)  | 
getSeed, random, setSeedpublic final int nextInt()
nextInt in class RandomEnginepublic final int nextInt(int n)
nextInt in class RandomEnginepublic final long nextLong()
nextLong in class RandomEnginepublic final long nextLong(long n)
nextLong in class RandomEnginepublic final double nextGaussian()
nextGaussian in class RandomEnginepublic double nextDouble()
nextDouble in class RandomEnginepublic float nextFloat()
nextFloat in class RandomEnginepublic RandomCMWC clone()
clone in class RandomEngine