lemon/radix_heap.h
changeset 2386 81b47fc5c444
parent 2263 9273fe7d850c
child 2391 14a343be7a5a
     1.1 --- a/lemon/radix_heap.h	Fri Mar 02 17:56:22 2007 +0000
     1.2 +++ b/lemon/radix_heap.h	Fri Mar 02 18:04:28 2007 +0000
     1.3 @@ -150,12 +150,12 @@
     1.4  
     1.5    private:
     1.6  
     1.7 -    bool upper(int box, Prio prio) {
     1.8 -      return prio < boxes[box].min;
     1.9 +    bool upper(int box, Prio pr) {
    1.10 +      return pr < boxes[box].min;
    1.11      }
    1.12  
    1.13 -    bool lower(int box, Prio prio) {
    1.14 -      return prio >= boxes[box].min + boxes[box].size;
    1.15 +    bool lower(int box, Prio pr) {
    1.16 +      return pr >= boxes[box].min + boxes[box].size;
    1.17      }
    1.18  
    1.19      /// \brief Remove item from the box list.
    1.20 @@ -187,8 +187,8 @@
    1.21      /// \brief Add a new box to the box list.
    1.22      void extend() {
    1.23        int min = boxes.back().min + boxes.back().size;
    1.24 -      int size = 2 * boxes.back().size;
    1.25 -      boxes.push_back(RadixBox(min, size));
    1.26 +      int bs = 2 * boxes.back().size;
    1.27 +      boxes.push_back(RadixBox(min, bs));
    1.28      }
    1.29  
    1.30      /// \brief Move an item up into the proper box.
    1.31 @@ -200,9 +200,9 @@
    1.32      }
    1.33  
    1.34      /// \brief Find up the proper box for the item with the given prio.
    1.35 -    int findUp(int start, int prio) {
    1.36 -      while (lower(start, prio)) {
    1.37 -	if (++start == (int)boxes.size()) {
    1.38 +    int findUp(int start, int pr) {
    1.39 +      while (lower(start, pr)) {
    1.40 +	if (++start == int(boxes.size())) {
    1.41  	  extend();
    1.42  	}
    1.43        }
    1.44 @@ -218,8 +218,8 @@
    1.45      }
    1.46  
    1.47      /// \brief Find up the proper box for the item with the given prio.
    1.48 -    int findDown(int start, int prio) {
    1.49 -      while (upper(start, prio)) {
    1.50 +    int findDown(int start, int pr) {
    1.51 +      while (upper(start, pr)) {
    1.52  	if (--start < 0) throw UnderFlowPriorityError();
    1.53        }
    1.54        return start;
    1.55 @@ -260,7 +260,7 @@
    1.56      }
    1.57  
    1.58      void relocate_last(int index) {
    1.59 -      if (index != (int)data.size() - 1) {
    1.60 +      if (index != int(data.size()) - 1) {
    1.61  	data[index] = data.back();
    1.62  	if (data[index].prev != -1) {
    1.63  	  data[data[index].prev].next = index;