Class DigitalNetFromFile
- java.lang.Object
-
- umontreal.iro.lecuyer.hups.PointSet
-
- umontreal.iro.lecuyer.hups.DigitalNet
-
- umontreal.iro.lecuyer.hups.DigitalNetFromFile
-
public class DigitalNetFromFile extends DigitalNet
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 classDigitalNet. The format of the data files must be the following: (see the format in guidehups.pdf)
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×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://www.iro.umontreal.ca/~simardr/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.
-
-
Constructor Summary
Constructors Constructor and Description DigitalNetFromFile(java.lang.String filename, int s)Same asDigitalNetFromFile(filename, r, r, s) where s is the dimension and r is given in data file filename.DigitalNetFromFile(java.lang.String filename, int r1, int w, int s1)Constructs a digital net after reading its parameters from file filename.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method and Description static java.lang.StringlistDir(java.lang.String dirname)Lists all files (or directories) in directory dirname.static voidlistDirHTML(java.lang.String dirname, java.lang.String filename)Creates a list of all data files in directory dirname and writes that list in format HTML in output file filename.java.lang.StringtoString()Formats a string that contains information about the point set.java.lang.StringtoStringDetailed()Writes the parameters and the generating matrices of this digital net to a string.-
Methods inherited from class umontreal.iro.lecuyer.hups.DigitalNet
addRandomShift, addRandomShift, clearRandomShift, eraseOriginalGeneratorMatrices, getCoordinate, getCoordinateNoGray, iBinomialMatrixScramble, iBinomialMatrixScrambleFaurePermut, iBinomialMatrixScrambleFaurePermutAll, iBinomialMatrixScrambleFaurePermutDiag, iterator, iteratorNoGray, leftMatrixScramble, leftMatrixScrambleDiag, leftMatrixScrambleFaurePermut, leftMatrixScrambleFaurePermutAll, leftMatrixScrambleFaurePermutDiag, printGeneratorMatrices, resetGeneratorMatrices, rightMatrixScramble, stripedMatrixScramble, stripedMatrixScrambleFaurePermutAll, unrandomize
-
Methods inherited from class umontreal.iro.lecuyer.hups.PointSet
addRandomShift, addRandomShift, formatPoints, formatPoints, formatPoints, formatPoints, formatPointsBase, formatPointsBase, formatPointsBase, formatPointsBase, formatPointsNumbered, formatPointsNumbered, getDimension, getNumPoints, getStream, randomize, randomize, randomize, randomize, randomize, setStream
-
-
-
-
Constructor Detail
-
DigitalNetFromFile
public DigitalNetFromFile(java.lang.String filename, int r1, int w, int s1) throws java.net.MalformedURLException, java.io.IOExceptionConstructs 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://www.iro.umontreal.ca/˜simardr/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 >= r1.- Parameters:
filename- Name of the file to be readr1- Number of rows for the generating matricesw- Number of digits of resolutions1- Number of dimensions- Throws:
java.net.MalformedURLExceptionjava.io.IOException
-
DigitalNetFromFile
public DigitalNetFromFile(java.lang.String filename, int s) throws java.net.MalformedURLException, java.io.IOExceptionSame asDigitalNetFromFile(filename, r, r, s) where s is the dimension and r is given in data file filename.- Parameters:
filename- Name of the file to be reads- Number of dimensions- Throws:
java.net.MalformedURLExceptionjava.io.IOException
-
-
Method Detail
-
toString
public java.lang.String toString()
Description copied from class:PointSetFormats a string that contains information about the point set.- Overrides:
toStringin classDigitalNet- Returns:
- string representation of the point set information
-
toStringDetailed
public java.lang.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.
-
listDir
public static java.lang.String listDir(java.lang.String dirname) throws java.io.IOExceptionLists 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.- Throws:
java.io.IOException
-
listDirHTML
public static void listDirHTML(java.lang.String dirname, java.lang.String filename) throws java.io.IOExceptionCreates 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.- Throws:
java.io.IOException
-
-
DMelt 3.0 © DataMelt by jWork.ORG