Class JenkinsSmallFast64
- java.lang.Object
-
- org.apache.commons.rng.core.BaseProvider
-
- org.apache.commons.rng.core.source64.LongProvider
-
- org.apache.commons.rng.core.source64.JenkinsSmallFast64
-
- All Implemented Interfaces:
RandomLongSource
,RestorableUniformRandomProvider
,UniformRandomProvider
public class JenkinsSmallFast64 extends LongProvider
Implement Bob Jenkins's small fast (JSF) 64-bit generator.The state size is 256-bits.
- Since:
- 1.3
- See Also:
- A small noncryptographic PRNG
-
-
Constructor Summary
Constructors Constructor Description JenkinsSmallFast64(Long seed)
Creates an instance with the given seed.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected byte[]
getStateInternal()
Creates a snapshot of the RNG state.long
next()
Return the next random value.protected void
setStateInternal(byte[] s)
Resets the RNG to the givenstate
.-
Methods inherited from class org.apache.commons.rng.core.source64.LongProvider
nextBoolean, nextInt, nextLong, resetCachedState
-
Methods inherited from class org.apache.commons.rng.core.BaseProvider
checkIndex, checkStateSize, composeStateInternal, extendSeed, extendSeed, fillState, fillState, restoreState, saveState, splitStateInternal, toString
-
-
-
-
Constructor Detail
-
JenkinsSmallFast64
public JenkinsSmallFast64(Long seed)
Creates an instance with the given seed.- Parameters:
seed
- Initial seed.
-
-
Method Detail
-
next
public final long next()
Return the next random value.- Returns:
- the next random value.
-
getStateInternal
protected byte[] getStateInternal()
Creates a snapshot of the RNG state.- Overrides:
getStateInternal
in classLongProvider
- Returns:
- the internal state.
-
setStateInternal
protected void setStateInternal(byte[] s)
Resets the RNG to the givenstate
.- Overrides:
setStateInternal
in classLongProvider
- Parameters:
s
- State (previously obtained by a call toBaseProvider.getStateInternal()
).- See Also:
BaseProvider.checkStateSize(byte[],int)
-
-