Public Member Functions | |
| KorobovLatticeSequence (int b, int a) | |
| Constructs a new lattice sequence with base b and generator \( = a\). | |
| double | getCoordinate (int i, int j) |
| Returns \(u_{i,j}\), the coordinate \(j\) of the point \(i\). | |
| Public Member Functions inherited from umontreal.ssj.hups.KorobovLattice | |
| KorobovLattice (int n, int a, int s) | |
| Instantiates a Korobov lattice point set with modulus \(n\) and multiplier \(a\) in dimension \(s\). | |
| KorobovLattice (int n, int a, int s, int t) | |
| Instantiates a shifted Korobov lattice point set with modulus. | |
| void | setNumPoints (int n) |
| Resets the number of points of the lattice to \(n\). | |
| int | getA () |
| Returns the multiplier \(a\) of the lattice. | |
| String | toString () |
| Formats a string that contains information about the point set. | |
| Public Member Functions inherited from umontreal.ssj.hups.Rank1Lattice | |
| Rank1Lattice (int n, int[] a, int s) | |
| Instantiates a Rank1Lattice with \(n\) points and lattice vector \(a\) of dimension \(s\). | |
| int[] | getAs () |
| Returns the generator \(a_j\) of the lattice. | |
| void | addRandomShift (int d1, int d2, RandomStream stream) |
| Adds a random shift to all the points of the point set, using stream stream to generate the random numbers. | |
| void | clearRandomShift () |
| Clears the random shift. | |
| PointSetIterator | iterator () |
| Constructs and returns a point set iterator. | |
| 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 (RandomStream stream) |
Same as addRandomShift(0, dim, stream), where dim is the dimension of the point set. | |
| 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. | |
Additional Inherited Members | |
| Static Public Member Functions inherited from umontreal.ssj.hups.PointSet | |
| static int | getMaxBits () |
| Returns the maximum number of usable bits. | |
| 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 implements Korobov lattice sequences, defined as follows.
One selects a *basis* @f$b@f$ and a (large) multiplier @f$a@f$. For
each integer @f$k\ge0@f$, we may consider the @f$n@f$-point Korobov
lattice with modulus @f$n = b^k@f$ and multiplier @f$\tilde{a} = a
\bmod n@f$. Its points have the form
\[ \mathbf{u}_i = (a^i (1, a, a^2, …) \bmod n) / n = (\tilde{a}^i (1, \tilde{a}, \tilde{a}^2, …) \bmod n) / n \tag{Korobov-seq1} \]
for \(i=0,…,n-1\). For \(k = 0,1,…\), we have an increasing sequence of lattices contained in one another.These embedded lattices contain an infinite sequence of points that can be enumerated as follows [77] :
\[ \mathbf{u}_i = \psi_b(i) \left(1, a, a^2, …\right) \bmod1. \tag{Korobov-seq2} \]
where \(\psi_b(i)\) is the radical inverse function in base \(b\), defined in RadicalInverse. The first \(n=b^k\) points in this sequence are exactly the same as the \(n\) points in ( Korobov-seq1 ), for each \(k\ge0\).
Definition at line 53 of file KorobovLatticeSequence.java.
| umontreal.ssj.hups.KorobovLatticeSequence.KorobovLatticeSequence | ( | int | b, |
| int | a ) |
Constructs a new lattice sequence with base b and generator \( = a\).
| b | number of points (modulus) is a power of b |
| a | multiplier \(a\) of this lattice sequence |
Definition at line 66 of file KorobovLatticeSequence.java.
| double umontreal.ssj.hups.KorobovLatticeSequence.getCoordinate | ( | int | i, |
| int | j ) |
Returns \(u_{i,j}\), the coordinate \(j\) of the point \(i\).
When the points are randomized (e.g., a random shift is added), the values returned by this method should incorporate the randomizations. Richard: La méthode getCoordinate de certaines classes ne tient pas compte du random shift, contrairement à l’itérateur de la même classe. Faut-il que toutes les getCoordinate implémentent le random shift quand il existe? Oui.
| i | index of the point to look for |
| j | index of the coordinate to look for |
Reimplemented from umontreal.ssj.hups.Rank1Lattice.
Definition at line 78 of file KorobovLatticeSequence.java.