 |
My Project
debian-1:4.1.1-p2+ds-4build2
|
#include <lattice.h>
Definition at line 6 of file lattice.h.
◆ lattice()
Definition at line 52 of file lattice.cc.
55 n = basismatrix->cols();
56 m = basismatrix->rows();
57 out_coef = basismatrix->basecoeffs();
66 for(
int i=1;
i<=
n;
i++) {
68 basismatrix->getcol(
i,
basis[
i]);
◆ ~lattice()
Definition at line 90 of file lattice.cc.
95 for(
int i=0;
i<=
n;
i++) {
102 for(
int i=0;
i<=
n;
i++) {
109 for(
int i=0;
i<=
n;
i++) {
◆ check_bound()
number lattice::check_bound |
( |
int |
index | ) |
|
|
inlineprivate |
◆ compute_gram_matrix()
void lattice::compute_gram_matrix |
( |
| ) |
|
|
inlineprivate |
◆ enumerate_all()
bigintmat * lattice::enumerate_all |
( |
number |
a | ) |
|
Definition at line 507 of file lattice.cc.
535 DEBUG_PRINT((
"Initialize vector and other variables\n"));
536 std::vector<std::pair<number,bigintmat*> > elementsvector;
554 for(
int i = 2;
i<
n+1;
i++){
570 for(
unsigned i=1;
i<elementsvector.size();
i++){
572 elementsvector.pop_back();
578 if(elementsvector.size() >= 1000000){
579 elementsvector.pop_back();
590 for(
unsigned i=1;
i<elementsvector.size();
i++){
594 for(
unsigned i=1;
i<elementsvector.size();
i++){
◆ enumerate_get_next()
number lattice::enumerate_get_next |
( |
| ) |
|
|
inlineprivate |
◆ enumerate_next() [1/4]
◆ enumerate_next() [2/4]
Definition at line 676 of file lattice.cc.
680 Werror(
"no bound for elements given\n");
683 if (in ==
NULL || in->rows()!=
n || in->cols()!=1){
◆ enumerate_next() [3/4]
bigintmat * lattice::enumerate_next |
( |
number |
a | ) |
|
◆ enumerate_next() [4/4]
Definition at line 605 of file lattice.cc.
607 DEBUG_PRINT((
"Start enumerate_next number and bigintmat\n"));
608 if (in ==
NULL || in->rows()!=
n || in->cols()!=1){
648 for(
int j =
n;
j>1;
j--){
◆ get_basis()
◆ get_reduced_basis()
◆ get_transformation_matrix()
bigintmat * lattice::get_transformation_matrix |
( |
| ) |
|
◆ gram_schmidt()
bool lattice::gram_schmidt |
( |
int |
k | ) |
|
|
inlineprivate |
◆ gram_schmidt_MLLL()
void lattice::gram_schmidt_MLLL |
( |
int |
k | ) |
|
|
inlineprivate |
◆ increase_x()
void lattice::increase_x |
( |
int |
index | ) |
|
|
inlineprivate |
◆ LLL() [1/2]
◆ LLL() [2/2]
bool lattice::LLL |
( |
number & |
c | ) |
|
Definition at line 143 of file lattice.cc.
149 for(
int j=1;
j<=
n;
j++) {
154 for(
int j=1;
j<=
n;
j++) {
162 for(
int j=0;
j<=
n;
j++) {
166 for(
int j=0;
j<=
n;
j++) {
175 for(
int j=0;
j<=
n;
j++) {
241 if(
n_Greater(
n_Mult(
n_Sub(
c,
n_Mult(
my->
view(
k,
k-1),
my->
view(
k,
k-1),
coef),
coef),
B[
k-1],
coef),
B[
k],
coef)){
251 for(
int l=
k-2;
l>0;
l--){
◆ quadratic_supplement()
bool lattice::quadratic_supplement |
( |
| ) |
|
|
inlineprivate |
◆ RED()
void lattice::RED |
( |
int |
k, |
|
|
int |
l |
|
) |
| |
|
inlineprivate |
Definition at line 276 of file lattice.cc.
289 number my_klplus1div2;
291 my_klplus1div2 =
n_Add(my_kl, n_1div2,
coef);
293 my_klplus1div2 =
n_Add(my_kl, n_neg1div2,
coef);
308 for(
int i=1;
i<=
l-1;
i++){
◆ SWAP()
void lattice::SWAP |
( |
int |
k, |
|
|
int |
k_max |
|
) |
| |
|
inlineprivate |
Definition at line 315 of file lattice.cc.
316 DEBUG_PRINT((
"Start SWAP with k=%d and k_max=%d\n",
k,k_max));
326 for(
int j = 1;
j <=
k-2;
j++){
349 for(
int i =
k+1;
i <= k_max;
i++){
◆ SWAPG()
void lattice::SWAPG |
( |
int |
k, |
|
|
int |
k_max |
|
) |
| |
|
inlineprivate |
Definition at line 357 of file lattice.cc.
358 DEBUG_PRINT((
"Start SWAPG with k=%d and k_max=%d\n",
k,k_max));
368 for(
int j = 1;
j <=
k-2;
j++){
380 number tempnumber =
B[
k];
388 for(
int i =
k+1;
i <= k_max;
i++){
389 number tempnumber =
my->
get(
i,
k);
400 for(
int i =
k+1;
i <= k_max;
i++){
421 for(
int i =
k+1;
i <= k_max;
i++){
◆ b_star
◆ basis
◆ bound
◆ coef
◆ gram_matrix
◆ independentVectors
bool lattice::independentVectors |
|
private |
◆ integral
◆ my
◆ out_coef
◆ rank
◆ trans_matrix
bool lattice::trans_matrix |
|
private |
The documentation for this class was generated from the following files:
void appendCol(bigintmat *a)
horizontally join the matrices, m <- m|a
number check_bound(int index)
bool addcol(int i, int j, number a, coeffs c)
addiert a-faches der j-ten Spalte zur i-ten dazu
bool quadratic_supplement()
void SWAPG(int k, int k_max)
static FORCE_INLINE void n_InpMult(number &a, number b, const coeffs r)
multiplication of 'a' and 'b'; replacement of 'a' by the product a*b
void zero()
Setzt alle Einträge auf 0.
static FORCE_INLINE number n_GetNumerator(number &n, const coeffs r)
return the numerator of n (if elements of r are by nature not fractional, result is n)
void compute_gram_matrix()
number view(int i, int j) const
view an entry an entry. NOTE: starts at [1,1]
bigintmat * bimCopy(const bigintmat *b)
same as copy constructor - apart from it being able to accept NULL as input
static FORCE_INLINE void n_Delete(number *p, const coeffs r)
delete 'p'
static FORCE_INLINE BOOLEAN n_IsZero(number n, const coeffs r)
TRUE iff 'n' represents the zero element.
static FORCE_INLINE BOOLEAN n_Greater(number a, number b, const coeffs r)
ordered fields: TRUE iff 'a' is larger than 'b'; in Z/pZ: TRUE iff la > lb, where la and lb are the l...
void one()
Macht Matrix (Falls quadratisch) zu Einheitsmatrix.
bigintmat * bimMult(bigintmat *a, bigintmat *b)
bigintmat * bimSub(bigintmat *a, bigintmat *b)
void increase_x(int index)
static FORCE_INLINE number n_Add(number a, number b, const coeffs r)
return the sum of 'a' and 'b', i.e., a+b
static FORCE_INLINE void n_InpAdd(number &a, number b, const coeffs r)
addition of 'a' and 'b'; replacement of 'a' by the sum a+b
number(* nMapFunc)(number a, const coeffs src, const coeffs dst)
maps "a", which lives in src, into dst
void set(int i, int j, number n, const coeffs C=NULL)
replace an entry with a copy (delete old + copy new!). NOTE: starts at [1,1]
number scalarproduct(bigintmat *a, bigintmat *b)
bigintmat * bimAdd(bigintmat *a, bigintmat *b)
Matrix-Add/-Sub/-Mult so oder mit operator+/-/* ? @Note: NULL as a result means an error (non-compati...
static FORCE_INLINE number n_Mult(number a, number b, const coeffs r)
return the product of 'a' and 'b', i.e., a*b
static FORCE_INLINE number n_Init(long i, const coeffs r)
a number representing i in the given coeff field/ring r
void Print()
IO: simply prints the matrix to the current output (screen?)
void gram_schmidt_MLLL(int k)
void setcol(int j, bigintmat *m)
Setzt j-te Spalte gleich übergebenem Vektor (Matrix) m.
static FORCE_INLINE number n_Sub(number a, number b, const coeffs r)
return the difference of 'a' and 'b', i.e., a-b
number get(int i, int j) const
get a copy of an entry. NOTE: starts at [1,1]
number enumerate_get_next()
void SWAP(int k, int k_max)
void mult(unsigned long *result, unsigned long *a, unsigned long *b, unsigned long p, int dega, int degb)
void Werror(const char *fmt,...)
void swap(int i, int j)
swap columns i and j
void rawset(int i, number n, const coeffs C=NULL)
replace an entry with the given number n (only delete old). NOTE: starts at [0]. Should be named set_...
static FORCE_INLINE BOOLEAN n_GreaterZero(number n, const coeffs r)
ordered fields: TRUE iff 'n' is positive; in Z/pZ: TRUE iff 0 < m <= roundedBelow(p/2),...
static FORCE_INLINE number n_Copy(number n, const coeffs r)
return a copy of 'n'
static FORCE_INLINE BOOLEAN n_Equal(number a, number b, const coeffs r)
TRUE iff 'a' and 'b' represent the same number; they may have different representations.
static FORCE_INLINE number n_Div(number a, number b, const coeffs r)
return the quotient of 'a' and 'b', i.e., a/b; raises an error if 'b' is not invertible in r exceptio...
bigintmat * bimChangeCoeff(bigintmat *a, coeffs cnew)
Liefert Kopier von Matrix a zurück, mit coeffs cnew statt den ursprünglichen.
bigintmat * enumerate_next()
static FORCE_INLINE nMapFunc n_SetMap(const coeffs src, const coeffs dst)
set the mapping function pointers for translating numbers from src to dst
static int index(p_Length length, p_Ord ord)
static FORCE_INLINE number n_GetDenom(number &n, const coeffs r)
return the denominator of n (if elements of r are by nature not fractional, result is 1)
bool sub(bigintmat *b)
Subtrahiert ...
bool skalmult(number b, coeffs c)
Multipliziert zur Matrix den Skalar b hinzu.