This class implements methods to search for the best lattices of rank 1, defined as follows [212] . More...
Public Member Functions | |
| Searcher (Discrepancy disc, boolean primeN) | |
| The number of points \(n\), the dimension \(s\), and possibly the \(s\) weight factors \(\gamma_j\) must be given in disc. | |
| double | exhaust (int s) |
| Exhaustive search to find the lattice with the best (the smallest) discrepancy in dimension \(s\). | |
| double | exhaustPrime (int s) |
Similar to exhaust(s), except that only values of \(a_j\) relatively prime to \(n\) are considered. | |
| double | random (int s, int k) |
| Random search to find the lattice with the best (the smallest) discrepancy in dimension \(s\). | |
| double | randomPrime (int s, int k) |
Similar to random(s, k), except that only values of \(a_j\) relatively prime to \(n\) are considered. | |
| double | getBestVal () |
| Returns the best value of the discrepancy found in the last search. | |
| int[] | getBestAs () |
| Returns the generator of the lattice which gave the best value of the discrepancy in the last search. | |
| void | initGen (int seed) |
| Initializes the random number generator used in random searches with the starting seed seed. | |
This class implements methods to search for the best lattices of rank 1, defined as follows [212] .
Given a positive integer \(n\) and a \(s\)-dimensional integer vector \((a_0,…,a_{s-1})\), where \(0 \le a_j < n\) for each \(j\), the points are defined by
\[ \mathbf{u}_i = (i/n)(a_0, a_1, …, a_{s-1}) \bmod1 \]
for \(i=0,…,n-1\). Here we always choose \(a_0=1\).
The discrepancy object in the Searcher constructor must fix the number of points \(n\), the maximal dimension \(s\) of the lattice and possibly, the weight factors \(\gamma_j\). Then the search program will examine different lattices with \(n\), \(s\) and \(\gamma_j\) fixed in order to find the best amongst those examined. Searches may be exhaustive or random.
One may consider only a subset of the possible lattices according to some criterion. Some of these restricted searches are implemented in classes derived from Searcher.
Definition at line 51 of file Searcher.java.
| umontreal.ssj.discrepancy.Searcher.Searcher | ( | Discrepancy | disc, |
| boolean | primeN ) |
The number of points \(n\), the dimension \(s\), and possibly the \(s\) weight factors \(\gamma_j\) must be given in disc.
The \(n\) points of each lattice will be generated in the search. The flag primeN indicates whether \(n\) is a prime number (true) or not (false). This is used in the *Prime methods.
Definition at line 183 of file Searcher.java.
| double umontreal.ssj.discrepancy.Searcher.exhaust | ( | int | s | ) |
Exhaustive search to find the lattice with the best (the smallest) discrepancy in dimension \(s\).
The search runs over all values of the generator \(a_j = 1, 2, …, (n-1)\) and over all dimensions up to \(s\) inclusively. The first component \(a_0\) of the generator is always set to
Reimplemented in umontreal.ssj.discrepancy.SearcherCBC, and umontreal.ssj.discrepancy.SearcherKorobov.
Definition at line 203 of file Searcher.java.
| double umontreal.ssj.discrepancy.Searcher.exhaustPrime | ( | int | s | ) |
Similar to exhaust(s), except that only values of \(a_j\) relatively prime to \(n\) are considered.
Reimplemented in umontreal.ssj.discrepancy.SearcherCBC, and umontreal.ssj.discrepancy.SearcherKorobov.
Definition at line 211 of file Searcher.java.
| int[] umontreal.ssj.discrepancy.Searcher.getBestAs | ( | ) |
Returns the generator of the lattice which gave the best value of the discrepancy in the last search.
The components of this generator are returned as \(a_j\), for \(j = 0, 1, …, (s-1)\).
Definition at line 253 of file Searcher.java.
| double umontreal.ssj.discrepancy.Searcher.getBestVal | ( | ) |
Returns the best value of the discrepancy found in the last search.
Definition at line 244 of file Searcher.java.
| void umontreal.ssj.discrepancy.Searcher.initGen | ( | int | seed | ) |
Initializes the random number generator used in random searches with the starting seed seed.
If this method is not called, a default seed will be used.
Definition at line 262 of file Searcher.java.
| double umontreal.ssj.discrepancy.Searcher.random | ( | int | s, |
| int | k ) |
Random search to find the lattice with the best (the smallest) discrepancy in dimension \(s\).
At most \(k\) random ( \(s\)-dimensional) generators \(\mathbf{a}\) are examined. Each random component \(a_j\) takes values over the integers \(1, 2, …, (n-1)\). The first component \(a_0\) is always set to 1. The method returns the best value of the discrepancy found in dimension \(s\).
Reimplemented in umontreal.ssj.discrepancy.SearcherCBC, and umontreal.ssj.discrepancy.SearcherKorobov.
Definition at line 226 of file Searcher.java.
| double umontreal.ssj.discrepancy.Searcher.randomPrime | ( | int | s, |
| int | k ) |
Similar to random(s, k), except that only values of \(a_j\) relatively prime to \(n\) are considered.
Reimplemented in umontreal.ssj.discrepancy.SearcherCBC, and umontreal.ssj.discrepancy.SearcherKorobov.
Definition at line 234 of file Searcher.java.