Class AbstractPcgMcg6432

    • Field Detail

      • state

        private long state
        The state of the MCG.
    • Constructor Detail

      • AbstractPcgMcg6432

        AbstractPcgMcg6432​(java.lang.Long seed)
        Creates a new instance.
        Parameters:
        seed - Initial seed.
    • Method Detail

      • bump

        private static long bump​(long input)
        Provides the next state of the MCG.
        Parameters:
        input - Current state.
        Returns:
        next state
      • next

        public int next()
        Return the next random value.
        Returns:
        the next random value.
      • transform

        protected abstract 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.
        Parameters:
        x - State.
        Returns:
        the output
      • getStateInternal

        protected byte[] getStateInternal()
        Creates a snapshot of the RNG state.
        Overrides:
        getStateInternal in class IntProvider
        Returns:
        the internal state.