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 class UniformLongSampler.FixedUniformLongSampler extends UniformLongSampler
Discrete uniform distribution sampler when the sample value is fixed.
-
-
Field Summary
Fields Modifier and Type Field Description private long
value
The 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 long
sample()
Creates along
sample.java.lang.String
toString()
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
-
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:LongSampler
Creates along
sample.- Returns:
- a sample.
-
toString
public java.lang.String toString()
Description copied from class:UniformLongSampler
- Overrides:
toString
in classUniformLongSampler
-
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
-
-