Class UniformLongSampler.FixedUniformLongSampler
- java.lang.Object
-
- org.apache.commons.rng.sampling.distribution.UniformLongSampler
-
- org.apache.commons.rng.sampling.distribution.UniformLongSampler.FixedUniformLongSampler
-
- All Implemented Interfaces:
LongSampler,SharedStateLongSampler,SharedStateSampler<SharedStateLongSampler>
- Enclosing class:
- UniformLongSampler
private static final class UniformLongSampler.FixedUniformLongSampler extends UniformLongSampler
Discrete uniform distribution sampler when the sample value is fixed.
-
-
Field Summary
Fields Modifier and Type Field Description private longvalueThe value.-
Fields inherited from class org.apache.commons.rng.sampling.distribution.UniformLongSampler
rng
-
-
Constructor Summary
Constructors Constructor Description FixedUniformLongSampler(long value)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description longsample()Creates alongsample.java.lang.StringtoString()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
-
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
-
-
-
-
Method Detail
-
sample
public long sample()
Description copied from interface:LongSamplerCreates alongsample.- Returns:
- a sample.
-
toString
public java.lang.String toString()
Description copied from class:UniformLongSampler- Overrides:
toStringin classUniformLongSampler
-
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
-
-