Loading...
Searching...
No Matches
lattice.h
Go to the documentation of this file.
#ifndef LATTICE_HPP
#define LATTICE_HPP
// Algorithms based on chapter 2.6 of
// "A course in computational algebraic numbertheory" by Henry Cohen
class lattice {
private:
//array of basisvectors
bigintmat ** basis;
//gram matrix of the lattice
bigintmat * gram_matrix;
//size of basis
int n;
//length of basisvectors
int m;
coeffs coef;
//constant for LLL
number c;
//array of basisvectors of LLL-basis
bigintmat ** b;
//for LLL, see Cohen 2.6.3
bigintmat ** b_star;
//array of B_i, see Cohen 2.6.3
number * B;
//for LLL, see Cohen 2.6.3
bigintmat * H;
//for LLL, see Cohen 2.6.3
bigintmat * my;
//for integral LLL, see Cohen 2.6.7
number * d;
//rank of the lattice
int rank;
//if true transformation matrix H will be computed
bool trans_matrix;
//true if basisvectors should be considered independent
bool independentVectors;
//true if gram matrix is integral
bool integral;
//triangular matrix for enumeration
bigintmat * Q;
//testing element for enumeration
bigintmat * x;
//bond for x_i in enumeration
number * bound;
//coef for output
coeffs out_coef;
// int precision;
//for LLL, see Cohen 2.6.3
inline void RED(int k, int l);
//for LLL, see Cohen 2.6.3
inline void SWAP(int k, int k_max);
//for MLLL, see Cohen 2.6.8
inline void SWAPG(int k, int k_max);
//for LLL, see Cohen 2.6.3
inline bool gram_schmidt(int k);
//for MLLL, see Cohen 2.6.8
inline void gram_schmidt_MLLL(int k);
// inline void INSERT(int k, int i);
// inline bool gram_matrix(int k);
inline void compute_gram_matrix();
inline number enumerate_get_next();
inline bool quadratic_supplement();
inline void increase_x(int index);
inline number check_bound(int index);
public:
//constructor creates new lattice spanned by columns of b
lattice(bigintmat* basis);
//destructor
~lattice();
//LLL with c=3/4
bool LLL();
bool LLL(number& c);
bigintmat * get_basis();
bigintmat * get_reduced_basis();
bigintmat * get_transformation_matrix();
bigintmat * enumerate_all(number a);
bigintmat * enumerate_next(number a, bigintmat * x);
bigintmat * enumerate_next(number a);
bigintmat * enumerate_next(bigintmat * x);
bigintmat * enumerate_next();
// void set_precision(int a);
};
//NOTE: could be moved to bigintmat
inline number scalarproduct(bigintmat * a, bigintmat * b);
//minkowski
bigintmat * minkowksi(bigintmat ** elementarray,int size_elementarray, number * poly,int deg, coeffs coef, int precision);
bool IsReal(number a, coeffs coef);
bool ImagGreaterZero(number a, coeffs coef);
number squareroot(number a, coeffs coef, int iteration);// iteration in Heron algorithm
#endif
l
int l
Definition cfEzgcd.cc:100
k
int k
Definition cfEzgcd.cc:99
b
CanonicalForm b
Definition cfModGcd.cc:4111
bigintmat
Matrices of numbers.
Definition bigintmat.h:51
lattice::quadratic_supplement
bool quadratic_supplement()
Definition lattice.cc:775
lattice::my
bigintmat * my
Definition lattice.h:40
lattice::m
int m
Definition lattice.h:20
lattice::~lattice
~lattice()
Definition lattice.cc:90
lattice::integral
bool integral
Definition lattice.h:55
lattice::SWAP
void SWAP(int k, int k_max)
Definition lattice.cc:315
lattice::SWAPG
void SWAPG(int k, int k_max)
Definition lattice.cc:357
lattice::rank
int rank
Definition lattice.h:46
lattice::H
bigintmat * H
Definition lattice.h:37
lattice::trans_matrix
bool trans_matrix
Definition lattice.h:49
lattice::increase_x
void increase_x(int index)
Definition lattice.cc:841
lattice::get_transformation_matrix
bigintmat * get_transformation_matrix()
Definition lattice.cc:890
lattice::lattice
lattice(bigintmat *basis)
Definition lattice.cc:52
lattice::B
number * B
Definition lattice.h:34
lattice::independentVectors
bool independentVectors
Definition lattice.h:52
lattice::basis
bigintmat ** basis
Definition lattice.h:11
lattice::get_basis
bigintmat * get_basis()
Definition lattice.cc:874
lattice::compute_gram_matrix
void compute_gram_matrix()
Definition lattice.cc:828
lattice::enumerate_all
bigintmat * enumerate_all(number a)
Definition lattice.cc:507
lattice::gram_matrix
bigintmat * gram_matrix
Definition lattice.h:14
lattice::enumerate_get_next
number enumerate_get_next()
Definition lattice.cc:718
lattice::c
number c
Definition lattice.h:25
lattice::out_coef
coeffs out_coef
Definition lattice.h:67
lattice::LLL
bool LLL()
Definition lattice.cc:133
lattice::n
int n
Definition lattice.h:17
lattice::check_bound
number check_bound(int index)
Definition lattice.cc:855
lattice::coef
coeffs coef
Definition lattice.h:22
lattice::bound
number * bound
Definition lattice.h:64
lattice::gram_schmidt
bool gram_schmidt(int k)
Definition lattice.cc:430
lattice::enumerate_next
bigintmat * enumerate_next()
Definition lattice.cc:691
lattice::gram_schmidt_MLLL
void gram_schmidt_MLLL(int k)
Definition lattice.cc:454
lattice::Q
bigintmat * Q
Definition lattice.h:58
lattice::x
bigintmat * x
Definition lattice.h:61
lattice::RED
void RED(int k, int l)
Definition lattice.cc:276
lattice::b_star
bigintmat ** b_star
Definition lattice.h:31
lattice::b
bigintmat ** b
Definition lattice.h:28
lattice::get_reduced_basis
bigintmat * get_reduced_basis()
Definition lattice.cc:882
lattice::d
number * d
Definition lattice.h:43
IsReal
bool IsReal(number a, coeffs coef)
Definition lattice.cc:1097
scalarproduct
number scalarproduct(bigintmat *a, bigintmat *b)
Definition lattice.cc:915
minkowksi
bigintmat * minkowksi(bigintmat **elementarray, int size_elementarray, number *poly, int deg, coeffs coef, int precision)
Definition lattice.cc:948
squareroot
number squareroot(number a, coeffs coef, int iteration)
Definition lattice.cc:1111
ImagGreaterZero
bool ImagGreaterZero(number a, coeffs coef)
Definition lattice.cc:1104
coeffs
The main handler for Singular numbers which are suitable for Singular polynomials.
index
static int index(p_Length length, p_Ord ord)
Definition p_Procs_Impl.h:592