Lattice Tester Online Documentation 0.1.0-861
Software Package For Testing The Uniformity Of Integral Lattices In The Real Space
Loading...
Searching...
No Matches
LatticeTester::IntLattice< Int, Real > Class Template Reference

An IntLattice object is an integral lattice, with its basis or its m-dual basis, or both. More...

#include <latticetester/IntLattice.h>

+ Inheritance diagram for LatticeTester::IntLattice< Int, Real >:

Public Member Functions

 IntLattice (const Int m, const int64_t maxDim, NormType norm=L2NORM)
 Constructs a lattice whose basis is the identity, in maxDim dimensions, with the specified norm type, and the scaling factor m.
 
 IntLattice (const IntMat basis, const Int m, const int64_t maxDim, NormType norm=L2NORM)
 Similar to the previous constructor, except that the primal basis is given in basis, which must be an IntMat object of size maxDim by maxDim.
 
 IntLattice (const IntMat primalbasis, const IntMat dualbasis, const Int m, const int64_t maxDim, NormType norm=L2NORM)
 Constructs a lattice with the given basis and given m-dual basis for the given m, in maxDim dimensions, and with the specified norm type.
 
 IntLattice (const IntLattice< Int, Real > &lat)
 Copy constructor.
 
virtual ~IntLattice ()
 Destructor.
 
void copyLattice (const IntLattice< Int, Real > &lat)
 Makes a deep copy of the lattice lat into this (existing) object.
 
void overwriteLattice (const IntLattice< Int, Real > &lat, long dim, long dimdual)
 
virtual void buildProjectionLLL (IntLattice< Int, Real > &projLattice, const Coordinates &proj, double delta=0.5)
 Constructs a set of generating vectors for the projection of the present lattice, over the set of coordinates determined by proj, and builds a basis for that projection using an LLL procedure from BasisConstruction.
 
virtual void buildProjection (IntLattice< Int, Real > &projLattice, const Coordinates &proj)
 Builds a basis for the projection of the present lattice over the set of coordinates determined by proj.
 
virtual void buildProjectionDual (IntLattice< Int, Real > &projLattice, const Coordinates &proj)
 Similar to buildProjection, except that it builds an upper-triangular basis for the primal and a lower-triangular basis for the $m$-dual of the projection, both in projLattice.
 
IntMatgetBasis ()
 Returns the IntMat object that contains the basis of this lattice.
 
void setBasis (const IntMat basis, const Int m, const int64_t dim, NormType norm=L2NORM)
 Changes the basis to 'basis', the modulus to 'm', and the current dimension to 'dim'.
 
void setBasis (const IntMat basis, const int64_t dim)
 Changes only the 'basis' and the current dimension to 'dim'.
 
IntMatgetDualBasis ()
 Returns the m-dual basis represented in a matrix.
 
int64_t getMaxDim () const
 Returns the maximal dimension for this lattice.
 
int64_t getDim () const
 Returns the current dimension of the primal lattice, which is the dimension of the basis vectors, and also usually the number of independent vectors in the basis.
 
int64_t getDimDual () const
 Returns the current dimension of the m-dual lattice.
 
NormType getNormType () const
 Returns the NormType used by this lattice.
 
Real getVecNorm (const int64_t &i)
 Returns the norm (squared in case of the L^2 norm) of the i-th vector of the basis, with the index i starting at 0.
 
RealVec getVecNorm () const
 Returns the norm (squared in case of the L^2 norm) of each basis vector, in a vector.
 
Real getDualVecNorm (const int64_t &i)
 Returns the norm (squared in case of the L^2 norm) of the i-th vector of the m-dual basis.
 
RealVec getDualVecNorm () const
 Returns the norm (squared in case of the L^2 norm) of each vector of the m-dual basis, in a vector.
 
Int getModulus () const
 Returns the scaling factor m.
 
void setDim (const int64_t dim)
 Sets the dimension of the primal basis to dim.
 
void setDimDual (const int64_t dim)
 Sets the dimension of the primal basis to dim.
 
void setNormType (const NormType &norm)
 Sets the NormType used by this lattice to norm.
 
