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
BasisConstruction.h File Reference
#include <string>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <vector>
#include <array>
#include <set>
#include <map>
#include <cmath>
#include <cstdlib>
#include <cstdint>
#include <cassert>
#include <type_traits>
#include "NTL/tools.h"
#include "NTL/ZZ.h"
#include "NTL/vec_ZZ.h"
#include "NTL/mat_ZZ.h"
#include <latticetester/FlexTypes.h>
#include "latticetester/EnumTypes.h"
#include "latticetester/IntLattice.h"

Namespaces

namespace  LatticeTester
 Lattice namespace.
 

Functions

template<typename IntMat , typename RealVec >
static long LatticeTester::LLLConstruction0 (IntMat &gen, const double delta=0.9, long r=0, long c=0, RealVec *sqlen=0)
 This static class offers methods (functions) to construct a basis from a set of generating vectors that are not necessarily independent, to construct a triangular basis, to construct the basis for a projection over a given subset of coordinates, and to obtain the \(m\)-dual of a given basis.
 
template<typename IntMat , typename Int , typename RealVec >
static void LatticeTester::LLLBasisConstruction (IntMat &gen, const Int &m, const double delta=0.9, long r=0, long c=0, RealVec *sqlen=0)
 Similar to LLLConstruction0, except that in case the set of generating vectors do not generate a full-dimensional lattice, it adds the vectors \(m e_i\) to the generating set, so it always returns a square matrix.
 
template<typename IntMat , typename Int >
static void LatticeTester::lowerTriangularBasis (IntMat &gen, IntMat &basis, const Int &m, long r=0, long c=0)
 Takes a set of generating vectors in the matrix gen and iteratively transforms it into a lower triangular lattice basis into the matrix basis.
 
template<typename IntMat , typename Int >
static void LatticeTester::upperTriangularBasis (IntMat &gen, IntMat &basis, const Int &m, long r=0, long c=0)
 Same as lowerTriangularBasis, except that the returned basis is upper triangular.
 
template<typename IntMat , typename Int >
static void LatticeTester::mDualUpperTriangular (const IntMat &basis, IntMat &basisDual, const Int &m, long dim=0)
 Takes an upper triangular basis matrix basis and computes the m-dual basis basisDual.
 
template<typename IntMat , typename Int >
static void LatticeTester::mDualUpperTriangular96 (IntMat &basis, IntMat &basisDual, const Int &m, long dim=0)
 This function does essentially the same thing as mDualUpperTriangular, but the algorithm is slightly different.
 
template<typename IntMat , typename Int >
static void LatticeTester::mDualBasis (const IntMat &basis, IntMat &basisDual, const Int &m)
 This function assumes that basis contains a basis of the primal lattice scaled by the factor m, not necessarily triangular, and it returns in basisDual the m-dual basis.
 
template<typename IntMat >
static void LatticeTester::projectMatrix (const IntMat &in, IntMat &out, const Coordinates &proj, long r=0)
 This function overwrites the first r rows of matrix 'out' by a matrix formed by the first r rows of the c columns of matrix in that are specified by proj, where ‘c = size(proj)’ is the cardinality of the projection proj.
 
template<typename IntMat , typename Int , typename RealVec >
static void LatticeTester::projectionConstructionLLL (const IntMat &inBasis, IntMat &projBasis, const Coordinates &proj, const Int &m, const double delta=0.9, long r=0, RealVec *sqlen=0)
 Constructs a basis for the projection proj of the lattice with basis inBasis, using LLLBasisConstruction, and returns it in projBasis.
 
template<typename IntMat , typename Int >
static void LatticeTester::projectionConstructionUpperTri (const IntMat &inBasis, IntMat &projBasis, IntMat &genTemp, const Coordinates &proj, const Int &m, long r=0)
 Same as projectionConstructionLLL, but the construction is made using upperTriangularBasis, so the returned basis is upper triangular.
 
template<typename IntMat , typename Int >
static void LatticeTester::projectionConstructionUpperTri (const IntMat &inBasis, IntMat &projBasis, const Coordinates &proj, const Int &m, long r=0)
 
template<typename IntMat , typename Int >
static void LatticeTester::projectionConstruction (const IntMat &inBasis, IntMat &projBasis, const Coordinates &proj, const Int &m, const ProjConstructType projType=LLLPROJ, const double delta=0.9)
 In this version, the construction method is passed as a parameter.
 
template<>
long LatticeTester::LLLConstruction0 (NTL::matrix< long > &gen, const double delta, long r, long c, NTL::vector< double > *sqlen)
 
template<>
long LatticeTester::LLLConstruction0 (NTL::matrix< NTL::ZZ > &gen, const double delta, long r, long c, NTL::vector< double > *sqlen)
 
template<>
long LatticeTester::LLLConstruction0 (NTL::matrix< NTL::ZZ > &gen, const double delta, long r, long c, NTL::vector< xdouble > *sqlen)
 
template<>
long LatticeTester::LLLConstruction0 (NTL::matrix< NTL::ZZ > &gen, const double delta, long r, long c, NTL::vector< quad_float > *sqlen)
 
template<>
long LatticeTester::LLLConstruction0 (NTL::matrix< NTL::ZZ > &gen, const double delta, long r, long c, NTL::vector< NTL::RR > *sqlen)
 
template<typename IntMat , typename Int , typename RealVec >
void LatticeTester::LLLBasisConstruction (IntMat &gen, const Int &m, double delta, long r, long c, RealVec *sqlen)
 Similar to LLLConstruction0, except that in case the set of generating vectors do not generate a full-dimensional lattice, it adds the vectors \(m e_i\) to the generating set, so it always returns a square matrix.
 
template<typename IntMat , typename Int >
void LatticeTester::lowerTriangularBasis (IntMat &gen, IntMat &basis, const Int &m, long dim1, long dim2)
 Takes a set of generating vectors in the matrix gen and iteratively transforms it into a lower triangular lattice basis into the matrix basis.
 
template<typename IntMat , typename Int >
void LatticeTester::upperTriangularBasis (IntMat &gen, IntMat &basis, const Int &m, long dim1, long dim2)
 Same as lowerTriangularBasis, except that the returned basis is upper triangular.
 
template<typename IntMat , typename Int >
void LatticeTester::mDualUpperTriangular (const IntMat &A, IntMat &B, const Int &m, long dim)
 For B to be m-dual to A, we have to have that \(AB^t = mI\).
 
template<typename IntMat , typename Int >
void LatticeTester::mDualUpperTriangular96 (IntMat &basis, IntMat &basisDual, const Int &m, long dim)
 This function does essentially the same thing as mDualUpperTriangular, but the algorithm is slightly different.
 
template<>
void LatticeTester::mDualUpperTriangular96 (NTL::matrix< NTL::ZZ > &basis, NTL::matrix< NTL::ZZ > &basisDual, const NTL::ZZ &m, long dim)
 
template<typename IntMat , typename Int >
void LatticeTester::mDualBasis (const IntMat &basis, IntMat &basisDual, const Int &m)
 This function assumes that basis contains a basis of the primal lattice scaled by the factor m, not necessarily triangular, and it returns in basisDual the m-dual basis.
 
template<>
void LatticeTester::mDualBasis (const NTL::matrix< NTL::ZZ > &basis, NTL::matrix< NTL::ZZ > &basisDual, const NTL::ZZ &m)
 
template<typename IntMat >
void LatticeTester::projectMatrix (const IntMat &in, IntMat &out, const Coordinates &proj, long r)
 This function overwrites the first r rows of matrix 'out' by a matrix formed by the first r rows of the c columns of matrix in that are specified by proj, where ‘c = size(proj)’ is the cardinality of the projection proj.
 
template<typename IntMat , typename Int , typename RealVec >
void LatticeTester::projectionConstructionLLL (const IntMat &inBasis, IntMat &projBasis, const Coordinates &proj, const Int &m, const double delta, long r, RealVec *sqlen)
 Constructs a basis for the projection proj of the lattice with basis inBasis, using LLLBasisConstruction, and returns it in projBasis.
 
template<typename IntMat , typename Int >
void LatticeTester::projectionConstructionUpperTri (const IntMat &inBasis, IntMat &projBasis, IntMat &genTemp, const Coordinates &proj, const Int &m, long r)
 Same as projectionConstructionLLL, but the construction is made using upperTriangularBasis, so the returned basis is upper triangular.
 
template<typename IntMat , typename Int >
void LatticeTester::projectionConstructionUpperTri (const IntMat &inBasis, IntMat &projBasis, const Coordinates &proj, const Int &m, long r)
 
template<typename IntMat , typename Int >
void LatticeTester::projectionConstruction (const IntMat &inBasis, IntMat &projBasis, const Coordinates &proj, const Int &m, const ProjConstructType projType, const double delta)
 In this version, the construction method is passed as a parameter.