SSJ
V. labo.

umontreal.iro.lecuyer.randvar
Class UnuranDiscreteInt

java.lang.Object
  extended by umontreal.iro.lecuyer.randvar.RandomVariateGen
      extended by umontreal.iro.lecuyer.randvar.RandomVariateGenInt
          extended by umontreal.iro.lecuyer.randvar.UnuranDiscreteInt

public class UnuranDiscreteInt
extends RandomVariateGenInt

This class permits one to create a discrete univariate generator using UNURAN via its string API.


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

Constructor Detail

UnuranDiscreteInt

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


UnuranDiscreteInt

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

Method Detail

nextInt

public int nextInt()
Description copied from class: RandomVariateGenInt
. \begin{tabb}
 Generates a random number (an integer) from the discrete
 distribu...
 ... object.
 Alternative generating methods are provided in subclasses.
 \end{tabb}
the generated value

Overrides:
nextInt in class RandomVariateGenInt

nextArrayOfInt

public void nextArrayOfInt(int[] v,
                           int start,
                           int n)
Description copied from class: RandomVariateGenInt
. \begin{tabb}Generates \texttt{n} random numbers from the discrete distribution
 ...
 ...mes, but one can reimplement it in subclasses for better efficiency.
 \end{tabb}
varray into which the variates will be stored startstarting index, in v, of the new variates nnumber of variates being generated

Overrides:
nextArrayOfInt in class RandomVariateGenInt

getDistribution

public DiscreteDistributionInt getDistribution()
Description copied from class: RandomVariateGenInt
. \begin{tabb}
 Returns the \class{DiscreteDistributionInt} used by this generator.
 \end{tabb}
the distribution associated to that object

Overrides:
getDistribution in class RandomVariateGenInt
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. labo.

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