LatMRG Guide  1.0
A software package to test and search for new linear congruential random number generators
LatMRG::MMRGLattice< Integ, Float > Class Template Reference

#include <latmrg/MMRGLattice.h>

Inheritance diagram for LatMRG::MMRGLattice< Integ, Float >:

Public Types

typedef Float Dbl
 
typedef Integ Int
 
typedef NTL::matrix< IntIntMat
 
typedef NTL::vector< IntIntVec
 

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 IntMatgetGeneratorMatrix () const
 Returns a non-mutable copy of the generator matrix of the MMRG. More...
 
IntgetLac (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< Intm_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
 

Detailed Description

template<typename Integ, typename Float>
class LatMRG::MMRGLattice< Integ, Float >

Todo:
Make this class not use/compute the dual if not asked.

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. \]

Member Typedef Documentation

◆ Dbl

template<typename Integ , typename Float >
typedef Float LatMRG::MMRGLattice< Integ, Float >::Dbl

◆ Int

template<typename Integ , typename Float >
typedef Integ LatMRG::MMRGLattice< Integ, Float >::Int

◆ IntMat

template<typename Integ , typename Float >
typedef NTL::matrix<Int> LatMRG::MMRGLattice< Integ, Float >::IntMat

◆ IntVec

template<typename Integ , typename Float >
typedef NTL::vector<Int> LatMRG::MMRGLattice< Integ, Float >::IntVec

Constructor & Destructor Documentation

◆ MMRGLattice() [1/3]

template<typename Int , typename Dbl >
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.

◆ MMRGLattice() [2/3]

template<typename Int , typename Dbl >
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.

◆ MMRGLattice() [3/3]

template<typename Int , typename Dbl >
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.

◆ ~MMRGLattice()

template<typename Int , typename Dbl >
LatMRG::MMRGLattice< Int, Dbl >::~MMRGLattice ( )

Destructor.

Member Function Documentation

◆ buildBasis()

template<typename Int , typename Dbl >
void LatMRG::MMRGLattice< Int, Dbl >::buildBasis ( int  d)
override

Builds the basis in dimension \(d\).

◆ buildLacunaryBasis()

template<typename Int , typename Dbl >
void LatMRG::MMRGLattice< Int, Dbl >::buildLacunaryBasis ( int  dimension)
protected

Builds the basis of the MMRG recurrence in case of lacunary indices.

◆ buildNonLacunaryBasis()

template<typename Int , typename Dbl >
void LatMRG::MMRGLattice< Int, Dbl >::buildNonLacunaryBasis ( int  dimension)
protected

Builds the basis of the MMRG recurrence in case of non-lacunary indices.

◆ getGeneratorMatrix()

template<typename Integ , typename Float >
const IntMat& LatMRG::MMRGLattice< Integ, Float >::getGeneratorMatrix ( ) const
inline

Returns a non-mutable copy of the generator matrix of the MMRG.

◆ getLac()

template<typename Int , typename Dbl >
Int & LatMRG::MMRGLattice< Int, Dbl >::getLac ( int  j)

Returns the \(j\)-th lacunary index.

◆ getSubLine()

template<typename Int , typename Dbl >
void LatMRG::MMRGLattice< Int, Dbl >::getSubLine ( IntVec vec,
IntMat B,
int  lign,
int  jMin,
int  jMax 
)

◆ incDim()

template<typename Int , typename Dbl >
void LatMRG::MMRGLattice< Int, Dbl >::incDim ( )

Increments the dimension of the basis by 1 by calling either incDimBasis or incDimLaBasis.

◆ incrementDimLacunaryBasis()

template<typename Int , typename Dbl >
void LatMRG::MMRGLattice< Int, Dbl >::incrementDimLacunaryBasis ( int  Imax)
protected

Increments the basis by 1 in case of lacunary indices.

◆ incrementDimNonLacunaryBasis()

template<typename Int , typename Dbl >
void LatMRG::MMRGLattice< Int, Dbl >::incrementDimNonLacunaryBasis ( )
protected