void setVecNorm (const Real &value, const int64_t &i)
 Sets the norm of the i-th component of the basis to value, which is assumed to be the correct value.
 
void setDualVecNorm (const Real &value, const int64_t &i)
 Sets the norm of the i-th component of the m-dual basis to value, which is assumed to be the correct value.
 
void setNegativeNorm ()
 Sets to -1 the first dim values in the array containing the norms of the basis vectors, where dim is the current dimension of the lattice.
 
void setNegativeNorm (const int64_t &i)
 Sets the value of the i-th component in the array containing the norms of the basis vectors to -1.
 
void setDualNegativeNorm ()
 Sets all the values in the array containing the norms of the dual basis vectors to -1, to indicate that these norms are no longer up to date.
 
void setDualNegativeNorm (const int64_t &i)
 Sets the value of the i-th component in the array containing the norms of the m-dual basis vectors to -1.
 
void updateVecNorm ()
 Updates the array containing the norms of the basis vectors by recomputing them.
 
void updateVecNorm (const int64_t &d)
 Updates the array containing the norm of the basis vectors from the d-th component to the last, by recomputing them.
 
void updateSingleVecNorm (const int64_t &d, const int64_t &c)
 Updates the 'd'-th entry of the array containing the basis vectors norms.
 
void updateDualVecNorm ()
 Updates the array containing the m-dual basis vectors norms by recomputing them.
 
void updateSingleDualVecNorm (const int64_t &d, const int64_t &c)
 Updates the 'd'-th entry of the array containing the m-dual basis vectors norms.
 
void updateDualVecNorm (const int64_t &d)
 Updates the array containing the m-dual basis vectors norms from the d-th component to the last by recomputing them.
 
void updateDualVecNorm (const int64_t &d, const int64_t &c)
 Updates the array containing the m-dual basis vectors norms from the d-th component to the last by recomputing them.
 
void updateScalL2Norm (const int64_t i)
 Updates the i-th value of the array containing the square norms of the basis vectors by recomputing it using the L2NORM.
 
void updateScalL2Norm (const int64_t k1, const int64_t k2)
 Updates the k1-th to the k2-1-th values of the array containing the square norms of the basis vectors by recomputing them using the L2NORM.
 
void updateDualScalL2Norm (const int64_t i)
 Updates the i-th value of the array containing the square norms of the m-dual basis vectors by recomputing it using the L2NORM.
 
void updateDualScalL2Norm (const int64_t k1, const int64_t k2)
 Updates the k1-th to the k2-1-th values of the array containing the square norms of the m-dual basis vectors by recomputing them using the L2NORM.
 
void permute (int64_t i, int64_t j)
 Exchanges vectors i and j in the basis.
 
void permuteDual (int64_t i, int64_t j)
 Exchanges vectors i and j in the m-dual basis without changing the primal.
 
void dualize ()
 Exchanges the primal and m-dual bases, their dimensions, and vector norms.
 
bool checkDuality ()
 Returns true iff the m-dual basis contained in the object really is the m-dual of the current primal basis.
 
void sortBasis (int64_t d)
 Sorts the primal basis vectors with indices greater of equal to d by increasing length.
 
void sortDualBasis (int64_t d)
 Sorts the m-dual basis vectors with indices greater of equal to d by increasing length.
 
std::string toStringBasis () const
 Returns a string that contains the primal basis vectors and their norms.
 
std::string toStringDualBasis () const
 Returns a string with the m-dual basis vectors and their norms.
 
std::string toString () const
 Returns a string that represents this lattice and its parameters.
 
void write () const
 Writes on standard output the string returned by toString.
 

Protected Attributes

Int m_modulo
 The scaling factor m used for rescaling the lattice.
 
int64_t m_maxDim
 The maximal dimension for this lattice.
 
int64_t m_dim
 The current dimension of the primal basis, which is the number of (independent) vectors in it.
 
int64_t m_dimdual
 The current dimension of the m-dual basis, which is the number of (independent) vectors in its basis.
 
IntMat m_basis
 The rows of the m_dim x m_dim upper left corner of this matrix are the primal basis vectors.
 
