| 514 | |
| 515 | |
| 516 | void list::ordered_print(const term_ordering& w) const |
| 517 | { |
| 518 | |
| 519 | #ifdef DL_LIST |
| 520 | |
| 521 | element* iter=start->next; |
| 522 | |
| 523 | #endif // DL_LIST |
| 524 | |
| 525 | #ifdef SL_LIST |
| 526 | |
| 527 | element *iter=start; |
| 528 | |
| 529 | #endif // SL_LIST |
| 530 | |
| 531 | if(iter==NULL) |
| 532 | { |
| 533 | cerr<<"\nWARNING: void list::print(const term_ordering&) const:\n" |
| 534 | "cannot print corrupt list"<<endl; |
| 535 | return; |
| 536 | } |
| 537 | |
| 538 | list aux; |
| 539 | |
| 540 | while(iter->next!=NULL) |
| 541 | { |
| 542 | aux._ordered_insert(*(iter->entry),w); |
| 543 | iter=iter->next; |
| 544 | } |
| 545 | |
| 546 | aux.print(); |
| 547 | |
| 548 | // delete aux, but only the element structs, not the binomials |
| 549 | // (these are still stored in the actual list!) |
| 550 | |
| 551 | #ifdef DL_LIST |
| 552 | |
| 553 | iter=aux.start->next; |
| 554 | |
| 555 | #endif // DL_LIST |
| 556 | |
| 557 | #ifdef SL_LIST |
| 558 | |
| 559 | iter=aux.start; |
| 560 | |
| 561 | #endif |
| 562 | |
| 563 | while(iter->next!=NULL) |
| 564 | // end_dummy not reached |
| 565 | { |
| 566 | element* aux2=iter->next; |
| 567 | iter->next=iter->next->next; |
| 568 | delete aux2; |
| 569 | } |
| 570 | |
| 571 | // the dummy elements are deleted by the destructor |
| 572 | |
| 573 | } |