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