SSJ
V. 2.6.2.

umontreal.iro.lecuyer.randvar
Class UnuranContinuous

java.lang.Object
  extended by umontreal.iro.lecuyer.randvar.RandomVariateGen
      extended by umontreal.iro.lecuyer.randvar.UnuranContinuous

public class UnuranContinuous
extends RandomVariateGen

This class permits one to create continuous univariate generators using UNURAN via its string API.


Constructor Summary
UnuranContinuous(RandomStream s, RandomStream aux, String genStr)
          Constructs a new continuous random number generator using the UNURAN generator specification string genStr, main stream s, and auxiliary stream aux.
UnuranContinuous(RandomStream s, String genStr)
          Same as UnuranContinuous(s, s, genStr).
 
Method Summary
 RandomStream getAuxStream()
          Returns the auxiliary random number stream.
 Distribution getDistribution()
          Returns the Distribution used by this generator.
 RandomStream getStream()
          Returns the RandomStream used by this generator.
 void nextArrayOfDouble(double[] v, int start, int n)
          Generates n random numbers from the continuous distribution contained in this object.
 double nextDouble()
          Generates a random number from the continuous distribution contained in this object.
 
Methods inherited from class umontreal.iro.lecuyer.randvar.RandomVariateGen
setStream, toString
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

UnuranContinuous

public UnuranContinuous(RandomStream s,
                        String genStr)
Same as UnuranContinuous(s, s, genStr).


UnuranContinuous

public UnuranContinuous(RandomStream s,
                        RandomStream aux,
                        String genStr)
Constructs a new continuous random number generator using the UNURAN generator specification string genStr, main stream s, and auxiliary stream aux.

Method Detail

nextDouble

public double nextDouble()
Description copied from class: RandomVariateGen
Generates a random number from the continuous distribution contained in this object. By default, this method uses inversion by calling the inverseF method of the distribution object. Alternative generating methods are provided in subclasses.

Overrides:
nextDouble in class RandomVariateGen
Returns:
the generated value

nextArrayOfDouble

public void nextArrayOfDouble(double[] v,
                              int start,
                              int n)
Description copied from class: RandomVariateGen
Generates n random numbers from the continuous distribution contained in this object. These numbers are stored in the array v, starting from index start. By default, this method calls nextDouble() n times, but one can override it in subclasses for better efficiency.

Overrides:
nextArrayOfDouble in class RandomVariateGen
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

getDistribution

public Distribution getDistribution()
Description copied from class: RandomVariateGen
Returns the Distribution used by this generator.

Overrides:
getDistribution in class RandomVariateGen
Returns:
the distribution associated to that object

getStream

public RandomStream getStream()
Description copied from class: RandomVariateGen
Returns the RandomStream used by this generator.

Overrides:
getStream in class RandomVariateGen
Returns:
the stream associated to this object

getAuxStream

public RandomStream getAuxStream()
Returns the auxiliary random number stream.


SSJ
V. 2.6.2.

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