SSJ
3.2.1
Stochastic Simulation in Java
|
This class allows us to read the parameters defining a digital net in base 2 either from a file, or from a URL address on the World Wide Web. More...
Public Member Functions | |
DigitalNetBase2FromFile (String filename, int r1, int w, int s1) throws IOException, MalformedURLException | |
Constructs a digital net in base 2 after reading its parameters from file filename . More... | |
DigitalNetBase2FromFile (String filename, int s1) throws IOException, MalformedURLException | |
Same as DigitalNetBase2FromFile(filename, r, 31, s1) where s1 is the dimension and r is given in data file filename . More... | |
String | toString () |
String | toStringDetailed () |
Writes the parameters and the generating matrices of this digital net to a string. More... | |
![]() | |
void | printGeneratorMatrices (int s) |
Prints the generator matrices as bit matrices in standard form for dimensions 1 to \(s\). | |
void | printGeneratorMatricesTrans (int s) |
Prints the generator matrices transposed in the form of integers for dimensions 1 to \(s\). More... | |
double | getCoordinate (int i, int j) |
double | getCoordinateNoGray (int i, int j) |
PointSetIterator | iterator () |
PointSetIterator | iteratorNoGray () |
This iterator does not use the Gray code. More... | |
String | toString () |
void | clearRandomShift () |
void | addRandomShift (RandomStream stream) |
void | addRandomShift (int d1, int d2, RandomStream stream) |
void | leftMatrixScramble (RandomStream stream) |
void | iBinomialMatrixScramble (RandomStream stream) |
void | stripedMatrixScramble (RandomStream stream) |
void | rightMatrixScramble (RandomStream stream) |
void | nestedUniformScramble (RandomStream stream, double[][] output) |
Same as nestedUniformScramble(stream, output, 0) . | |
void | nestedUniformScramble (RandomStream stream, double[][] output, int numBits) |
Apply Owen's nested uniform scrambling. More... | |
void | leftMatrixScrambleDiag (RandomStream stream) |
void | leftMatrixScrambleFaurePermut (RandomStream stream, int sb) |
void | leftMatrixScrambleFaurePermutDiag (RandomStream stream, int sb) |
void | leftMatrixScrambleFaurePermutAll (RandomStream stream, int sb) |
void | iBinomialMatrixScrambleFaurePermut (RandomStream stream, int sb) |
void | iBinomialMatrixScrambleFaurePermutDiag (RandomStream stream, int sb) |
void | iBinomialMatrixScrambleFaurePermutAll (RandomStream stream, int sb) |
void | stripedMatrixScrambleFaurePermutAll (RandomStream stream, int sb) |
![]() | |
double | getCoordinate (int i, int j) |
PointSetIterator | iterator () |
DigitalNet () | |
Empty constructor. | |
double | getCoordinateNoGray (int i, int j) |
Returns \(u_{i,j}\), the coordinate \(j\) of point \(i\), the points being enumerated in the standard order (no Gray code). More... | |
PointSetIterator | iteratorNoGray () |
This iterator does not use the Gray code. More... | |
void | addRandomShift (int d1, int d2, RandomStream stream) |
Adds a random digital shift to all the points of the point set, using stream stream to generate the random numbers. More... | |
void | addRandomShift (RandomStream stream) |
Same as addRandomShift(0, dim, stream), where dim is the dimension of the digital net. More... | |
void | clearRandomShift () |
Erases the current digital random shift, if any. | |
String | toString () |
void | leftMatrixScramble (RandomStream stream) |
Applies a linear scramble by multiplying each \(\mathbf{C}_j\) on the left by a \(w\times w\) nonsingular lower-triangular matrix \(\mathbf{M}_j\), as suggested by Matoušek [169] and implemented by Hong and Hickernell [86] . More... | |
void | leftMatrixScrambleDiag (RandomStream stream) |
Similar to leftMatrixScramble except that all the off-diagonal elements of the \(\mathbf{M}_j\) are 0. More... | |
void | leftMatrixScrambleFaurePermut (RandomStream stream, int sb) |
Similar to leftMatrixScramble except that the diagonal elements of each matrix \(\mathbf{M}_j\) are chosen from a restricted set of the best integers as calculated by Faure [56] . More... | |
void | leftMatrixScrambleFaurePermutDiag (RandomStream stream, int sb) |
Similar to leftMatrixScrambleFaurePermut except that all off-diagonal elements are 0. More... | |
void | leftMatrixScrambleFaurePermutAll (RandomStream stream, int sb) |
Similar to leftMatrixScrambleFaurePermut except that the elements under the diagonal are also chosen from the same restricted set as the diagonal elements. More... | |
void | iBinomialMatrixScramble (RandomStream stream) |
Applies the \(i\)-binomial matrix scramble proposed by Tezuka [217] (see also [184] ). More... | |
void | iBinomialMatrixScrambleFaurePermut (RandomStream stream, int sb) |
Similar to iBinomialMatrixScramble except that the diagonal elements of each matrix \(\mathbf{M}_j\) are chosen as in leftMatrixScrambleFaurePermut. More... | |
void | iBinomialMatrixScrambleFaurePermutDiag (RandomStream stream, int sb) |
Similar to iBinomialMatrixScrambleFaurePermut except that all the off-diagonal elements are 0. More... | |
void | iBinomialMatrixScrambleFaurePermutAll (RandomStream stream, int sb) |
Similar to iBinomialMatrixScrambleFaurePermut except that the elements under the diagonal are also chosen from the same restricted set as the diagonal elements. More... | |
void | stripedMatrixScramble (RandomStream stream) |
Applies the striped matrix scramble proposed by Owen [184] . More... | |
void | stripedMatrixScrambleFaurePermutAll (RandomStream stream, int sb) |
Similar to stripedMatrixScramble except that the elements on and under the diagonal of each matrix \(\mathbf{M}_j\) are chosen as in leftMatrixScrambleFaurePermut. More... | |
void | rightMatrixScramble (RandomStream stream) |
Applies a linear scramble by multiplying each \(\mathbf{C}_j\) on the right by a single \(k\times k\) nonsingular upper-triangular matrix \(\mathbf{M}\), as suggested by Faure and Tezuka [56] (see also [86] ). More... | |
void | unrandomize () |
Restores the original generator matrices and removes the random shift. | |
void | resetGeneratorMatrices () |
Restores the original generator matrices. More... | |
void | eraseOriginalGeneratorMatrices () |
Erases the original generator matrices and replaces them by the current ones. More... | |
void | printGeneratorMatrices (int s) |
Prints the generator matrices in standard form for dimensions 1 to \(s\). | |
![]() | |
int | getDimension () |
Returns the dimension (number of available coordinates) of the point set. More... | |
int | getNumPoints () |
Returns the number of points. More... | |
abstract double | getCoordinate (int i, int j) |
Returns \(u_{i,j}\), the coordinate \(j\) of the point \(i\). More... | |
PointSetIterator | iterator () |
Constructs and returns a point set iterator. More... | |
void | setStream (RandomStream stream) |
Sets the random stream used to generate random shifts to stream . More... | |
RandomStream | getStream () |
Returns the random stream used to generate random shifts. More... | |
void | randomize (PointSetRandomization rand) |
Randomizes the point set using the given rand . More... | |
void | addRandomShift (int d1, int d2, RandomStream stream) |
This method does nothing for this generic class. More... | |
void | addRandomShift (RandomStream stream) |
This method does nothing for this generic class. More... | |
void | addRandomShift (int d1, int d2) |
Similar to addRandomShift(d1, d2, stream) , with the current random stream. | |
void | addRandomShift () |
Similar to addRandomShift(0, d2, stream) with the current random stream and d2 the dimension of the current random shift. | |
void | clearRandomShift () |
Erases the current random shift, if any. | |
void | randomize (int fromDim, int toDim, RandomStream stream) |
By default, this method simply calls addRandomShift (fromDim, toDim, stream) , which does nothing. | |
void | randomize (RandomStream stream) |
By default, this method simply calls randomize(0, dim, stream). | |
void | randomize (int d1, int d2) |
By default, this method simply calls addRandomShift(d1, d2) . | |
void | randomize () |
By default, this method simply calls addRandomShift() . | |
void | unrandomize () |
By default, this method simply calls clearRandomShift() . | |
String | toString () |
Formats a string that contains information about the point set. More... | |
String | formatPoints () |
Same as invoking formatPoints(n, d) with \(n\) and \(d\) equal to the number of points and the dimension of this object, respectively. More... | |
String | formatPoints (int n, int d) |
Formats a string that displays the same information as returned by toString, together with the first \(d\) coordinates of the first \(n\) points. More... | |
String | formatPoints (PointSetIterator iter) |
Same as invoking formatPoints(iter, n, d) with \(n\) and \(d\) equal to the number of points and the dimension, respectively. More... | |
String | formatPoints (PointSetIterator iter, int n, int d) |
Same as invoking formatPoints(n, d), but prints the points by calling iter repeatedly. More... | |
String | formatPointsBase (int b) |
Similar to formatPoints(), but the points coordinates are printed in base \(b\). More... | |
String | formatPointsBase (int n, int d, int b) |
Similar to formatPoints(n, d), but the points coordinates are printed in base \(b\). More... | |
String | formatPointsBase (PointSetIterator iter, int b) |
Similar to formatPoints(iter), but the points coordinates are printed in base \(b\). More... | |
String | formatPointsBase (PointSetIterator iter, int n, int d, int b) |
Similar to formatPoints(iter, n, d), but the points coordinates are printed in base \(b\). More... | |
String | formatPointsNumbered () |
Same as invoking formatPointsNumbered(n, d) with \(n\) and \(d\) equal to the number of points and the dimension, respectively. More... | |
String | formatPointsNumbered (int n, int d) |
Same as invoking formatPoints(n,d), except that the points are numbered. More... | |
Static Public Member Functions | |
static String | listDir (String dirname) throws IOException |
Lists all files (or directories) in directory dirname . More... | |
Additional Inherited Members | |
![]() | |
int | intToDigitsGray (int b, int i, int numDigits, int[] bary, int[] gray) |
![]() | |
int [] | genMat |
int [] | digitalShift |
![]() | |
int | b = 0 |
int | numCols = 0 |
int | numRows = 0 |
int | outDigits = 0 |
int [][] | genMat |
int [][] | digitalShift |
double | normFactor |
double [] | factor |
![]() | |
double | EpsilonHalf = 1.0 / Num.TWOEXP[55] |
int | dim = 0 |
int | numPoints = 0 |
int | dimShift = 0 |
int | capacityShift = 0 |
RandomStream | shiftStream |
![]() | |
static final int | MAXBITS = 31 |
This class allows us to read the parameters defining a digital net in base 2 either from a file, or from a URL address on the World Wide Web.
See the documentation in umontreal.ssj.hups.DigitalNetFromFile. The parameters used in building the net are those defined in class umontreal.ssj.hups.DigitalNetBase2. The format of the data files must be the following (where \(B\) is any \(C_j\)): (see the format in umontreal.ssj.hups)
// Any number of comment lines starting with //
\(2\) // Base
\(k\) // Number of columns
\(r\) // Number of rows
\(n\) // Number of points = \(2^k\)
\(s\) // Dimension of points
// dim = 1
\(a_1\) // \(= 2^{30}B_{11} + 2^{29}B_{21} + \cdots+ 2^{31 - r}B_{r1}\)
\(a_2\) // \(= 2^{30}B_{12} + 2^{29}B_{22} + \cdots+ 2^{31 - r}B_{r2}\)
\(\vdots\)
\(a_k\)
// dim = 2
\(\vdots\)
// dim = \(s\)
\(a_1\)
\(a_2\)
\(\vdots\)
\(a_k\)
For each dimension \(j\), there must be a \(k\)-vector of 32-bit integers (the \(a_i\)) corresponding to the columns of \(\mathbf{C}_j\). The correspondance is such that integer \(a_i = 2^{30}(\mathbf{C}_j)_{1i} + 2^{29}(\mathbf{C}_j)_{2i} + \cdots+ 2^{31 - r}(\mathbf{C}_j)_{ri}\).
DigitalNetBase2FromFile | ( | String | filename, |
int | r1, | ||
int | w, | ||
int | s1 | ||
) | throws IOException, MalformedURLException |
Constructs a digital net in base 2 after reading its parameters from file filename
.
See the documentation in umontreal.ssj.hups.DigitalNetFromFile. Parameter w
gives the number of bits of resolution, r1
is the number of rows, and s1
is the dimension. Restrictions: s1
must be less than the maximal dimension, and r1
less than the maximal number of rows in the data file. Also w
\(\ge\) r1
.
filename | Name of the file to be read |
r1 | Number of rows for the generating matrices |
w | Number of bits of resolution |
s1 | Number of dimensions |
DigitalNetBase2FromFile | ( | String | filename, |
int | s1 | ||
) | throws IOException, MalformedURLException |
Same as DigitalNetBase2FromFile(filename, r, 31, s1) where s1
is the dimension and r
is given in data file filename
.
filename | Name of the file to be read |
s1 | Number of dimensions |
|
static |
Lists all files (or directories) in directory dirname
.
Only relative pathnames should be used. The files are parameter files used in defining digital nets. For example, calling listDir("")
will give the list of the main data directory in SSJ, while calling listDir("Edel/OOA2")
will give the list of all files in directory Edel/OOA2
.
String toStringDetailed | ( | ) |
Writes the parameters and the generating matrices of this digital net to a string.
This is useful to check that the file parameters have been read correctly.