diff -r b5eba564bb60 -r f393a8162688 lemon/bucket_heap.h --- a/lemon/bucket_heap.h Thu Dec 20 15:21:22 2007 +0000 +++ b/lemon/bucket_heap.h Thu Dec 27 13:40:16 2007 +0000 @@ -49,9 +49,13 @@ class BucketHeap { public: + /// \e typedef typename _ItemIntMap::Key Item; + /// \e typedef int Prio; + /// \e typedef std::pair Pair; + /// \e typedef _ItemIntMap ItemIntMap; /// \brief Type to represent the items states. @@ -62,7 +66,7 @@ /// /// The ItemIntMap \e should be initialized in such way that it maps /// PRE_HEAP (-1) to any element to be put in the heap... - enum state_enum { + enum State { IN_HEAP = 0, PRE_HEAP = -1, POST_HEAP = -2 @@ -278,10 +282,10 @@ /// otherwise. In the latter case it is possible that \c item will /// get back to the heap again. /// \param i The item. - state_enum state(const Item &i) const { + State state(const Item &i) const { int idx = index[i]; if (idx >= 0) idx = 0; - return state_enum(idx); + return State(idx); } /// \brief Sets the state of the \c item in the heap. @@ -291,7 +295,7 @@ /// better time complexity. /// \param i The item. /// \param st The state. It should not be \c IN_HEAP. - void state(const Item& i, state_enum st) { + void state(const Item& i, State st) { switch (st) { case POST_HEAP: case PRE_HEAP: @@ -334,7 +338,7 @@ typedef std::pair Pair; typedef _ItemIntMap ItemIntMap; - enum state_enum { + enum State { IN_HEAP = 0, PRE_HEAP = -1, POST_HEAP = -2 @@ -472,13 +476,13 @@ lace(idx); } - state_enum state(const Item &i) const { + State state(const Item &i) const { int idx = index[i]; if (idx >= 0) idx = 0; - return state_enum(idx); + return State(idx); } - void state(const Item& i, state_enum st) { + void state(const Item& i, State st) { switch (st) { case POST_HEAP: case PRE_HEAP: @@ -546,7 +550,7 @@ /// /// The ItemIntMap \e should be initialized in such way that it maps /// PRE_HEAP (-1) to any element to be put in the heap... - enum state_enum { + enum State { IN_HEAP = 0, PRE_HEAP = -1, POST_HEAP = -2 @@ -683,10 +687,10 @@ /// otherwise. In the latter case it is possible that \c item will /// get back to the heap again. /// \param i The item. - state_enum state(const Item &i) const { + State state(const Item &i) const { int idx = index[i]; if (idx >= 0) idx = 0; - return state_enum(idx); + return State(idx); } private: @@ -716,7 +720,7 @@ typedef std::pair Pair; typedef _ItemIntMap ItemIntMap; - enum state_enum { + enum State { IN_HEAP = 0, PRE_HEAP = -1, POST_HEAP = -2 @@ -798,10 +802,10 @@ return -1; } - state_enum state(const Item &i) const { + State state(const Item &i) const { int idx = index[i]; if (idx >= 0) idx = 0; - return state_enum(idx); + return State(idx); } private: