SSJ API Documentation
Stochastic Simulation in Java
Loading...
Searching...
No Matches
umontreal.ssj.discrepancy.SearcherKorobov Class Reference

This class implements searches to find the best Korobov lattices with respect to a given discrepancy. More...

Inheritance diagram for umontreal.ssj.discrepancy.SearcherKorobov:
umontreal.ssj.discrepancy.Searcher

Public Member Functions

 SearcherKorobov (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 best Korobov lattice (i.e.
double exhaustPrime (int s)
 Similar to exhaust(s), except that only values of \(a\) relatively prime to \(n\) are considered.
double random (int s, int k)
 Random search to find the best Korobov lattice (with the smallest discrepancy) in dimension \(s\).
double randomPrime (int s, int k)
 Similar to random(s, k), except that only values of \(a\) relatively prime to \(n\) are considered.
int getBestA ()
 Returns the generator \(a\) of the lattice which gave the best value of the discrepancy in the last search.
Public Member Functions inherited from 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.
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.

Detailed Description

This class implements searches to find the best Korobov lattices with respect to a given discrepancy.

Given a positive integer \(n\) and a multiplier \(a\), the points are defined by

\[ \mathbf{u}_i = (i/n)(1, a, a^2, …, a^{s-1}) \bmod1 \]

for \(i=0,…,n-1\).

The discrepancy object in the 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.

Definition at line 45 of file SearcherKorobov.java.

Constructor & Destructor Documentation

◆ SearcherKorobov()

umontreal.ssj.discrepancy.SearcherKorobov.SearcherKorobov ( 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 the 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 135 of file SearcherKorobov.java.

Member Function Documentation

◆ exhaust()

double umontreal.ssj.discrepancy.SearcherKorobov.exhaust ( int s)

Exhaustive search to find the best Korobov lattice (i.e.

with the smallest discrepancy) in dimension \(s\). The search runs exhaustively over all values \( a = 2, 3, …, (n-1)\), where

\(a\) is the generator of the lattice. The method returns the best value found for the discrepancy.

Reimplemented from umontreal.ssj.discrepancy.Searcher.

Definition at line 147 of file SearcherKorobov.java.

◆ exhaustPrime()

double umontreal.ssj.discrepancy.SearcherKorobov.exhaustPrime ( int s)

Similar to exhaust(s), except that only values of \(a\) relatively prime to \(n\) are considered.

Reimplemented from umontreal.ssj.discrepancy.Searcher.

Definition at line 155 of file SearcherKorobov.java.

◆ getBestA()

int umontreal.ssj.discrepancy.SearcherKorobov.getBestA ( )

Returns the generator \(a\) of the lattice which gave the best value of the discrepancy in the last search.

Definition at line 188 of file SearcherKorobov.java.

◆ random()

double umontreal.ssj.discrepancy.SearcherKorobov.random ( int s,
int k )

Random search to find the best Korobov lattice (with the smallest discrepancy) in dimension \(s\).

\(k\) random values \(a\) are examined as generator of the lattice. The \(a\) takes values over the integers \( a = 2, 3, …, (n-1)\). The method returns the best value found for the discrepancy.

Reimplemented from umontreal.ssj.discrepancy.Searcher.

Definition at line 169 of file SearcherKorobov.java.

◆ randomPrime()

double umontreal.ssj.discrepancy.SearcherKorobov.randomPrime ( int s,
int k )

Similar to random(s, k), except that only values of \(a\) relatively prime to \(n\) are considered.

Reimplemented from umontreal.ssj.discrepancy.Searcher.

Definition at line 177 of file SearcherKorobov.java.


The documentation for this class was generated from the following file: