SSJ
V. 1.2.5.

umontreal.iro.lecuyer.randvarmulti
Class RandomMultiVariateGen

java.lang.Object
  extended by umontreal.iro.lecuyer.randvarmulti.RandomMultiVariateGen
Direct Known Subclasses:
DirichletGen, MultiNormalGen

public abstract class RandomMultiVariateGen
extends Object

This is the base class for all random variate generators over Rd, the d-dimensional space over the reals. It specifies the signature of the nextPoint method, which is normally called to generate a real-valued random vector following a given distribution. A random multi-variate generator object can be created simply by invoking the constructors of this class with some previously created RandomVariateGen or RandomStream objects. The multi-dimensional generator normally uses one or more one-dimensional generators or a primitive stream to generate the components of the points one at a time.



Constructor Summary
RandomMultiVariateGen(RandomStream s)
          Creates a new multi-variate random generator using stream s.
RandomMultiVariateGen(RandomVariateGen gen1)
          Creates a new multi-variate random generator using the one-dimensional generator gen1.
 
Method Summary
 int getDimension()
          Returns the dimension of this multi-variate generator (the dimension of the random points).
 RandomVariateGen getGen1()
          Returns the one-dimensional RandomVariateGen used by this object.
 RandomStream getStream()
          Returns the RandomStream used by this object.
 void nextArrayOfPoints(double[][] v, int start, int n)
          Generates n random points.
abstract  void nextPoint(double[] p)
          Generates a random point p using the one-dimensional generator or the stream contained in this object.
 void setGen1(RandomVariateGen gen1)
          Sets the RandomVariateGen used by this object to gen1.
 void setStream(RandomStream stream)
          Sets the RandomStream used by this object to stream.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RandomMultiVariateGen

public RandomMultiVariateGen(RandomVariateGen gen1)
Creates a new multi-variate random generator using the one-dimensional generator gen1.

Parameters:
gen1 - one-dimensional generator used

RandomMultiVariateGen

public RandomMultiVariateGen(RandomStream s)
Creates a new multi-variate random generator using stream s.

Parameters:
s - random stream used to generate uniforms
Method Detail

nextPoint

public abstract void nextPoint(double[] p)
Generates a random point p using the one-dimensional generator or the stream contained in this object.


nextArrayOfPoints

public void nextArrayOfPoints(double[][] v,
                              int start,
                              int n)
Generates n random points. These points are stored in the array v, starting at index start. Thus v[start][i] contains coordinate i of the first generated point. By default, this method calls nextPoint n times, but one can override it in subclasses for better efficiency.

Parameters:
v - array in which the variates will be stored
start - starting index, in v, of the new variates
n - number of variates to generate

getDimension

public int getDimension()
Returns the dimension of this multi-variate generator (the dimension of the random points).


getGen1

public RandomVariateGen getGen1()
Returns the one-dimensional RandomVariateGen used by this object.

Returns:
the one-dimensional generator associated to that object

setGen1

public void setGen1(RandomVariateGen gen1)
Sets the RandomVariateGen used by this object to gen1.


getStream

public RandomStream getStream()
Returns the RandomStream used by this object.

Returns:
the stream associated to this object

setStream

public void setStream(RandomStream stream)
Sets the RandomStream used by this object to stream.


SSJ
V. 1.2.5.

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