LatMRG Guide  1.0
A software package to test and search for new linear congruential random number generators
LatMRG Namespace Reference

Namespaces

 Merit
 The methods in this namespace can compute the merit of a reduced lattice for a given projection and return it as a Dbl.
 
 Reductions
 Functions in this namespace perform lattice reductions.
 

Classes

class  AWCSWBLattice
 This class represents the lattice associated with either an AWC or a SWB random number generator. More...
 
class  Chrono
 This class acts as an interface to the system clock to compute the CPU time used by parts of a program. More...
 
class  ComboLattice
 This class represents a combined MRG. More...
 
class  FigureOfMerit
 This class is intended to store everything you might need after performing computations on a lattice. More...
 
class  IntFactorization
 The class IntFactorization implements the decomposition of integers in factors, preferably prime (see class IntFactor). More...
 
class  IntPrimitivity
 This class deals with primitive roots and primitive elements modulo an integer. More...
 
class  KorobovLattice
 This class implements lattice bases built from a Korobov lattice rule. More...
 
class  MeritList
 This class stores a certain number of FigureOfMerit objects. More...
 
class  MixmaxMMRG
 This class is used to manipulate easily MMRG of Mixmax types as described by Savvidy [CITE PAPER]. More...
 
class  MMRGLattice
 
class  ModInt
 
class  ModInt< NTL::ZZ >
 
class  ModInt< std::int64_t >
 
class  Modulus
 This class keeps parameters closely associated with a modulus of congruence. More...
 
class  MRGComponent
 This class is used to to test for full period length of generators and also to store a bit of information about generators without creating a lattice. More...
 
class  MRGLattice
 This class implements lattice basis built from multiple recursive linear congruential generators (MRGs). More...
 
class  MWCLattice
 This class represents the lattice associated to a Multiply-with-carry (MWC) random number generator. More...
 
class  ParamReaderExt
 Utility class used to read basic parameter fields in a configuration file. More...
 
class  PolyPE
 This class implements polynomials \(P(x)\) in \(\mathbb Z_m[X]\) defined as. More...
 
class  Primes
 This class provides methods to search for integers \(m\) that are prime, for which the integer \(r = (m^k-1)/(m-1)\) is also prime for a given \(k\), and possibly for which \((m-1)/2\) is also prime. More...
 
class  Projections
 A projection class that does exactly what we need when generating projections when testing a generator. More...
 

Enumerations

enum  DecompType {
  DECOMP, DECOMP_WRITE, DECOMP_READ, DECOMP_PRIME,
  NO_DECOMP
}
 Given an integer \(r\), indicates what to do about the decomposition of \(r\) in its prime factors. More...
 
enum  GenType {
  LCG, MRG, MWC, KOROBOV,
  RANK1, MMRG, COMBO
}
 Used to identify the type of a generator. More...
 
enum  ImplemCond {
  NO_COND, APP_FACT, POWER_TWO, EQUAL_COEF,
  ZERO_COEF
}
 Indicates which type of conditions are imposed on the coefficients \(a_i\) of a recurrence. More...
 
enum  LacunaryType { NONE, SUBVECTOR, ARBITRARYINDICES }
 Indicates the type of lacunary projection used for MMRG: More...
 
enum  LatticeType { FULL, RECURRENT, ORBIT, PRIMEPOWER }
 Indicates whether to analyze the lattice generated by all possible states, or a sub-lattice generated by the set of recurrent states or by a sub-cycle of the generator. More...
 
enum  SearchMethod { EXHAUST, RANDOM }
 Indicates the search method used to find good multipliers \(a_i\). More...
 

Functions

template<typename Int , typename Dbl >
MRGLattice< Int, Dbl > * getLatCombo (std::vector< MRGComponent< Int > * > &comp, int maxDim)
 This function computes and returns a MRGLattice that is the lattice of the combination of generators described in the MRGComponents in the vector comp. More...
 
template MRGLattice< std::int64_t, double > * getLatCombo (std::vector< MRGComponent< std::int64_t > * > &comp, int maxDim)
 
template MRGLattice< NTL::ZZ, double > * getLatCombo (std::vector< MRGComponent< NTL::ZZ > * > &comp, int maxDim)
 
int toDecomString (DecompType &decom, const std::string &decom_str)
 decom = decom_str. More...
 
int toGenString (GenType &type, const string &type_str)
 
int toGenString (GenType &type, const std::string &type_str)
 type = type_str. More...
 
std::string toString (Chrono &timer)
 Returns the value of the duration from timer. More...
 
toString functions

Useful functions for printing the enum constants in this module.

Returns the enum constants in this module as strings.

Remarks
Richard: These are global methods for now, but maybe Const should be a class containing these methods.
std::string toStringGen (GenType)
 
std::string toStringLattice (LatticeType)
 
std::string toStringDecomp (DecompType)
 
std::string toStringImplemCond (ImplemCond)
 
std::string toStringSearchMethod (SearchMethod)
 

Enumeration Type Documentation

◆ DecompType

Given an integer \(r\), indicates what to do about the decomposition of \(r\) in its prime factors.

DECOMP: means that the program will factorize \(r\).
DECOMP_WRITE: means that the program will factorize \(r\) and writes the factors in a file.
DECOMP_READ: means that \(r\) is already factorized, and the factors will be read from a file.
DECOMP_PRIME: means that \(r\) is prime. No factorization will be done. NO_DECOMP: The program will not need a decomposition. Used when not checking full generator period.

