[936551] | 1 | /**************************************** |
---|
| 2 | * Computer Algebra System SINGULAR * |
---|
| 3 | ****************************************/ |
---|
[d7d5f6] | 4 | /* $Id: f5gb.h,v 1.25 2009-02-12 12:43:31 ederc Exp $ */ |
---|
[936551] | 5 | /* |
---|
[d0f98e] | 6 | * ABSTRACT: f5gb interface |
---|
[936551] | 7 | */ |
---|
| 8 | #ifndef F5_HEADER |
---|
| 9 | #define F5_HEADER |
---|
| 10 | |
---|
| 11 | #ifdef HAVE_F5 |
---|
[5d0556] | 12 | #include "f5data.h" |
---|
[a3771a] | 13 | #include "f5lists.h" |
---|
[d0f98e] | 14 | |
---|
| 15 | |
---|
[199ae7] | 16 | /* |
---|
| 17 | ====================================================== |
---|
| 18 | sort polynomials in ideal i by decreasing total degree |
---|
| 19 | ====================================================== |
---|
| 20 | */ |
---|
| 21 | void qsort_degree(poly* left, poly* right); |
---|
| 22 | |
---|
| 23 | /* |
---|
| 24 | ============================================== |
---|
| 25 | generating the list lp of ideal generators and |
---|
| 26 | test if 1 is in lp(return 1) or not(return 0) |
---|
| 27 | ============================================== |
---|
| 28 | */ |
---|
| 29 | void generate_input_list(LPoly* lp, ideal id, poly one); |
---|
[8627ad] | 30 | |
---|
[199ae7] | 31 | /* |
---|
| 32 | ================================================== |
---|
| 33 | computes incrementally gbs of subsets of the input |
---|
| 34 | gb{f_m} -> gb{f_m,f_(m-1)} -> gb{f_m,...,f_1} |
---|
| 35 | ================================================== |
---|
[948192] | 36 | */ |
---|
[87beab7] | 37 | LList* F5inc(int i, poly f_i, LList* gPrev, ideal gbPrev, poly ONE, LTagList* lTag, RList* rules, RTagList* rTag); |
---|
[8627ad] | 38 | |
---|
[cce6ed3] | 39 | /* |
---|
| 40 | ================================================================ |
---|
| 41 | computes a list of critical pairs for the next reduction process |
---|
| 42 | first element in gPrev is always the newest element which must |
---|
| 43 | build critical pairs with all other elements in gPrev |
---|
| 44 | ================================================================ |
---|
| 45 | */ |
---|
[87beab7] | 46 | CList* criticalPair(LList* gPrev, CList* critPairs, LTagList* lTag, RTagList* rTag, RList* rules); |
---|
[8627ad] | 47 | |
---|
[cce6ed3] | 48 | /* |
---|
| 49 | ======================================== |
---|
| 50 | Criterion 1, i.e. Faugere's F5 Criterion |
---|
| 51 | ======================================== |
---|
| 52 | */ |
---|
[66e7b5] | 53 | bool criterion1(poly* t, LNode* l, LTagList* lTag); |
---|
| 54 | |
---|
| 55 | /* |
---|
| 56 | ===================================== |
---|
| 57 | Criterion 2, i.e. Rewritten Criterion |
---|
| 58 | ===================================== |
---|
| 59 | */ |
---|
[87beab7] | 60 | bool criterion2(poly* t, LNode* l, RList* rules, RTagList* rTag); |
---|
[66e7b5] | 61 | |
---|
[8978fd] | 62 | /* |
---|
| 63 | ========================================================================================================== |
---|
| 64 | Criterion 2, i.e. Rewritten Criterion, for its second call in sPols(), with added lastRuleTested parameter |
---|
| 65 | ========================================================================================================== |
---|
| 66 | */ |
---|
[87beab7] | 67 | bool criterion2(poly* t, LPoly* l, RList* rules, Rule* lastRuleTested); |
---|
[9bb97e] | 68 | |
---|
| 69 | /* |
---|
| 70 | ================================== |
---|
| 71 | Computation of S-Polynomials in F5 |
---|
| 72 | ================================== |
---|
| 73 | */ |
---|
[fcb8022] | 74 | void computeSPols(CNode* first, RTagList* rTag, RList* rules, LList* sPolyList); |
---|
[9bb97e] | 75 | |
---|
| 76 | /* |
---|
| 77 | ======================================================================== |
---|
| 78 | reduction including subalgorithm topReduction() using Faugere's criteria |
---|
| 79 | ======================================================================== |
---|
| 80 | */ |
---|
[d7d5f6] | 81 | LList* reduction(LList* sPolyList, LList* completed, LList* gPrev, RList* rules, LTagList* lTag, RTagList* rTag, |
---|
[fcb8022] | 82 | ideal gbPrev); |
---|
[9bb97e] | 83 | |
---|
| 84 | /* |
---|
| 85 | ===================================================================================== |
---|
| 86 | top reduction in F5, i.e. reduction of a given S-polynomial by labeled polynomials of |
---|
| 87 | the same index whereas the labels are taken into account |
---|
| 88 | ===================================================================================== |
---|
| 89 | */ |
---|
[d7d5f6] | 90 | TopRed* topReduction(LNode* l, LList* completed, LList* gPrev, RList* rules, LTagList* lTag, RTagList* rTag); |
---|
[9bb97e] | 91 | |
---|
| 92 | /* |
---|
| 93 | ===================================================================== |
---|
| 94 | subalgorithm to find a possible reductor for the labeled polynomial l |
---|
| 95 | ===================================================================== |
---|
| 96 | */ |
---|
[d7d5f6] | 97 | LNode* findReductor(LNode* l,LList* completed,LList* gPrev, RList* rules, LTagList* lTag,RTagList* rTag, |
---|
[fcb8022] | 98 | LNode* gPrevRedCheck, LNode* completedRedCheck); |
---|
[9bb97e] | 99 | |
---|
[199ae7] | 100 | /* |
---|
| 101 | ====================================== |
---|
[87beab7] | 102 | main function of our F5 implementation |
---|
[199ae7] | 103 | ====================================== |
---|
| 104 | */ |
---|
[171950] | 105 | ideal F5main(ideal i, ring r); |
---|
[199ae7] | 106 | |
---|
[936551] | 107 | #endif |
---|
| 108 | #endif |
---|