public class LinearCongruentialRNG extends Object implements RNG
A general linear congruential generator.
References:
| Constructor and Description |
|---|
LinearCongruentialRNG(long m,
long a)
Create a linear congruential generator with the given modulus and
multiplier.
|
LinearCongruentialRNG(long m,
long a,
long c)
Create a linear congruential generator with the given parameters.
|
LinearCongruentialRNG(long m,
long a,
long c,
long s)
Create a linear congruential generator with the given parameters.
|
| Modifier and Type | Method and Description |
|---|---|
double |
nextRandomNumber()
Access the next random number from this generator.
|
public LinearCongruentialRNG(long m,
long a)
m - the modulus.a - the multiplier.public LinearCongruentialRNG(long m,
long a,
long c)
m - the modulus.a - the multiplier.c - the shift.public LinearCongruentialRNG(long m,
long a,
long c,
long s)
m - the modulus.a - the multiplier.c - the shift.s - the seed.public double nextRandomNumber()
nextRandomNumber in interface RNGDMelt 2.0 © DataMelt by jWork.ORG