IntMat m_dualbasis
 The rows of the m_dim x m_dim upper left corner this matrix are the m-dual basis vectors.
 
NormType m_norm
 The NormType used to measure the vector lengths for this lattice.
 
RealVec m_vecNorm
 A vector that stores the norm of each basis vector.
 
RealVec m_dualvecNorm
 Similar to vecNorm, but for the m-dual basis.
 

Detailed Description

template<typename Int, typename Real>
class LatticeTester::IntLattice< Int, Real >

An IntLattice object is an integral lattice, with its basis or its m-dual basis, or both.

There are tools to perform simple manipulations on those lattice bases. The value of m must be chosen in a way that all coordinates of the basis and of its m-dual are integers, so they can be represented exactly. The basis or its m-dual is rescaled by m, which is typically the smallest integer with this property.

The dimension dim of the lattice is the number of independent vectors that form a basis. Usually, these vectors also have dim coordinates, but in general they may have more. The basis and/or the m-dual basis are stored in IntMat arrays (from NTL) of sizes maxDim x maxDim, where maxDim is usually fixed to a value as large as the largestdimthat we want to handle. We use only the upper-leftdim x dimcorner of each array to store the actual basis. These arrays can then be allocated only once and never have to be resized, which improves speed. A boolean variablewithPrimalindicates if we maintain the primal basis and a variable withDual` indicates if we maintain the dual basis. At least one of them (or both) should be true.

A norm is also chosen in NormType to measure the vector lengths; by default it is the Euclidean norm. Methods and attributes are offered to compute and store the norms of the basis and/or the m-dual basis vectors, to permute these vectors, sort them by length, etc. The norms are for the vectors of the rescaled lattice and its m-dual. An IntLattice object contains protected variables to store all these quantities. For better efficiency, we should avoid creating many IntLattice objects, for example when making searches for good lattices. We should try to reuse the same one as much as we can.

Often, we want to assess the quality of projections of the lattice over subsets of coordinates. The method buildProjection computes a basis for the lattice defined as the projection of the full lattice on a subset \(I\) of coordinates indices defined by a Coordinates object. When computing figures of merit, one may want to recompute a basis for a large number of different projections, which can be specified by a CoordinateSets object.

NOTE: There are no methods to copy or overwrite only the dual lattice!!! Maybe not needed?

The class IntLatticeExt extends this class and contains virtual methods that must be defined in its subclasses.

Constructor & Destructor Documentation

◆ IntLattice() [1/4]

template<typename Int , typename Real >
LatticeTester::IntLattice< Int, Real >::IntLattice ( const Int m,
const int64_t maxDim,
NormType norm = L2NORM )

Constructs a lattice whose basis is the identity, in maxDim dimensions, with the specified norm type, and the scaling factor m.

◆ IntLattice() [2/4]

template<typename Int , typename Real >
LatticeTester::IntLattice< Int, Real >::IntLattice ( const IntMat basis,
const Int m,
const int64_t maxDim,
NormType norm = L2NORM )

Similar to the previous constructor, except that the primal basis is given in basis, which must be an IntMat object of size maxDim by maxDim.

◆ IntLattice() [3/4]

template<typename Int , typename Real >
LatticeTester::IntLattice< Int, Real >::IntLattice ( const IntMat primalbasis,
const IntMat dualbasis,
const Int m,
const int64_t maxDim,
NormType norm = L2NORM )

Constructs a lattice with the given basis and given m-dual basis for the given m, in maxDim dimensions, and with the specified norm type.

In this case, by default, both the primal and m-dual basis will be maintained. The two IntMat objects must be of size maxDim by maxDim.

◆ IntLattice() [4/4]

template<typename Int , typename Real >
LatticeTester::IntLattice< Int, Real >::IntLattice ( const IntLattice< Int, Real > & lat)

Copy constructor.

Makes a deep copy of lat into *this new object.

◆ ~IntLattice()

template<typename Int , typename Real >
LatticeTester::IntLattice< Int, Real >::~IntLattice ( )
virtual

Destructor.

Member Function Documentation

◆ buildProjection()

template<typename Int , typename Real >
void LatticeTester::IntLattice< Int, Real >::buildProjection ( IntLattice< Int, Real > & projLattice,
const Coordinates & proj )
virtual

Builds a basis for the projection of the present lattice over the set of coordinates determined by proj.

This becomes the basis in projLattice. By default, it uses an upper-triangular construction. It is assumed that a basis for the present lattice is already available and contains all the coordinates in proj.

Reimplemented in LatticeTester::MRGLattice< Int, Real >, and LatticeTester::Rank1Lattice< Int, Real >.

◆ buildProjectionDual()

template<typename Int , typename Real >
void LatticeTester::IntLattice< Int, Real >::buildProjectionDual ( IntLattice< Int, Real > & projLattice,
const Coordinates & proj )
virtual

Similar to buildProjection, except that it builds an upper-triangular basis for the primal and a lower-triangular basis for the $m$-dual of the projection, both in projLattice.

The dimensions in the latter are updated. We should use this function when we need a basis for the $m$-dual of the projection.

Reimplemented in LatticeTester::MRGLattice< Int, Real >, and LatticeTester::Rank1Lattice< Int, Real >.

◆ buildProjectionLLL()

template<typename Int , typename Real >
void LatticeTester::IntLattice< Int, Real >::buildProjectionLLL ( IntLattice< Int, Real > & projLattice,
const Coordinates & proj,
double delta = 0.5 )
virtual

Constructs a set of generating vectors for the projection of the present lattice, over the set of coordinates determined by proj, and builds a basis for that projection using an LLL procedure from BasisConstruction.

It is assumed that a basis for the present lattice is already available and contains all the coordinates in proj. The maxDim of the projLattice object must be large enough so it can holds the projection. The modulus m is assumed to be the same for projLattice and for the current object. This function can be called several times with the same projLattice object to examine several different projections. Note that representing each projection as an IntLattice object is required when we want to call Reducer::shortestVector for several projections. This function can be overridden by more efficient ones in certain classes.

◆ checkDuality()

template<typename Int , typename Real >
bool LatticeTester::IntLattice< Int, Real >::checkDuality ( )

Returns true iff the m-dual basis contained in the object really is the m-dual of the current primal basis.

Otherwise, it returns false.

◆ copyLattice()

template<typename Int , typename Real >
void LatticeTester::IntLattice< Int, Real >::copyLattice ( const IntLattice< Int, Real > & lat)

Makes a deep copy of the lattice lat into this (existing) object.

New matrix and vector objects are constructed to store the bases and norms.

◆ dualize()

template<typename Int , typename Real >
void LatticeTester::IntLattice< Int, Real >::dualize ( )

Exchanges the primal and m-dual bases, their dimensions, and vector norms.

◆ getBasis()

template<typename Int , typename Real >
IntMat & LatticeTester::IntLattice< Int, Real >::getBasis ( )
inline

Returns the IntMat object that contains the basis of this lattice.

◆ getDim()

template<typename Int , typename Real >
int64_t LatticeTester::IntLattice< Int, Real >::getDim ( ) const
inline

Returns the current dimension of the primal lattice, which is the dimension of the basis vectors, and also usually the number of independent vectors in the basis.

◆ getDimDual()

template<typename Int , typename Real >
int64_t LatticeTester::IntLattice< Int, Real >::getDimDual ( ) const
inline

Returns the current dimension of the m-dual lattice.

◆ getDualBasis()

template<typename Int , typename Real >
IntMat & LatticeTester::IntLattice< Int, Real >::getDualBasis ( )
inline

Returns the m-dual basis represented in a matrix.

◆ getDualVecNorm() [1/2]

template<typename Int , typename Real >
RealVec LatticeTester::IntLattice< Int, Real >::getDualVecNorm ( ) const
inline

Returns the norm (squared in case of the L^2 norm) of each vector of the m-dual basis, in a vector.

◆ getDualVecNorm() [2/2]

template<typename Int , typename Real >
Real LatticeTester::IntLattice< Int, Real >::getDualVecNorm ( const int64_t & i)
inline

Returns the norm (squared in case of the L^2 norm) of the i-th vector of the m-dual basis.

The index i starts at 0.

◆ getMaxDim()

template<typename Int , typename Real >
int64_t LatticeTester::IntLattice< Int, Real >::getMaxDim ( ) const
inline

Returns the maximal dimension for this lattice.

◆ getModulus()

template<typename Int , typename Real >
Int LatticeTester::IntLattice< Int, Real >::getModulus ( ) const
inline

Returns the scaling factor m.

◆ getNormType()

template<typename Int , typename Real >
NormType LatticeTester::IntLattice< Int, Real >::getNormType ( ) const
inline

Returns the NormType used by this lattice.

◆ getVecNorm() [1/2]

template<typename Int , typename Real >
RealVec LatticeTester::IntLattice< Int, Real >::getVecNorm ( ) const
inline

Returns the norm (squared in case of the L^2 norm) of each basis vector, in a vector.

◆ getVecNorm() [2/2]

template<typename Int , typename Real >
Real LatticeTester::IntLattice< Int, Real >::getVecNorm ( const int64_t & i)
inline

Returns the norm (squared in case of the L^2 norm) of the i-th vector of the basis, with the index i starting at 0.

◆ overwriteLattice()

template<typename Int , typename Real >
void LatticeTester::IntLattice< Int, Real >::overwriteLattice ( const IntLattice< Int, Real > & lat,
long dim,
long dimdual )

◆ permute()

template<typename Int , typename Real >
void LatticeTester::IntLattice< Int, Real >::permute ( int64_t i,
int64_t j )

Exchanges vectors i and j in the basis.

This also changes the m-dual basis vectors and the arrays containing secondary information about the two bases (like the norms) accordingly.

◆ permuteDual()

template<typename Int , typename Real >
void LatticeTester::IntLattice< Int, Real >::permuteDual ( int64_t i,
int64_t j )

Exchanges vectors i and j in the m-dual basis without changing the primal.

◆ setBasis() [1/2]

template<typename Int , typename Real >
void LatticeTester::IntLattice< Int, Real >::setBasis ( const IntMat basis,
const Int m,
const int64_t dim,
NormType norm = L2NORM )
inline

Changes the basis to 'basis', the modulus to 'm', and the current dimension to 'dim'.

Does not change maxDim.

◆ setBasis() [2/2]

template<typename Int , typename Real >
void LatticeTester::IntLattice< Int, Real >::setBasis ( const IntMat basis,
const int64_t dim )
inline

Changes only the 'basis' and the current dimension to 'dim'.

Does not change m and maxDim.

◆ setDim()

template<typename Int , typename Real >
void LatticeTester::IntLattice< Int, Real >::setDim ( const int64_t dim)
inline

Sets the dimension of the primal basis to dim.

This does not change maxDim nor any of the basis vectors, but only the dimension variable.

◆ setDimDual()

template<typename Int , typename Real >
void LatticeTester::IntLattice< Int, Real >::setDimDual ( const int64_t dim)
inline

Sets the dimension of the primal basis to dim.

This does not change maxDim nor any of the basis vectors, but only the dimension variable.

◆ setDualNegativeNorm() [1/2]

template<typename Int , typename Real >
void LatticeTester::IntLattice< Int, Real >::setDualNegativeNorm ( )

Sets all the values in the array containing the norms of the dual basis vectors to -1, to indicate that these norms are no longer up to date.

◆ setDualNegativeNorm() [2/2]

template<typename Int , typename Real >
void LatticeTester::IntLattice< Int, Real >::setDualNegativeNorm ( const int64_t & i)
inline

Sets the value of the i-th component in the array containing the norms of the m-dual basis vectors to -1.

◆ setDualVecNorm()

template<typename Int , typename Real >
void LatticeTester::IntLattice< Int, Real >::setDualVecNorm ( const Real & value,
const int64_t & i )
inline

Sets the norm of the i-th component of the m-dual basis to value, which is assumed to be the correct value.

To recompute the norm, use updateDualVecNorm(const int64_t&) instead.

◆ setNegativeNorm() [1/2]

template<typename Int , typename Real >
void LatticeTester::IntLattice< Int, Real >::setNegativeNorm ( )

Sets to -1 the first dim values in the array containing the norms of the basis vectors, where dim is the current dimension of the lattice.

This means that these norms are no longer up to date.

◆ setNegativeNorm() [2/2]

template<typename Int , typename Real >
void LatticeTester::IntLattice< Int, Real >::setNegativeNorm ( const int64_t & i)
inline

Sets the value of the i-th component in the array containing the norms of the basis vectors to -1.

◆ setNormType()

template<typename Int , typename Real >
void LatticeTester::IntLattice< Int, Real >::setNormType ( const NormType & norm)
inline

Sets the NormType used by this lattice to norm.

◆ setVecNorm()

template<typename Int , typename Real >
void LatticeTester::IntLattice< Int, Real >::setVecNorm ( const Real & value,
const int64_t & i )
inline

Sets the norm of the i-th component of the basis to value, which is assumed to be the correct value.

To recompute the norm, use updateVecNorm(const int64_t&) instead.

◆ sortBasis()

template<typename Int , typename Real >
void LatticeTester::IntLattice< Int, Real >::sortBasis ( int64_t d)

Sorts the primal basis vectors with indices greater of equal to d by increasing length.

The m-dual vectors are permuted accordingly. Assumes that the lengths (norms) of the corresponding basis vectors are up to date. The dual basis vectors are not permuted.

◆ sortDualBasis()

template<typename Int , typename Real >
void LatticeTester::IntLattice< Int, Real >::sortDualBasis ( int64_t d)

Sorts the m-dual basis vectors with indices greater of equal to d by increasing length.

The primal basis vectors are not permuted.

◆ toString()

template<typename Int , typename Real >
std::string LatticeTester::IntLattice< Int, Real >::toString ( ) const

Returns a string that represents this lattice and its parameters.

It contains the dimension, the norm used, the basis and m-dual basis vectors and the basis and dual basis vector norms.

◆ toStringBasis()

template<typename Int , typename Real >
std::string LatticeTester::IntLattice< Int, Real >::toStringBasis ( ) const

Returns a string that contains the primal basis vectors and their norms.

◆ toStringDualBasis()

template<typename Int , typename Real >
std::string LatticeTester::IntLattice< Int, Real >::toStringDualBasis ( ) const

Returns a string with the m-dual basis vectors and their norms.

◆ updateDualScalL2Norm() [1/2]

template<typename Int , typename Real >
void LatticeTester::IntLattice< Int, Real >::updateDualScalL2Norm ( const int64_t i)

Updates the i-th value of the array containing the square norms of the m-dual basis vectors by recomputing it using the L2NORM.

◆ updateDualScalL2Norm() [2/2]

template<typename Int , typename Real >
void LatticeTester::IntLattice< Int, Real >::updateDualScalL2Norm ( const int64_t k1,
const int64_t k2 )

Updates the k1-th to the k2-1-th values of the array containing the square norms of the m-dual basis vectors by recomputing them using the L2NORM.

◆ updateDualVecNorm() [1/3]

template<typename Int , typename Real >
void LatticeTester::IntLattice< Int, Real >::updateDualVecNorm ( )

Updates the array containing the m-dual basis vectors norms by recomputing them.

Assumes that the dual basis is available.

◆ updateDualVecNorm() [2/3]

template<typename Int , typename Real >
void LatticeTester::IntLattice< Int, Real >::updateDualVecNorm ( const int64_t & d)

Updates the array containing the m-dual basis vectors norms from the d-th component to the last by recomputing them.

◆ updateDualVecNorm() [3/3]

template<typename Int , typename Real >
void LatticeTester::IntLattice< Int, Real >::updateDualVecNorm ( const int64_t & d,
const int64_t & c )

Updates the array containing the m-dual basis vectors norms from the d-th component to the last by recomputing them.

Only the first c components are used for calculating the norm

◆ updateScalL2Norm() [1/2]

template<typename Int , typename Real >
void LatticeTester::IntLattice< Int, Real >::updateScalL2Norm ( const int64_t i)

Updates the i-th value of the array containing the square norms of the basis vectors by recomputing it using the L2NORM.

◆ updateScalL2Norm() [2/2]

template<typename Int , typename Real >
void LatticeTester::IntLattice< Int, Real >::updateScalL2Norm ( const int64_t k1,
const int64_t k2 )

Updates the k1-th to the k2-1-th values of the array containing the square norms of the basis vectors by recomputing them using the L2NORM.

◆ updateSingleDualVecNorm()

template<typename Int , typename Real >
void LatticeTester::IntLattice< Int, Real >::updateSingleDualVecNorm ( const int64_t & d,
const int64_t & c )

Updates the 'd'-th entry of the array containing the m-dual basis vectors norms.

Only the first c components are used for calculating the norm.

◆ updateSingleVecNorm()

template<typename Int , typename Real >
void LatticeTester::IntLattice< Int, Real >::updateSingleVecNorm ( const int64_t & d,
const int64_t & c )

Updates the 'd'-th entry of the array containing the basis vectors norms.

Only the first c components are used for calculating the norm.

◆ updateVecNorm() [1/2]

template<typename Int , typename Real >
void LatticeTester::IntLattice< Int, Real >::updateVecNorm ( )

Updates the array containing the norms of the basis vectors by recomputing them.

We could also return the index of the vector that is shortest!

◆ updateVecNorm() [2/2]

template<typename Int , typename Real >
void LatticeTester::IntLattice< Int, Real >::updateVecNorm ( const int64_t & d)

Updates the array containing the norm of the basis vectors from the d-th component to the last, by recomputing them.

Putting d=0 recomputes all the norms.

◆ write()

template<typename Int , typename Real >
void LatticeTester::IntLattice< Int, Real >::write ( ) const

Writes on standard output the string returned by toString.

Member Data Documentation

◆ m_basis

template<typename Int , typename Real >
IntMat LatticeTester::IntLattice< Int, Real >::m_basis
protected

The rows of the m_dim x m_dim upper left corner of this matrix are the primal basis vectors.

◆ m_dim

template<typename Int , typename Real >
int64_t LatticeTester::IntLattice< Int, Real >::m_dim
protected

The current dimension of the primal basis, which is the number of (independent) vectors in it.

It cannot exceed the number of coordinates in those vectors. It also cannot exceed m_maxDim.

◆ m_dimdual

template<typename Int , typename Real >
int64_t LatticeTester::IntLattice< Int, Real >::m_dimdual
protected

The current dimension of the m-dual basis, which is the number of (independent) vectors in its basis.

It cannot exceed the number of coordinates in those vectors. It also cannot exceed m_maxDim.

◆ m_dualbasis

template<typename Int , typename Real >
IntMat LatticeTester::IntLattice< Int, Real >::m_dualbasis
protected

The rows of the m_dim x m_dim upper left corner this matrix are the m-dual basis vectors.

May not be initialized.

◆ m_dualvecNorm

template<typename Int , typename Real >
RealVec LatticeTester::IntLattice< Int, Real >::m_dualvecNorm
protected

Similar to vecNorm, but for the m-dual basis.

◆ m_maxDim

template<typename Int , typename Real >
int64_t LatticeTester::IntLattice< Int, Real >::m_maxDim
protected

The maximal dimension for this lattice.

It should correspond to the size of the IntMat objects that contain the basis and/or its m-dual.

◆ m_modulo

template<typename Int , typename Real >
Int LatticeTester::IntLattice< Int, Real >::m_modulo
protected

The scaling factor m used for rescaling the lattice.

◆ m_norm

template<typename Int , typename Real >
NormType LatticeTester::IntLattice< Int, Real >::m_norm
protected

The NormType used to measure the vector lengths for this lattice.

It is used for the basis reduction and compute a shortest vector, for example.

◆ m_vecNorm

template<typename Int , typename Real >
RealVec LatticeTester::IntLattice< Int, Real >::m_vecNorm
protected

A vector that stores the norm of each basis vector.

In case of the L_2 norm, it contains the square norm instead. A value of -1 means that the norm is not up to date.


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