Files | |
| file | eg_dbasis_red.c |
| file | eg_dbasis_red.h |
| This file provide the user interface and function definitions for the so-called LLL Basis Reduction Algorithm. This algorithm was first presented in the paper "Factoring polynomials with rational coefficients", Mathematische Annalen 261 (1981), p515-534. and has been extensivelly studied elsewere. for more details just Google-it. | |
Data Structures | |
| struct | EGdBsRed_t |
| structure to hold all necesary data to perform the LLL's basis reduction algorithm. More... | |
Profiling structures and functions for the basis reduction algorithm. | |
| #define | EG_BSRED_CALLS 0 |
| where we store the number of calls to EGdBsRed | |
| #define | EG_BSRED_INTR 2 |
| where we store the total number of interchanges performed in EGdBsRed | |
| #define | EG_BSRED_ITT 3 |
| where we store the total number of innermost loops performed in EGdBsRed | |
| #define | EG_BSRED_SZRED 1 |
| where we store the total number of size reductions performed in EGdBsRed | |
| #define | EGdBsRedProfile(ofile) |
| Print into the given file stream, the current statistics related to the EGdBsRed algorithm. And reset all counters to zero. | |
| uintmax_t | EGdBsRedStats [10] |
| where to hold the profile information | |
Defines | |
| #define | EG_DBSRED_ALPHA 0x3ffp-10 |
Value used in condition two of the LLL algorithm, remember that this number should be between . By default we choose . | |
| #define | EG_DBSRED_VERBOSE 0 |
| verbosity level | |
| #define | EGdBsRedAddElement(bsred, new_elem) |
| add a new vector to the basis. | |
| #define | EGdBsRedClear(bsred) |
| Free any internally allocated memory in a EGdBsRed_t structure. | |
| #define | EGdBsRedInit(bsred) |
| Initialize an EGdBsRed_t structure, as a basis with zero elements of dimension zero. | |
| #define | EGdBsRedReset(bsred) ((bsred)->dim = 0) |
| reset an EGdBsRed_t structure as a basis without elements (note that we do not reset the length of the vectors, just the number of vectors in the basis). | |
| #define | EGdBsRedSetLength(bsred, new_length) ((bsred)->length = (new_length)) |
| set the length of the vectors used in the basis for an EGdBsRed_t structure. | |
Typedefs | |
| typedef EGdBsRed_t | EGdBsRed_t |
| structure to hold all necesary data to perform the LLL's basis reduction algorithm. | |
Functions | |
| int | EGdBsRed (EGdBsRed_t *const bsred, unsigned *const dim, EGlpNum_t zero_tol, int *const status) |
| This function performs the so-called LLL basis reduction algorithm. | |
| static void | EGdBsRedBuildGM (EGdMatrix_t *const GM, const unsigned full_dim, const unsigned length, EGlpNum_t **const basis, EGlpNum_t orilen, EGlpNum_t tmpval) |
| , build (from scratch) the GM matrix | |
Variables | |
| uintmax_t | EGdBsRedStats [10] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } |
| where to hold the profile information | |
|
|
where we store the number of calls to EGdBsRed
Definition at line 67 of file eg_dbasis_red.h. |
|
|
where we store the total number of interchanges performed in EGdBsRed
Definition at line 77 of file eg_dbasis_red.h. |
|
|
where we store the total number of innermost loops performed in EGdBsRed
Definition at line 82 of file eg_dbasis_red.h. |
|
|
where we store the total number of size reductions performed in EGdBsRed
Definition at line 72 of file eg_dbasis_red.h. |
|
|
Value used in condition two of the LLL algorithm, remember that this number should be between
Definition at line 102 of file eg_dbasis_red.h. |
|
|
verbosity level
Definition at line 55 of file eg_dbasis_red.h. |
|
|
Value: do{\ EGdBsRed_t*const __EGdbs = (bsred);\ if(__EGdbs->basis_sz <= __EGdbs->dim){\ __EGdbs->basis_sz += 10U;\ EGrealloc(__EGdbs->basis,sizeof(EGlpNum_t*)*__EGdbs->basis_sz);}\ __EGdbs->basis[__EGdbs->dim++] = (new_elem);} while(0)
Definition at line 164 of file eg_dbasis_red.h. |
|
|
Value: do{\ EGdBsRed_t*const __EGdbs = (bsred);\ if(__EGdbs->basis) EGfree(__EGdbs->basis);\ EGdMatrixClear(&(__EGdbs->GM));} while(0)
Definition at line 138 of file eg_dbasis_red.h. |
|
|
Value: do{\ EGdBsRed_t*const __EGdbs = (bsred);\ memset(__EGdbs,0,sizeof(EGdBsRed_t));\ EGdMatrixInit(&(__EGdbs->GM));} while(0)
Definition at line 129 of file eg_dbasis_red.h. |
|
|
Value: do{\ fprintf(ofile,"LLL Basis Reduction Statistics:\n");\ fprintf(ofile,"\tNumber Calls : %ju\n", EGdBsRedStats[EG_BSRED_CALLS]);\ fprintf(ofile,"\tLoops : %ju\n", EGdBsRedStats[EG_BSRED_ITT]);\ fprintf(ofile,"\tSize Reductions : %ju\n", EGdBsRedStats[EG_BSRED_SZRED]);\ fprintf(ofile,"\tInterchanges : %ju\n", EGdBsRedStats[EG_BSRED_INTR]);\ memset(EGdBsRedStats,0,sizeof(EGdBsRedStats));} while(0)
Definition at line 88 of file eg_dbasis_red.h. |
|
|
reset an EGdBsRed_t structure as a basis without elements (note that we do not reset the length of the vectors, just the number of vectors in the basis).
Definition at line 149 of file eg_dbasis_red.h. |
|
|
set the length of the vectors used in the basis for an EGdBsRed_t structure.
Definition at line 157 of file eg_dbasis_red.h. |
|
|
structure to hold all necesary data to perform the LLL's basis reduction algorithm.
|
|
||||||||||||||||||||
|
This function performs the so-called LLL basis reduction algorithm.
Definition at line 66 of file eg_dbasis_red.c. Here is the call graph for this function: ![]() |
|
||||||||||||||||||||||||||||
|
, build (from scratch) the GM matrix
Definition at line 30 of file eg_dbasis_red.c. Here is the call graph for this function: ![]() |
|
|
where to hold the profile information
Definition at line 26 of file eg_dbasis_red.c. |
|
|
where to hold the profile information
Definition at line 26 of file eg_dbasis_red.c. |
1.4.5