|
SSJ V. 2.6. |
||||||||
| 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.UnuranDiscreteInt
public class UnuranDiscreteInt
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()
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. |
| 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 |
|---|
public UnuranDiscreteInt(RandomStream s,
String genStr)
UnuranDiscreteInt (s, s, genStr).
public UnuranDiscreteInt(RandomStream s,
RandomStream aux,
String genStr)
| Method Detail |
|---|
public int nextInt()
RandomVariateGenInt
nextInt in class RandomVariateGenInt
public 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()
|
SSJ V. 2.6. |
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||