Class UniformLongSampler.LargeRangeUniformLongSampler
- java.lang.Object
-
- org.apache.commons.rng.sampling.distribution.UniformLongSampler
-
- org.apache.commons.rng.sampling.distribution.UniformLongSampler.LargeRangeUniformLongSampler
-
- All Implemented Interfaces:
LongSampler,SharedStateLongSampler,SharedStateSampler<SharedStateLongSampler>
- Enclosing class:
- UniformLongSampler
private static final class UniformLongSampler.LargeRangeUniformLongSampler extends UniformLongSampler
Discrete uniform distribution sampler when the range between lower and upper is too large to fit in a positive long.
-
-
Field Summary
Fields Modifier and Type Field Description private longlowerLower bound.private longupperUpper bound.-
Fields inherited from class org.apache.commons.rng.sampling.distribution.UniformLongSampler
rng
-
-
Constructor Summary
Constructors Constructor Description LargeRangeUniformLongSampler(UniformRandomProvider rng, long lower, long upper)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description longsample()Creates alongsample.UniformLongSamplerwithUniformRandomProvider(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.UniformLongSampler
of, 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.LongSampler
samples, samples
-
-
-
-
Constructor Detail
-
LargeRangeUniformLongSampler
LargeRangeUniformLongSampler(UniformRandomProvider rng, long lower, long upper)
- Parameters:
rng- Generator of uniformly distributed random numbers.lower- Lower bound (inclusive) of the distribution.upper- Upper bound (inclusive) of the distribution.
-
-
Method Detail
-
sample
public long sample()
Description copied from interface:LongSamplerCreates alongsample.- Returns:
- a sample.
-
withUniformRandomProvider
public UniformLongSampler withUniformRandomProvider(UniformRandomProvider rng)
Description copied from class:UniformLongSamplerCreate 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<SharedStateLongSampler>- Specified by:
withUniformRandomProviderin classUniformLongSampler- Parameters:
rng- Generator of uniformly distributed random numbers.- Returns:
- the sampler
-
-