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 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 long
lower
Lower bound.private long
upper
Upper 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 long
sample()
Creates along
sample.UniformLongSampler
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.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:LongSampler
Creates along
sample.- Returns:
- a sample.
-
withUniformRandomProvider
public UniformLongSampler withUniformRandomProvider(UniformRandomProvider rng)
Description copied from class:UniformLongSampler
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<SharedStateLongSampler>
- Specified by:
withUniformRandomProvider
in classUniformLongSampler
- Parameters:
rng
- Generator of uniformly distributed random numbers.- Returns:
- the sampler
-
-