lemon/radix_heap.h
changeset 1824 3a15b39a7c78
parent 1717 75fe24093ded
child 1834 0a14e1ae45a1
equal deleted inserted replaced
1:fccc4a104d03 2:7665b8661f34
   369 
   369 
   370     /// \brief Decreases the priority of \c i to \c p.
   370     /// \brief Decreases the priority of \c i to \c p.
   371     ///
   371     ///
   372     /// This method decreases the priority of item \c i to \c p.
   372     /// This method decreases the priority of item \c i to \c p.
   373     /// \pre \c i must be stored in the heap with priority at least \c p, and
   373     /// \pre \c i must be stored in the heap with priority at least \c p, and
   374     /// \c should be greater then the last removed item's priority.
   374     /// \c should be greater or equal to the last removed item's priority.
   375     /// \param i The item.
   375     /// \param i The item.
   376     /// \param p The priority.
   376     /// \param p The priority.
   377     void decrease(const Item &i, const Prio &p) {
   377     void decrease(const Item &i, const Prio &p) {
   378       int idx = iim[i];
   378       int idx = iim[i];
   379       data[idx].prio = p;
   379       data[idx].prio = p;
   381     }
   381     }
   382 
   382 
   383     /// \brief Increases the priority of \c i to \c p.
   383     /// \brief Increases the priority of \c i to \c p.
   384     ///
   384     ///
   385     /// This method sets the priority of item \c i to \c p. 
   385     /// This method sets the priority of item \c i to \c p. 
   386     /// \pre \c i must be stored in the heap with priority at most \c
   386     /// \pre \c i must be stored in the heap with priority at most \c p
   387     /// p relative to \c Compare.
       
   388     /// \param i The item.
   387     /// \param i The item.
   389     /// \param p The priority.
   388     /// \param p The priority.
   390     void increase(const Item &i, const Prio &p) {
   389     void increase(const Item &i, const Prio &p) {
   391       int idx = iim[i];
   390       int idx = iim[i];
   392       data[idx].prio = p;
   391       data[idx].prio = p;