Bug fix in radix heap.
1.1 --- a/src/lemon/radix_heap.h Mon Mar 07 08:54:45 2005 +0000
1.2 +++ b/src/lemon/radix_heap.h Wed Mar 09 14:06:32 2005 +0000
1.3 @@ -30,7 +30,7 @@
1.4 /// \addtogroup auxdat
1.5 /// @{
1.6
1.7 - /// A Binary Heap implementation.
1.8 + /// A Radix Heap implementation.
1.9
1.10 ///\todo Please document...
1.11 ///
1.12 @@ -156,7 +156,7 @@
1.13
1.14 /// \brief Move an item up into the proper box.
1.15 void bubble_up(int index) {
1.16 - if (!lower(data[index].box, index)) return;
1.17 + if (!lower(data[index].box, data[index].prio)) return;
1.18 remove(index);
1.19 int box = findUp(data[index].box, data[index].prio);
1.20 insert(box, index);
1.21 @@ -334,16 +334,16 @@
1.22 return state_enum(s);
1.23 }
1.24
1.25 - void print() const {
1.26 - for (int i = 0; i < boxes.size(); ++i) {
1.27 - printf("(%d, %d) ", boxes[i].min, boxes[i].size);
1.28 - for (int k = boxes[i].first; k != -1; k = data[k].next) {
1.29 - printf("%d ", data[k].prio);
1.30 - }
1.31 - printf("\n");
1.32 - }
1.33 - fflush(stdout);
1.34 - }
1.35 +// void print() const {
1.36 +// for (int i = 0; i < boxes.size(); ++i) {
1.37 +// printf("(%d, %d) ", boxes[i].min, boxes[i].size);
1.38 +// for (int k = boxes[i].first; k != -1; k = data[k].next) {
1.39 +// printf("%d ", data[k].prio);
1.40 +// }
1.41 +// printf("\n");
1.42 +// }
1.43 +// fflush(stdout);
1.44 +// }
1.45
1.46 }; // class RadixHeap
1.47