Class ZigguratSampler.Exponential.ExponentialMean
java.lang.Object
org.apache.commons.rng.sampling.distribution.ZigguratSampler
org.apache.commons.rng.sampling.distribution.ZigguratSampler.Exponential
org.apache.commons.rng.sampling.distribution.ZigguratSampler.Exponential.ExponentialMean
- All Implemented Interfaces:
ContinuousSampler
,SharedStateContinuousSampler
,SharedStateSampler<SharedStateContinuousSampler>
- Enclosing class:
ZigguratSampler.Exponential
private static final class ZigguratSampler.Exponential.ExponentialMean
extends ZigguratSampler.Exponential
Specialisation which multiplies the standard exponential result by a specified mean.
-
Nested Class Summary
Nested classes/interfaces inherited from class org.apache.commons.rng.sampling.distribution.ZigguratSampler
ZigguratSampler.Exponential, ZigguratSampler.NormalizedGaussian
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiondouble
sample()
Creates adouble
sample.Create a new instance of the sampler with the same underlying state using the given uniform random provider as the source of randomness.Methods inherited from class org.apache.commons.rng.sampling.distribution.ZigguratSampler.Exponential
of, of, toString
Methods inherited from class org.apache.commons.rng.sampling.distribution.ZigguratSampler
interpolate, nextLong, randomInt63, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.apache.commons.rng.sampling.distribution.ContinuousSampler
samples, samples
-
Field Details
-
mean
private final double meanMean.
-
-
Constructor Details
-
ExponentialMean
ExponentialMean(UniformRandomProvider rng, double mean) - Parameters:
rng
- Generator of uniformly distributed random numbers.mean
- Mean.
-
-
Method Details
-
sample
public double sample()Description copied from class:ZigguratSampler.Exponential
Creates adouble
sample.- Specified by:
sample
in interfaceContinuousSampler
- Overrides:
sample
in classZigguratSampler.Exponential
- Returns:
- a sample.
-
withUniformRandomProvider
public ZigguratSampler.Exponential.ExponentialMean withUniformRandomProvider(UniformRandomProvider rng) Description copied from class:ZigguratSampler.Exponential
Create a new instance of the sampler with the same underlying state using the given uniform random provider as the source of randomness.- Specified by:
withUniformRandomProvider
in interfaceSharedStateSampler<SharedStateContinuousSampler>
- Overrides:
withUniformRandomProvider
in classZigguratSampler.Exponential
- Parameters:
rng
- Generator of uniformly distributed random numbers.- Returns:
- the sampler
-