[936551] | 1 | /**************************************** |
---|
| 2 | * Computer Algebra System SINGULAR * |
---|
| 3 | ****************************************/ |
---|
[bb02ea] | 4 | /* $Id: f5gb.h,v 1.35 2009-04-05 07:49:18 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 | */ |
---|
[61944d0] | 21 | void qsortDegree(poly* left, poly* right); |
---|
[199ae7] | 22 | |
---|
[bb02ea] | 23 | /** |
---|
| 24 | ========================================================================== |
---|
| 25 | compare monomials, i.e. divisibility tests for criterion 1 and criterion 2 |
---|
| 26 | ========================================================================== |
---|
| 27 | */ |
---|
| 28 | bool compareMonomials(int* m1, int** m2, int numberOfRules); |
---|
| 29 | |
---|
[199ae7] | 30 | /* |
---|
| 31 | ============================================== |
---|
| 32 | generating the list lp of ideal generators and |
---|
| 33 | test if 1 is in lp(return 1) or not(return 0) |
---|
| 34 | ============================================== |
---|
| 35 | */ |
---|
| 36 | void generate_input_list(LPoly* lp, ideal id, poly one); |
---|
[8627ad] | 37 | |
---|
[199ae7] | 38 | /* |
---|
| 39 | ================================================== |
---|
| 40 | computes incrementally gbs of subsets of the input |
---|
| 41 | gb{f_m} -> gb{f_m,f_(m-1)} -> gb{f_m,...,f_1} |
---|
| 42 | ================================================== |
---|
[948192] | 43 | */ |
---|
[9cb4078] | 44 | inline LList* F5inc(int i, poly f_i, LList* gPrev, ideal gbPrev, poly ONE, LTagList* lTag, RList* rules, RTagList* rTag); |
---|
[8627ad] | 45 | |
---|
[cce6ed3] | 46 | /* |
---|
| 47 | ================================================================ |
---|
| 48 | computes a list of critical pairs for the next reduction process |
---|
| 49 | first element in gPrev is always the newest element which must |
---|
| 50 | build critical pairs with all other elements in gPrev |
---|
| 51 | ================================================================ |
---|
| 52 | */ |
---|
[d51339] | 53 | void criticalPair(LList* gPrev, CList* critPairs, LTagList* lTag, RTagList* rTag, RList* rules); |
---|
| 54 | |
---|
[cce6ed3] | 55 | /* |
---|
| 56 | ======================================== |
---|
| 57 | Criterion 1, i.e. Faugere's F5 Criterion |
---|
| 58 | ======================================== |
---|
| 59 | */ |
---|
[9cb4078] | 60 | inline bool criterion1(LList* gPrev, poly t, LNode* l, LTagList* lTag); |
---|
[66e7b5] | 61 | |
---|
| 62 | /* |
---|
| 63 | ===================================== |
---|
| 64 | Criterion 2, i.e. Rewritten Criterion |
---|
| 65 | ===================================== |
---|
| 66 | */ |
---|
[f6c7c9b] | 67 | inline bool criterion2(int idx, poly t, LNode* l, RList* rules, RTagList* rTag); |
---|
[66e7b5] | 68 | |
---|
[8978fd] | 69 | /* |
---|
| 70 | ========================================================================================================== |
---|
| 71 | Criterion 2, i.e. Rewritten Criterion, for its second call in sPols(), with added lastRuleTested parameter |
---|
| 72 | ========================================================================================================== |
---|
| 73 | */ |
---|
[9cb4078] | 74 | inline bool criterion2(poly t, LPoly* l, RList* rules, Rule* testedRule); |
---|
[9bb97e] | 75 | |
---|
| 76 | /* |
---|
| 77 | ================================== |
---|
| 78 | Computation of S-Polynomials in F5 |
---|
| 79 | ================================== |
---|
| 80 | */ |
---|
[9cb4078] | 81 | inline void computeSPols(CNode* first, RTagList* rTag, RList* rules, LList* sPolyList); |
---|
[9bb97e] | 82 | |
---|
| 83 | /* |
---|
| 84 | ======================================================================== |
---|
| 85 | reduction including subalgorithm topReduction() using Faugere's criteria |
---|
| 86 | ======================================================================== |
---|
| 87 | */ |
---|
[9cb4078] | 88 | inline void reduction(LList* sPolyList, CList* critPairs, LList* gPrev, RList* rules, LTagList* lTag, RTagList* rTag, |
---|
[fcb8022] | 89 | ideal gbPrev); |
---|
[9bb97e] | 90 | |
---|
| 91 | /* |
---|
| 92 | ===================================================================================== |
---|
| 93 | top reduction in F5, i.e. reduction of a given S-polynomial by labeled polynomials of |
---|
| 94 | the same index whereas the labels are taken into account |
---|
| 95 | ===================================================================================== |
---|
| 96 | */ |
---|
[f6c6b01] | 97 | inline void topReduction(LNode* l, LList* sPolyList, LList* gPrev, CList* critPairs, RList* rules, LTagList* lTag, RTagList* rTag, ideal gbPrev); |
---|
[9bb97e] | 98 | |
---|
| 99 | /* |
---|
| 100 | ===================================================================== |
---|
| 101 | subalgorithm to find a possible reductor for the labeled polynomial l |
---|
| 102 | ===================================================================== |
---|
| 103 | */ |
---|
[bb02ea] | 104 | inline LNode* findReductor(LNode* l, LList* sPolyList, LNode* gPrevRedCheck, LList* gPrev, RList* rules, LTagList* lTag,RTagList* rTag); |
---|
[9bb97e] | 105 | |
---|
[199ae7] | 106 | /* |
---|
| 107 | ====================================== |
---|
[87beab7] | 108 | main function of our F5 implementation |
---|
[199ae7] | 109 | ====================================== |
---|
| 110 | */ |
---|
[171950] | 111 | ideal F5main(ideal i, ring r); |
---|
[199ae7] | 112 | |
---|
[936551] | 113 | #endif |
---|
| 114 | #endif |
---|