SSJ
V. labo.

umontreal.iro.lecuyer.hups
Class DigitalNetBase2

java.lang.Object
  extended by umontreal.iro.lecuyer.hups.PointSet
      extended by umontreal.iro.lecuyer.hups.DigitalNet
          extended by umontreal.iro.lecuyer.hups.DigitalNetBase2
Direct Known Subclasses:
DigitalNetBase2FromFile, DigitalSequenceBase2, F2wNetLFSR, F2wNetPolyLCG

public class DigitalNetBase2
extends DigitalNet

DigitalNetBase2

A special case of DigitalNet for the base b = 2. The implementation exploit the binary nature of computers and is much more efficient than for the general case. Binary expansions are easy to obtain because the computer already uses them internally. The generator matrices Cj are stored in a large array of size sk. The c-th column of Cj, for c = 0,..., k - 1, is stored at position jk + c of that array, as a 32-bit integer. For all derived classes, the above 32-bit integer must be of the form [00 ... C0C1 ... Cr-1]. The value of k cannot exceed 31 (32 is not allowed because Java does not have 32-bit unsigned integers). The value of w is always 31. In this implementation, w is always used in place of r so the value of r is not used.

The random digital shift in base 2 corresponds to a random XOR. It can be applied via the method addRandomShift.


Constructor Summary
DigitalNetBase2()
           
 
Method Summary
 void addRandomShift(int d1, int d2, RandomStream stream)
          .
 void addRandomShift(RandomStream stream)
          .
 void clearRandomShift()
          .
 double getCoordinate(int i, int j)
          .
 double getCoordinateNoGray(int i, int j)
          .
 void iBinomialMatrixScramble(RandomStream stream)
          .
 void iBinomialMatrixScrambleFaurePermut(RandomStream stream, int sb)
          .
 void iBinomialMatrixScrambleFaurePermutAll(RandomStream stream, int sb)
          .
 void iBinomialMatrixScrambleFaurePermutDiag(RandomStream stream, int sb)
          .
 PointSetIterator iterator()
          .
 PointSetIterator iteratorNoGray()
          .
 void leftMatrixScramble(RandomStream stream)
          .
 void leftMatrixScrambleDiag(RandomStream stream)
          .
 void leftMatrixScrambleFaurePermut(RandomStream stream, int sb)
          .
 void leftMatrixScrambleFaurePermutAll(RandomStream stream, int sb)
          .
 void leftMatrixScrambleFaurePermutDiag(RandomStream stream, int sb)
          .
 void printGeneratorMatrices(int s)
          .
 void printGeneratorMatricesTrans(int s)
          .
 void rightMatrixScramble(RandomStream stream)
          .
 void stripedMatrixScramble(RandomStream stream)
          .
 void stripedMatrixScrambleFaurePermutAll(RandomStream stream, int sb)
          .
 String toString()
          .
 
Methods inherited from class umontreal.iro.lecuyer.hups.DigitalNet
eraseOriginalGeneratorMatrices, resetGeneratorMatrices, 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
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DigitalNetBase2

public DigitalNetBase2()
Method Detail

printGeneratorMatrices

public void printGeneratorMatrices(int s)
. \begin{tabb}
 Prints the generator matrices as bit matrices in standard form
 for dimensions 1 to $s$.
 \end{tabb}

Overrides:
printGeneratorMatrices in class DigitalNet

printGeneratorMatricesTrans

public void printGeneratorMatricesTrans(int s)
. \begin{tabb}
 Prints the generator matrices transposed in the form of integers
 for dimensions 1 to $s$. Each integer corresponds to a column of bits.
 \end{tabb}


getCoordinate

public double getCoordinate(int i,
                            int j)
Description copied from class: PointSet
. \begin{tabb}
 Returns $u_{i,j}$, the coordinate $j$\ of the point $i$.
 \richard{...
 ...xttt{getCoordinate} impl\'ementent le random shift
 quand il existe?}
 \end{tabb}
iindex of the point to look for jindex of the coordinate to look for the value of ui, j

Overrides:
getCoordinate in class DigitalNet

getCoordinateNoGray

public double getCoordinateNoGray(int i,
                                  int j)
Description copied from class: DigitalNet
. \begin{tabb}
 Returns $u_{i,j}$, the coordinate $j$\ of point $i$, the points
 being enumerated in the standard order (no Gray code).
 \end{tabb}
ipoint index jcoordinate index the value of ui, j

Overrides:
getCoordinateNoGray in class DigitalNet

iterator

public PointSetIterator iterator()
Description copied from class: PointSet
. \begin{tabb}
 Constructs and returns a point set iterator.
 The default implemen...
 ...oordinates, but subclasses can reimplement it
 for better efficiency.
 \end{tabb}
point set iterator for the point set

Overrides:
iterator in class DigitalNet

iteratorNoGray

public PointSetIterator iteratorNoGray()
. \begin{tabb}
 This iterator does not use the
 Gray code. Thus the points are enumerated in the order of their first
 coordinate before randomization.
 \end{tabb}

Overrides:
iteratorNoGray in class DigitalNet

toString

public String toString()
Description copied from class: PointSet
. \begin{tabb}
 Formats a string that contains information about the point set.
 \end{tabb}
string representation of the point set information

Overrides:
toString in class DigitalNet

clearRandomShift

public void clearRandomShift()
Description copied from class: DigitalNet
. \begin{hide}
 \par
 \begin{tabb}
 Erases the current digital random shift, if any.
 \end{tabb}\end{hide}

Overrides:
clearRandomShift in class DigitalNet

addRandomShift

public void addRandomShift(RandomStream stream)
Description copied from class: DigitalNet
. \begin{tabb}Same as \method{addRandomShift}{}\texttt{(0, dim, stream)},
 where \texttt{dim} is the dimension of the digital net.
 \end{tabb}
streamrandom number stream used to generate uniforms
 

Overrides:
addRandomShift in class DigitalNet

addRandomShift

public void addRandomShift(int d1,
                           int d2,
                           RandomStream stream)
Description copied from class: DigitalNet
. \begin{tabb}Adds a random digital shift to all the points of the point set,
 usi...
 ...digital shift, all iterators must be reconstructed or
 reset to zero.
 \end{tabb}
streamrandom number stream used to generate uniforms

Overrides:
addRandomShift in class DigitalNet

leftMatrixScramble

public void leftMatrixScramble(RandomStream stream)
Description copied from class: DigitalNet
. \begin{tabb}
 Applies a linear scramble by multiplying each $\mathbf{C}_j$\ on t...
 ...pouvoir
 randomiser plus les derniers chiffres ou les derniers bits.}
 \end{tabb}
streamrandom number stream used to generate the randomness

Overrides:
leftMatrixScramble in class DigitalNet

iBinomialMatrixScramble

