This class allows us to read the parameters defining a digital net either from a file, or from a URL address on the World Wide Web. More...
Classes | |
| class | NetComparator |
Public Member Functions | |
| DigitalNetFromFile (String filename, int r1, int w, int s1) throws MalformedURLException, IOException | |
| Constructs a digital net after reading its parameters from file filename. | |
| DigitalNetFromFile (String filename, int s) throws MalformedURLException, IOException | |
Same as DigitalNetFromFile(filename, r, r, s) where s is the dimension and r is given in data file filename. | |
| String | toString () |
| Formats a string that contains information on this digital net. | |
| String | toStringDetailed () |
| Writes the parameters and the generating matrices of this digital net to a string. | |
| Public Member Functions inherited from umontreal.ssj.hups.DigitalNet | |
| DigitalNet () | |
| Empty constructor. | |
| int | getInterlacing () |
| Returns the interlacing factor. | |
| void | setInterlacing (int interlacing) |
| Sets the interlacing factor. | |
| double | getCoordinate (int i, int j) |
| Returns \(u_{i',j}\), the coordinate \(j\) of point \(i'\), where \(i'\) is the Gray code for \(i\). | |
| PointSetIterator | iterator () |
| 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). | |
| PointSetIterator | iteratorNoGray () |
| Returns an iterator that does not use the Gray code. | |
| void | addRandomShift (int d1, int d2, RandomStream stream) |
| Generates a random digital shift for coordinates \(j\) from d1 to d2-1, using stream to generate the random numbers. | |
| void | addRandomShift (RandomStream stream) |
Same as addRandomShift(0, dim, stream), where dim is the dimension of the digital net. | |
| void | clearRandomShift () |
| Erases the current digital random shift, if any. | |
| 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. | |
| void | leftMatrixScrambleDiag (RandomStream stream) |
| Similar to leftMatrixScramble except that all the off-diagonal elements of the \(\mathbf{M}_j\) are 0. | |
| 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 [58] . | |
| void | leftMatrixScrambleFaurePermutDiag (RandomStream stream, int sb) |
| Similar to leftMatrixScrambleFaurePermut except that all off-diagonal elements are 0. | |
| 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. | |
| void | iBinomialMatrixScramble (RandomStream stream) |
| Applies the \(i\)-binomial matrix scramble proposed by Tezuka. | |
| 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. | |
| void | iBinomialMatrixScrambleFaurePermutDiag (RandomStream stream, int sb) |
| Similar to iBinomialMatrixScrambleFaurePermut except that all the off-diagonal elements are 0. | |
| 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. | |
| void | stripedMatrixScramble (RandomStream stream) |
| Applies the striped matrix scramble proposed by Owen. | |
| 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. | |
| 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. | |
| void | unrandomize () |
| Restores the original generator matrices and removes the random shift. | |
| void | resetGeneratorMatrices () |
| Restores the original generator matrices. | |
| void | eraseOriginalGeneratorMatrices () |
| Erases the original generator matrices and replaces them by the current ones. | |
| void | printGeneratorMatrices (int s) |
| Prints the generator matrices in standard form for dimensions 1 to \(s\). | |
| Public Member Functions inherited from umontreal.ssj.hups.PointSet | |
| int | getDimension () |
| Returns the dimension (number of available coordinates) of the points. | |
| int | getNumPoints () |
| Returns the number of points. | |
| void | randomize (PointSetRandomization rand) |
| Randomizes this point set using the given rand. | |
| void | addRandomShift (int d1, int d2) |
| Refreshes the random shift (generates new uniform values for the random shift coordinates) for coordinates d1 to d2-1, using the saved shiftStream. | |
| void | addRandomShift () |
Same as addRandomShift(0, dim), where dim is the dimension of the point set. | |
| 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. | |
| 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. | |
| 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. | |
| String | formatPoints (PointSetIterator iter, int n, int d) |
Same as invoking formatPoints(n, d), but prints the points by calling iter repeatedly. | |
| String | formatPointsBase (int b) |
Similar to formatPoints(), but the points coordinates are printed in base \(b\). | |
| String | formatPointsBase (int n, int d, int b) |
Similar to formatPoints(n, d), but the points coordinates are printed in base \(b\). | |
| String | formatPointsBase (PointSetIterator iter, int b) |
Similar to formatPoints(iter), but the points coordinates are printed in base. | |
| 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\). | |
| String | formatPointsNumbered () |
Same as invoking formatPointsNumbered(n, d) with \(n\) and \(d\) equal to the number of points and the dimension, respectively. | |
| String | formatPointsNumbered (int n, int d) |
Same as invoking formatPoints(n,d), except that the points are numbered. | |
Static Public Member Functions | |
| static String | listDir (String dirname) throws IOException |
| Lists all files (or directories) in directory dirname. | |
| static void | listDirHTML (String dirname, String filename) throws IOException |
| Creates a list of all data files in directory dirname and writes that list in format HTML in output file filename. | |
| Static Public Member Functions inherited from umontreal.ssj.hups.PointSet | |
| static int | getMaxBits () |
| Returns the maximum number of usable bits. | |
Additional Inherited Members | |
| Protected Attributes inherited from umontreal.ssj.hups.PointSet | |
| double | EpsilonHalf = 1.0 / Num.TWOEXP[55] |
| To avoid 0 for nextCoordinate when random shifting, we add this to each coordinate. | |
| int | dim = 0 |
| Dimension of the points. | |
| int | numPoints = 0 |
| Number of points. | |
| int | dimShift = 0 |
| Current dimension of the shift. | |
| int | capacityShift = 0 |
| Number of array elements in the shift vector, always >= dimShift. | |
| double[] | shift |
| This is the shift vector as a double[] array, which contains the current random shift in case we apply a random shift modulo 1. | |
| RandomStream | shiftStream |
| Stream used to generate the random shifts. | |
| Static Protected Attributes inherited from umontreal.ssj.hups.PointSet | |
| static final int | MAXBITS = 31 |
| Since Java has no unsigned type, the 32nd bit cannot be used efficiently, so we have only 31 bits. | |
This class allows us to read the parameters defining a digital net either from a file, or from a URL address on the World Wide Web.
The parameters used in building the net are those defined in class
umontreal.ssj.hups.DigitalNet. The format of the data files must be the following: (see the format in umontreal.ssj.hups)
| // Any number of comment lines starting with // | |||
| \(b\) | // \(\mbox{Base}\) | ||
| \(k\) | // Number of columns | ||
| \(r\) | // Maximal number of rows | ||
| \(n\) | // Number of points = \(b^k\) | ||
| \(s\) | // Maximal dimension of points | ||
| // dim = 1 | |||
| \(c_{11}\) | \(c_{21}\) | \(\cdots\) | \(c_{r1}\) |
| \(c_{12}\) | \(c_{22}\) | \(\cdots\) | \(c_{r2}\) |
| \(\vdots\) | |||
| \(c_{1k}\) | \(c_{2k}\) | \(\cdots\) | \(c_{rk}\) |
| // dim = 2 | |||
| \(\vdots\) | |||
| // dim = \(s\) | |||
| \(c_{11}\) | \(c_{21}\) | \(\cdots\) | \(c_{r1}\) |
| \(c_{12}\) | \(c_{22}\) | \(\cdots\) | \(c_{r2}\) |
| \(\vdots\) | |||
| \(c_{1k}\) | \(c_{2k}\) | \(\cdots\) | \(c_{rk}\) |
The figure above gives the general format of the data file needed by `DigitalNetFromFile`. The values of the parameters on the left must appear in the file as integers. On the right of each parameter, there is an optional comment that is disregarded by the reader program. In general, the Java line comments `//` are accepted anywhere and will ensure that the rest of the line is dropped by the reader. Blank lines are also disregarded by the reader program. For each dimension, there must be a
\(k\times r\) matrix of integers in \(\{0, 1, …, b-1\}\) (note that the matrices must appear in transposed form).
The predefined files of parameters are kept in different directories, depending on the criteria used in the searches for the parameters defining the digital net. These files have all been stored at the address http://simul.iro.umontreal.ca/ssj/data. Each file contains the parameters for a specific digital net. The name of the files gives information about the main parameters of the digital net. For example, the file named Edel/OOA2/B3S13R9C9St6 contains the parameters for a digital net proposed by Yves Edel (see http://www.mathi.uni-heidelberg.de/~yves/index.html) based on ordered orthogonal arrays; the digital net has base B = 3, dimension S = 13, the generating matrices have R = 9 rows and C = 9 columns, and the strength of the net is St = 6.
Definition at line 155 of file DigitalNetFromFile.java.
| umontreal.ssj.hups.DigitalNetFromFile.DigitalNetFromFile | ( | String | filename, |
| int | r1, | ||
| int | w, | ||
| int | s1 ) throws MalformedURLException, IOException |
Constructs a digital net after reading its parameters from file filename.
If a file named filename can be found relative to the program’s directory, then the parameters will be read from this file; otherwise, they will be read from the file named filename in the ssj.jar archive. If filename is a URL string, it will be read on the World Wide Web. For example, to construct a digital net from the parameters in file B3S13R9C9St6 in the current directory, one must give the string "B3S13R9C9St6" as argument to the constructor. As an example of a file read from the WWW, one may give as argument to the constructor the string "http://simul.iro.umontreal.ca/ssj/data/Edel/OOA3/B3S13R6C6St4". Parameter w gives the number of digits 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 digits of resolution |
| s1 | Number of dimensions |
Definition at line 272 of file DigitalNetFromFile.java.
| umontreal.ssj.hups.DigitalNetFromFile.DigitalNetFromFile | ( | String | filename, |
| int | s ) throws MalformedURLException, IOException |
Same as DigitalNetFromFile(filename, r, r, s) where s is the dimension and r is given in data file filename.
| filename | Name of the file to be read |
| s | Number of dimensions |
Definition at line 357 of file DigitalNetFromFile.java.
|
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.
Definition at line 511 of file DigitalNetFromFile.java.
|
static |
Creates a list of all data files in directory dirname and writes that list in format HTML in output file filename.
Each data file contains the parameters required to build a digital net. The resulting list contains a line for each data file giving the name of the file, the base, the dimension, the number of rows and the number of columns of the corresponding digital net.
Definition at line 551 of file DigitalNetFromFile.java.
| String umontreal.ssj.hups.DigitalNetFromFile.toString | ( | ) |
Formats a string that contains information on this digital net.
Reimplemented from umontreal.ssj.hups.DigitalNet.
Definition at line 365 of file DigitalNetFromFile.java.
| String umontreal.ssj.hups.DigitalNetFromFile.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.
Definition at line 376 of file DigitalNetFromFile.java.