|
SSJ V. labo. |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectumontreal.iro.lecuyer.hups.PointSet
umontreal.iro.lecuyer.hups.DigitalNet
public class DigitalNet
DigitalNet
This class provides the basic structures for storing and
manipulating linear digital nets in base b, for an arbitrary
base b≥2. We recall that a net contains n = bk points in
s dimensions, where the ith point
ui,
for
i = 0,..., bk - 1, is defined as follows:
i | = | ![]() |
|
(ui, j, 1 ui, j, 2 …)T | = | Cj (ai, 0 ai, 1 … ai, k-1)T, | |
ui, j | = | ![]() |
|
ui | = | (ui, 0, …, ui, s-1). |
The points ui are enumerated using the Gray code technique. With this technique, the b-ary representation of i, ai = (ai, 0,..., ai, k-1), is replaced by a Gray code representation of i, gi = (gi, 0,..., gi, k-1). The Gray code gi used here is defined by gi, k-1 = ai, k-1 and gi, ν = (ai, ν - ai, ν+1)mod b for ν = 0,..., k - 2. It has the property that gi = (gi, 0,..., gi, k-1) and gi+1 = (gi+1, 0,..., gi+1, k-1) differ only in the position of the smallest index ν such that ai, ν < b - 1, and we have gi+1, ν = (gi, ν +1)mod 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 ui are enumerated, but the first bm points remain the same for every integer m. The ith 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 ai' is given by the Gray code gi. To enumerate all the points successively, we never need to compute the Gray codes explicitly. It suffices to know the position ν of the Gray code digit that changes at each step, and this can be found quickly from the b-ary representation ai. The digits of each coordinate j of the current point can be updated by adding column ν of the generator matrix Cj to the old digits, modulo b.
One should avoid using the method getCoordinate(i, j) for arbitrary values of i and j, because this is much slower than using an iterator to access successive coordinates.
Digital nets can be randomized in various ways[#!mMAT99a!#,#!rFAU02a!#,#!vLEC02a!#,#!vOWE03a!#]. 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 ui, j, ν in the third equation above by (ui, j, ν + dj, ν)mod b, where the dj, ν's are i.i.d. uniform over {0,..., b - 1}. This is equivalent to applying a single random shift to all the points in a formal series representation of their coordinates[#!vLEC02a!#,#!vLEM03a!#]. In practice, the digital shift is truncated to w digits, for some integer w≥r. Applying a digital shift does not change the equidistribution and (t, m, s)-net properties of a point set[#!vHON03a!#,#!vLEC99a!#,#!vLEM03a!#]. Moreover, with the random shift, each point is uniformly distributed 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[#!mMAT99a!#,#!rFAU02a!#,#!vHON03a!#,#!vOWE03a!#], which multiply the matrices Cj by a random invertible matrix Mj, modulo b. There are several variants, depending on how Mj is generated, and on whether Cj is multiplied on the left or on the right. In our implementation, the linear matrix scrambles are incorporated directly into the matrices Cj, 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 Cj's. A copy of the original Cj'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 is useful if one wishes to apply two or more linear matrix scrambles on top of each other.
Linear matrix scrambles are usually combined with a random digital shift; this combination is called an affine matrix scramble[#!vOWE03a!#]. These two randomizations are applied via separate methods. The linear matrix scrambles are incorporated into the matrices Cj whereas the digital random shift is stored and applied separately, independently of the other scramblings.
Applying a digital shift or a linear matrix scramble to a digital net invalidates all iterators for that randomized 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, the iterators must be reinitialized to the initial point by invoking PointSetIteratorresetCurPointIndex or reinstantiated by the iterator method (this is not done automatically).
Constructor Summary | |
---|---|
DigitalNet()
. |
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 |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public DigitalNet()
Method Detail |
---|
public double getCoordinate(int i, int j)
PointSet
getCoordinate
in class PointSet
public PointSetIterator iterator()
PointSet
iterator
in class PointSet
public double getCoordinateNoGray(int i, int j)
public PointSetIterator iteratorNoGray()
public void addRandomShift(int d1, int d2, RandomStream stream)
addRandomShift
in class PointSet
public void addRandomShift(RandomStream stream)
addRandomShift
in class PointSet
public void clearRandomShift()
clearRandomShift
in class PointSet
public String toString()
PointSet
toString
in class PointSet
public void leftMatrixScramble(RandomStream stream)
public void leftMatrixScrambleDiag(RandomStream stream)
public void leftMatrixScrambleFaurePermut(RandomStream stream, int sb)
public void leftMatrixScrambleFaurePermutDiag(RandomStream stream, int sb)
public void leftMatrixScrambleFaurePermutAll(RandomStream stream, int sb)
public void iBinomialMatrixScramble(RandomStream stream)
public void iBinomialMatrixScrambleFaurePermut(RandomStream stream, int sb)
public void iBinomialMatrixScrambleFaurePermutDiag(RandomStream stream, int sb)
public void iBinomialMatrixScrambleFaurePermutAll(RandomStream stream, int sb)
public void stripedMatrixScramble(RandomStream stream)
public void stripedMatrixScrambleFaurePermutAll(RandomStream stream, int sb)
public void rightMatrixScramble(RandomStream stream)
public void unrandomize()
unrandomize
in class PointSet
public void resetGeneratorMatrices()
public void eraseOriginalGeneratorMatrices()
public void printGeneratorMatrices(int s)
|
SSJ V. labo. |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |