Documentation of 'Catalano.Math.Random.Random' Java class
Random
Catalano.Math.Random

Class Random



  • public class Random
    extends java.lang.Object
    This is a high quality random number generator as a replacement of the standard Random class of Java system.
    • Constructor Summary

      Constructors 
      Constructor and Description
      Random()
      Initialize with default random number generator engine.
      Random(IRandomNumberGenerator rng)
      Initialize with given random number generator engine.
      Random(long seed)
      Initialize with given seed for default random number generator engine.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      long getSeed() 
      double nextDouble()
      Generator a random number uniformly distributed in [0, 1).
      double nextDouble(double lo, double hi)
      Generate a uniform random number in the range [lo, hi)
      void nextDoubles(double[] d)
      Generate n uniform random numbers in the range [0, 1)
      void nextDoubles(double[] d, double lo, double hi)
      Generate n uniform random numbers in the range [lo, hi)
      int nextInt()
      Returns a random integer.
      int nextInt(int n)
      Returns a random integer in [0, n).
      long nextLong() 
      void permutate(double[] x)
      Generates a permutation of given array.
      void permutate(float[] x)
      Generates a permutation of given array.
      int[] permutate(int n)
      Generates a permutation of 0, 1, 2, ..., n-1, which is useful for sampling without replacement.
      void permutate(int[] x)
      Generates a permutation of given array.
      void permutate(java.lang.Object[] x)
      Generates a permutation of given array.
      void setSeed(long seed) 
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • Random

        public Random()
        Initialize with default random number generator engine.
      • Random

        public Random(long seed)
        Initialize with given seed for default random number generator engine.
    • Method Detail

      • getSeed

        public long getSeed()
      • setSeed

        public void setSeed(long seed)
      • nextDouble

        public double nextDouble()
        Generator a random number uniformly distributed in [0, 1).
        Returns:
        a pseudo random number
      • nextDoubles

        public void nextDoubles(double[] d)
        Generate n uniform random numbers in the range [0, 1)
        Parameters:
        d - array of random numbers to be generated
      • nextDouble

        public double nextDouble(double lo,
                                 double hi)
        Generate a uniform random number in the range [lo, hi)
        Parameters:
        lo - lower limit of range
        hi - upper limit of range
        Returns:
        a uniform random real in the range [lo, hi)
      • nextDoubles

        public void nextDoubles(double[] d,
                                double lo,
                                double hi)
        Generate n uniform random numbers in the range [lo, hi)
        Parameters:
        lo - lower limit of range
        hi - upper limit of range
        d - array of random numbers to be generated
      • nextInt

        public int nextInt()
        Returns a random integer.
      • nextInt

        public int nextInt(int n)
        Returns a random integer in [0, n).
      • nextLong

        public long nextLong()
      • permutate

        public int[] permutate(int n)
        Generates a permutation of 0, 1, 2, ..., n-1, which is useful for sampling without replacement.
      • permutate

        public void permutate(int[] x)
        Generates a permutation of given array.
      • permutate

        public void permutate(float[] x)
        Generates a permutation of given array.
      • permutate

        public void permutate(double[] x)
        Generates a permutation of given array.
      • permutate

        public void permutate(java.lang.Object[] x)
        Generates a permutation of given array.

DataMelt 3.0 © DataMelt by jWork.ORG

You see the box below because you did not login.