Class AbstractWell

    • Field Detail

      • index

        protected int index
        Current index in the bytes pool.
      • v

        protected final int[] v
        Bytes pool.
    • Constructor Detail

      • AbstractWell

        protected AbstractWell​(int k,
                               int[] seed)
        Creates an instance with the given seed.
        Parameters:
        k - Number of bits in the pool (not necessarily a multiple of 32).
        seed - Initial seed.
    • Method Detail

      • getStateInternal

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

        private void setSeedInternal​(int[] seed)
        Initializes the generator with the given seed.
        Parameters:
        seed - Seed. Cannot be null.
      • calculateBlockCount

        private static int calculateBlockCount​(int k)
        Calculate the number of 32-bits blocks.
        Parameters:
        k - Number of bits in the pool (not necessarily a multiple of 32).
        Returns:
        the number of 32-bits blocks.