COIN-OR::LEMON - Graph Library

Changeset 1999:2ff283124dfc in lemon-0.x for lemon/graph_utils.h


Ignore:
Timestamp:
03/06/06 11:28:37 (18 years ago)
Author:
Balazs Dezso
Branch:
default
Phase:
public
Convert:
svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/lemon/trunk@2609
Message:

Clarifing alteration observing system
It is directly connected now to a container

File:
1 edited

Legend:

Unmodified
Added
Removed
  • lemon/graph_utils.h

    r1993 r1999  
    11901190      Map::build();
    11911191      Item it;
    1192       const typename Map::Graph* graph = Map::getGraph();
    1193       for (graph->first(it); it != INVALID; graph->next(it)) {
     1192      const typename Map::Notifier* notifier = Map::getNotifier();
     1193      for (notifier->first(it); it != INVALID; notifier->next(it)) {
    11941194        Map::set(it, invMap.size());
    11951195        invMap.push_back(it);   
     
    14981498  template <typename _Graph>
    14991499  class InDegMap 
    1500     : protected AlterationNotifier<typename _Graph::Edge>::ObserverBase {
     1500    : protected ItemSetTraits<_Graph, typename _Graph::Edge>
     1501      ::ItemNotifier::ObserverBase {
    15011502
    15021503  public:
     
    15051506    typedef int Value;
    15061507    typedef typename Graph::Node Key;
     1508
     1509    typedef typename ItemSetTraits<_Graph, typename _Graph::Edge>
     1510    ::ItemNotifier::ObserverBase Parent;
    15071511
    15081512  private:
     
    15341538    /// Constructor for creating in-degree map.
    15351539    InDegMap(const Graph& _graph) : graph(_graph), deg(_graph) {
    1536       AlterationNotifier<typename _Graph::Edge>
    1537         ::ObserverBase::attach(graph.getNotifier(typename _Graph::Edge()));
     1540      Parent::attach(graph.getNotifier(typename _Graph::Edge()));
    15381541     
    15391542      for(typename _Graph::NodeIt it(graph); it != INVALID; ++it) {
    15401543        deg[it] = countInEdges(graph, it);
    15411544      }
    1542     }
    1543 
    1544     virtual ~InDegMap() {
    1545       AlterationNotifier<typename _Graph::Edge>::
    1546         ObserverBase::detach();
    15471545    }
    15481546   
     
    16121610  template <typename _Graph>
    16131611  class OutDegMap 
    1614     : protected AlterationNotifier<typename _Graph::Edge>::ObserverBase {
    1615 
    1616   public:
     1612    : protected ItemSetTraits<_Graph, typename _Graph::Edge>
     1613      ::ItemNotifier::ObserverBase {
     1614
     1615  public:
     1616
     1617    typedef typename ItemSetTraits<_Graph, typename _Graph::Edge>
     1618    ::ItemNotifier::ObserverBase Parent;
    16171619   
    16181620    typedef _Graph Graph;
     
    16471649    /// Constructor for creating out-degree map.
    16481650    OutDegMap(const Graph& _graph) : graph(_graph), deg(_graph) {
    1649       AlterationNotifier<typename _Graph::Edge>
    1650         ::ObserverBase::attach(graph.getNotifier(typename _Graph::Edge()));
     1651      Parent::attach(graph.getNotifier(typename _Graph::Edge()));
    16511652     
    16521653      for(typename _Graph::NodeIt it(graph); it != INVALID; ++it) {
     
    16551656    }
    16561657
    1657     virtual ~OutDegMap() {
    1658       AlterationNotifier<typename _Graph::Edge>::
    1659         ObserverBase::detach();
    1660     }
    1661    
    16621658    /// Gives back the out-degree of a Node.
    16631659    int operator[](const Key& key) const {
Note: See TracChangeset for help on using the changeset viewer.