Documentation of 'org.apache.commons.math3.random.ISAACRandom' Java class
ISAACRandom
org.apache.commons.math3.random

Class ISAACRandom

  • All Implemented Interfaces:
    java.io.Serializable, RandomGenerator


    public class ISAACRandom
    extends BitsStreamGenerator
    implements java.io.Serializable
    ISAAC: a fast cryptographic pseudo-random number generator
    ISAAC (Indirection, Shift, Accumulate, Add, and Count) generates 32-bit random numbers. ISAAC has been designed to be cryptographically secure and is inspired by RC4. Cycles are guaranteed to be at least 240 values long, and they are 28295 values long on average. The results are uniformly distributed, unbiased, and unpredictable unless you know the seed.
    This code is based (with minor changes and improvements) on the original implementation of the algorithm by Bob Jenkins.
    Since:
    3.0
    See Also:
    Serialized Form
    • Constructor Summary

      Constructors 
      Constructor and Description
      ISAACRandom()
      Creates a new ISAAC random number generator.
      ISAACRandom(int[] seed)
      Creates a new ISAAC random number generator using an int array seed.
      ISAACRandom(long seed)
      Creates a new ISAAC random number generator using a single long seed.
    • Constructor Detail

      • ISAACRandom

        public ISAACRandom()
        Creates a new ISAAC random number generator.
        The instance is initialized using a combination of the current time and system hash code of the instance as the seed.
      • ISAACRandom

        public ISAACRandom(long seed)
        Creates a new ISAAC random number generator using a single long seed.
        Parameters:
        seed - Initial seed.
      • ISAACRandom

        public ISAACRandom(int[] seed)
        Creates a new ISAAC random number generator using an int array seed.
        Parameters:
        seed - Initial seed. If null, the seed will be related to the current time.
    • Method Detail

      • setSeed

        public void setSeed(int seed)
        Sets the seed of the underlying random number generator using an int seed.

        Sequences of values generated starting with the same seeds should be identical.

        Specified by:
        setSeed in interface RandomGenerator
        Specified by:
        setSeed in class BitsStreamGenerator
        Parameters:
        seed - the seed value
      • setSeed

        public void setSeed(long seed)
        Sets the seed of the underlying random number generator using a long seed.

        Sequences of values generated starting with the same seeds should be identical.

        Specified by:
        setSeed in interface RandomGenerator
        Specified by:
        setSeed in class BitsStreamGenerator
        Parameters:
        seed - the seed value
      • setSeed

        public void setSeed(int[] seed)
        Sets the seed of the underlying random number generator using an int array seed.

        Sequences of values generated starting with the same seeds should be identical.

        Specified by:
        setSeed in interface RandomGenerator
        Specified by:
        setSeed in class BitsStreamGenerator
        Parameters:
        seed - the seed value

DMelt 3.0 © DataMelt by jWork.ORG

You see the box below because you did not login.