|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectedu.rit.util.Random
edu.rit.util.Mcg1Random
public class Mcg1Random
Class Mcg1Random provides a default pseudorandom number generator (PRNG) designed for use in parallel scientific programming. To create an instance of class Mcg1Random, either use the Mcg1Random() constructor, or use the static getInstance(long,String) method in class Random.
Class Mcg1Random uses L'Ecuyer's 63-bit multiplicative congruential generator:
seed := seed * A (mod M);
with A = 2307085864 and M = 263-25. For further
information, see P. L'Ecuyer, F. Blouin, and R. Couture, A search for good
multiple recursive random number generators, ACM Transactions on Modeling
and Computer Simulation, 3(2):87-98, April 1993.
| Constructor Summary | |
|---|---|
Mcg1Random(long seed)
Construct a new PRNG with the given seed. |
|
| Method Summary | |
|---|---|
protected long |
next()
Return the next 64-bit pseudorandom value in this PRNG's sequence. |
protected long |
next(long skip)
Return the 64-bit pseudorandom value the given number of positions ahead in this PRNG's sequence. |
void |
setSeed(long seed)
Set this PRNG's seed. |
| Methods inherited from class edu.rit.util.Random |
|---|
getInstance, getInstance, nextBoolean, nextBoolean, nextByte, nextByte, nextCharacter, nextCharacter, nextDouble, nextDouble, nextFloat, nextFloat, nextInt, nextInt, nextInteger, nextInteger, nextLong, nextLong, nextShort, nextShort, nextUnsignedByte, nextUnsignedByte, nextUnsignedShort, nextUnsignedShort, skip, skip |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public Mcg1Random(long seed)
seed - Seed.
IllegalArgumentException - (unchecked exception) Thrown if seed = 0.| Method Detail |
|---|
public void setSeed(long seed)
setSeed in class Randomseed - Seed.
IllegalArgumentException - (unchecked exception) Thrown if seed = 0.protected long next()
next in class Randomprotected long next(long skip)
next in class Randomskip - Number of positions to skip, assumed to be > 0.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||