My Project
Loading...
Searching...
No Matches
f5data.h
Go to the documentation of this file.
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
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
75 index = i;
76}
77
79 _ruleOld = r;
80}
81
82void LPolyOld::setDel(bool d) {
83 del = d;
84}
85
87 return polynomial;
88}
89
91 return term;
92}
93
95 return index;
96}
97
99 return _ruleOld;
100}
101
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
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
163 return deg;
164}
165
167 return t1;
168}
169
171 return &t1;
172}
173
175 return &t2;
176}
177
179 return t2;
180}
181
183 return lp1;
184}
185
187 return lp2;
188}
189
191 return lp1->getPoly();
192}
193
195 return lp2->getPoly();
196}
197
199 return lp1->getTerm();
200}
201
203 return lp2->getTerm();
204}
205
207 return lp1->getIndex();
208}
209
211 return lp2->getIndex();
212}
213
215 return del;
216}
217
219 return testedRuleOld;
220}
221
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
249 //pDelete(&term);
250}
251
253 return index;
254}
255
257 return term;
258}
259#endif
260#endif
int degree(const CanonicalForm &f)
int i
Definition: cfEzgcd.cc:132
int p
Definition: cfModGcd.cc:4078
void setTestedRuleOld(RuleOld *r)
Definition: f5data.h:222
bool getDel()
Definition: f5data.h:214
poly getLp2Poly()
Definition: f5data.h:194
poly getLp1Poly()
Definition: f5data.h:190
long deg
Definition: f5data.h:125
poly t1
Definition: f5data.h:126
LPolyOld * getAdLp1()
Definition: f5data.h:182
long getDeg()
Definition: f5data.h:162
CPairOld(long degree, poly term1, LPolyOld *LPolyOld1, poly term2, LPolyOld *LPolyOld2, bool useless, RuleOld *r=NULL)
Definition: f5data.h:152
LPolyOld * getAdLp2()
Definition: f5data.h:186
poly * getAdT2()
Definition: f5data.h:174
poly getLp2Term()
Definition: f5data.h:202
int getLp1Index()
Definition: f5data.h:206
int getLp2Index()
Definition: f5data.h:210
LPolyOld * lp1
Definition: f5data.h:127
poly getLp1Term()
Definition: f5data.h:198
bool del
Definition: f5data.h:131
poly * getAdT1()
Definition: f5data.h:170
RuleOld * getTestedRuleOld()
Definition: f5data.h:218
LPolyOld * lp2
Definition: f5data.h:129
RuleOld * testedRuleOld
Definition: f5data.h:130
poly getT1()
Definition: f5data.h:166
poly getT2()
Definition: f5data.h:178
poly t2
Definition: f5data.h:128
poly getTerm()
Definition: f5data.h:90
LPolyOld(poly t, int i, poly p, RuleOld *r=NULL)
Definition: f5data.h:52
void setIndex(int i)
Definition: f5data.h:74
void set(poly t, int i, poly p, RuleOld *r)
Definition: f5data.h:106
RuleOld * _ruleOld
Definition: f5data.h:33
RuleOld * getRuleOld()
Definition: f5data.h:98
int index
Definition: f5data.h:31
poly getPoly()
Definition: f5data.h:86
bool del
Definition: f5data.h:34
void setRuleOld(RuleOld *r)
Definition: f5data.h:78
poly polynomial
Definition: f5data.h:32
void setPoly(poly p)
Definition: f5data.h:62
bool getDel()
Definition: f5data.h:102
poly term
Definition: f5data.h:30
void setDel(bool d)
Definition: f5data.h:82
int getIndex()
Definition: f5data.h:94
void setTerm(poly t)
Definition: f5data.h:68
LPolyOld * get()
Definition: f5data.h:113
~RuleOld()
Definition: f5data.h:248
poly getTerm()
Definition: f5data.h:256
int getIndex()
Definition: f5data.h:252
RuleOld(int i, poly term)
Definition: f5data.h:243
poly term
Definition: f5data.h:235
int index
Definition: f5data.h:234
Definition: int_poly.h:33
#define NULL
Definition: omList.c:12