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 (MRG). 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 random array
p - the parameter of the underlying distribution
Returns:
a n-dimensional random array
Throws:
ClassCastException - if the object p could not be parsed to the correct subclass
IllegalArgumentException - if an argument is not correct
See Also:
generate(double[], int, int, MRGParams)

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 random array
p - the parameter of the underlying distribution
Throws:
ClassCastException - if the object p could not be parsed to the correct subclass
IllegalArgumentException - if an argument is not correct