|
LatMRG Guide
1.0
A software package to test and search for new linear congruential random number generators
|
#include <latmrg/MMRGLattice.h>
Public Types | |
| typedef Float | Dbl |
| typedef Integ | Int |
| typedef NTL::matrix< Int > | IntMat |
| typedef NTL::vector< Int > | IntVec |
Public Member Functions | |
| MMRGLattice (const Int &m, const IntMat &A, int maxDim, int r, LatticeTester::NormType norm=LatticeTester::L2NORM, LatticeType lat=FULL) | |
Constructor with modulus of congruence \(m\), generator matrix \(A\), dimension of generator matrix \(r\), maximal dimension MaxDim, and lattice type Latt. More... | |
| MMRGLattice (const Int &m, const IntMat &A, int maxDim, int r, LacunaryType &lacunaryType, IntVec &lac, LatticeTester::NormType norm=LatticeTester::L2NORM, LatticeType lat=FULL) | |
As in the constructor above but the basis is built for the lacunary indices lac. More... | |
| MMRGLattice (const MMRGLattice< Int, Dbl > &Lat) | |
| Copy constructor. More... | |
| ~MMRGLattice () | |
| Destructor. More... | |
| void | buildBasis (int d) override |
| Builds the basis in dimension \(d\). More... | |
| const IntMat & | getGeneratorMatrix () const |
| Returns a non-mutable copy of the generator matrix of the MMRG. More... | |
| Int & | getLac (int j) |
| Returns the \(j\)-th lacunary index. More... | |
| void | getSubLine (IntVec &vec, IntMat &B, int lign, int jMin, int jMax) |
| void | incDim () |
Increments the dimension of the basis by 1 by calling either incDimBasis or incDimLaBasis. More... | |
| bool | isLacunary () const |
Returns true for the case of lacunary indices, returns false for non-lacunary indices. More... | |
| void | kill () |
| Cleans and releases memory used by this object. More... | |
| MMRGLattice< Int, Dbl > & | operator= (const MMRGLattice< Int, Dbl > &Lat) |
Assigns Lat to this object. More... | |
| virtual void | setLac (const LatticeTester::Lacunary< Int > &lat) |
Sets the lacunary indices for this lattice to lat. More... | |
| std::string | toString () const |
| Returns the generator matrix \(A\) as a string. More... | |
Protected Member Functions | |
| void | buildLacunaryBasis (int dimension) |
| Builds the basis of the MMRG recurrence in case of lacunary indices. More... | |
| void | buildNonLacunaryBasis (int dimension) |
| Builds the basis of the MMRG recurrence in case of non-lacunary indices. More... | |
| void | incrementDimLacunaryBasis (int Imax) |
| Increments the basis by 1 in case of lacunary indices. More... | |
| void | incrementDimNonLacunaryBasis () |
| Increments the basis by 1 in case of non-lacunary indices. More... | |
| void | init () |
| Initializes some of the local variables. More... | |
Protected Attributes | |
| IntMat | m_A |
| The generator matrix of the recurrence. More... | |
| IntMat | m_B |
| Matrix used for lacunary indices. More... | |
| IntMat | m_basis_max |
| Basis that is always of a dimension that is a multiple of the order and that is always of a greater or equal dimension than the current basis. More... | |
| bool * | m_ip |
When the flag m_ip[i] is true, the \(i\)-th diagonal element of matrix m_sta is non-zero (modulo \(m\)) and divides \(m\). More... | |
| LatticeTester::Lacunary< Int > | m_lac |
Contains the lacunary indices when LacunaryFlag is true, otherwise is undefined. More... | |
| bool | m_lacunaryFlag |
Is true in the case of lacunary indices, false otherwise. More... | |
| LacunaryType | m_lacunaryType |
| Type of the lacunary projection selected. More... | |
| LatticeType | m_latType |
| Indicates which lattice or sublattice is analyzed. More... | |
| int | m_numberLacIndices |
| Contains the number of lacunary indices. More... | |
| IntMat | m_sta |
| \(\clubsuit\) Seems to be use as working variables. More... | |
| Int | m_t4 |
| Work variables. More... | |
| Int | m_t5 |
| Int | m_t6 |
| Int | m_t7 |
| Int | m_t8 |
| Int | m_e |
| IntVec | m_xi |
This class implements lattice basis built from M-MRG (matrix multiple recursive linear congruential generators). One must first call the constructor with a given congruence modulus \(m\), a given generator matrix for the recurrence, and a maximal dimension for the basis. One must then build the lattice basis associated to the generator matrix for a given dimension. Each MMRG is defined by a generator matrix \(A\). This MMRG satisfies the recurrence
\[ X_n = A X_{n-1} \mod m. \]
| typedef Float LatMRG::MMRGLattice< Integ, Float >::Dbl |
| typedef Integ LatMRG::MMRGLattice< Integ, Float >::Int |
| typedef NTL::matrix<Int> LatMRG::MMRGLattice< Integ, Float >::IntMat |
| typedef NTL::vector<Int> LatMRG::MMRGLattice< Integ, Float >::IntVec |
| LatMRG::MMRGLattice< Int, Dbl >::MMRGLattice | ( | const Int & | m, |
| const IntMat & | A, | ||
| int | maxDim, | ||
| int | r, | ||
| LatticeTester::NormType | norm = LatticeTester::L2NORM, |
||
| LatticeType | lat = FULL |
||
| ) |
Constructor with modulus of congruence \(m\), generator matrix \(A\), dimension of generator matrix \(r\), maximal dimension MaxDim, and lattice type Latt.
Vectors and (square) matrices of the basis have maximal dimension maxDim, and the indices of vectors and matrices vary from dimension 0 to maxDim-1. The norm to be used for the basis vectors is norm.
| LatMRG::MMRGLattice< Int, Dbl >::MMRGLattice | ( | const Int & | m, |
| const IntMat & | A, | ||
| int | maxDim, | ||
| int | r, | ||
| LacunaryType & | lacunaryType, | ||
| IntVec & | lac, | ||
| LatticeTester::NormType | norm = LatticeTester::L2NORM, |
||
| LatticeType | lat = FULL |
||
| ) |
As in the constructor above but the basis is built for the lacunary indices lac.
| LatMRG::MMRGLattice< Int, Dbl >::MMRGLattice | ( | const MMRGLattice< Int, Dbl > & | Lat | ) |
Copy constructor.
The maximal dimension of the created basis is set equal to Lat’s current dimension.
| LatMRG::MMRGLattice< Int, Dbl >::~MMRGLattice | ( | ) |
Destructor.
|
override |
Builds the basis in dimension \(d\).
|
protected |
Builds the basis of the MMRG recurrence in case of lacunary indices.
|
protected |
Builds the basis of the MMRG recurrence in case of non-lacunary indices.
|
inline |
Returns a non-mutable copy of the generator matrix of the MMRG.
| Int & LatMRG::MMRGLattice< Int, Dbl >::getLac | ( | int | j | ) |
Returns the \(j\)-th lacunary index.
| void LatMRG::MMRGLattice< Int, Dbl >::getSubLine | ( | IntVec & | vec, |
| IntMat & | B, | ||
| int | lign, | ||
| int | jMin, | ||
| int | jMax | ||
| ) |
| void LatMRG::MMRGLattice< Int, Dbl >::incDim | ( | ) |
Increments the dimension of the basis by 1 by calling either incDimBasis or incDimLaBasis.
|
protected |
Increments the basis by 1 in case of lacunary indices.
|
protected |
Increments the basis by 1 in case of non-lacunary indices.
|
protected |
Initializes some of the local variables.
|
inline |
Returns true for the case of lacunary indices, returns false for non-lacunary indices.
| void LatMRG::MMRGLattice< Int, Dbl >::kill | ( | ) |
Cleans and releases memory used by this object.
| MMRGLattice< Int, Dbl > & LatMRG::MMRGLattice< Int, Dbl >::operator= | ( | const MMRGLattice< Int, Dbl > & | Lat | ) |
Assigns Lat to this object.
The maximal dimension of this basis is set equal to Lat’s current dimension.
|
virtual |
Sets the lacunary indices for this lattice to lat.
| std::string LatMRG::MMRGLattice< Int, Dbl >::toString | ( | ) | const |
Returns the generator matrix \(A\) as a string.
|
protected |
The generator matrix of the recurrence.
|
protected |
Matrix used for lacunary indices.
|
protected |
Basis that is always of a dimension that is a multiple of the order and that is always of a greater or equal dimension than the current basis.
This is used by buildBasis() and incDim() so that powers of A do not have to be computed every time.
|
protected |
|
protected |
When the flag m_ip[i] is true, the \(i\)-th diagonal element of matrix m_sta is non-zero (modulo \(m\)) and divides \(m\).
Otherwise (when m_ip[i] is false), the \(i\)-th line of matrix m_sta is identically 0.
|
protected |
Contains the lacunary indices when LacunaryFlag is true, otherwise is undefined.
|
protected |
Is true in the case of lacunary indices, false otherwise.
|
protected |
Type of the lacunary projection selected.
|
protected |
Indicates which lattice or sublattice is analyzed.
|
protected |
Contains the number of lacunary indices.
|
protected |
\(\clubsuit\) Seems to be use as working variables.
To be completed. Erwan
|
protected |
Work variables.
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |