Class TwoCmres

    • Field Detail

      • INTERNAL_ERROR_MSG

        private static final java.lang.String INTERNAL_ERROR_MSG
        Error message.
        See Also:
        Constant Field Values
      • SEED_GUARD

        private static final byte SEED_GUARD
        A small positive integer.
        See Also:
        Constant Field Values
      • xx

        private long xx
        State of first subcycle generator.
      • yy

        private long yy
        State of second subcycle generator.
    • Constructor Detail

      • TwoCmres

        private TwoCmres​(int seed,
                         TwoCmres.Cmres x,
                         TwoCmres.Cmres y)
        Creates a new instance.
        Parameters:
        seed - Initial seed.
        x - First subcycle generator.
        y - Second subcycle generator.
      • TwoCmres

        public TwoCmres​(java.lang.Integer seed)
        Creates a new instance.
        Parameters:
        seed - Seed.
      • TwoCmres

        public TwoCmres​(java.lang.Integer seed,
                        int i,
                        int j)
        Creates a new instance.
        Parameters:
        seed - Seed.
        i - Table entry for first subcycle generator.
        j - Table entry for second subcycle generator.
        Throws:
        java.lang.IllegalArgumentException - if i == j.
        java.lang.IndexOutOfBoundsException - if i < 0 or i >= numberOfSubcycleGenerators().
        java.lang.IndexOutOfBoundsException - if j < 0 or j >= numberOfSubcycleGenerators().
    • Method Detail

      • next

        public long next()
        Return the next random value.
        Returns:
        the next random value.
      • numberOfSubcycleGenerators

        public static int numberOfSubcycleGenerators()
        Get the number of subcycle generators.
        Returns:
        the number of subcycle generators.
      • getStateInternal

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

        private void setSeedInternal​(int seed)
        Parameters:
        seed - Seed.