|
SSJ V. labo. |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectumontreal.iro.lecuyer.randvar.RandomVariateGen
umontreal.iro.lecuyer.randvar.RandomVariateGenInt
umontreal.iro.lecuyer.randvar.BinomialGen
umontreal.iro.lecuyer.randvar.BinomialConvolutionGen
public class BinomialConvolutionGen
BinomialConvolutionGen
Implements binomial random variate generators using the convolution method. This method generates n Bernouilli random variates with parameter p and adds them up. Its advantages are that it requires little computer memory and no setup time. Its disadvantage is that it is very slow for large n. It makes sense only when n is small.
Constructor Summary | |
---|---|
BinomialConvolutionGen(RandomStream s,
BinomialDist dist)
. |
|
BinomialConvolutionGen(RandomStream s,
int n,
double p)
. |
Method Summary | |
---|---|
int |
nextInt()
. |
static int |
nextInt(RandomStream s,
int n,
double p)
|
Methods inherited from class umontreal.iro.lecuyer.randvar.BinomialGen |
---|
getN, getP |
Methods inherited from class umontreal.iro.lecuyer.randvar.RandomVariateGenInt |
---|
getDistribution, nextArrayOfInt |
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 |
---|
public BinomialConvolutionGen(RandomStream s, int n, double p)
public BinomialConvolutionGen(RandomStream s, BinomialDist dist)
Method Detail |
---|
public int nextInt()
RandomVariateGenInt
nextInt
in class RandomVariateGenInt
public static int nextInt(RandomStream s, int n, double p)
|
SSJ V. labo. |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |