LatMRG Online Documentation unknown
Tools to analyze the lattice structure of linear generators
|
This subclass of MRGLattice constructs and handles lattice bases built from MRGs as in MRGLattice, but with arbitrary lacunary indices that can be spaced very far apart. More...
Public Member Functions | |
MRGLatticeLac (const Int &m, const IntVec &aa, int64_t maxDim, IntVec &lac, NormType norm=L2NORM) | |
Constructor with modulus of congruence \(m\), order of the recurrence \(k\), multipliers in aa, and maximal dimension maxDim. | |
MRGLatticeLac (const MRGLatticeLac< Int, Real > &Lat) | |
Copy constructor. | |
MRGLatticeLac & | operator= (const MRGLatticeLac< Int, Real > &Lat) |
Assigns Lat to this object. | |
virtual | ~MRGLatticeLac () |
Destructor. | |
void | setLac (const IntVec &lac, bool buildBasisCopy=true) |
Sets the lacunary indices for this lattice to lac. | |
void | setaa (const IntVec &lac, bool buildBasisCopy=true) |
Sets the generating vector to aa. | |
Int & | getLac (int j) |
Returns the \(j\)-th lacunary index. | |
Public Member Functions inherited from 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. | |
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 | |
void | buildBasis0 (IntMat &basis, int64_t d) override |
This function overrides the correpsonding protected function in 'MRGLattice'. | |
void | buildDualBasis0 (IntMat &basis, int64_t d) override |
This functions overrides the corresponding protected function in 'MRGLattice', which is necessary because the entire copy of the primal basis is build upon creation of the object. | |
void | incDimBasis0 (IntMat &basis, int64_t d) override |
This function overrides the correpsonding protected function in 'MRGLattice'. | |
void | incDimDualBasis0 (IntMat &basis, int64_t d) override |
This function overrides the correpsonding protected function in 'MRGLattice'. | |
bool | buildProjection0 (IntMat &basis, int64_t dimbasis, IntMat &pbasis, const Coordinates &proj) override |
This function overrides the correpsonding protected function in 'MRGLattice'. | |
void | polyToColumn (IntVec &col, typename FlexModInt< Int >::PolE &pcol) |
Takes the polynomial pcol and returns in col the corresponding column in the matrix of generating vectors. |
Protected Attributes | |
IntVec | m_lac |
Stores the lacunary indices. | |
IntMat | m_copy_primal_basis |
If we want to increase the dimension of the dual basis with the polynomial approach we also need a copy of the primal and the dual basis. | |
IntMat | m_copy_dual_basis |
Protected Attributes inherited from LatMRG::MRGLattice< Int, Real > | |
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 MRGLattice constructs and handles lattice bases built from MRGs as in MRGLattice, but with arbitrary lacunary indices that can be spaced very far apart.
A special case of this is when they are regularly spaced by packets of the same size.
To construct or increment the basis in that case, we proceed as described in Section 3.1.9 of the guide. First, \(P(z)\) must be set as the polynomial modulus in NTL. Then for each lacunary index \(\nu = i_j\), we compute the corresponding column by computing \(z^{\nu-1} \bmod P(z)\) using power from polE in NTL, then transforming its vector of coefficients into the vector \((y_{\nu+k-2},\dots,y_{\nu-1})\) with the function polyToColumn. This gives a set of generating vectors, which can be reduced to a basis, as in MRGLattice. Under certain conditions, it is already a basis.
LatMRG::MRGLatticeLac< Int, Real >::MRGLatticeLac | ( | const Int & | m, |
const IntVec & | aa, | ||
int64_t | maxDim, | ||
IntVec & | lac, | ||
NormType | norm = L2NORM ) |
Constructor with modulus of congruence \(m\), order of the recurrence \(k\), multipliers in aa, and maximal dimension maxDim.
The length of basis vectors is computed with norm. The basis is built for the lacunary indices in lac. The vector aa must have k+1 components with a[j]= \(a_j\).
LatMRG::MRGLatticeLac< Int, Real >::MRGLatticeLac | ( | const MRGLatticeLac< Int, Real > & | Lat | ) |
Copy constructor.
The maximal dimension of the new basis is set to Lat’s current dimension.
|
inlinevirtual |
Destructor.
MRGLatticeLac< Int, Real > & LatMRG::MRGLatticeLac< Int, Real >::operator= | ( | const MRGLatticeLac< Int, Real > & | Lat | ) |
Assigns Lat to this object.
The maximal dimension of this basis is set to Lat’s current dimension.
void LatMRG::MRGLatticeLac< Int, Real >::setLac | ( | const IntVec & | lac, |
bool | buildBasisCopy = true ) |
Sets the lacunary indices for this lattice to lac.
If 'buildBasisCopy' is set to true, then 'm_copy_primal_basis' and 'm_dual_copy_basis' are updated according to the new lacunary indices.
void LatMRG::MRGLatticeLac< Int, Real >::setaa | ( | const IntVec & | lac, |
bool | buildBasisCopy = true ) |
Sets the generating vector to aa.
If 'buildBasisCopy' is set to true, then 'm_copy_primal_basis' and 'm_dual_copy_basis' are updated according to the new generator vector.
|
inline |
Returns the \(j\)-th lacunary index.
|
overrideprotectedvirtual |
This function overrides the correpsonding protected function in 'MRGLattice'.
It Builds a basis directly in d dimensions, as explained in Section 3.1.9 of the LatMRG guide. Must have d <= m_maxdim. The basis matrix is taken as a parameter.
Reimplemented from LatMRG::MRGLattice< Int, Real >.
|
overrideprotectedvirtual |
This functions overrides the corresponding protected function in 'MRGLattice', which is necessary because the entire copy of the primal basis is build upon creation of the object.
Reimplemented from LatMRG::MRGLattice< Int, Real >.
|
overrideprotectedvirtual |
This function overrides the correpsonding protected function in 'MRGLattice'.
It increases the dimension of the given basis from d-1 to d dimensions. One new column is calclated using the algorithm from the guide.
Reimplemented from LatMRG::MRGLattice< Int, Real >.
|
overrideprotectedvirtual |
This function overrides the correpsonding protected function in 'MRGLattice'.
It increases the dimension of a given dual basis from d-1 to d dimensions. One new column is calclated using the polynomial representation.
Reimplemented from LatMRG::MRGLattice< Int, Real >.
|
overrideprotectedvirtual |
This function overrides the correpsonding protected function in 'MRGLattice'.
It builds a projection for the primal basis.
Reimplemented from LatMRG::MRGLattice< Int, Real >.
|
protected |
Takes the polynomial pcol and returns in col the corresponding column in the matrix of generating vectors.
|
protected |
Stores the lacunary indices.
|
protected |
If we want to increase the dimension of the dual basis with the polynomial approach we also need a copy of the primal and the dual basis.
|
protected |