COIN-OR::LEMON - Graph Library

Changeset 2547:f393a8162688 in lemon-0.x for lemon/bucket_heap.h


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

Renaming state_enum to State
Removing "Type" suffix from typedefs
Moving implementation into the class definition

File:
1 edited

Legend:

Unmodified
Added
Removed
  • lemon/bucket_heap.h

    r2391 r2547  
    5050
    5151  public:
     52    /// \e
    5253    typedef typename _ItemIntMap::Key Item;
     54    /// \e
    5355    typedef int Prio;
     56    /// \e
    5457    typedef std::pair<Item, Prio> Pair;
     58    /// \e
    5559    typedef _ItemIntMap ItemIntMap;
    5660
     
    6367    /// The ItemIntMap \e should be initialized in such way that it maps
    6468    /// PRE_HEAP (-1) to any element to be put in the heap...
    65     enum state_enum {
     69    enum State {
    6670      IN_HEAP = 0,
    6771      PRE_HEAP = -1,
     
    279283    /// get back to the heap again.
    280284    /// \param i The item.
    281     state_enum state(const Item &i) const {
     285    State state(const Item &i) const {
    282286      int idx = index[i];
    283287      if (idx >= 0) idx = 0;
    284       return state_enum(idx);
     288      return State(idx);
    285289    }
    286290
     
    292296    /// \param i The item.
    293297    /// \param st The state. It should not be \c IN_HEAP.
    294     void state(const Item& i, state_enum st) {
     298    void state(const Item& i, State st) {
    295299      switch (st) {
    296300      case POST_HEAP:
     
    335339    typedef _ItemIntMap ItemIntMap;
    336340
    337     enum state_enum {
     341    enum State {
    338342      IN_HEAP = 0,
    339343      PRE_HEAP = -1,
     
    473477    }
    474478
    475     state_enum state(const Item &i) const {
     479    State state(const Item &i) const {
    476480      int idx = index[i];
    477481      if (idx >= 0) idx = 0;
    478       return state_enum(idx);
    479     }
    480 
    481     void state(const Item& i, state_enum st) {
     482      return State(idx);
     483    }
     484
     485    void state(const Item& i, State st) {
    482486      switch (st) {
    483487      case POST_HEAP:
     
    547551    /// The ItemIntMap \e should be initialized in such way that it maps
    548552    /// PRE_HEAP (-1) to any element to be put in the heap...
    549     enum state_enum {
     553    enum State {
    550554      IN_HEAP = 0,
    551555      PRE_HEAP = -1,
     
    684688    /// get back to the heap again.
    685689    /// \param i The item.
    686     state_enum state(const Item &i) const {
     690    State state(const Item &i) const {
    687691      int idx = index[i];
    688692      if (idx >= 0) idx = 0;
    689       return state_enum(idx);
     693      return State(idx);
    690694    }
    691695
     
    717721    typedef _ItemIntMap ItemIntMap;
    718722
    719     enum state_enum {
     723    enum State {
    720724      IN_HEAP = 0,
    721725      PRE_HEAP = -1,
     
    799803    }
    800804
    801     state_enum state(const Item &i) const {
     805    State state(const Item &i) const {
    802806      int idx = index[i];
    803807      if (idx >= 0) idx = 0;
    804       return state_enum(idx);
     808      return State(idx);
    805809    }
    806810
Note: See TracChangeset for help on using the changeset viewer.