jdistlib.rng
Class RandomCMWC
- java.lang.Object
-
- jdistlib.rng.RandomEngine
-
- jdistlib.rng.RandomCMWC
-
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 Summary
Constructors Constructor and Description RandomCMWC()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description RandomCMWCclone()doublenextDouble()floatnextFloat()doublenextGaussian()intnextInt()intnextInt(int n)longnextLong()longnextLong(long n)-
Methods inherited from class jdistlib.rng.RandomEngine
getSeed, random, setSeed
-
-
-
-
Method Detail
-
nextInt
public final int nextInt()
- Specified by:
nextIntin classRandomEngine
-
nextInt
public final int nextInt(int n)
- Specified by:
nextIntin classRandomEngine
-
nextLong
public final long nextLong()
- Specified by:
nextLongin classRandomEngine
-
nextLong
public final long nextLong(long n)
- Specified by:
nextLongin classRandomEngine
-
nextGaussian
public final double nextGaussian()
- Specified by:
nextGaussianin classRandomEngine
-
nextDouble
public double nextDouble()
- Specified by:
nextDoublein classRandomEngine
-
nextFloat
public float nextFloat()
- Specified by:
nextFloatin classRandomEngine
-
clone
public RandomCMWC clone()
- Specified by:
clonein classRandomEngine
-
-
DMelt 3.0 © DataMelt by jWork.ORG