Interface LinearCongruentialGenerator
- All Superinterfaces:
RandomLongGenerator
,RandomNumberGenerator
,Seedable
- All Known Implementing Classes:
CompositeLinearCongruentialGenerator
,LEcuyer
,Lehmer
,MRG
A linear congruential generator (LCG) produces a sequence of pseudo-random numbers
based on a linear recurrence relation.
An LCG is simple to understand and implement,
but it should not be used for applications where high-quality randomness is critical.
The higher quality pseudo-random generators available are, for instances,
MersenneTwister
and MWC8222
.
If, however, only a small number of random numbers are needed, e.g,. a few thousands,
then an LCG should be sufficient.- See Also:
-
Method Summary
Methods inherited from interface dev.nm.stat.random.rng.univariate.RandomLongGenerator
nextLong
Methods inherited from interface dev.nm.stat.random.rng.univariate.RandomNumberGenerator
nextDouble
-
Method Details
-
order
int order()Get the order of recursion.- Returns:
- the order of recursion
-
modulus
long modulus()Get the modulus of this linear congruential generator.- Returns:
- the modulus
-