LatMRG Online Documentation unknown
Tools to analyze the lattice structure of linear generators
|
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...
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) | |
MRGLattice & | operator= (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]. |
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.
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.
LatMRG::MRGLattice< Int, Real >::MRGLattice | ( | const MRGLattice< Int, Real > & | Lat | ) |
LatMRG::MRGLattice< Int, Real >::~MRGLattice | ( | ) |
Destructor.
MRGLattice< Int, Real > & LatMRG::MRGLattice< Int, Real >::operator= | ( | const MRGLattice< Int, Real > & | Lat | ) |
Assigns Lat to this object.
|
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.
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.
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'.
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.
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.
|
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.
|
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.
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.
|
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 >.
|
protectedvirtual |
Reimplemented in LatMRG::MRGLatticeLac< Int, Real >.
|
protectedvirtual |
Reimplemented in LatMRG::MRGLatticeLac< Int, Real >.
|
protectedvirtual |
Reimplemented in LatMRG::MRGLatticeLac< Int, Real >.
|
protectedvirtual |
Reimplemented in LatMRG::MRGLatticeLac< Int, Real >.
|
protected |
This auxiliary matrix is used to store the generating vectors of a projections before reducing them into a triangular 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.
|
protected |
|
protected |
The coefficients \(a_1, ..., a_k\) of the MRG recurrence, a_j stored in m_aCoeff[j].