SSJ
V. 2.6.

umontreal.iro.lecuyer.randvar
Class UniformGen

java.lang.Object
  extended by umontreal.iro.lecuyer.randvar.RandomVariateGen
      extended by umontreal.iro.lecuyer.randvar.UniformGen

public class UniformGen
extends RandomVariateGen

This class implements random variate generators for the (continuous) uniform distribution over the interval (a, b), where a and b are real numbers with a < b. The density is

f (x) = 1/(b - a)         for a <= x <= b.

The (non-static) nextDouble method simply calls inverseF on the distribution.


Constructor Summary
UniformGen(RandomStream s)
          Creates a uniform random variate generator over the interval (0, 1), using stream s.
UniformGen(RandomStream s, double a, double b)
          Creates a uniform random variate generator over the interval (a, b), using stream s.
UniformGen(RandomStream s, UniformDist dist)
          Creates a new generator for the uniform distribution dist and stream s.
 
Method Summary
 double getA()
          Returns the value of a for this object.
 double getB()
          Returns the value of b for this object.
static double nextDouble(RandomStream s, double a, double b)
          Generates a uniform random variate over the interval (a, b) by inversion, using stream s.
 
Methods inherited from class umontreal.iro.lecuyer.randvar.RandomVariateGen
getDistribution, getStream, nextArrayOfDouble, nextDouble, setStream, toString
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

UniformGen

public UniformGen(RandomStream s,
                  double a,
                  double b)
Creates a uniform random variate generator over the interval (a, b), using stream s.


UniformGen

public UniformGen(RandomStream s)
Creates a uniform random variate generator over the interval (0, 1), using stream s.


UniformGen

public UniformGen(RandomStream s,
                  UniformDist dist)
Creates a new generator for the uniform distribution dist and stream s.

Method Detail

nextDouble

public static double nextDouble(RandomStream s,
                                double a,
                                double b)
Generates a uniform random variate over the interval (a, b) by inversion, using stream s.


getA

public double getA()
Returns the value of a for this object.


getB

public double getB()
Returns the value of b for this object.


SSJ
V. 2.6.

To submit a bug or ask questions, send an e-mail to Pierre L'Ecuyer.