LatMRG Online Documentation unknown
Tools to analyze the lattice structure of linear generators
Loading...
Searching...
No Matches
LatMRG::MRGLattice< Int, Real > Class Template Reference

This subclass of IntLatticeExt defines an MRG lattice and is similar to Rank1Lattice, but constructs lattices associated with multiple recursive generators (MRGs) with modulus m, order k, and vector of multipliers a = (a_1, . More...

Inheritance diagram for LatMRG::MRGLattice< Int, Real >:

Public Member Functions

 MRGLattice (const Int &m, const IntVec &aa, int64_t maxDim, NormType norm=L2NORM)
 This constructor takes as input the modulus m, the vector of multipliers aa, and the norm used to measure the vector lengths.
 MRGLattice (const MRGLattice< Int, Real > &Lat)
MRGLatticeoperator= (const MRGLattice< Int, Real > &Lat)
 Assigns Lat to this object.
 ~MRGLattice ()
 Destructor.
virtual void setaa (const IntVec &aa)
 Sets the vector of multipliers.
void buildBasis (int64_t dim)
 Builds a basis in dim dimensions.
void buildDualBasis (int64_t dim)
 Builds the m-dual lower triangular basis directly in dim dimensions.
void incDimBasis ()
 Increases the current dimension of the primal basis by 1 and updates the basis.
void incDimDualBasis ()
 Increases the current dimension of the m-dual basis by 1.
void buildProjection (IntLattice< Int, Real > &projLattice, const Coordinates &proj) override
 This method overrides its namesake in IntLattice.
void buildProjectionDual (IntLattice< Int, Real > &projLattice, const Coordinates &proj) override
 Overrides the same function from IntLattice.
std::string toStringCoef () const
 Returns the first dim components of the generating vector \(\ba\) as a string, where dim is the current lattice dimension.

Protected Member Functions

virtual void buildBasis0 (IntMat &basis, int64_t d)
 The following protected functions take the basis as a parameter for more flexibility.
virtual void buildDualBasis0 (IntMat &basis, int64_t d)
virtual void incDimBasis0 (IntMat &basis, int64_t d)
virtual void incDimDualBasis0 (IntMat &basis, int64_t d)
virtual bool buildProjection0 (IntMat &basis, int64_t dimbasis, IntMat &pbasis, const Coordinates &proj)

Protected Attributes

IntMat m_genTemp
 This auxiliary matrix is used to store the generating vectors of a projections before reducing them into a triangular basis.
IntMat m_copy_primal_basis
 For generating the dual basis or increasing its dimension, we need a copy of the the primal basis if we use polynomial arithmetic.
int m_order
IntVec m_aCoeff
 The coefficients \(a_1, ..., a_k\) of the MRG recurrence, a_j stored in m_aCoeff[j].

Detailed Description

template<typename Int, typename Real>
class LatMRG::MRGLattice< Int, Real >

This subclass of IntLatticeExt defines an MRG lattice and is similar to Rank1Lattice, but constructs lattices associated with multiple recursive generators (MRGs) with modulus m, order k, and vector of multipliers a = (a_1, .

. . , a_k).

The functions buildBasis and incDimBasis always build and update the primal basis. To build the m-dual, use buildDualBasis.

Constructor & Destructor Documentation

◆ MRGLattice() [1/2]

template<typename Int, typename Real>
LatMRG::MRGLattice< Int, Real >::MRGLattice ( const Int & m,
const IntVec & aa,
int64_t maxDim,
NormType norm = L2NORM )

This constructor takes as input the modulus m, the vector of multipliers aa, and the norm used to measure the vector lengths.

The vector aa must have length k+1, with \(a_j\) in aa[j]. The maximal dimension maxDim will be the maximal dimension of the basis. This constructor does not build the basis, so we can build it for a smaller number of dimensions or only for selected projections.

◆ MRGLattice() [2/2]

template<typename Int, typename Real>
LatMRG::MRGLattice< Int, Real >::MRGLattice ( const MRGLattice< Int, Real > & Lat)

◆ ~MRGLattice()

template<typename Int, typename Real>
LatMRG::MRGLattice< Int, Real >::~MRGLattice ( )

Destructor.

Member Function Documentation

◆ operator=()

template<typename Int, typename Real>
MRGLattice< Int, Real > & LatMRG::MRGLattice< Int, Real >::operator= ( const MRGLattice< Int, Real > & Lat)

Assigns Lat to this object.

◆ setaa()

template<typename Int, typename Real>
void LatMRG::MRGLattice< Int, Real >::setaa ( const IntVec & aa)
virtual

Sets the vector of multipliers.

Sets the generating vector to aa.

The order k of the lattice is set equal to the length of this vector, minus 1. aa[j] must contain \(a_j\) for j=1,...,k.

◆ buildBasis()

template<typename Int, typename Real>
void LatMRG::MRGLattice< Int, Real >::buildBasis ( int64_t dim)

Builds a basis in dim dimensions.

This dim must not exceed this->maxDim(). This initial primal basis will be upper triangular - based on V^{(0)} or V^{(p)} depending on which approach is chosen by the user.

◆ buildDualBasis()

template<typename Int, typename Real>
void LatMRG::MRGLattice< Int, Real >::buildDualBasis ( int64_t dim)

Builds the m-dual lower triangular basis directly in dim dimensions.

This dim must not exceed maxDim. In order to build the m-dual basis, the primal basis is needed, even if it has not been built yet. Therefore, a copy of the basis matrix is always created upon building the m-dual basis. It is stored in the variable 'm_copy_primal_basis'.

◆ incDimBasis()

template<typename Int, typename Real>
void LatMRG::MRGLattice< Int, Real >::incDimBasis ( )

Increases the current dimension of the primal basis by 1 and updates the basis.

The new increased dimension must not exceed maxDim.

◆ incDimDualBasis()

template<typename Int, typename Real>
void LatMRG::MRGLattice< Int, Real >::incDimDualBasis ( )

Increases the current dimension of the m-dual basis by 1.

The new increased dimension must not exceed maxDim. This function uses the simplified method for MRG lattices given in the lattice tester guide. It requires to increase the dimension of 'm_copy_primal_basis' as well.

◆ buildProjection()

template<typename Int, typename Real>
void LatMRG::MRGLattice< Int, Real >::buildProjection ( IntLattice< Int, Real > & projLattice,
const Coordinates & proj )
override

This method overrides its namesake in IntLattice.

A basis for the projection of this MRGLattice over the coordinates in proj is returned in projLattice. The implementation used here exploits the rank-k lattice structure and it is faster than the general one. See Section 3.1.7 of the LatMRG guide.

◆ buildProjectionDual()

template<typename Int, typename Real>
void LatMRG::MRGLattice< Int, Real >::buildProjectionDual ( IntLattice< Int, Real > & projLattice,
const Coordinates & proj )
override

Overrides the same function from IntLattice.

When all the first k coordinates {1,...,k} belong to the projection, both the primal and m-dual constructions are direct, just by selecting the rows and columns whose indices are in proj. Otherwise an upper triangular basis is constructed for the basis and a lower-triangular basis for the m-dual.

◆ toStringCoef()

template<typename Int, typename Real>
std::string LatMRG::MRGLattice< Int, Real >::toStringCoef ( ) const

Returns the first dim components of the generating vector \(\ba\) as a string, where dim is the current lattice dimension.

◆ buildBasis0()

template<typename Int, typename Real>
void LatMRG::MRGLattice< Int, Real >::buildBasis0 ( IntMat & basis,
int64_t d )
protectedvirtual

The following protected functions take the basis as a parameter for more flexibility.

They are used inside buildBasis, buildBasisDual, incDimBasis, etc. For building the basis either the standard approach or the polynomial approach can be chosen. The polynomial approach is implemented in those functions ending with Pol

Reimplemented in LatMRG::MRGLatticeLac< Int, Real >.

◆ buildDualBasis0()

template<typename Int, typename Real>
void LatMRG::MRGLattice< Int, Real >::buildDualBasis0 ( IntMat & basis,
int64_t d )
protectedvirtual

◆ incDimBasis0()

template<typename Int, typename Real>
void LatMRG::MRGLattice< Int, Real >::incDimBasis0 ( IntMat & basis,
int64_t d )
protectedvirtual

◆ incDimDualBasis0()

template<typename Int, typename Real>
void LatMRG::MRGLattice< Int, Real >::incDimDualBasis0 ( IntMat & basis,
int64_t d )
protectedvirtual

◆ buildProjection0()

template<typename Int, typename Real>
bool LatMRG::MRGLattice< Int, Real >::buildProjection0 ( IntMat & basis,
int64_t dimbasis,
IntMat & pbasis,
const Coordinates & proj )
protectedvirtual

Member Data Documentation

◆ m_genTemp

template<typename Int, typename Real>
IntMat LatMRG::MRGLattice< Int, Real >::m_genTemp
protected

This auxiliary matrix is used to store the generating vectors of a projections before reducing them into a triangular basis.

◆ m_copy_primal_basis

template<typename Int, typename Real>
IntMat LatMRG::MRGLattice< Int, Real >::m_copy_primal_basis
protected

For generating the dual basis or increasing its dimension, we need a copy of the the primal basis if we use polynomial arithmetic.

Otherwise we just need to keep the first m_order rows of the matrix and save it here.

◆ m_order

template<typename Int, typename Real>
int LatMRG::MRGLattice< Int, Real >::m_order
protected

◆ m_aCoeff

template<typename Int, typename Real>
IntVec LatMRG::MRGLattice< Int, Real >::m_aCoeff
protected

The coefficients \(a_1, ..., a_k\) of the MRG recurrence, a_j stored in m_aCoeff[j].


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