This generator is described in a paper by François Panneton, Pierre L'Ecuyer and Makoto Matsumoto Improved Long-Period Generators Based on Linear Recurrences Modulo 2 ACM Transactions on Mathematical Software, 32, 1 (2006). The errata for the paper are in wellrng-errata.txt.
| Modifier and Type | Field and Description |
|---|---|
| protected final int[] | i1
Index indirection table giving for each index the value index + m1 taking table size into account. |
| protected final int[] | i2
Index indirection table giving for each index the value index + m2 taking table size into account. |
| protected final int[] | i3
Index indirection table giving for each index the value index + m3 taking table size into account. |
| protected int | index
Current index in the bytes pool. |
| protected final int[] | iRm1
Index indirection table giving for each index its predecessor taking table size into account. |
| protected final int[] | iRm2
Index indirection table giving for each index its second predecessor taking table size into account. |
| private static final long | serialVersionUID
Hides org. |
| protected final int[] | v
Bytes pool. |
| Access | Constructor and Description |
|---|---|
| protected | AbstractWell(final int
number of bits in the pool (not necessarily a multiple of 32) k, final int first parameter of the algorithm m1, final int second parameter of the algorithm m2, final int third parameter of the algorithm m3)Creates a new random number generator. |
| protected | AbstractWell(final int
number of bits in the pool (not necessarily a multiple of 32) k, final int first parameter of the algorithm m1, final int second parameter of the algorithm m2, final int third parameter of the algorithm m3, final int the initial seed (32 bits integer) seed)Creates a new random number generator using a single int seed. |
| protected | AbstractWell(final int
number of bits in the pool (not necessarily a multiple of 32) k, final int first parameter of the algorithm m1, final int second parameter of the algorithm m2, final int third parameter of the algorithm m3, final int[] the initial seed (32 bits integers array), if null
the seed of the generator will be related to the current time seed)Creates a new random number generator using an int array seed. |
| protected | AbstractWell(final int
number of bits in the pool (not necessarily a multiple of 32) k, final int first parameter of the algorithm m1, final int second parameter of the algorithm m2, final int third parameter of the algorithm m3, final long the initial seed (64 bits integer) seed)Creates a new random number generator using a single long seed. |
| Modifier and Type | Method and Description |
|---|---|
| protected abstract int | next(final int
number of random bits to produce bits)Implements abstract org. Generate next pseudorandom number. |
| public void | setSeed(final int
the initial seed (32 bits integer) seed)Implements abstract org. Implements org. Reinitialize the generator as if just built with the given int seed. |
| public void | setSeed(final int[]
the initial seed (32 bits integers array). If null
the seed of the generator will be the system time plus the system identity
hash code of the instance. seed)Implements abstract org. Implements org. Reinitialize the generator as if just built with the given int array seed. |
| public void | setSeed(final long
the initial seed (64 bits integer) seed)Implements abstract org. Implements org. Reinitialize the generator as if just built with the given long seed. |
| i1 | back to summary |
|---|---|
| protected final int[] i1 Index indirection table giving for each index the value index + m1 taking table size into account. | |
| i2 | back to summary |
|---|---|
| protected final int[] i2 Index indirection table giving for each index the value index + m2 taking table size into account. | |
| i3 | back to summary |
|---|---|
| protected final int[] i3 Index indirection table giving for each index the value index + m3 taking table size into account. | |
| index | back to summary |
|---|---|
| protected int index Current index in the bytes pool. | |
| iRm1 | back to summary |
|---|---|
| protected final int[] iRm1 Index indirection table giving for each index its predecessor taking table size into account. | |
| iRm2 | back to summary |
|---|---|
| protected final int[] iRm2 Index indirection table giving for each index its second predecessor taking table size into account. | |
| serialVersionUID | back to summary |
|---|---|
| private static final long serialVersionUID Hides org. Serializable version identifier. | |
| v | back to summary |
|---|---|
| protected final int[] v Bytes pool. | |
| AbstractWell | back to summary |
|---|---|
| protected AbstractWell(final int k, final int m1, final int m2, final int m3) Creates a new random number generator. The instance is initialized using the current time plus the system identity hash code of this instance as the seed.
| |
| AbstractWell | back to summary |
|---|---|
| protected AbstractWell(final int k, final int m1, final int m2, final int m3, final int seed) Creates a new random number generator using a single int seed.
| |
| AbstractWell | back to summary |
|---|---|
| protected AbstractWell(final int k, final int m1, final int m2, final int m3, final int[] seed) Creates a new random number generator using an int array seed.
| |
| AbstractWell | back to summary |
|---|---|
| protected AbstractWell(final int k, final int m1, final int m2, final int m3, final long seed) Creates a new random number generator using a single long seed.
| |
| next | back to summary |
|---|---|
| protected abstract int next(final int bits) Implements abstract org. Doc from org. Generate next pseudorandom number. This method is the core generation algorithm. It is used by all the
public generation methods for the various primitive types
| |
| setSeed | back to summary |
|---|---|
| public void setSeed(final int seed) Implements abstract org. Implements org. Reinitialize the generator as if just built with the given int seed. The state of the generator is exactly the same as a new generator built with the same seed.
| |
| setSeed | back to summary |
|---|---|
| public void setSeed(final int[] seed) Implements abstract org. Implements org. Reinitialize the generator as if just built with the given int array seed. The state of the generator is exactly the same as a new generator built with the same seed.
| |
| setSeed | back to summary |
|---|---|
| public void setSeed(final long seed) Implements abstract org. Implements org. Reinitialize the generator as if just built with the given long seed. The state of the generator is exactly the same as a new generator built with the same seed.
| |