Class MixFunctions
java.lang.Object
org.apache.commons.rng.simple.internal.MixFunctions
Performs mixing of bits.
- Since:
- 1.5
-
Field Summary
FieldsModifier and TypeFieldDescription(package private) static final int
The fractional part of the golden ratio, phi, scaled to 32-bits and rounded to odd.(package private) static final long
The fractional part of the golden ratio, phi, scaled to 64-bits and rounded to odd. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription(package private) static int
murmur3
(int x) Perform the finalising 32-bit mix function of Austin Appleby's MurmurHash3.(package private) static long
stafford13
(long x) Perform variant 13 of David Stafford's 64-bit mix function.
-
Field Details
-
GOLDEN_RATIO_64
static final long GOLDEN_RATIO_64The fractional part of the golden ratio, phi, scaled to 64-bits and rounded to odd. This can be used as an increment for a Weyl sequence.- See Also:
-
GOLDEN_RATIO_32
static final int GOLDEN_RATIO_32The fractional part of the golden ratio, phi, scaled to 32-bits and rounded to odd. This can be used as an increment for a Weyl sequence.- See Also:
-
-
Constructor Details
-
MixFunctions
private MixFunctions()No instances.
-
-
Method Details
-
stafford13
static long stafford13(long x) Perform variant 13 of David Stafford's 64-bit mix function. This is the mix function used in theSplitMix64
RNG.This is ranked first of the top 14 Stafford mixers.
- Parameters:
x
- the input value- Returns:
- the output value
- See Also:
-
murmur3
static int murmur3(int x) Perform the finalising 32-bit mix function of Austin Appleby's MurmurHash3.- Parameters:
x
- the input value- Returns:
- the output value
- See Also:
-