COIN-OR::LEMON - Graph Library

Changeset 817:b87f0504cdbe in lemon-1.2


Ignore:
Timestamp:
11/13/09 00:15:50 (14 years ago)
Author:
Peter Kovacs <kpeter@…>
Branch:
default
Phase:
public
Rebase:
64356634363065373633646430373664383966376636656530633434643434663265633032346639
Message:

Fixes in the heap concept to avoid warnings (#180)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • lemon/concepts/heap.h

    r710 r817  
    8989      /// handle the cross references. The assigned value must be
    9090      /// \c PRE_HEAP (<tt>-1</tt>) for each item.
     91#ifdef DOXYGEN
    9192      explicit Heap(ItemIntMap &map) {}
     93#else
     94      explicit Heap(ItemIntMap&) {}
     95#endif     
    9296
    9397      /// \brief Constructor.
     
    99103      /// \c PRE_HEAP (<tt>-1</tt>) for each item.
    100104      /// \param comp The function object used for comparing the priorities.
     105#ifdef DOXYGEN
    101106      explicit Heap(ItemIntMap &map, const CMP &comp) {}
     107#else
     108      explicit Heap(ItemIntMap&, const CMP&) {}
     109#endif     
    102110
    103111      /// \brief The number of items stored in the heap.
     
    127135      /// \param p The priority of the item.
    128136      /// \pre \e i must not be stored in the heap.
     137#ifdef DOXYGEN
    129138      void push(const Item &i, const Prio &p) {}
     139#else
     140      void push(const Item&, const Prio&) {}
     141#endif     
    130142
    131143      /// \brief Return the item having minimum priority.
     
    133145      /// This function returns the item having minimum priority.
    134146      /// \pre The heap must be non-empty.
    135       Item top() const {}
     147      Item top() const { return Item(); }
    136148
    137149      /// \brief The minimum priority.
     
    139151      /// This function returns the minimum priority.
    140152      /// \pre The heap must be non-empty.
    141       Prio prio() const {}
     153      Prio prio() const { return Prio(); }
    142154
    143155      /// \brief Remove the item having minimum priority.
     
    153165      /// \param i The item to delete.
    154166      /// \pre \e i must be in the heap.
     167#ifdef DOXYGEN
    155168      void erase(const Item &i) {}
     169#else
     170      void erase(const Item&) {}
     171#endif     
    156172
    157173      /// \brief The priority of the given item.
     
    160176      /// \param i The item.
    161177      /// \pre \e i must be in the heap.
     178#ifdef DOXYGEN
    162179      Prio operator[](const Item &i) const {}
     180#else
     181      Prio operator[](const Item&) const { return Prio(); }
     182#endif     
    163183
    164184      /// \brief Set the priority of an item or insert it, if it is
     
    171191      /// \param i The item.
    172192      /// \param p The priority.
     193#ifdef DOXYGEN
    173194      void set(const Item &i, const Prio &p) {}
     195#else
     196      void set(const Item&, const Prio&) {}
     197#endif     
    174198
    175199      /// \brief Decrease the priority of an item to the given value.
     
    179203      /// \param p The priority.
    180204      /// \pre \e i must be stored in the heap with priority at least \e p.
     205#ifdef DOXYGEN
    181206      void decrease(const Item &i, const Prio &p) {}
     207#else
     208      void decrease(const Item&, const Prio&) {}
     209#endif     
    182210
    183211      /// \brief Increase the priority of an item to the given value.
     
    187215      /// \param p The priority.
    188216      /// \pre \e i must be stored in the heap with priority at most \e p.
     217#ifdef DOXYGEN
    189218      void increase(const Item &i, const Prio &p) {}
     219#else
     220      void increase(const Item&, const Prio&) {}
     221#endif     
    190222
    191223      /// \brief Return the state of an item.
     
    197229      /// to the heap again.
    198230      /// \param i The item.
     231#ifdef DOXYGEN
    199232      State state(const Item &i) const {}
     233#else
     234      State state(const Item&) const { return PRE_HEAP; }
     235#endif     
    200236
    201237      /// \brief Set the state of an item in the heap.
     
    206242      /// \param i The item.
    207243      /// \param st The state. It should not be \c IN_HEAP.
     244#ifdef DOXYGEN
    208245      void state(const Item& i, State st) {}
     246#else
     247      void state(const Item&, State) {}
     248#endif     
    209249
    210250
Note: See TracChangeset for help on using the changeset viewer.