@Deprecated public class RandMrg extends java.lang.Object implements CloneableRandomStream, java.io.Serializable
| Constructor and Description |
|---|
RandMrg()
Deprecated.
Constructs a new stream, initializes its seed Ig,
sets Bg and Cg equal to Ig, and sets its antithetic switch
to false.
|
RandMrg(java.lang.String name)
Deprecated.
Constructs a new stream with an identifier name
(can be used when printing the stream state, in error messages, etc.).
|
| Modifier and Type | Method and Description |
|---|---|
void |
advanceState(int e,
int c)
Deprecated.
Advances the state of this stream by k values,
without modifying the states of other streams (as in setSeed),
nor the values of Bg and Ig associated with this stream.
|
RandMrg |
clone()
Deprecated.
Clones the current generator and return its copy.
|
double[] |
getState()
Deprecated.
Returns the current state Cg of this stream.
|
void |
increasedPrecis(boolean incp)
Deprecated.
After calling this method with incp = true, each call to
the generator (direct or indirect) for this stream
will return a uniform random number with (roughly) 53 bits of resolution
instead of 32 bits,
and will advance the state of the stream by 2 steps instead of 1.
|
void |
nextArrayOfDouble(double[] u,
int start,
int n)
Deprecated.
Generates n (pseudo)random numbers from the
uniform distribution and stores them into the array u
starting at index start.
|
void |
nextArrayOfInt(int i,
int j,
int[] u,
int start,
int n)
Deprecated.
Generates n (pseudo)random numbers
from the discrete uniform
distribution over the integers
{i, i + 1,..., j},
using this stream and stores the result in the array u
starting at index start.
|
double |
nextDouble()
Deprecated.
Returns a (pseudo)random number from the uniform distribution
over the interval (0, 1), using this stream,
after advancing its state by one step.
|
int |
nextInt(int i,
int j)
Deprecated.
Returns a (pseudo)random number from the discrete uniform
distribution over the integers
{i, i + 1,..., j},
using this stream.
|
void |
resetNextSubstream()
Deprecated.
Reinitializes the stream to the beginning of its next
substream: Ng is computed, and
Cg and Bg are set to Ng.
|
void |
resetStartStream()
Deprecated.
Reinitializes the stream to its initial state Ig:
Cg and Bg are set to Ig.
|
void |
resetStartSubstream()
Deprecated.
Reinitializes the stream to the beginning of its current
substream: Cg is set to Bg.
|
void |
setAntithetic(boolean anti)
Deprecated.
|
static void |
setPackageSeed(long[] seed)
Deprecated.
Sets the initial seed for the class RandMrg to the
six integers in the vector seed[0..5].
|
void |
setSeed(long[] seed)
Deprecated.
Sets the initial seed Ig of this stream
to the vector seed[0..5].
|
java.lang.String |
toString()
Deprecated.
Returns a string containing the current state of this stream.
|
java.lang.String |
toStringFull()
Deprecated.
Returns a string containing the name of this stream and the
values of all its internal variables.
|
public RandMrg()
setPackageSeed if this is the first stream created,
otherwise it is Z steps ahead of that of the stream most recently
created in this class.public RandMrg(java.lang.String name)
name - name of the streampublic static void setPackageSeed(long[] seed)
seed - array of 6 elements representing the seedpublic void resetStartStream()
RandomStreamresetStartStream in interface RandomStreampublic void resetStartSubstream()
RandomStreamresetStartSubstream in interface RandomStreampublic void resetNextSubstream()
RandomStreamresetNextSubstream in interface RandomStreampublic void increasedPrecis(boolean incp)
By default, or if this method is called again with incp = false, each call to nextDouble for this stream advances the state by 1 step and returns a number with 32 bits of resolution.
incp - true if increased precision is desired, false otherwisepublic void setAntithetic(boolean anti)
public void advanceState(int e,
int c)
e - an exponentc - a constantpublic void setSeed(long[] seed)
seed - array of 6 integers representing the new seedpublic double[] getState()
public java.lang.String toString()
RandomStreamtoString in interface RandomStreamtoString in class java.lang.Objectpublic java.lang.String toStringFull()
public double nextDouble()
nextDouble in interface RandomStreampublic void nextArrayOfDouble(double[] u,
int start,
int n)
RandomStreamnextArrayOfDouble in interface RandomStreamu - array that will contain the generated uniformsstart - starting index, in the array u, to write uniforms fromn - number of uniforms to generatepublic int nextInt(int i,
int j)
RandomStreamnextInt in interface RandomStreami - smallest integer that can be generatedj - greatest integer that can be generatedpublic void nextArrayOfInt(int i,
int j,
int[] u,
int start,
int n)
RandomStreamnextArrayOfInt in interface RandomStreami - smallest integer that can be generatedj - greatest integer that can be generatedu - array that will contain the generated valuesstart - starting index, in the array u, to write integers fromn - number of values being generatedpublic RandMrg clone()
clone in interface CloneableRandomStreamclone in class java.lang.ObjectTo submit a bug or ask questions, send an e-mail to Pierre L'Ecuyer.