public void iBinomialMatrixScramble(RandomStream stream)
Description copied from class: DigitalNet
. \begin{tabb}
 Applies the $i$-binomial matrix scramble proposed by Tezuka\cite{r...
 ...n any given diagonal or subdiagonal of $\mathbf{M}_j$\ are identical.
 \end{tabb}
streamrandom number stream used as generator of the randomness

Overrides:
iBinomialMatrixScramble in class DigitalNet

stripedMatrixScramble

public void stripedMatrixScramble(RandomStream stream)
Description copied from class: DigitalNet
. \begin{tabb}
 Applies the \emph{striped matrix scramble} proposed by Owen\cite{v...
 ...eterministic, with
 all entries on and below the diagonal equal to 1.
 \end{tabb}
streamrandom number stream used as generator of the randomness

Overrides:
stripedMatrixScramble in class DigitalNet

rightMatrixScramble

public void rightMatrixScramble(RandomStream stream)
Description copied from class: DigitalNet
. \begin{tabb}
 Applies a linear scramble by multiplying each $\mathbf{C}_j$\ on t...
 ...hat is a power of the basis, then this
 scramble makes no difference.
 \end{tabb}
streamrandom number stream used as generator of the randomness
\begin{hide}%
 \par
 \end{hide}

Overrides:
rightMatrixScramble in class DigitalNet

leftMatrixScrambleDiag

public void leftMatrixScrambleDiag(RandomStream stream)
Description copied from class: DigitalNet
. \begin{tabb}
 Similar to \method{leftMatrixScramble}{} except that all the
 off-diagonal elements of the $\mathbf{M}_j$\ are 0.
 \end{tabb}
streamrandom number stream used to generate the randomness

Overrides:
leftMatrixScrambleDiag in class DigitalNet

leftMatrixScrambleFaurePermut

public void leftMatrixScrambleFaurePermut(RandomStream stream,
                                          int sb)
Description copied from class: DigitalNet
. \begin{tabb}
 Similar to \method{leftMatrixScramble}{} except that the diagonal ...
 ...f the upper bounds of the extreme discrepancy
 for the given integer.
 \end{tabb}
streamrandom number stream used to generate the randomness sbOnly the first sb elements of F are used

Overrides:
leftMatrixScrambleFaurePermut in class DigitalNet

leftMatrixScrambleFaurePermutDiag

public void leftMatrixScrambleFaurePermutDiag(RandomStream stream,
                                              int sb)
Description copied from class: DigitalNet
. \begin{tabb}
 Similar to \method{leftMatrixScrambleFaurePermut}{} except that all
 off-diagonal elements are 0.
 \end{tabb}
streamrandom number stream used to generate the randomness sbOnly the first sb elements of F are used

Overrides:
leftMatrixScrambleFaurePermutDiag in class DigitalNet

leftMatrixScrambleFaurePermutAll

public void leftMatrixScrambleFaurePermutAll(RandomStream stream,
                                             int sb)
Description copied from class: DigitalNet
. \begin{tabb}
 Similar to \method{leftMatrixScrambleFaurePermut}{} except that th...
 ...e also
 chosen from the same restricted set as the diagonal elements.
 \end{tabb}
streamrandom number stream used to generate the randomness sbOnly the first sb elements of F are used

Overrides:
leftMatrixScrambleFaurePermutAll in class DigitalNet

iBinomialMatrixScrambleFaurePermut

public void iBinomialMatrixScrambleFaurePermut(RandomStream stream,
                                               int sb)
Description copied from class: DigitalNet
. \begin{tabb}
 Similar to \method{iBinomialMatrixScramble}{} except that the diag...
 ...bf{M}_j$\ are chosen as in
 \method{leftMatrixScrambleFaurePermut}{}.
 \end{tabb}
streamrandom number stream used to generate the randomness sbOnly the first sb elements of F are used

Overrides:
iBinomialMatrixScrambleFaurePermut in class DigitalNet

iBinomialMatrixScrambleFaurePermutDiag

public void iBinomialMatrixScrambleFaurePermutDiag(RandomStream stream,
                                                   int sb)
Description copied from class: DigitalNet
. \begin{tabb}
 Similar to \method{iBinomialMatrixScrambleFaurePermut}{} except that all the
 off-diagonal elements are 0.
 \end{tabb}
streamrandom number stream used to generate the randomness sbOnly the first sb elements of F are used

Overrides:
iBinomialMatrixScrambleFaurePermutDiag in class DigitalNet

iBinomialMatrixScrambleFaurePermutAll

public void iBinomialMatrixScrambleFaurePermutAll(RandomStream stream,
                                                  int sb)
Description copied from class: DigitalNet
. \begin{tabb}
 Similar to \method{iBinomialMatrixScrambleFaurePermut}{} except th...
 ...e also
 chosen from the same restricted set as the diagonal elements.
 \end{tabb}
streamrandom number stream used to generate the randomness sbOnly the first sb elements of F are used

Overrides:
iBinomialMatrixScrambleFaurePermutAll in class DigitalNet

stripedMatrixScrambleFaurePermutAll

public void stripedMatrixScrambleFaurePermutAll(RandomStream stream,
                                                int sb)
Description copied from class: DigitalNet
. \begin{tabb}
 Similar to \method{stripedMatrixScramble}{} except that the
 eleme...
 ...bf{M}_j$\ are
 chosen as in \method{leftMatrixScrambleFaurePermut}{}.
 \end{tabb}
streamrandom number stream used as generator of the randomness sbOnly the first sb elements of F are used

Overrides:
stripedMatrixScrambleFaurePermutAll in class DigitalNet

SSJ
V. labo.

To submit a bug or ask questions, send an e-mail to Pierre L'Ecuyer.