de.jstacs.utils.random
Class DirichletMRG

java.lang.Object
  extended by de.jstacs.utils.random.MultivariateRandomGenerator
      extended by de.jstacs.utils.random.DirichletMRG

public class DirichletMRG
extends MultivariateRandomGenerator

This class is a multivariate random generator based on a Dirichlet distribution.

Author:
Jens Keilwagen

Field Summary
static DirichletMRG DEFAULT_INSTANCE
          This instance shall be used, since quite often two instance of this class return the same values.
 
Method Summary
 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.
 void generateLog(double[] d, int start, int n, MRGParams p)
          Fills a part of the array d beginning at start with n logarithmic values.
 
Methods inherited from class de.jstacs.utils.random.MultivariateRandomGenerator
generate
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_INSTANCE

public static final DirichletMRG DEFAULT_INSTANCE
This instance shall be used, since quite often two instance of this class return the same values. With this a new Dirichlet random generator is created.

Method Detail

generate

public void generate(double[] d,
                     int start,
                     int n,
                     MRGParams p)
Description copied from class: MultivariateRandomGenerator
Generates a n-dimensional random array as part of the array d beginning at start.

Specified by:
generate in class MultivariateRandomGenerator
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

generateLog

public void generateLog(double[] d,
                        int start,
                        int n,
                        MRGParams p)
Fills a part of the array d beginning at start with n logarithmic values.

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
See Also:
DiMRGParams, generate(double[], int, int, MRGParams)