source: git/kernel/f5data.h @ a9c298

spielwiese
Last change on this file since a9c298 was a9c298, checked in by Hans Schoenemann <hannes@…>, 10 years ago
format stuff
  • Property mode set to 100644
File size: 5.9 KB
Line 
1//! \file f5data.cc
2/****************************************
3*  Computer Algebra System SINGULAR     *
4****************************************/
5/*
6* ABSTRACT: labeled polynomial interface
7*/
8#ifndef F5DATA_HEADER
9#define F5DATA_HEADER
10#ifdef HAVE_F5
11/*!
12=========================================================
13=========================================================
14classes for labeled polynomials/pairs/S-polynomials in F5
15=========================================================
16=========================================================
17*/
18class LPolyOld;
19class CPairOld;
20class RuleOld;
21
22
23/*!
24============================
25class of labeled polynomials
26============================
27*/
28class LPolyOld {
29    private:
30        poly    term;           //term of signature
31        int     index;          //index of signature
32        poly    polynomial;     //standard polynomial data
33        RuleOld*   _ruleOld;
34        bool    del;
35    public:
36        inline          LPolyOld(poly t, int i, poly p, RuleOld* r=NULL);
37 //       inline          LPolyOld(poly t, int i, poly p, RuleOld* r=NULL, bool b=0);
38        inline  void    setPoly(poly p);
39        inline  poly    getPoly();
40        inline  void    setTerm(poly t);
41        inline  poly    getTerm();
42        inline  void    setIndex(int i);
43        inline  int     getIndex();
44        inline  void    setRuleOld(RuleOld* r);
45        inline  RuleOld*   getRuleOld();
46        inline  void    setDel(bool d);
47        inline  bool    getDel();
48        inline  void    set(poly t, int i, poly p, RuleOld* r);
49        inline  LPolyOld*  get();
50};
51
52LPolyOld::LPolyOld(poly t,int i,poly p, RuleOld* r) {
53    set(t,i,p,r);
54    del =   0;
55}
56
57/*LPolyOld::LPolyOld(poly t,int i,poly p, RuleOld* r, bool b) {
58    set(t,i,p,r);
59    del =   b;
60}
61*/
62void LPolyOld::setPoly(poly p)  {
63    //poly _p     =   pInit();
64    //_p          =   pCopy(p);
65    polynomial = p;
66}
67
68void LPolyOld::setTerm(poly t) {
69    //poly _t     =   pInit();
70    //_t          =   pCopy(t);
71    term = t;
72}
73
74void LPolyOld::setIndex(int i) {
75    index = i;
76}
77
78void LPolyOld::setRuleOld(RuleOld* r) {
79    _ruleOld   =   r;
80}
81
82void LPolyOld::setDel(bool d) {
83    del =   d;
84}
85
86poly LPolyOld::getPoly() {
87    return polynomial;
88}
89
90poly LPolyOld::getTerm() {
91    return term;
92}
93
94int LPolyOld::getIndex() {
95    return index;
96}
97
98RuleOld* LPolyOld::getRuleOld() {
99    return _ruleOld;
100}
101
102bool LPolyOld::getDel() {
103    return del;
104}
105
106void LPolyOld::set(poly t, int i, poly p, RuleOld* r) {
107    this->setTerm(t);
108    this->setIndex(i);
109    this->setPoly(p);
110    this->setRuleOld(r);
111}
112
113LPolyOld* LPolyOld::get() {
114    return this;
115}
116
117
118/*!
119===================================
120structure of labeled critical pairs
121===================================
122*/
123class CPairOld {
124    private:
125        long    deg;            // total degree of the critical pair
126        poly    t1;             // first term for label
127        LPolyOld*  lp1;            // first labeled poly
128        poly    t2;             // second term for label
129        LPolyOld*  lp2;            // second labeled poly
130        RuleOld*   testedRuleOld;     // already tested by RuleOlds up to lastRuleOldTested
131        bool  del;
132    public:
133        inline          CPairOld(long degree, poly term1, LPolyOld* LPolyOld1, poly term2, LPolyOld* LPolyOld2, bool useless, RuleOld* r = NULL);
134        inline  long    getDeg();
135        inline  poly    getT1();
136        inline  poly*   getAdT1();
137        inline  LPolyOld*  getAdLp1();
138        inline  poly    getLp1Poly();
139        inline  poly    getLp1Term();
140        inline  int     getLp1Index();
141        inline  poly    getT2();
142        inline  poly*   getAdT2();
143        inline  LPolyOld*  getAdLp2();
144        inline  poly    getLp2Poly();
145        inline  poly    getLp2Term();
146        inline  int     getLp2Index();
147        inline  bool    getDel();
148        inline  RuleOld*   getTestedRuleOld();
149        inline  void    setTestedRuleOld(RuleOld* r);
150};
151
152CPairOld::CPairOld(long degree, poly term1, LPolyOld* LPolyOld1, poly term2, LPolyOld* LPolyOld2, bool useless, RuleOld* r) {
153   deg              =   degree;
154   t1               =   term1;
155   lp1              =   LPolyOld1;
156   t2               =   term2;
157   lp2              =   LPolyOld2;
158   testedRuleOld       =   r;
159   del              =   useless;
160}
161
162long CPairOld::getDeg() {
163    return deg;
164}
165
166poly CPairOld::getT1() {
167    return t1;
168}
169
170poly* CPairOld::getAdT1() {
171    return &t1;
172}
173
174poly* CPairOld::getAdT2() {
175    return &t2;
176}
177
178poly CPairOld::getT2() {
179    return t2;
180}
181
182LPolyOld* CPairOld::getAdLp1() {
183    return lp1;
184}
185
186LPolyOld* CPairOld::getAdLp2() {
187    return lp2;
188}
189
190poly CPairOld::getLp1Poly() {
191    return lp1->getPoly();
192}
193
194poly CPairOld::getLp2Poly() {
195    return lp2->getPoly();
196}
197
198poly CPairOld::getLp1Term() {
199    return lp1->getTerm();
200}
201
202poly CPairOld::getLp2Term() {
203    return lp2->getTerm();
204}
205
206int CPairOld::getLp1Index() {
207    return lp1->getIndex();
208}
209
210int CPairOld::getLp2Index() {
211    return lp2->getIndex();
212}
213
214bool CPairOld::getDel() {
215  return del;
216}
217
218RuleOld* CPairOld::getTestedRuleOld() {
219    return testedRuleOld;
220}
221
222void CPairOld::setTestedRuleOld(RuleOld* r) {
223    testedRuleOld      =   r;
224}
225
226
227/*!
228========================================================
229structure of RuleOlds(i.e. already computed / known labels)
230========================================================
231*/
232class RuleOld {
233    private:
234        int     index;      // index of the labeled polynomial the RuleOld comes from
235        poly    term;       // term of the labeled polynomial the RuleOld comes from
236    public:
237        inline          RuleOld(int i, poly term);
238        inline          ~RuleOld();
239        inline  int     getIndex();
240        inline  poly    getTerm();
241};
242
243RuleOld::RuleOld(int i, poly t) {
244    index   =   i;
245    term    =   t;
246}
247
248RuleOld::~RuleOld() {
249    //pDelete(&term);
250}
251
252int RuleOld::getIndex() {
253    return index;
254}
255
256poly RuleOld::getTerm() {
257    return term;
258}
259#endif
260#endif
Note: See TracBrowser for help on using the repository browser.