Class AbstractWell
java.lang.Object
org.apache.commons.rng.core.BaseProvider
org.apache.commons.rng.core.source32.IntProvider
org.apache.commons.rng.core.source32.AbstractWell
- All Implemented Interfaces:
RandomIntSource, RestorableUniformRandomProvider, UniformRandomProvider
- Direct Known Subclasses:
Well1024a, Well19937a, Well44497a, Well512a
This abstract class implements the WELL class of pseudo-random number
generator from François Panneton, Pierre L'Ecuyer and Makoto
Matsumoto.
This generator is described in a paper by François Panneton, Pierre L'Ecuyer and Makoto Matsumoto Improved Long-Period Generators Based on Linear Recurrences Modulo 2 ACM Transactions on Mathematical Software, 32, 1 (2006). The errata for the paper are in wellrng-errata.txt.
- Since:
- 1.0
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected static final classInner class used to store the indirection index table which is fixed for a given type of WELL class of pseudo-random number generator. -
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedAbstractWell(int k, int[] seed) Creates an instance with the givenseed. -
Method Summary
Modifier and TypeMethodDescriptionprotected byte[]Creates a snapshot of the RNG state.protected voidsetStateInternal(byte[] s) Resets the RNG to the givenstate.Methods inherited from class IntProvider
nextBoolean, nextBytes, nextBytes, nextDouble, nextInt, nextLong, resetCachedStateMethods inherited from class BaseProvider
checkIndex, checkStateSize, composeStateInternal, extendSeed, extendSeed, fillState, fillState, restoreState, saveState, splitStateInternal, toStringMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface RandomIntSource
next
-
Field Details
-
index
Current index in the bytes pool. -
v
Bytes pool.
-
-
Constructor Details
-
AbstractWell
Creates an instance with the givenseed.- Parameters:
k- Number of bits in the pool (not necessarily a multiple of 32).seed- Initial seed.
-
-
Method Details
-
getStateInternal
Creates a snapshot of the RNG state.- Overrides:
getStateInternalin classIntProvider- Returns:
- the internal state.
-
setStateInternal
Resets the RNG to the givenstate.- Overrides:
setStateInternalin classIntProvider- Parameters:
s- State (previously obtained by a call toBaseProvider.getStateInternal()).- See Also:
-