COIN-OR::LEMON - Graph Library

Ignore:
Timestamp:
11/28/04 17:30:10 (16 years ago)
Author:
Mihaly Barasz
Branch:
default
Phase:
public
Convert:
svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/lemon/trunk@1412
Message:

UndirGraph? implementation nearly complete

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/lemon/erasable_graph_extender.h

    r980 r1022  
    4444  };
    4545
     46  template <typename _Base>
     47  class ErasableUndirGraphExtender : public _Base {
     48  public:
     49
     50    typedef ErasableUndirGraphExtender Graph;
     51    typedef _Base Parent;
     52
     53    typedef typename Parent::Node Node;
     54    typedef typename Parent::UndirEdge UndirEdge;
     55    typedef typename Parent::Edge Edge;
     56
     57    void erase(const Node& node) {
     58      Edge edge;
     59      Parent::firstOut(edge, node);
     60      while (edge != INVALID ) {
     61        erase(edge);
     62        Parent::firstOut(edge, node);
     63      }
     64
     65      Parent::getObserverRegistry(Node()).erase(node);
     66      Parent::erase(node);
     67    }
     68   
     69    void erase(const UndirEdge& uedge) {
     70      Parent::getObserverRegistry(Edge()).erase(Edge(uedge,true));
     71      Parent::getObserverRegistry(Edge()).erase(Edge(uedge,false));
     72      Parent::getObserverRegistry(UndirEdge()).erase(uedge);
     73      Parent::erase(uedge);
     74    }
     75
     76  };
     77
    4678}
    4779
Note: See TracChangeset for help on using the changeset viewer.