[01e82c8] | 1 | /**************************************** |
---|
| 2 | * Computer Algebra System SINGULAR * |
---|
| 3 | ****************************************/ |
---|
[d51339] | 4 | /* $Id: f5data.h,v 1.6 2009-02-18 20:43:05 ederc Exp $ */ |
---|
[01e82c8] | 5 | /* |
---|
| 6 | * ABSTRACT: labeled polynomial interface |
---|
| 7 | */ |
---|
| 8 | #ifndef F5DATA_HEADER |
---|
| 9 | #define F5DATA_HEADER |
---|
| 10 | #ifdef HAVE_F5 |
---|
| 11 | /* |
---|
| 12 | ========================================================= |
---|
| 13 | ========================================================= |
---|
| 14 | classes for labeled polynomials/pairs/S-polynomials in F5 |
---|
| 15 | ========================================================= |
---|
| 16 | ========================================================= |
---|
| 17 | */ |
---|
| 18 | class LPoly; |
---|
| 19 | class CPair; |
---|
| 20 | class Rule; |
---|
| 21 | |
---|
| 22 | |
---|
| 23 | /* |
---|
| 24 | ============================ |
---|
| 25 | class of labeled polynomials |
---|
| 26 | ============================ |
---|
| 27 | */ |
---|
| 28 | class LPoly { |
---|
| 29 | private: |
---|
[fcb8022] | 30 | poly term; //term of signature |
---|
| 31 | int index; //index of signature |
---|
| 32 | poly polynomial; //standard polynomial data |
---|
[87beab7] | 33 | Rule* _rule; |
---|
[01e82c8] | 34 | public: |
---|
[87beab7] | 35 | LPoly(poly t, int i, poly p, Rule* r=NULL); |
---|
[9bb97e] | 36 | void setPoly(poly p); |
---|
[01e82c8] | 37 | poly getPoly(); |
---|
[9bb97e] | 38 | void setTerm(poly t); |
---|
[01e82c8] | 39 | poly getTerm(); |
---|
[9bb97e] | 40 | void setIndex(int i); |
---|
[01e82c8] | 41 | int getIndex(); |
---|
[87beab7] | 42 | void setRule(Rule* r); |
---|
| 43 | Rule* getRule(); |
---|
| 44 | void set(poly t, int i, poly p, Rule* r); |
---|
[01e82c8] | 45 | LPoly* get(); |
---|
| 46 | }; |
---|
| 47 | |
---|
| 48 | /* |
---|
| 49 | =================================== |
---|
| 50 | structure of labeled critical pairs |
---|
| 51 | =================================== |
---|
| 52 | */ |
---|
| 53 | class CPair { |
---|
| 54 | private: |
---|
| 55 | long deg; // total degree of the critical pair |
---|
| 56 | poly t1; // first term for label |
---|
| 57 | LPoly* lp1; // first labeled poly |
---|
| 58 | poly t2; // second term for label |
---|
| 59 | LPoly* lp2; // second labeled poly |
---|
| 60 | Rule* lastRuleTested; // already tested by rules up to lastRuleTested |
---|
| 61 | public: |
---|
| 62 | CPair(long degree, poly term1, LPoly* lpoly1, poly term2, LPoly* lpoly2); |
---|
| 63 | long getDeg(); |
---|
| 64 | poly getT1(); |
---|
[9bb97e] | 65 | poly* getAdT1(); |
---|
| 66 | LPoly* getAdLp1(); |
---|
[01e82c8] | 67 | poly getLp1Poly(); |
---|
| 68 | poly getLp1Term(); |
---|
| 69 | int getLp1Index(); |
---|
| 70 | poly getT2(); |
---|
[9bb97e] | 71 | poly* getAdT2(); |
---|
| 72 | LPoly* getAdLp2(); |
---|
[01e82c8] | 73 | poly getLp2Poly(); |
---|
| 74 | poly getLp2Term(); |
---|
| 75 | int getLp2Index(); |
---|
| 76 | Rule* getLastRuleTested(); |
---|
[d51339] | 77 | void setLastRuleTested(Rule* r); |
---|
[01e82c8] | 78 | }; |
---|
| 79 | |
---|
[a41f3aa] | 80 | |
---|
| 81 | /* |
---|
| 82 | ======================================================== |
---|
| 83 | structure of rules(i.e. already computed / known labels) |
---|
| 84 | ======================================================== |
---|
| 85 | */ |
---|
| 86 | class Rule { |
---|
| 87 | private: |
---|
[9bb97e] | 88 | int index; // index of the labeled polynomial the rule comes from |
---|
| 89 | poly term; // term of the labeled polynomial the rule comes from |
---|
[a41f3aa] | 90 | public: |
---|
[87beab7] | 91 | Rule(int i, poly term); |
---|
[a41f3aa] | 92 | int getIndex(); |
---|
| 93 | poly getTerm(); |
---|
| 94 | }; |
---|
[01e82c8] | 95 | #endif |
---|
| 96 | #endif |
---|