1 | #include "config.h" |
---|
2 | #include <kernel/mod2.h> |
---|
3 | |
---|
4 | #ifdef HAVE_F5 |
---|
5 | #include <kernel/kutil.h> |
---|
6 | #include <kernel/structs.h> |
---|
7 | #include <omalloc/omalloc.h> |
---|
8 | #include <kernel/polys.h> |
---|
9 | #include <polys/monomials/p_polys.h> |
---|
10 | #include <kernel/ideals.h> |
---|
11 | #include <kernel/febase.h> |
---|
12 | #include <kernel/kstd1.h> |
---|
13 | #include <kernel/khstd.h> |
---|
14 | #include <polys/kbuckets.h> |
---|
15 | #include <polys/weight.h> |
---|
16 | #include <misc/intvec.h> |
---|
17 | #include <kernel/polys.h> |
---|
18 | #include <kernel/f5gb.h> |
---|
19 | #include <kernel/f5data.h> |
---|
20 | #include <kernel/f5lists.h> |
---|
21 | |
---|
22 | /** |
---|
23 | * functions working on the class PNode |
---|
24 | */ |
---|
25 | PNode::PNode(poly p, PNode* n) { |
---|
26 | data = p; |
---|
27 | next = n; |
---|
28 | } |
---|
29 | |
---|
30 | poly PNode::getPoly() { |
---|
31 | return this->data; |
---|
32 | } |
---|
33 | |
---|
34 | PNode* PNode::getNext() { |
---|
35 | return this->next; |
---|
36 | } |
---|
37 | PNode* PNode::insert(poly p) { |
---|
38 | poly q = pOne(); |
---|
39 | q = pCopy(p); |
---|
40 | PNode* temp = this; |
---|
41 | if(NULL == temp) { |
---|
42 | PNode* pn = new PNode(q,temp); |
---|
43 | return pn; |
---|
44 | } |
---|
45 | if(1 == pLmCmp(q,temp->getPoly())) { |
---|
46 | PNode* pn = new PNode(q,temp); |
---|
47 | return pn; |
---|
48 | } |
---|
49 | if(0 == pLmCmp(q,temp->getPoly())) { |
---|
50 | return this; |
---|
51 | } |
---|
52 | if(-1 == pLmCmp(q,temp->getPoly())) { |
---|
53 | while(NULL != temp->getNext() && -1 == pLmCmp(q,temp->getNext()->getPoly())) { |
---|
54 | temp = temp->getNext(); |
---|
55 | } |
---|
56 | if(NULL == temp->getNext() || 1 == pLmCmp(q,temp->getNext()->getPoly())) { |
---|
57 | PNode* pn = new PNode(q,temp->getNext()); |
---|
58 | temp->next = pn; |
---|
59 | return this; |
---|
60 | } |
---|
61 | if(0 == pLmCmp(q,temp->getNext()->getPoly())) { |
---|
62 | return this; |
---|
63 | } |
---|
64 | } |
---|
65 | } |
---|
66 | /* |
---|
67 | PNode* PNode::insert(poly p) { |
---|
68 | PNode* pn = new PNode(p,this); |
---|
69 | return pn; |
---|
70 | } |
---|
71 | */ |
---|
72 | /** |
---|
73 | * functions working on the class PList |
---|
74 | */ |
---|
75 | PList::PList() { |
---|
76 | first = NULL; |
---|
77 | } |
---|
78 | |
---|
79 | |
---|
80 | void PList::insert(poly p) { |
---|
81 | first = first->insert(p); |
---|
82 | } |
---|
83 | |
---|
84 | |
---|
85 | /* |
---|
86 | PNode* PList::insert(poly p) { |
---|
87 | PNode* temp = first; |
---|
88 | PNode* pn = new PNode(p,temp); |
---|
89 | first = pn; |
---|
90 | return first; |
---|
91 | } |
---|
92 | */ |
---|
93 | bool PList::check(poly p) { |
---|
94 | PNode* temp = first; |
---|
95 | //Print("\nCHECK: \n"); |
---|
96 | //pWrite(p); |
---|
97 | //Print("-----\n"); |
---|
98 | while(NULL != temp) { |
---|
99 | //pWrite(temp->getPoly()); |
---|
100 | //pWrite(p); |
---|
101 | //Print("COMAPRE: %d\n",pLmEqual(p,temp->getPoly())); |
---|
102 | if(1 == pLmEqual(p,temp->getPoly())) { |
---|
103 | //Print("YES!\n"); |
---|
104 | //pWrite(pHead(temp->getPoly())); |
---|
105 | //Print("YES!\n"); |
---|
106 | return 1; |
---|
107 | } |
---|
108 | temp = temp->getNext(); |
---|
109 | } |
---|
110 | //Print("NOTHING!\n"); |
---|
111 | return 0; |
---|
112 | } |
---|
113 | |
---|
114 | void PList::print() { |
---|
115 | Print("-----LIST-----\n"); |
---|
116 | PNode* temp = first; |
---|
117 | while(NULL != temp) { |
---|
118 | pWrite(temp->getPoly()); |
---|
119 | temp = temp->getNext(); |
---|
120 | } |
---|
121 | } |
---|
122 | /* |
---|
123 | ==================================== |
---|
124 | functions working on the class LNode |
---|
125 | ==================================== |
---|
126 | */ |
---|
127 | |
---|
128 | // generating new list elements (labeled / classical polynomial / LNode view) |
---|
129 | LNode::LNode() { |
---|
130 | data = NULL; |
---|
131 | next = NULL; |
---|
132 | } |
---|
133 | LNode::LNode(LPolyOld* lp) { |
---|
134 | data = lp; |
---|
135 | next = NULL; |
---|
136 | } |
---|
137 | |
---|
138 | LNode::LNode(LPolyOld* lp, LNode* l) { |
---|
139 | //Print("HIER LNODE\n"); |
---|
140 | data = lp; |
---|
141 | next = l; |
---|
142 | } |
---|
143 | |
---|
144 | LNode::LNode(poly t, int i, poly p, RuleOld* r) { |
---|
145 | LPolyOld* lp = new LPolyOld(t,i,p,r); |
---|
146 | data = lp; |
---|
147 | next = NULL; |
---|
148 | } |
---|
149 | |
---|
150 | LNode::LNode(poly t, int i, poly p, RuleOld* r, LNode* l) { |
---|
151 | LPolyOld* lp = new LPolyOld(t,i,p,r); |
---|
152 | data = lp; |
---|
153 | next = l; |
---|
154 | } |
---|
155 | |
---|
156 | LNode::LNode(LNode* ln) { |
---|
157 | data = ln->getLPolyOld(); |
---|
158 | next = ln->getNext(); |
---|
159 | } |
---|
160 | |
---|
161 | LNode::~LNode() { |
---|
162 | //delete next; |
---|
163 | //Print("DELETE LNODE\n"); |
---|
164 | delete data; |
---|
165 | } |
---|
166 | |
---|
167 | void LNode::deleteAll() { |
---|
168 | while(NULL != next) { |
---|
169 | //Print("%p\n",next); |
---|
170 | //pWrite(next->data->getPoly()); |
---|
171 | next->deleteAll(); |
---|
172 | } |
---|
173 | delete data; |
---|
174 | } |
---|
175 | |
---|
176 | // insert new elements to the list always at the end (labeled / classical polynomial view) |
---|
177 | // needed for list gPrev |
---|
178 | inline LNode* LNode::insert(LPolyOld* lp) { |
---|
179 | //Print("LAST GPREV: "); |
---|
180 | //pWrite(this->getPoly()); |
---|
181 | if(NULL == this) { |
---|
182 | LNode* newElement = new LNode(lp,this); |
---|
183 | return newElement; |
---|
184 | } |
---|
185 | else { |
---|
186 | LNode* newElement = new LNode(lp, NULL); |
---|
187 | this->next = newElement; |
---|
188 | return newElement; |
---|
189 | } |
---|
190 | } |
---|
191 | |
---|
192 | inline LNode* LNode::insert(poly t, int i, poly p, RuleOld* r) { |
---|
193 | if(NULL == this) { |
---|
194 | LNode* newElement = new LNode(t,i,p,r,this); |
---|
195 | return newElement; |
---|
196 | } |
---|
197 | else { |
---|
198 | LNode* newElement = new LNode(t, i, p, r, NULL); |
---|
199 | this->next = newElement; |
---|
200 | return newElement; |
---|
201 | } |
---|
202 | } |
---|
203 | |
---|
204 | // insert new elements to the list always in front (labeled / classical polynomial view) |
---|
205 | // needed for sPolyList |
---|
206 | inline LNode* LNode::insertSP(LPolyOld* lp) { |
---|
207 | LNode* newElement = new LNode(lp, this); |
---|
208 | //Print("INSERTED IN SPOLYLIST: "); |
---|
209 | //pWrite(lp->getTerm()); |
---|
210 | return newElement; |
---|
211 | } |
---|
212 | |
---|
213 | inline LNode* LNode::insertSP(poly t, int i, poly p, RuleOld* r) { |
---|
214 | LNode* newElement = new LNode(t, i, p, r, this); |
---|
215 | //Print("INSERTED IN SPOLYLIST: "); |
---|
216 | //pWrite(t); |
---|
217 | return newElement; |
---|
218 | } |
---|
219 | // insert new elemets to the list w.r.t. increasing labels |
---|
220 | // only used for the S-polys to be reduced (TopReduction building new S-polys with higher label) |
---|
221 | inline LNode* LNode::insertByLabel(poly t, int i, poly p, RuleOld* r) { |
---|
222 | //Print("ADDING SOLYS TO THE LIST\n"); |
---|
223 | //Print("new element: "); |
---|
224 | //pWrite(t); |
---|
225 | if(NULL == this) { // || NULL == data) { |
---|
226 | LNode* newElement = new LNode(t, i, p, r, this); |
---|
227 | return newElement; |
---|
228 | } |
---|
229 | else { |
---|
230 | //Print("tested element1: "); |
---|
231 | //pWrite(this->getTerm()); |
---|
232 | if(-1 == pLmCmp(t,this->getTerm())) { |
---|
233 | //Print("HIERDRIN\n"); |
---|
234 | LNode* newElement = new LNode(t, i, p, r, this); |
---|
235 | //Print("%p\n",this); |
---|
236 | //Print("%p\n",newElement->next); |
---|
237 | return newElement; |
---|
238 | } |
---|
239 | else { |
---|
240 | LNode* temp = this; |
---|
241 | while(NULL != temp->next && NULL != temp->next->data) { |
---|
242 | //Print("tested element: "); |
---|
243 | //pWrite(temp->getTerm()); |
---|
244 | if(-1 == pLmCmp(t,temp->next->getTerm())) { |
---|
245 | LNode* newElement = new LNode(t, i, p, r, temp->next); |
---|
246 | temp->next = newElement; |
---|
247 | return this; |
---|
248 | } |
---|
249 | else { |
---|
250 | temp = temp->next; |
---|
251 | //Print("%p\n",temp); |
---|
252 | //Print("%p\n",temp->data); |
---|
253 | |
---|
254 | //Print("%p\n",temp->next); |
---|
255 | } |
---|
256 | } |
---|
257 | //Print("HIER\n"); |
---|
258 | LNode* newElement = new LNode(t, i, p, r, temp->next); |
---|
259 | temp->next = newElement; |
---|
260 | return this; |
---|
261 | } |
---|
262 | } |
---|
263 | } |
---|
264 | |
---|
265 | inline LNode* LNode::insertFirst(LNode* l) { |
---|
266 | l->next = this; |
---|
267 | return l; |
---|
268 | } |
---|
269 | |
---|
270 | inline LNode* LNode::insertByLabel(LNode* l) { |
---|
271 | //Print("ADDING SOLYS TO THE LIST\n"); |
---|
272 | //Print("new element: "); |
---|
273 | //pWrite(t); |
---|
274 | if(NULL == this) { // || NULL == data) { |
---|
275 | l->next = this; |
---|
276 | return l; |
---|
277 | } |
---|
278 | else { |
---|
279 | //Print("tested element1: "); |
---|
280 | //pWrite(this->getTerm()); |
---|
281 | if(-1 == pLmCmp(l->getTerm(),this->getTerm())) { |
---|
282 | //Print("HIERDRIN\n"); |
---|
283 | l->next = this; |
---|
284 | //Print("%p\n",this); |
---|
285 | //Print("%p\n",newElement->next); |
---|
286 | return l; |
---|
287 | } |
---|
288 | else { |
---|
289 | LNode* temp = this; |
---|
290 | while(NULL != temp->next && NULL != temp->next->data) { |
---|
291 | //Print("tested element: "); |
---|
292 | //pWrite(temp->getTerm()); |
---|
293 | if(-1 == pLmCmp(l->getTerm(),temp->next->getTerm())) { |
---|
294 | l->next = temp->next; |
---|
295 | temp->next = l; |
---|
296 | return this; |
---|
297 | } |
---|
298 | else { |
---|
299 | temp = temp->next; |
---|
300 | //Print("%p\n",temp); |
---|
301 | //Print("%p\n",temp->data); |
---|
302 | |
---|
303 | //Print("%p\n",temp->next); |
---|
304 | } |
---|
305 | } |
---|
306 | //Print("HIER\n"); |
---|
307 | l->next = temp->next; |
---|
308 | temp->next = l; |
---|
309 | return this; |
---|
310 | } |
---|
311 | } |
---|
312 | } |
---|
313 | |
---|
314 | // deletes the first elements of the list with the same degree |
---|
315 | // only used for the S-polys, which are already sorted by increasing degree by CListOld |
---|
316 | LNode* LNode::deleteByDeg() { |
---|
317 | return this; |
---|
318 | } |
---|
319 | |
---|
320 | // get next from current LNode |
---|
321 | LNode* LNode::getNext() { |
---|
322 | return next; |
---|
323 | } |
---|
324 | |
---|
325 | // get the LPolyOld* out of LNode* |
---|
326 | LPolyOld* LNode::getLPolyOld() { |
---|
327 | return data; |
---|
328 | } |
---|
329 | |
---|
330 | // get the data from the LPolyOld saved in LNode |
---|
331 | poly LNode::getPoly() { |
---|
332 | return data->getPoly(); |
---|
333 | } |
---|
334 | |
---|
335 | poly LNode::getTerm() { |
---|
336 | return data->getTerm(); |
---|
337 | } |
---|
338 | |
---|
339 | int LNode::getIndex() { |
---|
340 | return data->getIndex(); |
---|
341 | } |
---|
342 | |
---|
343 | RuleOld* LNode::getRuleOld() { |
---|
344 | return data->getRuleOld(); |
---|
345 | } |
---|
346 | |
---|
347 | void LNode::setRuleOld(RuleOld* r) { |
---|
348 | return data->setRuleOld(r); |
---|
349 | } |
---|
350 | |
---|
351 | bool LNode::getDel() { |
---|
352 | return data->getDel(); |
---|
353 | } |
---|
354 | |
---|
355 | // set the data from the LPolyOld saved in LNode |
---|
356 | void LNode::setPoly(poly p) { |
---|
357 | data->setPoly(p); |
---|
358 | } |
---|
359 | |
---|
360 | void LNode::setTerm(poly t) { |
---|
361 | data->setTerm(t); |
---|
362 | } |
---|
363 | |
---|
364 | void LNode::setIndex(int i) { |
---|
365 | data->setIndex(i); |
---|
366 | } |
---|
367 | |
---|
368 | void LNode::setNext(LNode* l) { |
---|
369 | next = l; |
---|
370 | } |
---|
371 | |
---|
372 | void LNode::setDel(bool d) { |
---|
373 | data->setDel(d); |
---|
374 | } |
---|
375 | |
---|
376 | // test if for any list element the polynomial part of the data is equal to *p |
---|
377 | bool LNode::polyTest(poly* p) { |
---|
378 | LNode* temp = new LNode(this); |
---|
379 | while(NULL != temp) { |
---|
380 | if(pComparePolys(temp->getPoly(),*p)) { |
---|
381 | return 1; |
---|
382 | } |
---|
383 | temp = temp->next; |
---|
384 | } |
---|
385 | return 0; |
---|
386 | } |
---|
387 | |
---|
388 | LNode* LNode::getNext(LNode* l) { |
---|
389 | return l->next; |
---|
390 | } |
---|
391 | |
---|
392 | // for debugging |
---|
393 | void LNode::print() { |
---|
394 | LNode* temp = this; |
---|
395 | Print("___________________List of S-polynomials______________________:\n"); |
---|
396 | while(NULL != temp && NULL != temp->data) { |
---|
397 | Print("Index: %d\n",temp->getIndex()); |
---|
398 | Print("Term: "); |
---|
399 | pWrite(temp->getTerm()); |
---|
400 | Print("Poly: "); |
---|
401 | pWrite(temp->getPoly()); |
---|
402 | temp = temp->next; |
---|
403 | } |
---|
404 | Print("_______________________________________________________________\n"); |
---|
405 | } |
---|
406 | |
---|
407 | int LNode::count(LNode* l) { |
---|
408 | int nonDel = 0; |
---|
409 | LNode* temp = l; |
---|
410 | while(NULL != temp) { |
---|
411 | if(!temp->getDel()) { |
---|
412 | nonDel++; |
---|
413 | temp = temp->next; |
---|
414 | } |
---|
415 | else { |
---|
416 | temp = temp->next; |
---|
417 | } |
---|
418 | } |
---|
419 | return nonDel; |
---|
420 | } |
---|
421 | |
---|
422 | /* |
---|
423 | ==================================== |
---|
424 | functions working on the class LList |
---|
425 | ==================================== |
---|
426 | */ |
---|
427 | |
---|
428 | LList::LList() { |
---|
429 | first = last = NULL;; |
---|
430 | length = 0; |
---|
431 | } |
---|
432 | |
---|
433 | LList::LList(LPolyOld* lp) { |
---|
434 | first = new LNode(lp); |
---|
435 | last = first; |
---|
436 | length = 1; |
---|
437 | } |
---|
438 | |
---|
439 | LList::LList(poly t,int i,poly p,RuleOld* r) { |
---|
440 | first = new LNode(t,i,p,r); |
---|
441 | last = first; |
---|
442 | length = 1; |
---|
443 | } |
---|
444 | |
---|
445 | LList::~LList() { |
---|
446 | LNode* temp; |
---|
447 | while(first) { |
---|
448 | temp = first; |
---|
449 | first = first->getNext(); |
---|
450 | delete temp; |
---|
451 | //Print("%p\n",first); |
---|
452 | } |
---|
453 | } |
---|
454 | |
---|
455 | // insertion at the end of the list, needed for gPrev |
---|
456 | void LList::insert(LPolyOld* lp) { |
---|
457 | last = last->insert(lp); |
---|
458 | if(NULL == first) { |
---|
459 | first = last; |
---|
460 | } |
---|
461 | //Print("NEW LAST GPREV: "); |
---|
462 | //pWrite(last->getPoly()); |
---|
463 | //Print("%p\n",first); |
---|
464 | //pWrite(first->getPoly()); |
---|
465 | length++; |
---|
466 | //Print("LENGTH %d\n",length); |
---|
467 | } |
---|
468 | |
---|
469 | void LList::insert(poly t,int i, poly p, RuleOld* r) { |
---|
470 | last = last->insert(t,i,p,r); |
---|
471 | if(NULL == first) { |
---|
472 | first = last; |
---|
473 | } |
---|
474 | length++; |
---|
475 | //Print("LENGTH %d\n",length); |
---|
476 | } |
---|
477 | |
---|
478 | // insertion in front of the list, needed for sPolyList |
---|
479 | void LList::insertSP(LPolyOld* lp) { |
---|
480 | first = first->insertSP(lp); |
---|
481 | length++; |
---|
482 | //Print("LENGTH %d\n",length); |
---|
483 | } |
---|
484 | |
---|
485 | void LList::insertSP(poly t,int i, poly p, RuleOld* r) { |
---|
486 | first = first->insertSP(t,i,p,r); |
---|
487 | length++; |
---|
488 | //Print("LENGTH %d\n",length); |
---|
489 | } |
---|
490 | |
---|
491 | |
---|
492 | void LList::insertByLabel(poly t, int i, poly p, RuleOld* r) { |
---|
493 | first = first->insertByLabel(t,i,p,r); |
---|
494 | length++; |
---|
495 | //Print("LENGTH %d\n",length); |
---|
496 | } |
---|
497 | |
---|
498 | void LList::insertFirst(LNode* l) { |
---|
499 | first = first->insertFirst(l); |
---|
500 | length++; |
---|
501 | //Print("LENGTH %d\n",length); |
---|
502 | } |
---|
503 | |
---|
504 | void LList::insertByLabel(LNode* l) { |
---|
505 | first = first->insertByLabel(l); |
---|
506 | length++; |
---|
507 | //Print("LENGTH %d\n",length); |
---|
508 | } |
---|
509 | |
---|
510 | void LList::deleteByDeg() { |
---|
511 | first = first->deleteByDeg(); |
---|
512 | } |
---|
513 | |
---|
514 | bool LList::polyTest(poly* p) { |
---|
515 | return first->polyTest(p); |
---|
516 | } |
---|
517 | |
---|
518 | LNode* LList::getFirst() { |
---|
519 | return first; |
---|
520 | } |
---|
521 | |
---|
522 | LNode* LList::getLast() { |
---|
523 | return last; |
---|
524 | } |
---|
525 | |
---|
526 | int LList::getLength() { |
---|
527 | return length; |
---|
528 | } |
---|
529 | |
---|
530 | void LList::setFirst(LNode* l) { |
---|
531 | LNode* temp = first; |
---|
532 | temp->setNext(NULL); |
---|
533 | first = l; |
---|
534 | length--; |
---|
535 | } |
---|
536 | |
---|
537 | void LList::print() { |
---|
538 | first->print(); |
---|
539 | } |
---|
540 | |
---|
541 | int LList::count(LNode* l) { |
---|
542 | return first->count(l); |
---|
543 | } |
---|
544 | /* |
---|
545 | ======================================= |
---|
546 | functions working on the class LTagNode |
---|
547 | ======================================= |
---|
548 | */ |
---|
549 | LTagNode::LTagNode() { |
---|
550 | data = NULL; |
---|
551 | next = NULL; |
---|
552 | } |
---|
553 | |
---|
554 | LTagNode::LTagNode(LNode* l) { |
---|
555 | data = l; |
---|
556 | next = NULL; |
---|
557 | } |
---|
558 | |
---|
559 | LTagNode::LTagNode(LNode* l, LTagNode* n) { |
---|
560 | data = l; |
---|
561 | next = n; |
---|
562 | } |
---|
563 | |
---|
564 | LTagNode::~LTagNode() { |
---|
565 | delete data; |
---|
566 | } |
---|
567 | |
---|
568 | // declaration with first as parameter due to sorting of LTagList |
---|
569 | LTagNode* LTagNode::insert(LNode* l) { |
---|
570 | LTagNode* newElement = new LTagNode(l, this); |
---|
571 | return newElement; |
---|
572 | } |
---|
573 | |
---|
574 | LNode* LTagNode::getLNode() { |
---|
575 | return this->data; |
---|
576 | } |
---|
577 | |
---|
578 | LTagNode* LTagNode::getNext() { |
---|
579 | return next; |
---|
580 | } |
---|
581 | |
---|
582 | // NOTE: We insert at the beginning of the list and length = i-1, where i is the actual index. |
---|
583 | // Thus given actual index i and idx being the index of the LPolyOld under investigation |
---|
584 | // the element on position length-idx is the right one |
---|
585 | LNode* LTagNode::get(int idx, int length) { |
---|
586 | if(idx == 1) { |
---|
587 | return NULL; |
---|
588 | } |
---|
589 | else { |
---|
590 | int j; |
---|
591 | LTagNode* temp = this; // last |
---|
592 | for(j=1;j<=length-idx+1;j++) { |
---|
593 | temp = temp->next; |
---|
594 | } |
---|
595 | return temp->data; |
---|
596 | } |
---|
597 | } |
---|
598 | |
---|
599 | |
---|
600 | /* |
---|
601 | ======================================= |
---|
602 | functions working on the class LTagList |
---|
603 | ======================================= |
---|
604 | */ |
---|
605 | LTagList::LTagList() { |
---|
606 | LTagNode* first = new LTagNode(); |
---|
607 | |
---|
608 | length = 0; |
---|
609 | } |
---|
610 | |
---|
611 | LTagList::LTagList(LNode* l) { |
---|
612 | LTagNode* first = new LTagNode(l); |
---|
613 | length = 1; |
---|
614 | } |
---|
615 | |
---|
616 | LTagList::~LTagList() { |
---|
617 | LTagNode* temp; |
---|
618 | while(first) { |
---|
619 | temp = first; |
---|
620 | first = first->getNext(); |
---|
621 | delete temp; |
---|
622 | //Print("%p\n",first); |
---|
623 | } |
---|
624 | } |
---|
625 | |
---|
626 | // declaration with first as parameter in LTagNode due to sorting of LTagList |
---|
627 | void LTagList::insert(LNode* l) { |
---|
628 | first = first->insert(l); |
---|
629 | length++; |
---|
630 | } |
---|
631 | |
---|
632 | void LTagList::setFirstCurrentIdx(LNode* l) { |
---|
633 | firstCurrentIdx = l; |
---|
634 | } |
---|
635 | |
---|
636 | LNode* LTagList::get(int idx) { |
---|
637 | return first->get(idx, length); |
---|
638 | } |
---|
639 | |
---|
640 | LNode* LTagList::getFirst() { |
---|
641 | return first->getLNode(); |
---|
642 | } |
---|
643 | |
---|
644 | LNode* LTagList::getFirstCurrentIdx() { |
---|
645 | return firstCurrentIdx; |
---|
646 | } |
---|
647 | |
---|
648 | /* |
---|
649 | ===================================== |
---|
650 | functions working on the class TopRed |
---|
651 | ===================================== |
---|
652 | */ |
---|
653 | |
---|
654 | TopRed::TopRed() { |
---|
655 | _completed = NULL; |
---|
656 | _toDo = NULL; |
---|
657 | } |
---|
658 | |
---|
659 | TopRed::TopRed(LList* c, LList* t) { |
---|
660 | _completed = c; |
---|
661 | _toDo = t; |
---|
662 | } |
---|
663 | |
---|
664 | LList* TopRed::getCompleted() { |
---|
665 | return _completed; |
---|
666 | } |
---|
667 | |
---|
668 | LList* TopRed::getToDo() { |
---|
669 | return _toDo; |
---|
670 | } |
---|
671 | |
---|
672 | /* |
---|
673 | ==================================== |
---|
674 | functions working on the class CNode |
---|
675 | ==================================== |
---|
676 | */ |
---|
677 | |
---|
678 | CNode::CNode() { |
---|
679 | data = NULL; |
---|
680 | next = NULL; |
---|
681 | } |
---|
682 | |
---|
683 | CNode::CNode(CPairOld* c) { |
---|
684 | data = c; |
---|
685 | next = NULL; |
---|
686 | } |
---|
687 | |
---|
688 | CNode::CNode(CPairOld* c, CNode* n) { |
---|
689 | data = c; |
---|
690 | next = n; |
---|
691 | } |
---|
692 | |
---|
693 | CNode::~CNode() { |
---|
694 | delete data; |
---|
695 | } |
---|
696 | |
---|
697 | // insert sorts the critical pairs firstly by increasing total degree, secondly by increasing label |
---|
698 | // note: as all critical pairs have the same index here, the second sort is done on the terms of the labels |
---|
699 | // working only with linked, but not doubly linked lists due to memory usage we have to check the |
---|
700 | // insertion around the first element separately from the insertion around all other elements in the list |
---|
701 | CNode* CNode::insert(CPairOld* c) { |
---|
702 | if(NULL == this) { |
---|
703 | CNode* newElement = new CNode(c, this); |
---|
704 | return newElement; |
---|
705 | } |
---|
706 | else { |
---|
707 | poly u1 = ppMult_qq(c->getT1(),c->getLp1Term()); |
---|
708 | if( c->getDeg() < this->data->getDeg() ) { // lower degree than the first list element |
---|
709 | CNode* newElement = new CNode(c, this); |
---|
710 | return newElement; |
---|
711 | } |
---|
712 | if( c->getDeg() == this->data->getDeg() ) { // same degree than the first list element |
---|
713 | if(1 != pLmCmp(u1,ppMult_qq(this->data->getT1(), this->data->getLp1Term()))) { |
---|
714 | //pWrite(u1); |
---|
715 | //Print("Multi-Term in CritPairs Sortierung altes Element: "); |
---|
716 | //pWrite(ppMult_qq(this->data->getT1(),this->data->getLp1Term())); |
---|
717 | CNode* newElement = new CNode(c, this); |
---|
718 | return newElement; |
---|
719 | } |
---|
720 | else { |
---|
721 | //Print("Insert Deg\n"); |
---|
722 | CNode* temp = this; |
---|
723 | while( NULL != temp->next) { |
---|
724 | if(temp->next->data->getDeg() == c->getDeg() ) { |
---|
725 | if(1 == pLmCmp(u1,ppMult_qq(temp->next->data->getT1(),temp->next->data->getLp1Term()))) { |
---|
726 | temp = temp->next; |
---|
727 | } |
---|
728 | else { |
---|
729 | CNode* newElement = new CNode(c, temp->next); |
---|
730 | temp->next = newElement; |
---|
731 | return this; |
---|
732 | } |
---|
733 | } |
---|
734 | else { |
---|
735 | CNode* newElement = new CNode(c, temp->next); |
---|
736 | temp->next = newElement; |
---|
737 | return this; |
---|
738 | } |
---|
739 | } |
---|
740 | CNode* newElement = new CNode(c, NULL); |
---|
741 | temp->next = newElement; |
---|
742 | return this; |
---|
743 | } |
---|
744 | } // outer if-clause |
---|
745 | if( c->getDeg() > this->data->getDeg() ) { // greater degree than the first list element |
---|
746 | CNode* temp = this; |
---|
747 | while( NULL != temp->next ) { |
---|
748 | if( c->getDeg() < temp->next->data->getDeg() ) { |
---|
749 | CNode* newElement = new CNode(c, temp->next); |
---|
750 | temp->next = newElement; |
---|
751 | return this; |
---|
752 | } |
---|
753 | if( c->getDeg() == temp->next->data->getDeg() ) { |
---|
754 | if(1 != pLmCmp(u1,ppMult_qq(temp->next->data->getT1(),temp->next->data->getLp1Term()))) { |
---|
755 | CNode* newElement = new CNode(c, temp->next); |
---|
756 | temp->next = newElement; |
---|
757 | return this; |
---|
758 | } |
---|
759 | else { |
---|
760 | temp = temp->next; |
---|
761 | while( NULL != temp->next ) { |
---|
762 | if( temp->next->data->getDeg() == c->getDeg() ) { |
---|
763 | if(1 == pLmCmp(u1,ppMult_qq(temp->next->data->getT1(), |
---|
764 | temp->next->data->getLp1Term()))) { |
---|
765 | temp = temp->next; |
---|
766 | } |
---|
767 | else { |
---|
768 | CNode* newElement = new CNode(c, temp->next); |
---|
769 | temp->next = newElement; |
---|
770 | return this; |
---|
771 | } |
---|
772 | } |
---|
773 | else { |
---|
774 | CNode* newElement = new CNode(c, temp->next); |
---|
775 | temp->next = newElement; |
---|
776 | return this; |
---|
777 | } |
---|
778 | } |
---|
779 | CNode* newElement = new CNode(c, NULL); |
---|
780 | temp->next = newElement; |
---|
781 | return this; |
---|
782 | } |
---|
783 | } |
---|
784 | if( c->getDeg() > temp->next->data->getDeg() ) { |
---|
785 | temp = temp->next; |
---|
786 | } |
---|
787 | } |
---|
788 | CNode* newElement = new CNode(c, NULL); |
---|
789 | temp->next = newElement; |
---|
790 | return this; |
---|
791 | } |
---|
792 | } |
---|
793 | } |
---|
794 | |
---|
795 | |
---|
796 | CNode* CNode::insertWithoutSort(CPairOld* cp) { |
---|
797 | CNode* newElement = new CNode(cp); |
---|
798 | newElement->next = this; |
---|
799 | return newElement; |
---|
800 | } |
---|
801 | |
---|
802 | |
---|
803 | // get the first elements from CListOld which by the above sorting have minimal degree |
---|
804 | CNode* CNode::getMinDeg() { |
---|
805 | CNode* temp = this; |
---|
806 | while(NULL != temp) { |
---|
807 | while(NULL != temp->next && temp->next->data->getDeg() == this->data->getDeg()) { |
---|
808 | temp = temp->next; |
---|
809 | } |
---|
810 | CNode* returnCNode = temp->next; |
---|
811 | // every CListOld should end with a (NULL,NULL) element for a similar behaviour |
---|
812 | // using termination conditions throughout the algorithm |
---|
813 | temp->next = NULL; |
---|
814 | return returnCNode; |
---|
815 | } |
---|
816 | return NULL; |
---|
817 | } |
---|
818 | |
---|
819 | CPairOld* CNode::getData() { |
---|
820 | return data; |
---|
821 | } |
---|
822 | |
---|
823 | CNode* CNode::getNext() { |
---|
824 | return next; |
---|
825 | } |
---|
826 | |
---|
827 | LPolyOld* CNode::getAdLp1() { |
---|
828 | return this->data->getAdLp1(); |
---|
829 | } |
---|
830 | |
---|
831 | LPolyOld* CNode::getAdLp2() { |
---|
832 | return this->data->getAdLp2(); |
---|
833 | } |
---|
834 | |
---|
835 | poly CNode::getLp1Poly() { |
---|
836 | return this->data->getLp1Poly(); |
---|
837 | } |
---|
838 | |
---|
839 | poly CNode::getLp2Poly() { |
---|
840 | return this->data->getLp2Poly(); |
---|
841 | } |
---|
842 | |
---|
843 | poly CNode::getLp1Term() { |
---|
844 | return this->data->getLp1Term(); |
---|
845 | } |
---|
846 | |
---|
847 | poly CNode::getLp2Term() { |
---|
848 | return this->data->getLp2Term(); |
---|
849 | } |
---|
850 | |
---|
851 | int CNode::getLp1Index() { |
---|
852 | return this->data->getLp1Index(); |
---|
853 | } |
---|
854 | |
---|
855 | int CNode::getLp2Index() { |
---|
856 | return this->data->getLp2Index(); |
---|
857 | } |
---|
858 | |
---|
859 | poly CNode::getT1() { |
---|
860 | return this->data->getT1(); |
---|
861 | } |
---|
862 | |
---|
863 | poly* CNode::getAdT1() { |
---|
864 | return this->data->getAdT1(); |
---|
865 | } |
---|
866 | |
---|
867 | poly CNode::getT2() { |
---|
868 | return this->data->getT2(); |
---|
869 | } |
---|
870 | |
---|
871 | poly* CNode::getAdT2() { |
---|
872 | return this->data->getAdT2(); |
---|
873 | } |
---|
874 | |
---|
875 | bool CNode::getDel() { |
---|
876 | return data->getDel(); |
---|
877 | } |
---|
878 | |
---|
879 | RuleOld* CNode::getTestedRuleOld() { |
---|
880 | return this->data->getTestedRuleOld(); |
---|
881 | } |
---|
882 | |
---|
883 | // for debugging |
---|
884 | void CNode::print() { |
---|
885 | CNode* temp = this; |
---|
886 | Print("___________________List of critical pairs______________________:\n"); |
---|
887 | while(NULL != temp) { |
---|
888 | pWrite(ppMult_qq(temp->getT1(),temp->getLp1Term())); |
---|
889 | Print("LP1 Index: %d\n",temp->getLp1Index()); |
---|
890 | Print("T1: "); |
---|
891 | pWrite(temp->getT1()); |
---|
892 | Print("%p\n",temp->getT1()); |
---|
893 | Print("LP1 Term: "); |
---|
894 | pWrite(temp->getLp1Term()); |
---|
895 | Print("LP1 Poly: "); |
---|
896 | pWrite(temp->getLp1Poly()); |
---|
897 | Print("LP2 Index: %d\n",temp->getLp2Index()); |
---|
898 | Print("T2: "); |
---|
899 | pWrite(temp->getT2()); |
---|
900 | Print("%p\n",temp->getT2()); |
---|
901 | Print("LP2 Term: "); |
---|
902 | pWrite(temp->getLp2Term()); |
---|
903 | Print("LP2 Poly: "); |
---|
904 | pWrite(temp->getLp2Poly()); |
---|
905 | Print("\n"); |
---|
906 | temp = temp->next; |
---|
907 | } |
---|
908 | } |
---|
909 | |
---|
910 | /* |
---|
911 | ==================================== |
---|
912 | functions working on the class CListOld |
---|
913 | ==================================== |
---|
914 | */ |
---|
915 | // for initialization of CListOlds, last element alwas has data=NULL and next=NULL |
---|
916 | CListOld::CListOld() { |
---|
917 | first = NULL; |
---|
918 | } |
---|
919 | |
---|
920 | CListOld::CListOld(CPairOld* c) { |
---|
921 | first = new CNode(c); |
---|
922 | } |
---|
923 | |
---|
924 | CListOld::~CListOld() { |
---|
925 | CNode* temp; |
---|
926 | while(NULL != first) { |
---|
927 | temp = first; |
---|
928 | first = first->getNext(); |
---|
929 | delete temp; |
---|
930 | } |
---|
931 | } |
---|
932 | |
---|
933 | // insert sorts the critical pairs firstly by increasing total degree, secondly by increasing label |
---|
934 | // note: as all critical pairs have the same index here, the second sort is done on the terms of the labels |
---|
935 | void CListOld::insert(CPairOld* c) { |
---|
936 | first = first->insert(c); |
---|
937 | } |
---|
938 | |
---|
939 | void CListOld::insertWithoutSort(CPairOld* c) { |
---|
940 | first = first->insertWithoutSort(c); |
---|
941 | } |
---|
942 | |
---|
943 | CNode* CListOld::getFirst() { |
---|
944 | return first; |
---|
945 | } |
---|
946 | |
---|
947 | // get the first elements from CListOld which by the above sorting have minimal degree |
---|
948 | // returns the pointer on the first element of those |
---|
949 | CNode* CListOld::getMinDeg() { |
---|
950 | CNode* temp = first; |
---|
951 | first = first->getMinDeg(); |
---|
952 | return temp; |
---|
953 | } |
---|
954 | |
---|
955 | void CListOld::print() { |
---|
956 | first->print(); |
---|
957 | } |
---|
958 | |
---|
959 | /* |
---|
960 | ==================================== |
---|
961 | functions working on the class RNode |
---|
962 | ==================================== |
---|
963 | */ |
---|
964 | RNode::RNode() { |
---|
965 | //Print("HIER RNODE CONSTRUCTOR\n"); |
---|
966 | data = NULL; |
---|
967 | next = NULL; |
---|
968 | } |
---|
969 | |
---|
970 | RNode::RNode(RuleOld* r) { |
---|
971 | data = r; |
---|
972 | next = NULL; |
---|
973 | } |
---|
974 | |
---|
975 | RNode::~RNode() { |
---|
976 | //Print("DELETE RuleOld\n"); |
---|
977 | delete data; |
---|
978 | } |
---|
979 | |
---|
980 | RNode* RNode::insert(RuleOld* r) { |
---|
981 | RNode* newElement = new RNode(r); |
---|
982 | newElement->next = this; |
---|
983 | return newElement; |
---|
984 | } |
---|
985 | |
---|
986 | RNode* RNode::insert(int i, poly t) { |
---|
987 | //Print("IN INSERT: "); |
---|
988 | //pWrite(t); |
---|
989 | RuleOld* r = new RuleOld(i,t); |
---|
990 | //Print("ADDRESS OF RuleOld: %p\n",r); |
---|
991 | RNode* newElement = new RNode(r); |
---|
992 | //Print("ADDRESS OF RNODE: %p\n",newElement); |
---|
993 | //Print("ADDRESS OF RNODE DATA: %p\n",newElement->getRuleOld()); |
---|
994 | newElement->next = this; |
---|
995 | return newElement; |
---|
996 | } |
---|
997 | |
---|
998 | |
---|
999 | RNode* RNode::insertOrdered(RuleOld* r) { |
---|
1000 | RNode* newElement = new RNode(r); |
---|
1001 | RNode* temp = this; |
---|
1002 | if(NULL == temp) { |
---|
1003 | newElement->next = temp; |
---|
1004 | return newElement; |
---|
1005 | } |
---|
1006 | if(1 == pLmCmp(newElement->getRuleOldTerm(),temp->getRuleOldTerm())) { |
---|
1007 | newElement->next = temp; |
---|
1008 | return newElement; |
---|
1009 | } |
---|
1010 | else { |
---|
1011 | while(NULL != temp && 1 == pLmCmp(temp->getRuleOldTerm(),newElement->getRuleOldTerm())) { |
---|
1012 | temp = temp->getNext(); |
---|
1013 | } |
---|
1014 | newElement->next = temp; |
---|
1015 | return this; |
---|
1016 | } |
---|
1017 | } |
---|
1018 | |
---|
1019 | |
---|
1020 | RNode* RNode::getNext() { |
---|
1021 | return next; |
---|
1022 | } |
---|
1023 | |
---|
1024 | RuleOld* RNode::getRuleOld() { |
---|
1025 | return data; |
---|
1026 | } |
---|
1027 | |
---|
1028 | int RNode::getRuleOldIndex() { |
---|
1029 | return data->getIndex(); |
---|
1030 | } |
---|
1031 | |
---|
1032 | poly RNode::getRuleOldTerm() { |
---|
1033 | return data->getTerm(); |
---|
1034 | } |
---|
1035 | |
---|
1036 | void RNode::print() { |
---|
1037 | RNode* temp = this; |
---|
1038 | while(NULL != temp) { |
---|
1039 | pWrite(temp->getRuleOldTerm()); |
---|
1040 | Print("%d\n\n",temp->getRuleOldIndex()); |
---|
1041 | temp = temp->getNext(); |
---|
1042 | } |
---|
1043 | } |
---|
1044 | |
---|
1045 | /* |
---|
1046 | ==================================== |
---|
1047 | functions working on the class RList |
---|
1048 | ==================================== |
---|
1049 | */ |
---|
1050 | RList::RList() { |
---|
1051 | first = NULL; |
---|
1052 | } |
---|
1053 | |
---|
1054 | RList::RList(RuleOld* r) { |
---|
1055 | first = new RNode(r); |
---|
1056 | } |
---|
1057 | |
---|
1058 | RList::~RList() { |
---|
1059 | RNode* temp; |
---|
1060 | //Print("%p\n",first); |
---|
1061 | while(first) { |
---|
1062 | temp = first; |
---|
1063 | first = first->getNext(); |
---|
1064 | //Print("1 %p\n",first); |
---|
1065 | //if(first) { |
---|
1066 | //Print("1' %p\n",first->getRuleOld()); |
---|
1067 | //Print("2 %p\n",first->getNext()); |
---|
1068 | //Print("3 %p\n",first->getNext()->getRuleOld()); |
---|
1069 | //Print("3 %p\n",first->getNext()->getRuleOldTerm()); |
---|
1070 | //} |
---|
1071 | delete temp; |
---|
1072 | } |
---|
1073 | //Print("FERTIG\n"); |
---|
1074 | } |
---|
1075 | |
---|
1076 | void RList::insert(int i, poly t) { |
---|
1077 | first = first->insert(i,t); |
---|
1078 | } |
---|
1079 | |
---|
1080 | void RList::insert(RuleOld* r) { |
---|
1081 | first = first->insert(r); |
---|
1082 | } |
---|
1083 | |
---|
1084 | void RList::insertOrdered(RuleOld* r) { |
---|
1085 | first = first->insertOrdered(r); |
---|
1086 | } |
---|
1087 | |
---|
1088 | RNode* RList::getFirst() { |
---|
1089 | return first; |
---|
1090 | } |
---|
1091 | |
---|
1092 | RuleOld* RList::getRuleOld() { |
---|
1093 | return this->getRuleOld(); |
---|
1094 | } |
---|
1095 | |
---|
1096 | void RList::print() { |
---|
1097 | first->print(); |
---|
1098 | } |
---|
1099 | |
---|
1100 | /* |
---|
1101 | ======================================= |
---|
1102 | functions working on the class RTagNode |
---|
1103 | ======================================= |
---|
1104 | */ |
---|
1105 | |
---|
1106 | RTagNode::RTagNode() { |
---|
1107 | data = NULL; |
---|
1108 | next = NULL; |
---|
1109 | } |
---|
1110 | |
---|
1111 | RTagNode::RTagNode(RNode* r) { |
---|
1112 | data = r; |
---|
1113 | next = NULL; |
---|
1114 | } |
---|
1115 | |
---|
1116 | RTagNode::RTagNode(RNode* r, RTagNode* n) { |
---|
1117 | |
---|
1118 | data = r; |
---|
1119 | next = n; |
---|
1120 | } |
---|
1121 | |
---|
1122 | RTagNode::~RTagNode() { |
---|
1123 | delete data; |
---|
1124 | } |
---|
1125 | |
---|
1126 | // declaration with first as parameter due to sorting of RTagList |
---|
1127 | RTagNode* RTagNode::insert(RNode* r) { |
---|
1128 | //Print("Hier1\n"); |
---|
1129 | RTagNode* newElement = new RTagNode(r, this); |
---|
1130 | //Print("Hier2\n"); |
---|
1131 | return newElement; |
---|
1132 | } |
---|
1133 | |
---|
1134 | RNode* RTagNode::getRNode() { |
---|
1135 | //Print("%p\n", this); |
---|
1136 | //Print("%p\n",this->data); |
---|
1137 | return this->data; |
---|
1138 | } |
---|
1139 | |
---|
1140 | RTagNode* RTagNode::getNext() { |
---|
1141 | return next; |
---|
1142 | } |
---|
1143 | |
---|
1144 | // NOTE: We insert at the beginning of the list and length = i-1, where i is the actual index. |
---|
1145 | // Thus given actual index i and idx being the index of the LPolyOld under investigation |
---|
1146 | // the element on position length-idx+1 is the right one |
---|
1147 | RNode* RTagNode::get(int idx, int length) { |
---|
1148 | if(idx==1 || idx==0) { |
---|
1149 | // NOTE: We set this NULL as putting it the last element in the list, i.e. the element having |
---|
1150 | // RNode* = NULL would cost lots of iterations at each step of F5inc, with increasing |
---|
1151 | // length of the list this should be prevented |
---|
1152 | return NULL; |
---|
1153 | } |
---|
1154 | else { |
---|
1155 | int j; |
---|
1156 | RTagNode* temp = this; |
---|
1157 | //Print("\n\nHIER IN GET IDX\n"); |
---|
1158 | //Print("FOR LOOP: %d\n",length-idx+1); |
---|
1159 | for(j=1; j<=length-idx+1; j++) { |
---|
1160 | temp = temp->next; |
---|
1161 | } |
---|
1162 | return temp->data; |
---|
1163 | } |
---|
1164 | } |
---|
1165 | |
---|
1166 | void RTagNode::set(RNode* r) { |
---|
1167 | this->data = r; |
---|
1168 | } |
---|
1169 | |
---|
1170 | |
---|
1171 | void RTagNode::print() { |
---|
1172 | RTagNode* temp = this; |
---|
1173 | if(NULL != temp && NULL != temp->getRNode()) { |
---|
1174 | Print("1. element: %d, ",getRNode()->getRuleOld()->getIndex()); |
---|
1175 | pWrite(getRNode()->getRuleOld()->getTerm()); |
---|
1176 | temp = temp->next; |
---|
1177 | int i = 2; |
---|
1178 | while(NULL != temp->getRNode() && NULL != temp) { |
---|
1179 | Print("%d. element: %d, ",i,getRNode()->getRuleOld()->getIndex()); |
---|
1180 | pWrite(getRNode()->getRuleOld()->getTerm()); |
---|
1181 | temp = temp->next; |
---|
1182 | i++; |
---|
1183 | } |
---|
1184 | } |
---|
1185 | } |
---|
1186 | |
---|
1187 | /* |
---|
1188 | ======================================= |
---|
1189 | functions working on the class LTagList |
---|
1190 | ======================================= |
---|
1191 | */ |
---|
1192 | |
---|
1193 | RTagList::RTagList() { |
---|
1194 | RTagNode* first = new RTagNode(); |
---|
1195 | length = 0; |
---|
1196 | } |
---|
1197 | |
---|
1198 | RTagList::RTagList(RNode* r) { |
---|
1199 | RTagNode* first = new RTagNode(r); |
---|
1200 | length = 1; |
---|
1201 | } |
---|
1202 | |
---|
1203 | RTagList::~RTagList() { |
---|
1204 | RTagNode* temp; |
---|
1205 | while(first) { |
---|
1206 | temp = first; |
---|
1207 | first = first->getNext(); |
---|
1208 | delete temp; |
---|
1209 | } |
---|
1210 | } |
---|
1211 | |
---|
1212 | // declaration with first as parameter in LTagNode due to sorting of LTagList |
---|
1213 | void RTagList::insert(RNode* r) { |
---|
1214 | first = first->insert(r); |
---|
1215 | //Print("LENGTH:%d\n",length); |
---|
1216 | length = length +1; |
---|
1217 | //Print("LENGTH:%d\n",length); |
---|
1218 | } |
---|
1219 | |
---|
1220 | RNode* RTagList::getFirst() { |
---|
1221 | return first->getRNode(); |
---|
1222 | } |
---|
1223 | |
---|
1224 | RNode* RTagList::get(int idx) { |
---|
1225 | return first->get(idx, length); |
---|
1226 | } |
---|
1227 | |
---|
1228 | void RTagList::setFirst(RNode* r) { |
---|
1229 | first->set(r); |
---|
1230 | } |
---|
1231 | |
---|
1232 | void RTagList::print() { |
---|
1233 | first->print(); |
---|
1234 | } |
---|
1235 | |
---|
1236 | int RTagList::getLength() { |
---|
1237 | return length; |
---|
1238 | } |
---|
1239 | #endif |
---|