25package umontreal.ssj.randvar;
27import umontreal.ssj.rng.RandomStream;
28import umontreal.ssj.probdist.Distribution;
55public class RandomVariateGen {
64 protected RandomVariateGen() {
89 return dist.inverseF(stream.nextDouble());
104 throw new IllegalArgumentException(
"n must be positive.");
105 for (
int i = 0; i < n; i++)
120 throw new IllegalArgumentException(
"n must be positive.");
121 double[] v =
new double[n];
122 for (
int i = 0; i < n; i++)
141 this.stream = stream;
158 return getClass().getSimpleName() +
" with " + dist.toString();
160 return getClass().getSimpleName();
void nextArrayOfDouble(double[] v, int start, int n)
Generates n random numbers from the continuous distribution contained in this object.
double[] nextArrayOfDouble(int n)
Generates n random numbers from the continuous distribution contained in this object,...
double nextDouble()
Generates a random number from the continuous distribution contained in this object.
RandomVariateGen(RandomStream s, Distribution dist)
Creates a new random variate generator from the distribution dist, using stream s.
void setStream(RandomStream stream)
Sets the umontreal.ssj.rng.RandomStream used by this generator to stream.
RandomStream getStream()
Returns the umontreal.ssj.rng.RandomStream used by this generator.
Distribution getDistribution()
Returns the umontreal.ssj.probdist.Distribution used by this generator.
String toString()
Returns a String containing information about the current generator.
This interface should be implemented by all classes supporting discrete and continuous distributions.
This interface defines the basic structures to handle multiple streams of uniform (pseudo)random numb...