Class RandomUtil



  • public class RandomUtil
    extends java.lang.Object
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static long seed  
      static boolean useSeed  
    • Constructor Summary

      Constructors 
      Constructor Description
      RandomUtil​()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static double poisson​(double mean)
      Get random data from a Poisson distribution
      static ucar.ma2.Array poisson​(double mean, int n)
      Get random data from a Poisson distribution
      static ucar.ma2.Array poisson​(double mean, java.util.List<java.lang.Integer> shape)
      Get random data from a Poisson distribution
      static double rand​()
      Get random value
      static ucar.ma2.Array rand​(int n)
      Get random array - one dimension
      static ucar.ma2.Array rand​(java.util.List<java.lang.Integer> shape)
      Get random array
      static int randint​(int bound)
      Get random int value
      static ucar.ma2.Array randint​(int bound, int n)
      Get random integer array
      static ucar.ma2.Array randint​(int bound, java.util.List<java.lang.Integer> shape)
      Get random integer array
      static double randn​()
      Get random value
      static ucar.ma2.Array randn​(int n)
      Get random array - one dimension
      static ucar.ma2.Array randn​(java.util.List<java.lang.Integer> shape)
      Get random array
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • seed

        public static long seed
      • useSeed

        public static boolean useSeed
    • Constructor Detail

      • RandomUtil

        public RandomUtil​()
    • Method Detail

      • rand

        public static double rand​()
        Get random value
        Returns:
        Random value
      • rand

        public static ucar.ma2.Array rand​(int n)
        Get random array - one dimension
        Parameters:
        n - Array length
        Returns:
        Result array
      • rand

        public static ucar.ma2.Array rand​(java.util.List<java.lang.Integer> shape)
        Get random array
        Parameters:
        shape - Shape
        Returns:
        Array Result array
      • randn

        public static double randn​()
        Get random value
        Returns:
        Random value
      • randn

        public static ucar.ma2.Array randn​(int n)
        Get random array - one dimension
        Parameters:
        n - Array length
        Returns:
        Result array
      • randn

        public static ucar.ma2.Array randn​(java.util.List<java.lang.Integer> shape)
        Get random array
        Parameters:
        shape - Shape
        Returns:
        Array Result array
      • randint

        public static int randint​(int bound)
        Get random int value
        Parameters:
        bound - Highest value
        Returns:
        Random int value
      • randint

        public static ucar.ma2.Array randint​(int bound,
                                             int n)
        Get random integer array
        Parameters:
        bound - Highest value
        n - Array length
        Returns:
        Array Result array
      • randint

        public static ucar.ma2.Array randint​(int bound,
                                             java.util.List<java.lang.Integer> shape)
        Get random integer array
        Parameters:
        bound - Highest value
        shape - Shape
        Returns:
        Array Result array
      • poisson

        public static double poisson​(double mean)
        Get random data from a Poisson distribution
        Parameters:
        mean - Poisson mean
        Returns:
        Random value
      • poisson

        public static ucar.ma2.Array poisson​(double mean,
                                             int n)
        Get random data from a Poisson distribution
        Parameters:
        mean - Poisson mean
        n - Array length
        Returns:
        Array Result array
      • poisson

        public static ucar.ma2.Array poisson​(double mean,
                                             java.util.List<java.lang.Integer> shape)
        Get random data from a Poisson distribution
        Parameters:
        mean - Poisson mean
        shape - Shape
        Returns:
        Array Result array