Changeset a9c298 in git for kernel/f5lists.cc
- Timestamp:
- Nov 20, 2013, 4:54:25 PM (9 years ago)
- Branches:
- (u'jengelh-datetime', 'ceac47cbc86fe4a15902392bdbb9bd2ae0ea02c6')(u'spielwiese', 'a800fe4b3e9d37a38c5a10cc0ae9dfa0c15a4ee6')
- Children:
- 0de0509972719531e2a4b51ec9fd0e44a66fd2fd
- Parents:
- e4014563a82388c4b39dfa37db24cbe159b24a35
- git-author:
- Hans Schoenemann <hannes@mathematik.uni-kl.de>2013-11-20 16:54:25+01:00
- git-committer:
- Hans Schoenemann <hannes@mathematik.uni-kl.de>2013-11-20 16:54:42+01:00
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/f5lists.cc
re40145 ra9c298 39 39 PNode* PNode::insert(poly p) { 40 40 poly q = pOne(); 41 q = pCopy(p); 41 q = pCopy(p); 42 42 PNode* temp = this; 43 43 if(NULL == temp) { … … 83 83 first = first->insert(p); 84 84 } 85 85 86 86 87 87 /* … … 137 137 next = NULL; 138 138 } 139 139 140 140 LNode::LNode(LPolyOld* lp, LNode* l) { 141 141 //Print("HIER LNODE\n"); … … 149 149 next = NULL; 150 150 } 151 151 152 152 LNode::LNode(poly t, int i, poly p, RuleOld* r, LNode* l) { 153 153 LPolyOld* lp = new LPolyOld(t,i,p,r); … … 160 160 next = ln->getNext(); 161 161 } 162 162 163 163 LNode::~LNode() { 164 164 //delete next; 165 165 //Print("DELETE LNODE\n"); 166 delete data; 166 delete data; 167 167 } 168 168 … … 191 191 } 192 192 } 193 193 194 194 inline LNode* LNode::insert(poly t, int i, poly p, RuleOld* r) { 195 195 if(NULL == this) { … … 212 212 return newElement; 213 213 } 214 214 215 215 inline LNode* LNode::insertSP(poly t, int i, poly p, RuleOld* r) { 216 216 LNode* newElement = new LNode(t, i, p, r, this); … … 253 253 //Print("%p\n",temp); 254 254 //Print("%p\n",temp->data); 255 255 256 256 //Print("%p\n",temp->next); 257 257 } … … 302 302 //Print("%p\n",temp); 303 303 //Print("%p\n",temp->data); 304 304 305 305 //Print("%p\n",temp->next); 306 306 } … … 443 443 last = first; 444 444 length = 1; 445 } 445 } 446 446 447 447 LList::~LList() { … … 558 558 next = NULL; 559 559 } 560 560 561 561 LTagNode::LTagNode(LNode* l, LTagNode* n) { 562 562 data = l; … … 565 565 566 566 LTagNode::~LTagNode() { 567 delete data; 568 } 569 567 delete data; 568 } 569 570 570 // declaration with first as parameter due to sorting of LTagList 571 571 LTagNode* LTagNode::insert(LNode* l) { … … 607 607 LTagList::LTagList() { 608 608 LTagNode* first = new LTagNode(); 609 609 610 610 length = 0; 611 611 } … … 679 679 680 680 CNode::CNode() { 681 data = NULL; 682 next = NULL; 681 data = NULL; 682 next = NULL; 683 683 } 684 684 685 685 CNode::CNode(CPairOld* c) { 686 data = c; 687 next = NULL; 686 data = c; 687 next = NULL; 688 688 } 689 689 690 690 CNode::CNode(CPairOld* c, CNode* n) { 691 data = c; 692 next = n; 691 data = c; 692 next = n; 693 693 } 694 694 … … 699 699 // insert sorts the critical pairs firstly by increasing total degree, secondly by increasing label 700 700 // note: as all critical pairs have the same index here, the second sort is done on the terms of the labels 701 // working only with linked, but not doubly linked lists due to memory usage we have to check the 701 // working only with linked, but not doubly linked lists due to memory usage we have to check the 702 702 // insertion around the first element separately from the insertion around all other elements in the list 703 703 CNode* CNode::insert(CPairOld* c) { … … 724 724 CNode* temp = this; 725 725 while( NULL != temp->next) { 726 if(temp->next->data->getDeg() == c->getDeg() ) { 726 if(temp->next->data->getDeg() == c->getDeg() ) { 727 727 if(1 == pLmCmp(u1,ppMult_qq(temp->next->data->getT1(),temp->next->data->getLp1Term()))) { 728 728 temp = temp->next; … … 732 732 temp->next = newElement; 733 733 return this; 734 } 734 } 735 735 } 736 736 else { … … 747 747 if( c->getDeg() > this->data->getDeg() ) { // greater degree than the first list element 748 748 CNode* temp = this; 749 while( NULL != temp->next ) { 749 while( NULL != temp->next ) { 750 750 if( c->getDeg() < temp->next->data->getDeg() ) { 751 751 CNode* newElement = new CNode(c, temp->next); … … 754 754 } 755 755 if( c->getDeg() == temp->next->data->getDeg() ) { 756 if(1 != pLmCmp(u1,ppMult_qq(temp->next->data->getT1(),temp->next->data->getLp1Term()))) { 756 if(1 != pLmCmp(u1,ppMult_qq(temp->next->data->getT1(),temp->next->data->getLp1Term()))) { 757 757 CNode* newElement = new CNode(c, temp->next); 758 758 temp->next = newElement; … … 762 762 temp = temp->next; 763 763 while( NULL != temp->next ) { 764 if( temp->next->data->getDeg() == c->getDeg() ) { 764 if( temp->next->data->getDeg() == c->getDeg() ) { 765 765 if(1 == pLmCmp(u1,ppMult_qq(temp->next->data->getT1(), 766 766 temp->next->data->getLp1Term()))) { … … 771 771 temp->next = newElement; 772 772 return this; 773 } 773 } 774 774 } 775 775 else { … … 810 810 temp = temp->next; 811 811 } 812 CNode* returnCNode = temp->next; 813 // every CListOld should end with a (NULL,NULL) element for a similar behaviour 812 CNode* returnCNode = temp->next; 813 // every CListOld should end with a (NULL,NULL) element for a similar behaviour 814 814 // using termination conditions throughout the algorithm 815 815 temp->next = NULL; … … 1000 1000 1001 1001 RNode* RNode::insertOrdered(RuleOld* r) { 1002 RNode* newElement = new RNode(r); 1002 RNode* newElement = new RNode(r); 1003 1003 RNode* temp = this; 1004 1004 if(NULL == temp) { … … 1022 1022 RNode* RNode::getNext() { 1023 1023 return next; 1024 } 1024 } 1025 1025 1026 1026 RuleOld* RNode::getRuleOld() { … … 1074 1074 } 1075 1075 //Print("FERTIG\n"); 1076 } 1076 } 1077 1077 1078 1078 void RList::insert(int i, poly t) { … … 1110 1110 next = NULL; 1111 1111 } 1112 1112 1113 1113 RTagNode::RTagNode(RNode* r) { 1114 1114 data = r; 1115 1115 next = NULL; 1116 1116 } 1117 1117 1118 1118 RTagNode::RTagNode(RNode* r, RTagNode* n) { 1119 1119 1120 1120 data = r; 1121 1121 next = n; … … 1123 1123 1124 1124 RTagNode::~RTagNode() { 1125 delete data; 1126 } 1127 1125 delete data; 1126 } 1127 1128 1128 // declaration with first as parameter due to sorting of RTagList 1129 1129 RTagNode* RTagNode::insert(RNode* r) { … … 1156 1156 else { 1157 1157 int j; 1158 RTagNode* temp = this; 1158 RTagNode* temp = this; 1159 1159 //Print("\n\nHIER IN GET IDX\n"); 1160 //Print("FOR LOOP: %d\n",length-idx+1); 1160 //Print("FOR LOOP: %d\n",length-idx+1); 1161 1161 for(j=1; j<=length-idx+1; j++) { 1162 1162 temp = temp->next;
Note: See TracChangeset
for help on using the changeset viewer.