public class ConcurrentCachedRNG extends java.lang.Object implements RandomNumberGenerator
ConcurrentCachedGenerator.| Constructor and Description |
|---|
ConcurrentCachedRNG(RandomNumberGenerator rng)
Construct a new instance which wraps the given random number generator and
uses a cache which has 8 entries per available core.
|
ConcurrentCachedRNG(RandomNumberGenerator rng,
int cacheSize)
Constructs a new instance which wraps the given random number generator
and uses a cache of the specified size.
|
| Modifier and Type | Method and Description |
|---|---|
double |
nextDouble()
Get the next random
double. |
void |
seed(long... seeds)
Delegate to the underlying random number generator.
|
public ConcurrentCachedRNG(RandomNumberGenerator rng, int cacheSize)
rng - the underlying generatorcacheSize - the cache sizeConcurrentCachedGenerator.ConcurrentCachedGenerator(com.numericalmethod.suanshu.stats.random.concurrent.ConcurrentCachedGenerator.Generator, int)public ConcurrentCachedRNG(RandomNumberGenerator rng)
rng - the underlying generatorpublic double nextDouble()
RandomNumberGeneratordouble.nextDouble in interface RandomNumberGeneratorpublic void seed(long... seeds)
seed in interface RandomNumberGeneratorseeds - the seeds