LatMRG Guide
1.0
A software package to test and search for new linear congruential random number generators
|
As of the latest update, LatMRG possesses a single executable taking all it's options from configuration files. This executable has 4 different execution modes that simply the usage of the core functionnalities of LatMRG.
We briefly introduce what each mode can do, before presenting the program usage.
This mode will search for good modulus in a certain range given a number \(k\). This is used when searching for new generators with full period.
This will search for prime \(m\) in \(m < 2^e\) or \( 2^e+c_1 \le m \le 2^e+c_2\). When doing these search, it is possible to ask that \(r = (m^k-1)/(m-1)\) is prime and that \((m-1)/2\). It is also possible to ask the program to factor \(m-1\) to a file.
All these factorisations and restrictions on primality are useful because they simplify the initialization process of the search program, as the factorization of \(r\) and \((m-1)/2\) is needed to check the full period of a generator.
This mode takes a generator and tests if it's period length is maximal. This will need a factorization for \(r\) and \(m-1\) which can be very long to compute. Accomplishing this factorization outside of the main program is the main use case of this mode. Using this seperately of the generator testing gives you more flexibility with the execution time.
This mode takes a generator, a test, a description of how to apply this test and performs the test on the generator. The generator can be of any of the types of MRG described in Theory of Random Numbers.
The program can perform multiple computations:
But it's real strength lies in the fact that it can build the generator lattice and dual lattice for any projection of the generator, and compute figures of merit based on the normalized mesures on these multiple projections. Computing these figures of merit is really the main reason to use this mode.
To execute the program, it is necessary to feed it with the set of of the generator that you want to test. This program takes a values for \(T\), \(d\) and \(T_2, \ldots, T_d\) such that the program will test all projections of the form \(\{0, \ldots, t\}\) with \(k \le t < T\), and projections on indices \(\{i_1, \ldots, i_j: 0 \leq i_k \le T_j\}\) for \(2 \le j \le d\).
This mode takes configuration of MRG generators (such and the modulo, the order and ranges for the parameters) and randomly searches for parameters that fit this configuration. Once a generator is found, it is tested with the same methodology as in the preceding Testing lattice structure for MRG mode and generators are ranked by the value they get in these tests.
Even though a lot for flexibility is available when using this mode, it is usual to compare generators with figures of merit between 0 and
We do not provide a precompiled binairy for the main executable. To use it you must first compile it following the instructions following this section. Once this is done, you will find the main MRGLattice
executable in the bin
directory of the software repository.
As any executable, the executable can be called from the command line as
It is necessary to specify configuration files for the program to actually do stuff. The option of LD
, ZD
or ZR
can be used to change the numeric types used by the program. It can be ommited, its default value is ZD
. For more information on what this option means, you can have a look at Types in LatMRG.
NEW As of the last upgrade to LatMRG, the executable now reads it's configuration from xml
files. Since configuration files have a quite extensive set of tags allowing users to specify the options, the list of these tags and their usage for the different modes is specified in Configuration Files Synthax and Tags.
LatMRG is available on Github and can be downloaded either via git
or as a .zip
archive. We do not provide precompiled binairies, so you have to follow these instruction to use the software. Once you have the repository on a local machine, it is necessary to make sure that you have the correct dependencies installed:
NTL_THREADS=off
in a standard path.-dev
or -devel
named package).data
directory.To build the program, it will also be necessary to have a recent C++ compiler and Python interpreter installed. Note that we do not provide instructions to build the library under Windows or macOS, and that the software is only tested for the x86_64
architecture. Also note that we currently do not use automatic makefile
generation and that you will need to manually modify the makefile for any non standard path choices.
First, download the source code via github as a .zip
unpack it and open a terminal in that directory, or use git:
If you downloaded the zip, you will also need to download and extract Lattice Tester. In the latticetester
directory. Once this is done, the program can be compiled in only a few commands. Note that the first one is interractive.
Once this is done, the executables can be invoked from the local directory as ./bin/Program_name data_file
.
Note that there is no way to install the program somewhere else. If yafu
is used by the program, it might be problematic to move the binaries. This is because the program uses a relative path to invoke yafu
. We are aware of these issues and they will be fixed some time in the future.