Uniform
cern.jet.random

Class Uniform

    • Constructor Summary

      Constructors 
      Constructor and Description
      Uniform(double min, double max, int seed)
      Constructs a uniform distribution with the given minimum and maximum, using a MersenneTwister seeded with the given seed.
      Uniform(double min, double max, RandomEngine randomGenerator)
      Constructs a uniform distribution with the given minimum and maximum.
      Uniform(RandomEngine randomGenerator)
      Constructs a uniform distribution with min=0.0 and max=1.0.
    • Method Summary

      Methods 
      Modifier and TypeMethod and Description
      doublecdf(double x)
      Returns the cumulative distribution function (assuming a continous uniform distribution).
      booleannextBoolean()
      Returns a uniformly distributed random boolean.
      doublenextDouble()
      Returns a uniformly distributed random number in the open interval (min,max) (excluding min and max).
      doublenextDoubleFromTo(double from, double to)
      Returns a uniformly distributed random number in the open interval (from,to) (excluding from and to).
      floatnextFloatFromTo(float from, float to)
      Returns a uniformly distributed random number in the open interval (from,to) (excluding from and to).
      intnextInt()
      Returns a uniformly distributed random number in the closed interval [min,max] (including min and max).
      intnextIntFromTo(int from, int to)
      Returns a uniformly distributed random number in the closed interval [from,to] (including from and to).
      longnextLongFromTo(long from, long to)
      Returns a uniformly distributed random number in the closed interval [from,to] (including from and to).
      doublepdf(double x)
      Returns the probability distribution function (assuming a continous uniform distribution).
      voidsetState(double min, double max)
      Sets the internal state.
      static booleanstaticNextBoolean()
      Returns a uniformly distributed random boolean.
      static doublestaticNextDouble()
      Returns a uniformly distributed random number in the open interval (0,1) (excluding 0 and 1).
      static doublestaticNextDoubleFromTo(double from, double to)
      Returns a uniformly distributed random number in the open interval (from,to) (excluding from and to).
      static floatstaticNextFloatFromTo(float from, float to)
      Returns a uniformly distributed random number in the open interval (from,to) (excluding from and to).
      static intstaticNextIntFromTo(int from, int to)
      Returns a uniformly distributed random number in the closed interval [from,to] (including from and to).
      static longstaticNextLongFromTo(long from, long to)
      Returns a uniformly distributed random number in the closed interval [from,to] (including from and to).
      static voidstaticSetRandomEngine(RandomEngine randomGenerator)
      Sets the uniform random number generation engine shared by all static methods.
      StringtoString()
      Returns a String representation of the receiver.
    • Constructor Detail

      • Uniform

        public Uniform(double min,       double max,       int seed)
        Constructs a uniform distribution with the given minimum and maximum, using a MersenneTwister seeded with the given seed.
      • Uniform

        public Uniform(double min,       double max,       RandomEngine randomGenerator)
        Constructs a uniform distribution with the given minimum and maximum.
      • Uniform

        public Uniform(RandomEngine randomGenerator)
        Constructs a uniform distribution with min=0.0 and max=1.0.
    • Method Detail

      • cdf

        public double cdf(double x)
        Returns the cumulative distribution function (assuming a continous uniform distribution).
      • nextBoolean

        public boolean nextBoolean()
        Returns a uniformly distributed random boolean.
      • nextDouble

        public double nextDouble()
        Returns a uniformly distributed random number in the open interval (min,max) (excluding min and max).
        Specified by:
        nextDouble in class AbstractDistribution
      • nextDoubleFromTo

        public double nextDoubleFromTo(double from,                      double to)
        Returns a uniformly distributed random number in the open interval (from,to) (excluding from and to). Pre conditions: from <= to.
      • nextFloatFromTo

        public float nextFloatFromTo(float from,                    float to)
        Returns a uniformly distributed random number in the open interval (from,to) (excluding from and to). Pre conditions: from <= to.
      • nextInt

        public int nextInt()
        Returns a uniformly distributed random number in the closed interval [min,max] (including min and max).
        Overrides:
        nextInt in class AbstractDistribution
      • nextIntFromTo

        public int nextIntFromTo(int from,                int to)
        Returns a uniformly distributed random number in the closed interval [from,to] (including from and to). Pre conditions: from <= to.
      • nextLongFromTo

        public long nextLongFromTo(long from,                  long to)
        Returns a uniformly distributed random number in the closed interval [from,to] (including from and to). Pre conditions: from <= to.
      • pdf

        public double pdf(double x)
        Returns the probability distribution function (assuming a continous uniform distribution).
      • setState

        public void setState(double min,            double max)
        Sets the internal state.
      • staticNextBoolean

        public static boolean staticNextBoolean()
        Returns a uniformly distributed random boolean.
      • staticNextDouble

        public static double staticNextDouble()
        Returns a uniformly distributed random number in the open interval (0,1) (excluding 0 and 1).
      • staticNextDoubleFromTo

        public static double staticNextDoubleFromTo(double from,                            double to)
        Returns a uniformly distributed random number in the open interval (from,to) (excluding from and to). Pre conditions: from <= to.
      • staticNextFloatFromTo

        public static float staticNextFloatFromTo(float from,                          float to)
        Returns a uniformly distributed random number in the open interval (from,to) (excluding from and to). Pre conditions: from <= to.
      • staticNextIntFromTo

        public static int staticNextIntFromTo(int from,                      int to)
        Returns a uniformly distributed random number in the closed interval [from,to] (including from and to). Pre conditions: from <= to.
      • staticNextLongFromTo

        public static long staticNextLongFromTo(long from,                        long to)
        Returns a uniformly distributed random number in the closed interval [from,to] (including from and to). Pre conditions: from <= to.
      • staticSetRandomEngine

        public static void staticSetRandomEngine(RandomEngine randomGenerator)
        Sets the uniform random number generation engine shared by all static methods.
        Parameters:
        randomGenerator - the new uniform random number generation engine to be shared.
      • toString

        public String toString()
        Returns a String representation of the receiver.
        Overrides:
        toString in class Object

SCaVis 2.1 © jWork.ORG