public class AhrensDieterExponentialSampler extends SamplerBase implements SharedStateContinuousSampler
Sampling uses:
| Constructor and Description |
|---|
AhrensDieterExponentialSampler(UniformRandomProvider rng,
double mean) |
| Modifier and Type | Method and Description |
|---|---|
static SharedStateContinuousSampler |
of(UniformRandomProvider rng,
double mean)
Create a new exponential distribution sampler.
|
double |
sample()
Creates a
double sample. |
String |
toString() |
SharedStateContinuousSampler |
withUniformRandomProvider(UniformRandomProvider rng)
Create a new instance of the sampler with the same underlying state using the given
uniform random provider as the source of randomness.
|
nextDouble, nextInt, nextInt, nextLongclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitsamples, samplespublic AhrensDieterExponentialSampler(UniformRandomProvider rng, double mean)
rng - Generator of uniformly distributed random numbers.mean - Mean of this distribution.IllegalArgumentException - if mean <= 0public double sample()
double sample.sample in interface ContinuousSamplerpublic String toString()
toString in class SamplerBasepublic SharedStateContinuousSampler withUniformRandomProvider(UniformRandomProvider rng)
withUniformRandomProvider in interface SharedStateSampler<SharedStateContinuousSampler>rng - Generator of uniformly distributed random numbers.public static SharedStateContinuousSampler of(UniformRandomProvider rng, double mean)
rng - Generator of uniformly distributed random numbers.mean - Mean of the distribution.IllegalArgumentException - if mean <= 0Copyright © 2016–2022 The Apache Software Foundation. All rights reserved.