SSJ
V. labo.

umontreal.iro.lecuyer.randvar
Class RandomVariateGenInt

java.lang.Object
  extended by umontreal.iro.lecuyer.randvar.RandomVariateGen
      extended by umontreal.iro.lecuyer.randvar.RandomVariateGenInt
Direct Known Subclasses:
BernoulliGen, BinomialGen, GeometricGen, HypergeometricGen, LogarithmicGen, NegativeBinomialGen, PascalGen, PoissonGen, UniformIntGen, UnuranDiscreteInt

public class RandomVariateGenInt
extends RandomVariateGen

RandomVariateGenInt

This is the base class for all generators of discrete random variates over the set of integers. Similar to RandomVariateGen, except that the generators produce integers, via the nextInt method, instead of real numbers.


Constructor Summary
RandomVariateGenInt(RandomStream s, DiscreteDistributionInt dist)
          .
 
Method Summary
 DiscreteDistributionInt getDistribution()
          .
 void nextArrayOfInt(int[] v, int start, int n)
          .
 int nextInt()
          .
 
Methods inherited from class umontreal.iro.lecuyer.randvar.RandomVariateGen
getStream, nextArrayOfDouble, nextDouble, setStream, toString
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

RandomVariateGenInt

public RandomVariateGenInt(RandomStream s,
                           DiscreteDistributionInt dist)
. \begin{tabb}Creates a new random variate generator for the discrete
 distribution \texttt{dist}, using stream \texttt{s}.
 \end{tabb}
srandom stream used for generating uniforms distdiscrete distribution object of the generated values

Method Detail

nextInt

public int nextInt()
. \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


nextArrayOfInt

public void nextArrayOfInt(int[] v,
                           int start,
                           int n)
. \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


getDistribution

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

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

SSJ
V. labo.

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