Class SplitMix64
java.lang.Object
org.apache.commons.rng.core.BaseProvider
org.apache.commons.rng.core.source64.LongProvider
org.apache.commons.rng.core.source64.SplitMix64
- All Implemented Interfaces:
RandomLongSource, RestorableUniformRandomProvider, UniformRandomProvider
A fast RNG, with 64 bits of state, that can be used to initialize the
state of other generators.
- Since:
- 1.0
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionSplitMix64(long seed) Creates a new instance.SplitMix64(Long seed) Creates a new instance. -
Method Summary
Modifier and TypeMethodDescriptionprotected byte[]Creates a snapshot of the RNG state.longnext()Return the next random value.protected voidsetStateInternal(byte[] s) Resets the RNG to the givenstate.Methods inherited from class LongProvider
nextBoolean, nextInt, nextLong, resetCachedStateMethods inherited from class BaseProvider
checkIndex, checkStateSize, composeStateInternal, extendSeed, extendSeed, fillState, fillState, restoreState, saveState, splitStateInternal, toString
-
Constructor Details
-
SplitMix64
-
SplitMix64
-
-
Method Details
-
next
-
getStateInternal
Creates a snapshot of the RNG state.- Overrides:
getStateInternalin classLongProvider- Returns:
- the internal state.
-
setStateInternal
Resets the RNG to the givenstate.- Overrides:
setStateInternalin classLongProvider- Parameters:
s- State (previously obtained by a call toBaseProvider.getStateInternal()).- See Also:
-