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 TypeMethodDescriptiondoublesample()Creates adoublesample.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, toStringMethods inherited from class org.apache.commons.rng.sampling.distribution.ZigguratSampler
interpolate, nextLong, randomInt63, toStringMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods 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.ExponentialCreates adoublesample.- Specified by:
samplein interfaceContinuousSampler- Overrides:
samplein classZigguratSampler.Exponential- Returns:
- a sample.
-
withUniformRandomProvider
public ZigguratSampler.Exponential.ExponentialMean withUniformRandomProvider(UniformRandomProvider rng) Description copied from class:ZigguratSampler.ExponentialCreate a new instance of the sampler with the same underlying state using the given uniform random provider as the source of randomness.- Specified by:
withUniformRandomProviderin interfaceSharedStateSampler<SharedStateContinuousSampler>- Overrides:
withUniformRandomProviderin classZigguratSampler.Exponential- Parameters:
rng- Generator of uniformly distributed random numbers.- Returns:
- the sampler
-