Increments the basis by 1 in case of non-lacunary indices.

◆ init()

template<typename Int , typename Dbl >
void LatMRG::MMRGLattice< Int, Dbl >::init ( )
protected

Initializes some of the local variables.

◆ isLacunary()

template<typename Integ , typename Float >
bool LatMRG::MMRGLattice< Integ, Float >::isLacunary ( ) const
inline

Returns true for the case of lacunary indices, returns false for non-lacunary indices.

◆ kill()

template<typename Int , typename Dbl >
void LatMRG::MMRGLattice< Int, Dbl >::kill ( )

Cleans and releases memory used by this object.

◆ operator=()

template<typename Int , typename Dbl >
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.

◆ setLac()

template<typename Int , typename Dbl >
void LatMRG::MMRGLattice< Int, Dbl >::setLac ( const LatticeTester::Lacunary< Int > &  lat)
virtual

Sets the lacunary indices for this lattice to lat.

◆ toString()

template<typename Int , typename Dbl >
std::string LatMRG::MMRGLattice< Int, Dbl >::toString ( ) const

Returns the generator matrix \(A\) as a string.

Member Data Documentation

◆ m_A

template<typename Integ , typename Float >
IntMat LatMRG::MMRGLattice< Integ, Float >::m_A
protected

The generator matrix of the recurrence.

◆ m_B

template<typename Integ , typename Float >
IntMat LatMRG::MMRGLattice< Integ, Float >::m_B
protected

Matrix used for lacunary indices.

◆ m_basis_max

template<typename Integ , typename Float >
IntMat LatMRG::MMRGLattice< Integ, Float >::m_basis_max
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.

◆ m_e

template<typename Integ , typename Float >
Int LatMRG::MMRGLattice< Integ, Float >::m_e
protected

◆ m_ip

template<typename Integ , typename Float >
bool* LatMRG::MMRGLattice< Integ, Float >::m_ip
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.

◆ m_lac

template<typename Integ , typename Float >
LatticeTester::Lacunary<Int> LatMRG::MMRGLattice< Integ, Float >::m_lac
protected

Contains the lacunary indices when LacunaryFlag is true, otherwise is undefined.

◆ m_lacunaryFlag

template<typename Integ , typename Float >
bool LatMRG::MMRGLattice< Integ, Float >::m_lacunaryFlag
protected

Is true in the case of lacunary indices, false otherwise.

◆ m_lacunaryType

template<typename Integ , typename Float >
LacunaryType LatMRG::MMRGLattice< Integ, Float >::m_lacunaryType
protected

Type of the lacunary projection selected.

◆ m_latType

template<typename Integ , typename Float >
LatticeType LatMRG::MMRGLattice< Integ, Float >::m_latType
protected

Indicates which lattice or sublattice is analyzed.

◆ m_numberLacIndices

template<typename Integ , typename Float >
int LatMRG::MMRGLattice< Integ, Float >::m_numberLacIndices
protected

Contains the number of lacunary indices.

◆ m_sta

template<typename Integ , typename Float >
IntMat LatMRG::MMRGLattice< Integ, Float >::m_sta
protected

\(\clubsuit\) Seems to be use as working variables.

To be completed. Erwan

◆ m_t4

template<typename Integ , typename Float >
Int LatMRG::MMRGLattice< Integ, Float >::m_t4
protected

Work variables.

◆ m_t5

template<typename Integ , typename Float >
Int LatMRG::MMRGLattice< Integ, Float >::m_t5
protected

◆ m_t6

template<typename Integ , typename Float >
Int LatMRG::MMRGLattice< Integ, Float >::m_t6
protected

◆ m_t7

template<typename Integ , typename Float >
Int LatMRG::MMRGLattice< Integ, Float >::m_t7
protected

◆ m_t8

template<typename Integ , typename Float >
Int LatMRG::MMRGLattice< Integ, Float >::m_t8
protected

◆ m_xi

template<typename Integ , typename Float >
IntVec LatMRG::MMRGLattice< Integ, Float >::m_xi
protected

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