public class UnuranDiscreteInt extends RandomVariateGenInt
| Constructor and Description |
|---|
UnuranDiscreteInt(RandomStream s,
RandomStream aux,
java.lang.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,
java.lang.String genStr)
Same as
UnuranDiscreteInt (s, s, genStr). |
| Modifier and Type | Method and Description |
|---|---|
RandomStream |
getAuxStream()
Returns the auxiliary random number stream.
|
DiscreteDistributionInt |
getDistribution()
Returns the
DiscreteDistributionInt used by this generator. |
RandomStream |
getStream()
Returns the
RandomStream used by this generator. |
void |
nextArrayOfInt(int[] v,
int start,
int n)
Generates n random numbers from the discrete distribution
contained in this object.
|
int |
nextInt()
Generates a random number (an integer) from the discrete
distribution contained in this object.
|
nextArrayOfDouble, nextDouble, setStreampublic UnuranDiscreteInt(RandomStream s, java.lang.String genStr)
UnuranDiscreteInt (s, s, genStr).public UnuranDiscreteInt(RandomStream s, RandomStream aux, java.lang.String genStr)
public int nextInt()
RandomVariateGenIntnextInt in class RandomVariateGenIntpublic void nextArrayOfInt(int[] v,
int start,
int n)
RandomVariateGenIntnextInt() n
times, but one can reimplement it in subclasses for better efficiency.nextArrayOfInt in class RandomVariateGenIntv - array into which the variates will be storedstart - starting index, in v, of the new variatesn - number of variates being generatedpublic DiscreteDistributionInt getDistribution()
RandomVariateGenIntDiscreteDistributionInt used by this generator.getDistribution in class RandomVariateGenIntpublic RandomStream getStream()
RandomVariateGenRandomStream used by this generator.getStream in class RandomVariateGenpublic RandomStream getAuxStream()
To submit a bug or ask questions, send an e-mail to Pierre L'Ecuyer.