Class AbstractWell.IndexTable
java.lang.Object
org.apache.commons.rng.core.source32.AbstractWell.IndexTable
- Enclosing class:
AbstractWell
Inner class used to store the indirection index table which is fixed for a given
type of WELL class of pseudo-random number generator.
- Since:
- 1.0
-
Constructor Summary
ConstructorsConstructorDescriptionIndexTable(int k, int m1, int m2, int m3) Creates a new pre-calculated indirection index table. -
Method Summary
Modifier and TypeMethodDescriptionintgetIndexM1(int index) Returns index + M1 modulo the table size.intgetIndexM2(int index) Returns index + M2 modulo the table size.intgetIndexM3(int index) Returns index + M3 modulo the table size.intgetIndexPred(int index) Returns the predecessor of the given index modulo the table size.intgetIndexPred2(int index) Returns the second predecessor of the given index modulo the table size.
-
Constructor Details
-
IndexTable
Creates a new pre-calculated indirection index table.- Parameters:
k- number of bits in the pool (not necessarily a multiple of 32)m1- first parameter of the algorithmm2- second parameter of the algorithmm3- third parameter of the algorithm
-
-
Method Details
-
getIndexPred
Returns the predecessor of the given index modulo the table size.- Parameters:
index- the index to look at- Returns:
- (index - 1) % table size
-
getIndexPred2
Returns the second predecessor of the given index modulo the table size.- Parameters:
index- the index to look at- Returns:
- (index - 2) % table size
-
getIndexM1
Returns index + M1 modulo the table size.- Parameters:
index- the index to look at- Returns:
- (index + M1) % table size
-
getIndexM2
Returns index + M2 modulo the table size.- Parameters:
index- the index to look at- Returns:
- (index + M2) % table size
-
getIndexM3
Returns index + M3 modulo the table size.- Parameters:
index- the index to look at- Returns:
- (index + M3) % table size
-