Class AbstractWell

    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected int[] i1
      Index indirection table giving for each index the value index + m1 taking table size into account.
      protected int[] i2
      Index indirection table giving for each index the value index + m2 taking table size into account.
      protected int[] i3
      Index indirection table giving for each index the value index + m3 taking table size into account.
      protected int index
      Current index in the bytes pool.
      protected int[] iRm1
      Index indirection table giving for each index its predecessor taking table size into account.
      protected int[] iRm2
      Index indirection table giving for each index its second predecessor taking table size into account.
      protected int[] v
      Bytes pool.
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      protected AbstractWell​(int k, int m1, int m2, int m3)
      Creates a new random number generator.
      protected AbstractWell​(int k, int m1, int m2, int m3, int seed)
      Creates a new random number generator using a single int seed.
      protected AbstractWell​(int k, int m1, int m2, int m3, int[] seed)
      Creates a new random number generator using an int array seed.
      protected AbstractWell​(int k, int m1, int m2, int m3, long seed)
      Creates a new random number generator using a single long seed.
    • Field Detail

      • index

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

        protected final int[] v
        Bytes pool.
      • iRm1

        protected final int[] iRm1
        Index indirection table giving for each index its predecessor taking table size into account.
      • iRm2

        protected final int[] iRm2
        Index indirection table giving for each index its second predecessor taking table size into account.
      • i1

        protected final int[] i1
        Index indirection table giving for each index the value index + m1 taking table size into account.
      • i2

        protected final int[] i2
        Index indirection table giving for each index the value index + m2 taking table size into account.
      • i3

        protected final int[] i3
        Index indirection table giving for each index the value index + m3 taking table size into account.
    • Constructor Detail

      • AbstractWell

        protected AbstractWell​(int k,
                               int m1,
                               int m2,
                               int m3)
        Creates a new random number generator.

        The instance is initialized using the current time as the seed.

        Parameters:
        k - number of bits in the pool (not necessarily a multiple of 32)
        m1 - first parameter of the algorithm
        m2 - second parameter of the algorithm
        m3 - third parameter of the algorithm
      • AbstractWell

        protected AbstractWell​(int k,
                               int m1,
                               int m2,
                               int m3,
                               int seed)
        Creates a new random number generator using a single int seed.
        Parameters:
        k - number of bits in the pool (not necessarily a multiple of 32)
        m1 - first parameter of the algorithm
        m2 - second parameter of the algorithm
        m3 - third parameter of the algorithm
        seed - the initial seed (32 bits integer)
      • AbstractWell

        protected AbstractWell​(int k,
                               int m1,
                               int m2,
                               int m3,
                               int[] seed)
        Creates a new random number generator using an int array seed.
        Parameters:
        k - number of bits in the pool (not necessarily a multiple of 32)
        m1 - first parameter of the algorithm
        m2 - second parameter of the algorithm
        m3 - third parameter of the algorithm
        seed - the initial seed (32 bits integers array), if null the seed of the generator will be related to the current time
      • AbstractWell

        protected AbstractWell​(int k,
                               int m1,
                               int m2,
                               int m3,
                               long seed)
        Creates a new random number generator using a single long seed.
        Parameters:
        k - number of bits in the pool (not necessarily a multiple of 32)
        m1 - first parameter of the algorithm
        m2 - second parameter of the algorithm
        m3 - third parameter of the algorithm
        seed - the initial seed (64 bits integer)