umontreal.iro.lecuyer.randvar
Class UniformGen
- java.lang.Object
-
- umontreal.iro.lecuyer.randvar.RandomVariateGen
-
- 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 isf (x) = 1/(b - a) for a <= x <= b.The (non-static) nextDouble method simply calls inverseF on the distribution.
-
-
Constructor Summary
Constructors Constructor and Description 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
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method and Description doublegetA()Returns the value of a for this object.doublegetB()Returns the value of b for this object.static doublenextDouble(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
-
-
-
-
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.
-
-
DMelt 3.0 © DataMelt by jWork.ORG