My Project
Loading...
Searching...
No Matches
f5lists.h
Go to the documentation of this file.
1#ifndef F5LISTS_HEADER
2#define F5LISTS_HEADER
3/****************************************
4* Computer Algebra System SINGULAR *
5****************************************/
6/*
7* ABSTRACT: list interface
8*/
10
11#ifdef HAVE_F5
12/*
13============================
14============================
15classes for lists used in F5
16============================
17============================
18*/
19class PNode;
20class PList;
21class LNode;
22class LList;
23class LTagNode;
24class LTagList;
25class CNode;
26class CListOld;
27class RList;
28class RNode;
29class RTagNode;
30class RTagList;
31
32
33/**
34 * class PNode of nodes of polynomials
35 */
36class PNode {
37 private:
38 poly data;
40 public:
41 PNode(poly p, PNode* n);
42 poly getPoly();
43 PNode* getNext();
44 PNode* insert(poly p);
45};
46
47/**
48 * class PList of lists of PNodes
49 */
50class PList {
51 private:
53 public:
54 PList();
55 void insert(poly p);
56 bool check(poly p);
57 void print();
58};
59
60/*
61=======================================
62class LNode (nodes for lists of LPolyOlds)
63=======================================
64*/
65class LNode {
66 private:
69 public:
70 // generating new list elements from the labeled / classical polynomial view
71 LNode();
72 LNode(LPolyOld* lp);
73 LNode(LPolyOld* lp, LNode* l);
74 LNode(poly t, int i, poly p, RuleOld* r=NULL);
75 LNode(poly t, int i, poly p, RuleOld* r, LNode* l);
76 LNode(LNode* ln);
77 ~LNode();
78 void deleteAll();
79 // insert new elements to the list at the end from the labeled / classical polynomial view
80 // needed for gPrev
81 LNode* insert(LPolyOld* lp);
82 LNode* insert(poly t, int i, poly p, RuleOld* r);
84 // insert new elements to the list in front from the labeled / classical polynomial view
85 // needed for sPolyList
87 LNode* insertSP(poly t, int i, poly p, RuleOld* r);
88 // insert new elements to the list with resp. to increasing labels
89 // only used for the S-polys to be reduced (TopReduction building new S-polys with higher label)
90 LNode* insertByLabel(poly t, int i, poly p, RuleOld* r);
93 // deletes the first elements of the list with the same degree
94 // get next & prev from current LNode
95 LNode* getNext();
97 // only used for the S-polys, which are already sorted by increasing degree by CListOld
99 // get the LPolyOld* out of LNode*
101 // get the data from the LPolyOld saved in LNode
102 poly getPoly();
103 poly getTerm();
104 int getIndex();
106 bool getDel();
107 // set the data from the LPolyOld saved in LNode
108 void setPoly(poly p);
109 void setTerm(poly t);
110 void setIndex(int i);
111 void setNext(LNode* l);
112 void setRuleOld(RuleOld* r);
113 void setDel(bool d);
114 // test if for any list element the polynomial part of the data is equal to *p
115 bool polyTest(poly* p);
116 LNode* getNext(LNode* l);
117 void print();
118 int count(LNode* l);
119};
120
121
122/*
123============================
124class LList(lists of LPolyOlds)
125============================
126*/
127class LList {
128 private:
132 public:
133 LList();
134 LList(LPolyOld* lp);
135 LList(poly t,int i,poly p, RuleOld* r = NULL);
136 ~LList();
137 // insertion at the end of the list
138 // needed for gPrev
139 void insert(LPolyOld* lp);
140 void insert(poly t,int i, poly p, RuleOld* r = NULL);
142 // insertion in front of the list
143 // needed for sPolyList
144 void insertSP(LPolyOld* lp);
145 void insertSP(poly t,int i, poly p, RuleOld* r = NULL);
146 void insertByLabel(poly t, int i, poly p, RuleOld* r = NULL);
147 void insertByLabel(LNode* l);
148 void insertFirst(LNode* l);
149 void deleteByDeg();
150 bool polyTest(poly* p);
151 LNode* getFirst();
152 LNode* getLast();
153 int getLength();
154 void setFirst(LNode* l);
155 void print();
156 int count(LNode* l);
157};
158
159
160
161/*
162==============================================
163class LtagNode (nodes for lists of LPolyOld tags)
164==============================================
165*/
166class LTagNode {
167 private:
170 public:
171 LTagNode();
172 LTagNode(LNode* l);
173 LTagNode(LNode* l, LTagNode* n);
174 ~LTagNode();
175 // declaration with first as parameter due to sorting of LTagList
177 LNode* getLNode();
178 LTagNode* getNext();
179 LNode* get(int i, int length);
180};
181
182
183/*
184=========================================================================
185class LTagList(lists of LPolyOld tags, i.e. first elements of a given index)
186=========================================================================
187*/
188class LTagList {
189 private:
193 public:
194 LTagList();
195 LTagList(LNode* l);
196 ~LTagList();
197 // declaration with first as parameter in LTagNode due to sorting of LTagList
198 void insert(LNode* l);
200 LNode* get(int idx);
201 LNode* getFirst();
203};
204
207
208
209/*
210======================================================================================
211class TopRed(return values of subalgorithm TopRed in f5gb.cc), i.e. the first elements
212 of the lists LList* completed & LList* sPolyList
213======================================================================================
214*/
215class TopRed {
216 private:
219 public:
220 TopRed();
221 TopRed(LList* c, LList* t);
223 LList* getToDo();
224};
225
226
227/*
228=======================================
229class CNode (nodes for lists of CPairOlds)
230=======================================
231*/
232class CNode {
233 private:
236 public:
237 CNode();
238 CNode(CPairOld* c);
239 CNode(CPairOld* c, CNode* n);
240 ~CNode();
241 CNode* insert(CPairOld* c);
243 CNode* getMinDeg();
244 CPairOld* getData();
245 CNode* getNext();
248 poly getLp1Poly();
249 poly getLp2Poly();
250 poly getLp1Term();
251 poly getLp2Term();
252 poly getT1();
253 poly* getAdT1();
254 poly getT2();
255 poly* getAdT2();
256 int getLp1Index();
257 int getLp2Index();
258 bool getDel();
260 void print();
261};
262
263
264/*
265============================
266class CListOld(lists of CPairOlds)
267============================
268*/
269class CListOld {
270 private:
272 public:
273 // for initialization of CListOlds, last element always has data=NULL and next=NULL
274 CListOld();
275 CListOld(CPairOld* c);
276 ~CListOld();
277 CNode* getFirst();
278 void insert(CPairOld* c);
280 CNode* getMinDeg();
281 void print();
282};
283
284
285/*
286======================================
287class RNode (nodes for lists of RuleOlds)
288======================================
289*/
290class RNode {
291 private:
294 public:
295 RNode();
296 RNode(RuleOld* r);
297 ~RNode();
298 RNode* insert(RuleOld* r);
299 RNode* insert(int i, poly t);
301 RNode* getNext();
303 int getRuleOldIndex();
304 poly getRuleOldTerm();
305 void print();
306};
307
308/*
309============================
310class RList (lists of RuleOlds)
311============================
312*/
313class RList {
314 private:
316 // last always has data=NULL and next=NULL, for initialization purposes used
318 public:
319 RList();
320 RList(RuleOld* r);
321 ~RList();
322 void insert(RuleOld* r);
323 void insert(int i, poly t);
324 void insertOrdered(RuleOld* r);
325 RNode* getFirst();
327 void print();
328};
329
330
331
332/*
333=============================================
334class RtagNode (nodes for lists of RuleOld tags)
335=============================================
336*/
337class RTagNode {
338 private:
341 public:
342 RTagNode();
343 RTagNode(RNode* r);
344 RTagNode(RNode* r, RTagNode* n);
345 ~RTagNode();
346 // declaration with first as parameter due to sorting of LTagList
347 RTagNode* insert(RNode* r);
348 RNode* getRNode();
349 RTagNode* getNext();
350 RNode* get(int idx, int length);
351 void set(RNode*);
352 void print();
353};
354
355
356/*
357========================================================================
358class RTagList(lists of RuleOld tags, i.e. first elements of a given index)
359========================================================================
360*/
361class RTagList {
362 private:
365 public:
366 RTagList();
367 RTagList(RNode* r);
368 ~RTagList();
369 // declaration with first as parameter in LTagNode due to sorting of LTagList
370 void insert(RNode* r);
371 RNode* getFirst();
372 RNode* get(int idx);
373 void setFirst(RNode* r);
374 void print();
375 int getLength();
376};
377#endif
378#endif
int l
Definition: cfEzgcd.cc:100
int i
Definition: cfEzgcd.cc:132
int p
Definition: cfModGcd.cc:4078
CNode * getMinDeg()
Definition: f5lists.cc:952
void insert(CPairOld *c)
Definition: f5lists.cc:938
~CListOld()
Definition: f5lists.cc:927
void insertWithoutSort(CPairOld *c)
Definition: f5lists.cc:942
CNode * getFirst()
Definition: f5lists.cc:946
void print()
Definition: f5lists.cc:958
CListOld()
Definition: f5lists.cc:919
CNode * first
Definition: f5lists.h:271
Definition: f5lists.h:232
CNode * getMinDeg()
Definition: f5lists.cc:805
LPolyOld * getAdLp2()
Definition: f5lists.cc:832
CPairOld * getData()
Definition: f5lists.cc:820
LPolyOld * getAdLp1()
Definition: f5lists.cc:828
poly getT1()
Definition: f5lists.cc:860
bool getDel()
Definition: f5lists.cc:876
poly getLp2Poly()
Definition: f5lists.cc:840
int getLp2Index()
Definition: f5lists.cc:856
RuleOld * getTestedRuleOld()
Definition: f5lists.cc:880
poly getLp1Term()
Definition: f5lists.cc:844
poly getT2()
Definition: f5lists.cc:868
void print()
Definition: f5lists.cc:885
CNode()
Definition: f5lists.cc:679
CNode * insert(CPairOld *c)
Definition: f5lists.cc:702
CNode * getNext()
Definition: f5lists.cc:824
CPairOld * data
Definition: f5lists.h:234
poly getLp2Term()
Definition: f5lists.cc:848
poly * getAdT2()
Definition: f5lists.cc:872
int getLp1Index()
Definition: f5lists.cc:852
CNode * insertWithoutSort(CPairOld *cp)
Definition: f5lists.cc:797
~CNode()
Definition: f5lists.cc:694
poly * getAdT1()
Definition: f5lists.cc:864
poly getLp1Poly()
Definition: f5lists.cc:836
CNode * next
Definition: f5lists.h:235
Definition: f5lists.h:127
LNode * last
Definition: f5lists.h:130
LNode * getFirst()
Definition: f5lists.cc:519
void insert(LPolyOld *lp)
Definition: f5lists.cc:457
~LList()
Definition: f5lists.cc:446
int length
Definition: f5lists.h:131
void insertByDeg(LPolyOld *lp)
void insertFirst(LNode *l)
Definition: f5lists.cc:499
LList()
Definition: f5lists.cc:429
int getLength()
Definition: f5lists.cc:527
bool polyTest(poly *p)
Definition: f5lists.cc:515
void setFirst(LNode *l)
Definition: f5lists.cc:531
void deleteByDeg()
Definition: f5lists.cc:511
void print()
Definition: f5lists.cc:538
void insertByLabel(poly t, int i, poly p, RuleOld *r=NULL)
Definition: f5lists.cc:493
void insertSP(LPolyOld *lp)
Definition: f5lists.cc:480
LNode * getLast()
Definition: f5lists.cc:523
LNode * first
Definition: f5lists.h:129
Definition: f5lists.h:65
void deleteAll()
Definition: f5lists.cc:167
LNode * insertFirst(LNode *l)
Definition: f5lists.cc:265
LNode * next
Definition: f5lists.h:68
void setTerm(poly t)
Definition: f5lists.cc:360
LNode()
Definition: f5lists.cc:129
void setIndex(int i)
Definition: f5lists.cc:364
LNode * deleteByDeg()
Definition: f5lists.cc:316
LNode * insert(LPolyOld *lp)
Definition: f5lists.cc:178
LPolyOld * data
Definition: f5lists.h:67
LNode * getNext()
Definition: f5lists.cc:321
int getIndex()
Definition: f5lists.cc:339
RuleOld * getRuleOld()
Definition: f5lists.cc:343
LNode * insertByDeg(LPolyOld *lp)
~LNode()
Definition: f5lists.cc:161
LNode * getPrev()
poly getPoly()
Definition: f5lists.cc:331
void setPoly(poly p)
Definition: f5lists.cc:356
LNode * insertSP(LPolyOld *lp)
Definition: f5lists.cc:206
void setDel(bool d)
Definition: f5lists.cc:372
void setNext(LNode *l)
Definition: f5lists.cc:368
LNode * insertByLabel(poly t, int i, poly p, RuleOld *r)
Definition: f5lists.cc:221
bool polyTest(poly *p)
Definition: f5lists.cc:377
bool getDel()
Definition: f5lists.cc:351
void setRuleOld(RuleOld *r)
Definition: f5lists.cc:347
LPolyOld * getLPolyOld()
Definition: f5lists.cc:326
void print()
Definition: f5lists.cc:393
poly getTerm()
Definition: f5lists.cc:335
LTagNode * first
Definition: f5lists.h:190
~LTagList()
Definition: f5lists.cc:617
LTagList()
Definition: f5lists.cc:606
void setFirstCurrentIdx(LNode *l)
Definition: f5lists.cc:633
LNode * firstCurrentIdx
Definition: f5lists.h:191
LNode * getFirstCurrentIdx()
Definition: f5lists.cc:645
void insert(LNode *l)
Definition: f5lists.cc:628
LNode * getFirst()
Definition: f5lists.cc:641
int length
Definition: f5lists.h:192
LNode * get(int idx)
Definition: f5lists.cc:637
LNode * get(int i, int length)
Definition: f5lists.cc:586
LTagNode()
Definition: f5lists.cc:550
LNode * data
Definition: f5lists.h:168
~LTagNode()
Definition: f5lists.cc:565
LTagNode * next
Definition: f5lists.h:169
LTagNode * insert(LNode *l)
Definition: f5lists.cc:570
LTagNode * getNext()
Definition: f5lists.cc:579
LNode * getLNode()
Definition: f5lists.cc:575
class PList of lists of PNodes
Definition: f5lists.h:50
void print()
Definition: f5lists.cc:114
PList()
functions working on the class PList
Definition: f5lists.cc:75
PNode * first
Definition: f5lists.h:52
void insert(poly p)
Definition: f5lists.cc:80
class PNode of nodes of polynomials
Definition: f5lists.h:36
PNode * getNext()
Definition: f5lists.cc:34
PNode * insert(poly p)
Definition: f5lists.cc:37
poly data
Definition: f5lists.h:38
poly getPoly()
Definition: f5lists.cc:30
PNode * next
Definition: f5lists.h:39
Definition: f5lists.h:313
~RList()
Definition: f5lists.cc:1061
RuleOld * getRuleOld()
Definition: f5lists.cc:1095
void print()
Definition: f5lists.cc:1099
RNode * getFirst()
Definition: f5lists.cc:1091
RNode * first
Definition: f5lists.h:315
RList()
Definition: f5lists.cc:1053
RNode * last
Definition: f5lists.h:317
void insert(RuleOld *r)
Definition: f5lists.cc:1083
void insertOrdered(RuleOld *r)
Definition: f5lists.cc:1087
Definition: f5lists.h:290
poly getRuleOldTerm()
Definition: f5lists.cc:1035
RNode * next
Definition: f5lists.h:293
void print()
Definition: f5lists.cc:1039
RNode * insertOrdered(RuleOld *r)
Definition: f5lists.cc:1002
RuleOld * data
Definition: f5lists.h:292
RNode()
Definition: f5lists.cc:967
RNode * insert(RuleOld *r)
Definition: f5lists.cc:983
RNode * getNext()
Definition: f5lists.cc:1023
~RNode()
Definition: f5lists.cc:978
int getRuleOldIndex()
Definition: f5lists.cc:1031
RuleOld * getRuleOld()
Definition: f5lists.cc:1027
int length
Definition: f5lists.h:364
RNode * getFirst()
Definition: f5lists.cc:1223
RTagNode * first
Definition: f5lists.h:363
int getLength()
Definition: f5lists.cc:1239
~RTagList()
Definition: f5lists.cc:1206
void setFirst(RNode *r)
Definition: f5lists.cc:1231
RTagList()
Definition: f5lists.cc:1196
void insert(RNode *r)
Definition: f5lists.cc:1216
void print()
Definition: f5lists.cc:1235
RNode * get(int idx)
Definition: f5lists.cc:1227
RTagNode * next
Definition: f5lists.h:340
RNode * getRNode()
Definition: f5lists.cc:1137
RNode * data
Definition: f5lists.h:339
~RTagNode()
Definition: f5lists.cc:1125
RTagNode()
Definition: f5lists.cc:1109
void set(RNode *)
Definition: f5lists.cc:1169
RTagNode * getNext()
Definition: f5lists.cc:1143
RTagNode * insert(RNode *r)
Definition: f5lists.cc:1130
void print()
Definition: f5lists.cc:1174
RNode * get(int idx, int length)
Definition: f5lists.cc:1150
LList * getCompleted()
Definition: f5lists.cc:665
LList * _toDo
Definition: f5lists.h:218
LList * _completed
Definition: f5lists.h:217
TopRed()
Definition: f5lists.cc:655
LList * getToDo()
Definition: f5lists.cc:669
LNode * getGPrevRedCheck()
LNode * getcompletedRedCheck()
static BOOLEAN length(leftv result, leftv arg)
Definition: interval.cc:257
VAR int check
Definition: libparse.cc:1106
#define NULL
Definition: omList.c:12
int status int void size_t count
Definition: si_signals.h:59