public class MRG extends Object implements LinearCongruentialGenerator
xi = (a1 * xi-1 + a2 * xi-2 + ... + ak * xi-k) mod m ui = xi / m
Constructor and Description |
---|
MRG(long m,
long... a)
Construct a Multiple Recursive Generator.
|
Modifier and Type | Method and Description |
---|---|
long |
modulus()
Get the modulus of this linear congruential generator.
|
double |
nextDouble()
Get the next random
double . |
long |
nextLong()
Get the next random
long . |
int |
order()
Get the order of recursion.
|
void |
seed(long... x)
Seed the random number/vector/scenario generator to produce repeatable experiments.
|
public MRG(long m, long... a)
m
- the modulusa
- multipliers for the Lehmer rng (a long
)public void seed(long... x)
Seedable
public int order()
LinearCongruentialGenerator
order
in interface LinearCongruentialGenerator
public long modulus()
LinearCongruentialGenerator
modulus
in interface LinearCongruentialGenerator
public long nextLong()
RandomLongGenerator
long
.nextLong
in interface RandomLongGenerator
long
public double nextDouble()
RandomNumberGenerator
double
.nextDouble
in interface RandomNumberGenerator
Copyright © 2010-2020 NM FinTech Ltd.. All Rights Reserved.