umontreal.iro.lecuyer.randvarmulti
Class RandomMultivariateGen
- java.lang.Object
-
- umontreal.iro.lecuyer.randvarmulti.RandomMultivariateGen
-
- Direct Known Subclasses:
- DirichletGen, IIDMultivariateGen, MultinormalGen
public abstract class RandomMultivariateGen extends java.lang.ObjectThis class is the multivariate counterpart ofRandomVariateGen. It is the base class for general random variate generators over the d-dimensional real space Rd. It specifies the signature of thenextPointmethod, which is normally called to generate a random vector from a given distribution. Contrary to univariate distributions and generators, here the inversion method is not well defined, so we cannot construct a multivariate generator simply by passing a multivariate distribution and a stream; we must specify a generating method as well. For this reason, this class is abstract. Generators can be constructed only by invoking the constructor of a subclass. This is an important difference withRandomVariateGen.
-
-
Constructor Summary
Constructors Constructor and Description RandomMultivariateGen()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method and Description intgetDimension()Returns the dimension of this multivariate generator (the dimension of the random points).RandomStreamgetStream()Returns theRandomStreamused by this object.voidnextArrayOfPoints(double[][] v, int start, int n)Generates n random points.abstract voidnextPoint(double[] p)Generates a random point p using the the stream contained in this object.voidsetStream(RandomStream stream)Sets theRandomStreamused by this object to stream.
-
-
-
Method Detail
-
nextPoint
public abstract void nextPoint(double[] p)
Generates a random point p using the 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 callsnextPointn times, but one can override it in subclasses for better efficiency. The array argument v[][d] must have d elements reserved for each generated point before calling this method.- Parameters:
v- array in which the variates will be storedstart- starting index, in v, of the new variatesn- number of variates to generate
-
getDimension
public int getDimension()
Returns the dimension of this multivariate generator (the dimension of the random points).
-
getStream
public RandomStream getStream()
Returns theRandomStreamused by this object.- Returns:
- the stream associated to this object
-
setStream
public void setStream(RandomStream stream)
Sets theRandomStreamused by this object to stream.
-
-
DMelt 3.0 © DataMelt by jWork.ORG