COIN-OR::LEMON - Graph Library

Changeset 1717:75fe24093ded in lemon-0.x for lemon/bin_heap.h


Ignore:
Timestamp:
10/14/05 12:40:00 (14 years ago)
Author:
Balazs Dezso
Branch:
default
Phase:
public
Convert:
svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/lemon/trunk@2244
Message:

Added clear function to heaps and concept

File:
1 edited

Legend:

Unmodified
Added
Removed
  • lemon/bin_heap.h

    r1435 r1717  
    110110    bool empty() const { return data.empty(); }
    111111
     112    /// \brief Make empty this heap.
     113    ///
     114    /// Make empty this heap.
     115    void clear() {
     116      for (int i = 0; i < (int)data.size(); ++i) {
     117        iim.set(data[i].first, POST_HEAP);
     118      }
     119      data.clear();
     120    }
     121
    112122  private:
    113123    static int parent(int i) { return (i-1)/2; }
Note: See TracChangeset for help on using the changeset viewer.