Fixes in the heap concept to avoid warnings (#180)
authorPeter Kovacs <kpeter@inf.elte.hu>
Fri, 13 Nov 2009 00:15:50 +0100
changeset 817b87f0504cdbe
parent 816 277ef0218f0c
child 818 bc75ee2ad082
Fixes in the heap concept to avoid warnings (#180)
lemon/concepts/heap.h
     1.1 --- a/lemon/concepts/heap.h	Fri Nov 13 00:11:11 2009 +0100
     1.2 +++ b/lemon/concepts/heap.h	Fri Nov 13 00:15:50 2009 +0100
     1.3 @@ -88,7 +88,11 @@
     1.4        /// \c Item. It is used internally by the heap implementations to
     1.5        /// handle the cross references. The assigned value must be
     1.6        /// \c PRE_HEAP (<tt>-1</tt>) for each item.
     1.7 +#ifdef DOXYGEN
     1.8        explicit Heap(ItemIntMap &map) {}
     1.9 +#else
    1.10 +      explicit Heap(ItemIntMap&) {}
    1.11 +#endif      
    1.12  
    1.13        /// \brief Constructor.
    1.14        ///
    1.15 @@ -98,7 +102,11 @@
    1.16        /// handle the cross references. The assigned value must be
    1.17        /// \c PRE_HEAP (<tt>-1</tt>) for each item.
    1.18        /// \param comp The function object used for comparing the priorities.
    1.19 +#ifdef DOXYGEN
    1.20        explicit Heap(ItemIntMap &map, const CMP &comp) {}
    1.21 +#else
    1.22 +      explicit Heap(ItemIntMap&, const CMP&) {}
    1.23 +#endif      
    1.24  
    1.25        /// \brief The number of items stored in the heap.
    1.26        ///
    1.27 @@ -126,19 +134,23 @@
    1.28        /// \param i The item to insert.
    1.29        /// \param p The priority of the item.
    1.30        /// \pre \e i must not be stored in the heap.
    1.31 +#ifdef DOXYGEN
    1.32        void push(const Item &i, const Prio &p) {}
    1.33 +#else
    1.34 +      void push(const Item&, const Prio&) {}
    1.35 +#endif      
    1.36  
    1.37        /// \brief Return the item having minimum priority.
    1.38        ///
    1.39        /// This function returns the item having minimum priority.
    1.40        /// \pre The heap must be non-empty.
    1.41 -      Item top() const {}
    1.42 +      Item top() const { return Item(); }
    1.43  
    1.44        /// \brief The minimum priority.
    1.45        ///
    1.46        /// This function returns the minimum priority.
    1.47        /// \pre The heap must be non-empty.
    1.48 -      Prio prio() const {}
    1.49 +      Prio prio() const { return Prio(); }
    1.50  
    1.51        /// \brief Remove the item having minimum priority.
    1.52        ///
    1.53 @@ -152,14 +164,22 @@
    1.54        /// already stored.
    1.55        /// \param i The item to delete.
    1.56        /// \pre \e i must be in the heap.
    1.57 +#ifdef DOXYGEN
    1.58        void erase(const Item &i) {}
    1.59 +#else
    1.60 +      void erase(const Item&) {}
    1.61 +#endif      
    1.62  
    1.63        /// \brief The priority of the given item.
    1.64        ///
    1.65        /// This function returns the priority of the given item.
    1.66        /// \param i The item.
    1.67        /// \pre \e i must be in the heap.
    1.68 +#ifdef DOXYGEN
    1.69        Prio operator[](const Item &i) const {}
    1.70 +#else
    1.71 +      Prio operator[](const Item&) const { return Prio(); }
    1.72 +#endif      
    1.73  
    1.74        /// \brief Set the priority of an item or insert it, if it is
    1.75        /// not stored in the heap.
    1.76 @@ -170,7 +190,11 @@
    1.77        ///
    1.78        /// \param i The item.
    1.79        /// \param p The priority.
    1.80 +#ifdef DOXYGEN
    1.81        void set(const Item &i, const Prio &p) {}
    1.82 +#else
    1.83 +      void set(const Item&, const Prio&) {}
    1.84 +#endif      
    1.85  
    1.86        /// \brief Decrease the priority of an item to the given value.
    1.87        ///
    1.88 @@ -178,7 +202,11 @@
    1.89        /// \param i The item.
    1.90        /// \param p The priority.
    1.91        /// \pre \e i must be stored in the heap with priority at least \e p.
    1.92 +#ifdef DOXYGEN
    1.93        void decrease(const Item &i, const Prio &p) {}
    1.94 +#else
    1.95 +      void decrease(const Item&, const Prio&) {}
    1.96 +#endif      
    1.97  
    1.98        /// \brief Increase the priority of an item to the given value.
    1.99        ///
   1.100 @@ -186,7 +214,11 @@
   1.101        /// \param i The item.
   1.102        /// \param p The priority.
   1.103        /// \pre \e i must be stored in the heap with priority at most \e p.
   1.104 +#ifdef DOXYGEN
   1.105        void increase(const Item &i, const Prio &p) {}
   1.106 +#else
   1.107 +      void increase(const Item&, const Prio&) {}
   1.108 +#endif      
   1.109  
   1.110        /// \brief Return the state of an item.
   1.111        ///
   1.112 @@ -196,7 +228,11 @@
   1.113        /// In the latter case it is possible that the item will get back
   1.114        /// to the heap again.
   1.115        /// \param i The item.
   1.116 +#ifdef DOXYGEN
   1.117        State state(const Item &i) const {}
   1.118 +#else
   1.119 +      State state(const Item&) const { return PRE_HEAP; }
   1.120 +#endif      
   1.121  
   1.122        /// \brief Set the state of an item in the heap.
   1.123        ///
   1.124 @@ -205,7 +241,11 @@
   1.125        /// to achive better time complexity.
   1.126        /// \param i The item.
   1.127        /// \param st The state. It should not be \c IN_HEAP.
   1.128 +#ifdef DOXYGEN
   1.129        void state(const Item& i, State st) {}
   1.130 +#else
   1.131 +      void state(const Item&, State) {}
   1.132 +#endif      
   1.133  
   1.134  
   1.135        template <typename _Heap>