SSJ
V. 2.0.

umontreal.iro.lecuyer.randvar
Class PascalGen

java.lang.Object
  extended by umontreal.iro.lecuyer.randvar.RandomVariateGen
      extended by umontreal.iro.lecuyer.randvar.RandomVariateGenInt
          extended by umontreal.iro.lecuyer.randvar.PascalGen
Direct Known Subclasses:
PascalConvolutionGen

public class PascalGen
extends RandomVariateGenInt

Implements Pascal random variate generators, which is a special case of the negative binomial generator with parameter γ equal to a positive integer. See NegativeBinomialGen for a description.


Constructor Summary
PascalGen(RandomStream s, PascalDist dist)
          Creates a new generator for the distribution dist, using stream s.
 
Method Summary
 int nextInt()
          Generates a random number (an integer) from the discrete distribution contained in this object.
static int nextInt(RandomStream s, int n, double p)
          Generates a new variate from the Pascal distribution, with parameters n = n and p = p, using stream s.
 
Methods inherited from class umontreal.iro.lecuyer.randvar.RandomVariateGenInt
getDistribution, nextArrayOfInt
 
Methods inherited from class umontreal.iro.lecuyer.randvar.RandomVariateGen
getStream, nextArrayOfDouble, nextDouble, setStream
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PascalGen

public PascalGen(RandomStream s,
                 PascalDist dist)
Creates a new generator for the distribution dist, using stream s.

Method Detail

nextInt

public int nextInt()
Description copied from class: RandomVariateGenInt
Generates a random number (an integer) from the discrete 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:
nextInt in class RandomVariateGenInt
Returns:
the generated value

nextInt

public static int nextInt(RandomStream s,
                          int n,
                          double p)
Generates a new variate from the Pascal distribution, with parameters n = n and p = p, using stream s.


SSJ
V. 2.0.

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