Enumerator
DECOMP 
DECOMP_WRITE 
DECOMP_READ 
DECOMP_PRIME 
NO_DECOMP 

◆ GenType

Used to identify the type of a generator.

If a generator is of type MWC, it is converted to its corresponding MRG by the program.

LCG: the linear congruential generator with a carry.
MRG: the multiple-recursive generator.
MWC: the multiply-with-carry generator.
KOROBOV: the Korobov lattice. This is not used in LatMRG.
RANK1: the rank 1 lattice. This is not used in LatMRG
MMRG: the matrix multiple-recursive generator. A generator with a matrix multiplier.

Enumerator
LCG 
MRG 
MWC 
KOROBOV 
RANK1 
MMRG 
COMBO 

◆ ImplemCond

Indicates which type of conditions are imposed on the coefficients \(a_i\) of a recurrence.

NO_COND: no condition is imposed on the coefficients.
APP_FACT: the coefficients must satisfy the "approximate factoring" condition \(|a_i| (m\mod|a_i|) < m\). Congruential generators are easier to implement under this condition [20] .
POWER_TWO: the coefficients must be sums or differences of powers of 2.
EQUAL_COEF: all the coefficients must be equal by groups: a first group all equal to a first number, a second group all equal to a second number, and so on.
ZERO_COEF: all the coefficients must be equal to 0, except for a select fews.

Enumerator
NO_COND 
APP_FACT 
POWER_TWO 
EQUAL_COEF 
ZERO_COEF 

◆ LacunaryType

Indicates the type of lacunary projection used for MMRG:

  • NONE: no lacunary projection
  • SUBVECTOR: only the selected coordinates of each new random vector are kept
  • ARBITRARY: only the selected indices are kept.
Enumerator
NONE 
SUBVECTOR 
ARBITRARYINDICES 

◆ LatticeType

Indicates whether to analyze the lattice generated by all possible states, or a sub-lattice generated by the set of recurrent states or by a sub-cycle of the generator.

FULL: The complete lattice, generated by all possible initial states, will be analyzed.
RECURRENT: If the (combined) generator has transient states, then the lattice analyzed will be the sub-lattice generated by the set of recurrent states.
ORBIT: The grid generated by the (forward) orbit of a state of the (combined) generator is analyzed. This state is specified as follows. On the following \(J\) lines, the initial state for each component must be given. This is an integer vector with a number of components equal to the order of the component.
PRIMEPOWER: In the case where some component is an MLCG whose modulus is a power of a prime \(p\), then the states visited over a single orbit (sub-cycle) of that component generate a sub-lattice (when \(a \equiv1 \bmod p\)) or belong to the union of \(p-1\) sub-lattices (otherwise). If LatticeType takes this value, and a component is a MLCG ( \(k=1\)), and if the modulus of that MLCG is given in the data file in the form (b): \((x y z)\) with \(z=0\) and \(x\) prime, then what is analyzed is one of those sub-lattices. This is done by dividing the modulus by the appropriate power of \(p\), as described in [17] . For example, if \(p=2\) and \(a \mod8 = 5\), then the modulus is divided by 4 as in [8], [13] .

Enumerator
FULL 
RECURRENT 
ORBIT 
PRIMEPOWER 

◆ SearchMethod

Indicates the search method used to find good multipliers \(a_i\).

EXHAUST: the search will be exhaustive over the chosen regions.
RANDOM: the search will be random over the chosen regions.

Enumerator
EXHAUST 
RANDOM 

Function Documentation

◆ getLatCombo() [1/3]

template<typename Int , typename Dbl >
MRGLattice<Int, Dbl>* LatMRG::getLatCombo ( std::vector< MRGComponent< Int > * > &  comp,
int  maxDim 
)

This function computes and returns a MRGLattice that is the lattice of the combination of generators described in the MRGComponents in the vector comp.

This dynamically allocates memory to returned pointer. and needs to be deleted afterwards.

◆ getLatCombo() [2/3]

template MRGLattice< std::int64_t, double > * LatMRG::getLatCombo ( std::vector< MRGComponent< std::int64_t > * > &  comp,
int  maxDim 
)

◆ getLatCombo() [3/3]

template MRGLattice< NTL::ZZ, NTL::RR > * LatMRG::getLatCombo ( std::vector< MRGComponent< NTL::ZZ > * > &  comp,
int  maxDim 
)

◆ toDecomString()

int LatMRG::toDecomString ( DecompType decom,
const std::string &  decom_str 
)

decom = decom_str.

Does not change the value of decom if decom_str does not specify a valid value. Returns 0 if a change took place.

◆ toGenString() [1/2]

int LatMRG::toGenString ( GenType type,
const string &  type_str 
)

◆ toGenString() [2/2]

int LatMRG::toGenString ( GenType type,
const std::string &  type_str 
)

type = type_str.

Does not change the value of type if type_str does not specify a valid value. Returns 0 if a change took place.

◆ toString()

std::string LatMRG::toString ( Chrono timer)

Returns the value of the duration from timer.

◆ toStringDecomp()

string LatMRG::toStringDecomp ( DecompType  deco)

◆ toStringGen()

string LatMRG::toStringGen ( GenType  gen)

◆ toStringImplemCond()

string LatMRG::toStringImplemCond ( ImplemCond  cond)

◆ toStringLattice()

string LatMRG::toStringLattice ( LatticeType  lat)

◆ toStringSearchMethod()

string LatMRG::toStringSearchMethod ( SearchMethod  method)