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 Modifier and Type Field Description private doublemeanMean.
-
Constructor Summary
Constructors Constructor Description ExponentialMean(UniformRandomProvider rng, double mean)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description doublesample()Creates adoublesample.ZigguratSampler.Exponential.ExponentialMeanwithUniformRandomProvider(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.-
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
-
-
-
-
Constructor Detail
-
ExponentialMean
ExponentialMean(UniformRandomProvider rng, double mean)
- Parameters:
rng- Generator of uniformly distributed random numbers.mean- Mean.
-
-
Method Detail
-
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
-
-