|
| DigitalNet () |
| Empty constructor.
|
|
double | getCoordinate (int i, int j) |
| Returns \(u_{i',j}\), the coordinate \(j\) of point \(i'\), where \(i'\) is the Gray code for \(i\). More...
|
|
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). More...
|
|
PointSetIterator | iteratorNoGray () |
| Returns an iterator that does not use the Gray code. More...
|
|
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. 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 () |
| Formats a string that contains information on this digital net. More...
|
|
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. 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 [59] . 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. 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. 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. 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 points. 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 | randomize (PointSetRandomization rand) |
| Randomizes this point set using the given rand . More...
|
|
void | addRandomShift (int d1, int d2, RandomStream stream) |
| By default, this method generates a random shift in the protected double[] array shift , to be used eventually for a random shift modulo 1. More...
|
|
void | addRandomShift (RandomStream stream) |
| Same as addRandomShift(0, dim, stream), where dim is the dimension of the point set. More...
|
|
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.
|
|
void | clearRandomShift () |
| Erases the current random shift, if any.
|
|
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...
|
|
This class provides the basic structures for storing and manipulating linear digital nets in base \(b\), for an arbitrary base \(b\ge2\).
We recall that a net contains \(n = b^k\) points in \(s\) dimensions, where the \(i\)th point \(\mathbf{u}_i\), for \(i=0,…,b^k-1\), is defined as follows:
\begin{align*} i & = \sum_{\ell=0}^{k-1} a_{i,\ell} b^{\ell}, \\ \begin{pmatrix} u_{i,j,1} \\ u_{i,j,2} \\ \vdots \end{pmatrix} & = \mathbf{C}_j \begin{pmatrix} a_{i,0} \\ a_{i,1} \\ \vdots \\ a_{i,k-1} \end{pmatrix} , \\ u_{i,j} & = \sum_{\ell=1}^{\infty}u_{i,j,\ell} b^{-\ell}, \\ \mathbf{u}_i & = (u_{i,0},\dots,u_{i,s-1}). \end{align*}
In our implementation, the matrices \(\mathbf{C}_j\) are \(r\times k\), so the expansion of \(u_{i,j}\) is truncated to its first \(r\) terms. The points are stored implicitly by storing the generator matrices \(\mathbf{C}_j\) in a large two-dimensional array of integers, with \(srk\) elements. For general \(b\), the element \((l,c)\) of \(\mathbf{C}_j\) (counting elements from 0) is stored at position \([jk+c][l]\) in this array.
To enumerate the points, one should avoid using the method getCoordinate(i, j) for arbitrary values of i
and j
, because this is much slower than using a PointSetIterator to access successive coordinates. By default, the iterator enumerates the points \(\mathbf{u}_i\) using a Gray code technique as proposed in [8], [230], and also described in [69], [88]). With this technique, the \(b\)-ary representation of \(i\), \(\mathbf{a}_i = (a_{i,0}, …, a_{i,k-1})\), is replaced in Equation (digital-Cj) by a Gray code representation of \(i\), \(\mathbf{g}_i = (g_{i,0}, …, g_{i,k-1})\). The Gray code \(\mathbf{g}_i\) used here is defined by \(g_{i,k-1} = a_{i,k-1}\) and \(g_{i,\ell} = (a_{i,\ell} - a_{i,\ell+1}) \bmod b\) for \(\ell= 0,…,k-2\). It has the property that \(\mathbf{g}_i = (g_{i,0}, …, g_{i,k-1})\) and \(\mathbf{g}_{i+1} = (g_{i+1,0}, …, g_{i+1,k-1})\) differ only in the position of the smallest index \(\ell\) such that \(a_{i,\ell} < b - 1\), and we have \(g_{i+1,\ell} = (g_{i,\ell}+1) \bmod b\) in that position. This Gray code representation permits a more efficient enumeration of the points by the iterators. It changes the order in which the points \(\mathbf{u}_i\) are enumerated, but the first \(b^m\) points remain the same for every integer \(m\). The \(i\)th point of the sequence with the Gray enumeration is the \(i’\)th point of the original enumeration, where \(i’\) is the integer whose \(b\)-ary representation \(\mathbf{a}_{i’}\) is given by the Gray code \(\mathbf{g}_i\). To enumerate all the points successively, we never need to compute the Gray codes explicitly. It suffices to know the position \(\ell\) of the Gray code digit that changes at each step, and this can be found quickly from the \(b\)-ary representation \(\mathbf{a}_i\). The digits of each coordinate \(j\) of the current point can be updated by adding column \(\ell\) of the generator matrix \(\mathbf{C}_j\) to the old digits, modulo \(b\).
Digital nets can be randomized in various ways [178], [59], [126], [195]. Several types of randomizations specialized for nets are implemented directly in this class. A simple but important randomization is the random digital shift in base \(b\), defined as follows: replace each digit \(u_{i,j,\ell}\) in ( digital-uij ) by \((u_{i,j,\ell} + d_{j,\ell}) \bmod b\), where the \(d_{j,\ell}\)’s are i.i.d. uniform over \(\{0,\dots,b-1\}\). This is equivalent to applying a single random shift to all the points in a formal series representation of their coordinates [126], [161]. In practice, the digital shift is truncated to \(w\) digits, for some integer \(w\ge r\). Applying a digital shift does not change the equidistribution and \((t,m,s)\)-net properties of a point set [88], [124], [161]. Moreover, with the random shift, each point has the uniform distribution over the unit hypercube (but the points are not independent, of course).
A second class of randomizations specialized for digital nets are the linear matrix scrambles [178], [59], [88], [195], which multiply the matrices \(\mathbf{C}_j\) by a random invertible matrix \(\mathbf{M}_j\), modulo \(b\). There are several variants, depending on how \(\mathbf{M}_j\) is generated, and on whether \(\mathbf{C}_j\) is multiplied on the left or on the right. In our implementation, the linear matrix scrambles are incorporated directly into the matrices \(\mathbf{C}_j\) (as in [88]), so they do not slow down the enumeration of points. Methods are available for applying linear matrix scrambles and for removing these randomizations. These methods generate the appropriate random numbers and make the corresponding changes to the \(\mathbf{C}_j\)’s. A copy of the original \(\mathbf{C}_j\)’s is maintained, so the point set can be returned to its original unscrambled state at any time. When a new linear matrix scramble is applied, it is always applied to the original generator matrices. The method resetGeneratorMatrices removes the current matrix scramble by resetting the generator matrices to their original state. On the other hand, the method eraseOriginalGeneratorMatrices replaces the original generator matrices by the current ones, making the changes permanent. This could be useful if one wishes to apply two or more linear matrix scrambles on top of each other and not retain the original matrices.
With the linear matrix scrambles alone, the randomized points do not have the uniform distribution over the unit cube. For this reason, they are usually combined with a random digital shift; this combination is called an affine matrix scramble [195]. These two randomizations are applied via separate methods. The linear matrix scrambles are incorporated into the matrices \(\mathbf{C}_j\) whereas the digital random shift is stored and applied separately, independently of the other scrambles.
Applying a digital shift or a linear matrix scramble to a digital net invalidates all current iterators for the current point, because each iterator uses a cached copy of the current point, which is updated only when the current point index of that iterator changes, and the update also depends on the cached copy of the previous point. After applying any kind of scrambling or randomization that affects the DigitalNet
object, the iterators must be reinitialized to the initial point by invoking PointSetIterator.resetCurPointIndex
or re-instantiated by the iterator
method (this is not done automatically).