Class Random

java.lang.Object
io.deephaven.function.Random

public class Random extends Object
Functions for the generation random numbers.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static double
    Returns a uniform random number between 0.0 (inclusive) and 1.0 (exclusive).
    static boolean
    Returns a random boolean.
    static boolean[]
    randomBool(int size)
    Returns an array of random booleans.
    static double
    randomDouble(double min, double max)
    Returns a uniform random number.
    static double[]
    randomDouble(double min, double max, int size)
    Returns an array of uniform random numbers.
    static float
    randomFloat(float min, float max)
    Returns a uniform random number.
    static float[]
    randomFloat(float min, float max, int size)
    Returns an array of uniform random numbers.
    static double
    randomGaussian(double mean, double std)
    Returns a Gaussian random number.
    static double[]
    randomGaussian(double mean, double std, int size)
    Returns an array of Gaussian random numbers.
    static int
    randomInt(int min, int max)
    Returns a uniform random number.
    static int[]
    randomInt(int min, int max, int size)
    Returns an array of uniform random numbers.
    static long
    randomLong(long min, long max)
    Returns a uniform random number.
    static long[]
    randomLong(long min, long max, int size)
    Returns an array of uniform random numbers.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • Random

      public Random()
  • Method Details

    • random

      public static double random()
      Returns a uniform random number between 0.0 (inclusive) and 1.0 (exclusive).
      Returns:
      uniform random number between 0.0 (inclusive) and 1.0 (exclusive).
    • randomBool

      public static boolean randomBool()
      Returns a random boolean.
      Returns:
      random boolean.
    • randomBool

      public static boolean[] randomBool(int size)
      Returns an array of random booleans.
      Parameters:
      size - array size to generate.
      Returns:
      array of random booleans.
    • randomInt

      public static int randomInt(int min, int max)
      Returns a uniform random number.
      Parameters:
      min - minimum result.
      max - maximum result (exclusive).
      Returns:
      uniform random number between min (inclusive) and max (exclusive).
    • randomInt

      public static int[] randomInt(int min, int max, int size)
      Returns an array of uniform random numbers.
      Parameters:
      min - minimum result.
      max - maximum result (exclusive).
      size - array size to generate.
      Returns:
      array of uniform random numbers between min (inclusive) and max (exclusive).
    • randomLong

      public static long randomLong(long min, long max)
      Returns a uniform random number.
      Parameters:
      min - minimum result.
      max - maximum result (exclusive).
      Returns:
      uniform random number between min (inclusive) and max (exclusive).
    • randomLong

      public static long[] randomLong(long min, long max, int size)
      Returns an array of uniform random numbers.
      Parameters:
      min - minimum result.
      max - maximum result (exclusive).
      size - array size to generate.
      Returns:
      array of uniform random numbers between min (inclusive) and max (exclusive).
    • randomFloat

      public static float randomFloat(float min, float max)
      Returns a uniform random number.
      Parameters:
      min - minimum result.
      max - maximum result.
      Returns:
      uniform random number between min (inclusive) and max (exclusive).
    • randomFloat

      public static float[] randomFloat(float min, float max, int size)
      Returns an array of uniform random numbers.
      Parameters:
      min - minimum result.
      max - maximum result.
      size - array size to generate.
      Returns:
      array of uniform random numbers between min (inclusive) and max (exclusive).
    • randomDouble

      public static double randomDouble(double min, double max)
      Returns a uniform random number.
      Parameters:
      min - minimum result.
      max - maximum result.
      Returns:
      uniform random number between min (inclusive) and max (exclusive).
    • randomDouble

      public static double[] randomDouble(double min, double max, int size)
      Returns an array of uniform random numbers.
      Parameters:
      min - minimum result.
      max - maximum result.
      size - array size to generate.
      Returns:
      array of uniform random numbers between min (inclusive) and max (exclusive).
    • randomGaussian

      public static double randomGaussian(double mean, double std)
      Returns a Gaussian random number.
      Parameters:
      mean - mean.
      std - standard deviation.
      Returns:
      Gaussian random number.
    • randomGaussian

      public static double[] randomGaussian(double mean, double std, int size)
      Returns an array of Gaussian random numbers.
      Parameters:
      mean - mean.
      std - standard deviation.
      size - array size to generate.
      Returns:
      array of Gaussian random numbers.