SSJ
V. labo.

umontreal.iro.lecuyer.discrepancy
Class Searcher

java.lang.Object
  extended by umontreal.iro.lecuyer.discrepancy.Searcher
Direct Known Subclasses:
SearcherCBC, SearcherKorobov

public class Searcher
extends Object

This class implements searches to find the best lattices of rank 1, defined as follows. Given a positive integer n and a s-dimensional integer vector (a0,..., as-1), where 0 <= aj < n for each j, the points are defined by

ui = (i/n)(a0, a1,…, as-1) mod 1

for i = 0,..., n - 1. Here we always choose a0 = 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 γj. Then the search program will examine different lattices with n, s and γ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.


Constructor Summary
Searcher(Discrepancy disc, boolean primeN)
          The number of points n, the dimension s, and possibly the s weight factors γj must be given in disc.
 
Method Summary
 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 aj relatively prime to n are considered.
 int[] getBestAs()
          Returns the generator of the lattice which gave the best value of the discrepancy in the last search.
 double getBestVal()
          Returns the best value of the discrepancy found in the last search.
 void initGen(int seed)
          Initializes the random number generator used in random searches with the starting seed seed.
 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 aj relatively prime to n are considered.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Searcher

public Searcher(Discrepancy disc,
                boolean primeN)
The number of points n, the dimension s, and possibly the s weight factors γ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.

Method Detail

exhaust

public double 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 aj = 1, 2,…,(n - 1) and over all dimensions up to s inclusively. The first component a0 of the generator is always set to 1. The method returns the best value of the discrepancy found in dimension s.


exhaustPrime

public double exhaustPrime(int s)
Similar to exhaust(s), except that only values of aj relatively prime to n are considered.


random

public double 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 a are examined. Each random component aj takes values over the integers 1, 2,…,(n - 1). The first component a0 is always set to 1. The method returns the best value of the discrepancy found in dimension s.


randomPrime

public double randomPrime(int s,
                          int k)
Similar to random(s, k), except that only values of aj relatively prime to n are considered.


getBestVal

public double getBestVal()
Returns the best value of the discrepancy found in the last search.


getBestAs

public int[] 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 aj, for j = 0, 1,…,(s - 1).


initGen

public void 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.


SSJ
V. labo.

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