insert new elements to the list w.r.t. increasing labels only used for the S-polys to be reduced (TopReduction building new S-polys with higher label)
| 219 | // insert new elements 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; |
no test coverage detected