Class PcgMcgXshRs32
java.lang.Object
org.apache.commons.rng.core.BaseProvider
org.apache.commons.rng.core.source32.IntProvider
org.apache.commons.rng.core.source32.AbstractPcgMcg6432
org.apache.commons.rng.core.source32.PcgMcgXshRs32
- All Implemented Interfaces:
RandomIntSource
,RestorableUniformRandomProvider
,UniformRandomProvider
A Permuted Congruential Generator (PCG) that is composed of a 64-bit Multiplicative Congruential
Generator (MCG) combined with the XSH-RS (xorshift; random shift) output
transformation to create 32-bit output.
State size is 64 bits and the period is 262.
- Since:
- 1.3
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected int
transform
(long x) Transform the 64-bit state of the generator to a 32-bit output.Methods inherited from class org.apache.commons.rng.core.source32.AbstractPcgMcg6432
getStateInternal, next, setStateInternal
Methods inherited from class org.apache.commons.rng.core.source32.IntProvider
nextBoolean, nextBytes, nextBytes, nextBytesFill, nextDouble, 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 Details
-
PcgMcgXshRs32
Creates a new instance.- Parameters:
seed
- Initial seed.
-
-
Method Details
-
transform
protected int transform(long x) Transform the 64-bit state of the generator to a 32-bit output. The transformation function shall vary with respect to different generators.- Specified by:
transform
in classAbstractPcgMcg6432
- Parameters:
x
- State.- Returns:
- the output
-