diff -r b9a7f4115abe -r 9273fe7d850c lemon/fib_heap.h --- a/lemon/fib_heap.h Thu Oct 26 13:35:35 2006 +0000 +++ b/lemon/fib_heap.h Thu Oct 26 14:20:17 2006 +0000 @@ -43,7 +43,6 @@ ///heap. In case of many calls to these operations, it is better to use a ///\e binary \e heap. /// - ///\param Item Type of the items to be stored. ///\param Prio Type of the priority of the items. ///\param ItemIntMap A read and writable Item int map, used internally ///to handle the cross references. @@ -55,18 +54,17 @@ ///\author Jacint Szabo #ifdef DOXYGEN - template #else - template > #endif class FibHeap { - public: + public: + typedef typename ItemIntMap::Key Item; typedef Prio PrioType; private: @@ -271,9 +269,9 @@ // IMPLEMENTATIONS // ********************************************************************** - template - void FibHeap::set + void FibHeap::set (Item const item, PrioType const value) { int i=iimap[item]; @@ -283,9 +281,9 @@ } else push(item, value); } - template - void FibHeap::push + void FibHeap::push (Item const item, PrioType const value) { int i=iimap[item]; if ( i < 0 ) { @@ -316,9 +314,9 @@ ++num_items; } - template - void FibHeap::pop() { + void FibHeap::pop() { /*The first case is that there are only one root.*/ if ( container[minimum].left_neighbor==minimum ) { container[minimum].in=false; @@ -350,9 +348,9 @@ } - template - void FibHeap::erase + void FibHeap::erase (const Item& item) { int i=iimap[item]; @@ -367,9 +365,9 @@ } } - template - void FibHeap::decrease + void FibHeap::decrease (Item item, PrioType const value) { int i=iimap[item]; container[i].prio=value; @@ -383,9 +381,9 @@ } - template - void FibHeap::balance() { + void FibHeap::balance() { int maxdeg=int( std::floor( 2.08*log(double(container.size()))))+1; @@ -428,9 +426,9 @@ } while ( s != m ); } - template - void FibHeap::makeroot + void FibHeap::makeroot (int c) { int s=c; do { @@ -440,9 +438,9 @@ } - template - void FibHeap::cut + void FibHeap::cut (int a, int b) { /* *Replacing a from the children of b. @@ -469,9 +467,9 @@ } - template - void FibHeap::cascade + void FibHeap::cascade (int a) { if ( container[a].parent!=-1 ) { @@ -486,9 +484,9 @@ } - template - void FibHeap::fuse + void FibHeap::fuse (int a, int b) { unlace(b); @@ -517,9 +515,9 @@ /* *It is invoked only if a has siblings. */ - template - void FibHeap::unlace + void FibHeap::unlace (int a) { int leftn=container[a].left_neighbor; int rightn=container[a].right_neighbor;