COIN-OR::LEMON - Graph Library

Changeset 2263:9273fe7d850c in lemon-0.x for lemon/fib_heap.h


Ignore:
Timestamp:
10/26/06 16:20:17 (18 years ago)
Author:
mqrelly
Branch:
default
Phase:
public
Convert:
svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/lemon/trunk@3021
Message:

Bug #46 fixed: Superfluous template parameter in Heap concept
NOTE: Not every affected file tested.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • lemon/fib_heap.h

    r2050 r2263  
    4444  ///\e binary \e heap.
    4545  ///
    46   ///\param Item Type of the items to be stored. 
    4746  ///\param Prio Type of the priority of the items.
    4847  ///\param ItemIntMap A read and writable Item int map, used internally
     
    5655 
    5756#ifdef DOXYGEN
    58   template <typename Item,
    59             typename Prio,
     57  template <typename Prio,
    6058            typename ItemIntMap,
    6159            typename Compare>
    6260#else
    63   template <typename Item,
    64             typename Prio,
     61  template <typename Prio,
    6562            typename ItemIntMap,
    6663            typename Compare = std::less<Prio> >
    6764#endif
    6865  class FibHeap {
    69   public:     
     66  public:
     67    typedef typename ItemIntMap::Key Item;
    7068    typedef Prio PrioType;
    7169   
     
    272270    // **********************************************************************
    273271   
    274   template <typename Item, typename Prio, typename ItemIntMap,
    275     typename Compare>
    276   void FibHeap<Item, Prio, ItemIntMap, Compare>::set
     272  template <typename Prio, typename ItemIntMap,
     273    typename Compare>
     274  void FibHeap<Prio, ItemIntMap, Compare>::set
    277275  (Item const item, PrioType const value)
    278276  {
     
    284282  }
    285283   
    286   template <typename Item, typename Prio, typename ItemIntMap,
    287     typename Compare>
    288   void FibHeap<Item, Prio, ItemIntMap, Compare>::push
     284  template <typename Prio, typename ItemIntMap,
     285    typename Compare>
     286  void FibHeap<Prio, ItemIntMap, Compare>::push
    289287  (Item const item, PrioType const value) {
    290288      int i=iimap[item];     
     
    317315    }
    318316   
    319   template <typename Item, typename Prio, typename ItemIntMap,
    320     typename Compare>
    321   void FibHeap<Item, Prio, ItemIntMap, Compare>::pop() {
     317  template <typename Prio, typename ItemIntMap,
     318    typename Compare>
     319  void FibHeap<Prio, ItemIntMap, Compare>::pop() {
    322320      /*The first case is that there are only one root.*/
    323321      if ( container[minimum].left_neighbor==minimum ) {
     
    351349
    352350
    353   template <typename Item, typename Prio, typename ItemIntMap,
    354     typename Compare>
    355   void FibHeap<Item, Prio, ItemIntMap, Compare>::erase
     351  template <typename Prio, typename ItemIntMap,
     352    typename Compare>
     353  void FibHeap<Prio, ItemIntMap, Compare>::erase
    356354  (const Item& item) {
    357355      int i=iimap[item];
     
    368366  }
    369367   
    370   template <typename Item, typename Prio, typename ItemIntMap,
    371     typename Compare>
    372   void FibHeap<Item, Prio, ItemIntMap, Compare>::decrease
     368  template <typename Prio, typename ItemIntMap,
     369    typename Compare>
     370  void FibHeap<Prio, ItemIntMap, Compare>::decrease
    373371  (Item item, PrioType const value) {
    374372      int i=iimap[item];
     
    384382 
    385383
    386   template <typename Item, typename Prio, typename ItemIntMap,
    387     typename Compare>
    388   void FibHeap<Item, Prio, ItemIntMap, Compare>::balance() {     
     384  template <typename Prio, typename ItemIntMap,
     385    typename Compare>
     386  void FibHeap<Prio, ItemIntMap, Compare>::balance() {     
    389387
    390388    int maxdeg=int( std::floor( 2.08*log(double(container.size()))))+1;
     
    429427    }
    430428
    431   template <typename Item, typename Prio, typename ItemIntMap,
    432     typename Compare>
    433   void FibHeap<Item, Prio, ItemIntMap, Compare>::makeroot
     429  template <typename Prio, typename ItemIntMap,
     430    typename Compare>
     431  void FibHeap<Prio, ItemIntMap, Compare>::makeroot
    434432  (int c) {
    435433      int s=c;
     
    441439 
    442440 
    443   template <typename Item, typename Prio, typename ItemIntMap,
    444     typename Compare>
    445   void FibHeap<Item, Prio, ItemIntMap, Compare>::cut
     441  template <typename Prio, typename ItemIntMap,
     442    typename Compare>
     443  void FibHeap<Prio, ItemIntMap, Compare>::cut
    446444  (int a, int b) {   
    447445    /*
     
    470468 
    471469
    472   template <typename Item, typename Prio, typename ItemIntMap,
    473     typename Compare>
    474   void FibHeap<Item, Prio, ItemIntMap, Compare>::cascade
     470  template <typename Prio, typename ItemIntMap,
     471    typename Compare>
     472  void FibHeap<Prio, ItemIntMap, Compare>::cascade
    475473  (int a)
    476474    {
     
    487485
    488486
    489   template <typename Item, typename Prio, typename ItemIntMap,
    490     typename Compare>
    491   void FibHeap<Item, Prio, ItemIntMap, Compare>::fuse
     487  template <typename Prio, typename ItemIntMap,
     488    typename Compare>
     489  void FibHeap<Prio, ItemIntMap, Compare>::fuse
    492490  (int a, int b) {
    493491      unlace(b);
     
    518516   *It is invoked only if a has siblings.
    519517   */
    520   template <typename Item, typename Prio, typename ItemIntMap,
    521     typename Compare>
    522   void FibHeap<Item, Prio, ItemIntMap, Compare>::unlace
     518  template <typename Prio, typename ItemIntMap,
     519    typename Compare>
     520  void FibHeap<Prio, ItemIntMap, Compare>::unlace
    523521  (int a) {     
    524522      int leftn=container[a].left_neighbor;
Note: See TracChangeset for help on using the changeset viewer.