Changeset d51339 in git for kernel/f5lists.cc
- Timestamp:
- Feb 18, 2009, 9:43:05 PM (14 years ago)
- Branches:
- (u'jengelh-datetime', 'ceac47cbc86fe4a15902392bdbb9bd2ae0ea02c6')(u'spielwiese', 'f875bbaccd0831e36aaed09ff6adeb3eb45aeb94')
- Children:
- eab144e3329d02244a62975d1bb6e77d4754f131
- Parents:
- 93a7f7b1c20c3c886dd4dff521c518039f3824e7
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/f5lists.cc
r93a7f7 rd51339 70 70 } 71 71 72 // insert new elements to the list always in front (labeled / classical polynomial view) 72 // insert new elements to the list always at the end (labeled / classical polynomial view) 73 // needed for list gPrev 73 74 LNode* LNode::insert(LPoly* lp) { 74 Print("HIER\n"); 75 LNode* newElement = new LNode(lp, this); 75 Print("INSERTION: \n"); 76 Print("LAST GPREV: "); 77 pWrite(this->getPoly()); 78 LNode* newElement = new LNode(lp, NULL); 79 this->next = newElement; 76 80 return newElement; 77 81 } 78 82 79 83 LNode* LNode::insert(poly t, int i, poly p, Rule* r) { 80 LNode* newElement = new LNode(t, i, p, r, NULL, this); 84 LNode* newElement = new LNode(t, i, p, r, NULL, NULL); 85 this->next = newElement; 81 86 return newElement; 82 87 } 83 88 84 LNode* LNode::append(poly t, int i, poly p, Rule* r) { 85 LNode* newElement = new LNode(t,i,p,r,NULL); 86 this->next = newElement; 87 } 88 89 // insert new elements to the list always in front (labeled / classical polynomial view) 90 // needed for sPolyList 91 LNode* LNode::insertSP(LPoly* lp) { 92 LNode* newElement = new LNode(lp, this); 93 return newElement; 94 } 95 96 LNode* LNode::insertSP(poly t, int i, poly p, Rule* r) { 97 LNode* newElement = new LNode(t, i, p, r, NULL, this); 98 return newElement; 99 } 89 100 // insert new elemets to the list w.r.t. increasing labels 90 101 // only used for the S-polys to be reduced (TopReduction building new S-polys with higher label) … … 122 133 return next; 123 134 } 124 135 125 136 // get the LPoly* out of LNode* 126 137 LPoly* LNode::getLPoly() { … … 182 193 } 183 194 195 // for debugging 196 void LNode::print() { 197 LNode* temp = this; 198 Print("___________________List of S-polynomials______________________:\n"); 199 while(NULL != temp->data) { 200 Print("Index: %d\n",temp->getIndex()); 201 Print("Term: "); 202 pWrite(temp->getTerm()); 203 Print("Poly: "); 204 pWrite(temp->getPoly()); 205 Print("\n"); 206 temp = temp->next; 207 } 208 } 209 210 184 211 /* 185 212 ==================================== … … 210 237 } 211 238 212 // insertion in front of the list239 // insertion at the end of the list, needed for gPrev 213 240 void LList::insert(LPoly* lp) { 214 first = first->insert(lp); 241 last = last->insert(lp); 242 Print("NEW LAST GPREV: "); 243 pWrite(last->getPoly()); 215 244 length++; 245 Print("LENGTH %d\n",length); 216 246 } 217 247 218 248 void LList::insert(poly t,int i, poly p, Rule* r) { 219 first = first->insert(t,i,p,r);249 last = last->insert(t,i,p,r); 220 250 length++; 221 } 222 223 void LList::append(poly t, int i, poly p, Rule* r) { 224 last = last->append(t,i,p,r); 251 Print("LENGTH %d\n",length); 252 } 253 254 // insertion in front of the list, needed for sPolyList 255 void LList::insertSP(LPoly* lp) { 256 first = first->insertSP(lp); 225 257 length++; 226 } 258 Print("LENGTH %d\n",length); 259 } 260 261 void LList::insertSP(poly t,int i, poly p, Rule* r) { 262 first = first->insertSP(t,i,p,r); 263 length++; 264 Print("LENGTH %d\n",length); 265 } 266 227 267 228 268 void LList::insertByLabel(poly t, int i, poly p, Rule* r) { 229 269 first = first->insertByLabel(t,i,p,r); 230 270 length++; 271 Print("LENGTH %d\n",length); 231 272 } 232 273 … … 234 275 first = first->insertByLabel(l->getTerm(),l->getIndex(),l->getPoly(),l->getRule()); 235 276 length++; 277 Print("LENGTH %d\n",length); 236 278 } 237 279 … … 252 294 } 253 295 254 LNode* LList::getNext(LNode* l) {255 return l->getNext();256 }257 258 296 int LList::getLength() { 259 297 return length; … … 261 299 262 300 void LList::setFirst(LNode* l) { 263 LNode* temp = first;264 301 first = l; 265 delete(temp);266 302 length--; 267 303 } 268 304 269 305 void LList::print() { 306 first->print(); 307 } 270 308 271 309 /* … … 302 340 LNode* LTagNode::getLNode() { 303 341 return this->data; 342 } 343 344 LTagNode* LTagNode::getNext() { 345 return next; 304 346 } 305 347 … … 329 371 LTagList::LTagList() { 330 372 LTagNode* first = new LTagNode(); 373 331 374 length = 0; 332 375 } … … 343 386 } 344 387 388 void LTagList::setFirstCurrentIdx(LNode* l) { 389 firstCurrentIdx = l; 390 } 391 345 392 LNode* LTagList::get(int idx) { 346 393 return first->get(idx, length); … … 351 398 } 352 399 400 LNode* LTagList::getFirstCurrentIdx() { 401 return firstCurrentIdx; 402 } 353 403 354 404 /* … … 579 629 void CNode::print() { 580 630 CNode* temp = this; 581 Print(" List of critical pairs:\n");631 Print("___________________List of critical pairs______________________:\n"); 582 632 while(NULL != temp->data) { 583 Print(" Index: %d\n",temp->getLp1Index());633 Print("LP1 Index: %d\n",temp->getLp1Index()); 584 634 Print("T1: "); 585 635 pWrite(temp->getT1()); 586 Print("L p1 Term: ");636 Print("LP1 Term: "); 587 637 pWrite(temp->getLp1Term()); 588 Print("%d\n",temp->getLp2Index()); 638 Print("LP1 Poly: "); 639 pWrite(temp->getLp1Poly()); 640 Print("LP2 Index: %d\n",temp->getLp2Index()); 641 Print("T2: "); 589 642 pWrite(temp->getT2()); 643 Print("LP2 Term: "); 590 644 pWrite(temp->getLp2Term()); 645 Print("LP2 Poly: "); 646 pWrite(temp->getLp2Poly()); 591 647 Print("\n"); 592 648 temp = temp->next; 593 649 } 650 } 651 652 void CNode::setLastRuleTested(Rule* r) { 653 data->setLastRuleTested(r); 594 654 } 595 655
Note: See TracChangeset
for help on using the changeset viewer.