public class TruncatedRandomStream extends java.lang.Object implements RandomStream
| Constructor and Description |
|---|
TruncatedRandomStream(RandomStream stream,
double a,
double b) |
| Modifier and Type | Method and Description |
|---|---|
void |
nextArrayOfDouble(double[] u,
int start,
int n)
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)
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()
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)
Returns a (pseudo)random number from the discrete uniform
distribution over the integers
{i, i + 1,..., j},
using this stream.
|
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.
|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waittoStringpublic TruncatedRandomStream(RandomStream stream, double a, double b)
public void resetStartStream()
RandomStreamresetStartStream in interface RandomStreampublic void resetStartSubstream()
RandomStreamresetStartSubstream in interface RandomStreampublic void resetNextSubstream()
RandomStreamresetNextSubstream in interface RandomStreampublic double nextDouble()
RandomStreamnextDouble 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 generatedTo submit a bug or ask questions, send an e-mail to Pierre L'Ecuyer.