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 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 double
mean
Mean.
-
Constructor Summary
Constructors Constructor Description ExponentialMean(UniformRandomProvider rng, double mean)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description double
sample()
Creates adouble
sample.ZigguratSampler.Exponential.ExponentialMean
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.-
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.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
-
-