|
SSJ V. 2.6.2. |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object umontreal.iro.lecuyer.rng.RandomStreamBase umontreal.iro.lecuyer.rng.F2NL607
public class F2NL607
Implements the RandomStream
interface by using as a backbone
generator the combination of the WELL607 proposed in
(and implemented in WELL607
) with a nonlinear generator.
This nonlinear generator is made up of a small number of components (say n)
combined via addition modulo 1. Each component contains an array already
filled with a ``random'' permutation of
{0,..., s - 1} where s is the
size of the array.
These numbers and the lengths of the components can be changed by the user.
Each call to the generator uses the next number in each array
(or the first one if we are at the end of the array). By default,
there are 3 components of lengths 1019, 1021, and 1031, respectively.
The non-linear generator is combined with the WELL using a bitwise XOR operation.
This ensures that the new generator has at least as much equidistribution
as the WELL607, as shown in.
The combined generator has a period length of approximatively
2637. The values of V, W and Z
are 2250,
2150, and 2400, respectively (see RandomStream
for their
definition). The seed of the RNG has two part: the linear part is a
19-dimensional vector of 32-bit integers, while the nonlinear part is
made up of a n-dimensional vector of indices, representing the position
of the generator in each array of the nonlinear components.
Constructor Summary | |
---|---|
F2NL607()
Constructs a new stream, initializing it at its beginning. |
|
F2NL607(String name)
Constructs a new stream with the identifier name (used in the toString method). |
Method Summary | |
---|---|
F2NL607 |
clone()
Clones the current generator and return its copy. |
int[] |
getLinearState()
Returns the current state of the linear part of the stream, represented as an array of 19 integers. |
static int[][] |
getNonLinearData()
Return the data of all the components of the non-linear part of the random number generator. |
int[] |
getNonLinearState()
Returns the current state of the non-linear part of the stream, represented as an array of n integers, where n is the number of components in the non-linear generator. |
void |
resetNextSubstream()
Reinitializes the stream to the beginning of its next substream: Ng is computed, and Cg and Bg are set to Ng. |
void |
resetStartStream()
Reinitializes the stream to its initial state Ig: Cg and Bg are set to Ig. |
void |
resetStartSubstream()
Reinitializes the stream to the beginning of its current substream: Cg is set to Bg. |
void |
setLinearSeed(int[] seed)
This method is discouraged for normal use. |
static void |
setNonLinearData(int[][] data)
Selects new data for the components of the non-linear generator. |
void |
setNonLinearSeed(int[] seed)
This method is discouraged for normal use. |
static void |
setPackageLinearSeed(int[] seed)
Sets the initial seed of the linear part of the class F2NL607 to the 19 integers of the vector seed[0..18]. |
static void |
setPackageNonLinearSeed(int[] seed)
Sets the non-linear part of the initial seed of the class F2NL607 to the n integers of the vector seed[0..n-1], where n is the number of components of the non-linear part. |
static void |
setScrambleData(RandomStream rand,
int steps,
int[] size)
Selects new data for the components of the non-linear generator. |
String |
toString()
Returns a string containing the current state of this stream. |
Methods inherited from class umontreal.iro.lecuyer.rng.RandomStreamBase |
---|
formatState, formatStateFull, increasedPrecision, nextArrayOfDouble, nextArrayOfInt, nextDouble, nextInt |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public F2NL607()
public F2NL607(String name)
name
- name of the streamMethod Detail |
---|
public void resetStartStream()
RandomStream
resetStartStream
in interface RandomStream
resetStartStream
in class RandomStreamBase
public void resetStartSubstream()
RandomStream
resetStartSubstream
in interface RandomStream
resetStartSubstream
in class RandomStreamBase
public void resetNextSubstream()
RandomStream
resetNextSubstream
in interface RandomStream
resetNextSubstream
in class RandomStreamBase
public static void setPackageLinearSeed(int[] seed)
seed
- array of 19 elements representing the seedpublic void setLinearSeed(int[] seed)
seed
- array of 19 elements representing the seedpublic int[] getLinearState()
public static void setPackageNonLinearSeed(int[] seed)
seed
- array of n elements representing the non-linear seedpublic void setNonLinearSeed(int[] seed)
seed
- public int[] getNonLinearState()
public static int[][] getNonLinearData()
public static void setNonLinearData(int[][] data)
NOTE : This method cannot be called if at least one instance of
F2NL607 has been constructed. In that case, it will throw
an IllegalStateException
.
data
- the new data of the components
IllegalStateException
- if an instance of the class was
constructed beforepublic static void setScrambleData(RandomStream rand, int steps, int[] size)
NOTE : This method cannot be called if at least one instance of
F2NL607 has been constructed. In that case, it will throw
an IllegalStateException
.
rand
- the random numbers source to do the scramblingsteps
- number of time to do the scramblingsize
- size of each components
IllegalStateException
- if an instance of the class was
constructed beforepublic F2NL607 clone()
clone
in interface CloneableRandomStream
public String toString()
RandomStream
toString
in interface RandomStream
toString
in class RandomStreamBase
|
SSJ V. 2.6.2. |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |