Class MixFunctions

java.lang.Object
org.apache.commons.rng.simple.internal.MixFunctions

final class MixFunctions extends Object
Performs mixing of bits.
Since:
1.5
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    (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
    Modifier
    Constructor
    Description
    private
    No instances.
  • Method Summary

    Modifier and Type
    Method
    Description
    (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.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • GOLDEN_RATIO_64

      static final long GOLDEN_RATIO_64
      The 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_32
      The 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 the SplitMix64 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: