This container class permits one to apply the baker’s transformation to the output of any RandomStream. More...
Public Member Functions | |
| BakerTransformedStream (RandomStream stream) | |
| Constructs a new baker transformed stream, using the random numbers from the base stream stream. | |
| void | resetStartStream () |
| Reinitializes the stream to its initial state \(I_g\): \(C_g\) and \(B_g\) are set to \(I_g\). | |
| void | resetStartSubstream () |
| Reinitializes the stream to the beginning of its current substream: | |
| void | resetNextSubstream () |
| Reinitializes the stream to the beginning of its next substream: | |
| String | toString () |
| Returns a string starting with "Baker transformation of " and finishing with the result of the call to the toString method of the generator. | |
| double | nextDouble () |
| Returns the baker transformation of s.nextDouble() where s is the base stream. | |
| int | nextInt (int i, int j) |
| Generates a random integer in \(\{i,...,j\}\) via nextDouble (in which the baker transformation is applied). | |
| void | nextArrayOfDouble (double[] u, int start, int n) |
| Calls nextArrayOfDouble (u, start, n) for the base stream, then applies the baker transformation. | |
| void | nextArrayOfInt (int i, int j, int[] u, int start, int n) |
| Fills up the array by calling nextInt (i, j). | |
This container class permits one to apply the baker’s transformation to the output of any RandomStream.
It transforms each \(u \in[0,1]\) into \(2u\) if \(u \le1/2\) and \(2(1-u)\) if \(u > 1/2\). The nextDouble method will return the result of this transformation and the other next... methods are affected accordingly. Any instance of this class contains a RandomStream called its base stream, used to generate its numbers and to which the transformation is applied. Any call to one of the next... methods of this class will modify the state of the base stream.
The baker transformation is often applied when the RandomStream is actually an iterator over a point set used for quasi-Monte Carlo integration (see the hups package).
Definition at line 44 of file BakerTransformedStream.java.
| umontreal.ssj.rng.BakerTransformedStream.BakerTransformedStream | ( | RandomStream | stream | ) |
Constructs a new baker transformed stream, using the random numbers from the base stream stream.
Definition at line 53 of file BakerTransformedStream.java.
| void umontreal.ssj.rng.BakerTransformedStream.nextArrayOfDouble | ( | double[] | u, |
| int | start, | ||
| int | n ) |
Calls nextArrayOfDouble (u, start, n) for the base stream, then applies the baker transformation.
| u | the array in which the numbers will be stored |
| start | the first index of u to be used |
| n | the number of random numbers to put in u |
Implements umontreal.ssj.rng.RandomStream.
Definition at line 105 of file BakerTransformedStream.java.
| void umontreal.ssj.rng.BakerTransformedStream.nextArrayOfInt | ( | int | i, |
| int | j, | ||
| int[] | u, | ||
| int | start, | ||
| int | n ) |
Fills up the array by calling nextInt (i, j).
| i | the smallest possible integer to put in u |
| j | the largest possible integer to put in u |
| u | the array in which the numbers will be stored |
| start | the first index of u to be used |
| n | the number of random numbers to put in u |
Implements umontreal.ssj.rng.RandomStream.
Definition at line 123 of file BakerTransformedStream.java.
| double umontreal.ssj.rng.BakerTransformedStream.nextDouble | ( | ) |
Returns the baker transformation of s.nextDouble() where s is the base stream.
Implements umontreal.ssj.rng.RandomStream.
Definition at line 81 of file BakerTransformedStream.java.
| int umontreal.ssj.rng.BakerTransformedStream.nextInt | ( | int | i, |
| int | j ) |
Generates a random integer in \(\{i,...,j\}\) via nextDouble (in which the baker transformation is applied).
Implements umontreal.ssj.rng.RandomStream.
Definition at line 93 of file BakerTransformedStream.java.
| void umontreal.ssj.rng.BakerTransformedStream.resetNextSubstream | ( | ) |
Reinitializes the stream to the beginning of its next substream:
\(N_g\) is computed, and \(C_g\) and \(B_g\) are set to \(N_g\).
Implements umontreal.ssj.rng.RandomStream.
Definition at line 65 of file BakerTransformedStream.java.
| void umontreal.ssj.rng.BakerTransformedStream.resetStartStream | ( | ) |
Reinitializes the stream to its initial state \(I_g\): \(C_g\) and \(B_g\) are set to \(I_g\).
Implements umontreal.ssj.rng.RandomStream.
Definition at line 57 of file BakerTransformedStream.java.
| void umontreal.ssj.rng.BakerTransformedStream.resetStartSubstream | ( | ) |
Reinitializes the stream to the beginning of its current substream:
\(C_g\) is set to \(B_g\).
Implements umontreal.ssj.rng.RandomStream.
Definition at line 61 of file BakerTransformedStream.java.
| String umontreal.ssj.rng.BakerTransformedStream.toString | ( | ) |
Returns a string starting with "Baker transformation of " and finishing with the result of the call to the toString method of the generator.
Implements umontreal.ssj.rng.RandomStream.
Definition at line 73 of file BakerTransformedStream.java.