de.jstacs.utils.random
Class MultivariateRandomGenerator

java.lang.Object
  extended by de.jstacs.utils.random.MultivariateRandomGenerator
Direct Known Subclasses:
DirichletMRG, EqualParts, ErlangMRG, SoftOneOfN

public abstract class MultivariateRandomGenerator
extends Object

This class is the abstract super class for any multivariate random generator. Some Random generators need parameters. These will be given by an object MRGParams.

Author:
Jens Keilwagen
See Also:
MRGParams

Constructor Summary
MultivariateRandomGenerator()
           
 
Method Summary
abstract  void generate(double[] d, int start, int n, MRGParams p)
          Generates a n-dimensional random-array as part of the array d beginning at start.
 double[] generate(int n, MRGParams p)
          Generates a n-dimensional random-array.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MultivariateRandomGenerator

public MultivariateRandomGenerator()
Method Detail

generate

public double[] generate(int n,
                         MRGParams p)
                  throws ClassCastException,
                         IllegalArgumentException
Generates a n-dimensional random-array.

Parameters:
n - the dimension of the array
p - the parameter of the distribution
Returns:
a n-dimensional random-array
Throws:
ClassCastException
IllegalArgumentException

generate

public abstract void generate(double[] d,
                              int start,
                              int n,
                              MRGParams p)
                       throws ClassCastException,
                              IllegalArgumentException
Generates a n-dimensional random-array as part of the array d beginning at start.

Parameters:
d - the array
start - the start index for generated values
n - the dimension of the array
p - the parameter of the distribution
Throws:
ClassCastException
IllegalArgumentException