Changeset 1999:2ff283124dfc in lemon-0.x for lemon/graph_utils.h
- Timestamp:
- 03/06/06 11:28:37 (18 years ago)
- Branch:
- default
- Phase:
- public
- Convert:
- svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/lemon/trunk@2609
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
lemon/graph_utils.h
r1993 r1999 1190 1190 Map::build(); 1191 1191 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)) { 1194 1194 Map::set(it, invMap.size()); 1195 1195 invMap.push_back(it); … … 1498 1498 template <typename _Graph> 1499 1499 class InDegMap 1500 : protected AlterationNotifier<typename _Graph::Edge>::ObserverBase { 1500 : protected ItemSetTraits<_Graph, typename _Graph::Edge> 1501 ::ItemNotifier::ObserverBase { 1501 1502 1502 1503 public: … … 1505 1506 typedef int Value; 1506 1507 typedef typename Graph::Node Key; 1508 1509 typedef typename ItemSetTraits<_Graph, typename _Graph::Edge> 1510 ::ItemNotifier::ObserverBase Parent; 1507 1511 1508 1512 private: … … 1534 1538 /// Constructor for creating in-degree map. 1535 1539 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())); 1538 1541 1539 1542 for(typename _Graph::NodeIt it(graph); it != INVALID; ++it) { 1540 1543 deg[it] = countInEdges(graph, it); 1541 1544 } 1542 }1543 1544 virtual ~InDegMap() {1545 AlterationNotifier<typename _Graph::Edge>::1546 ObserverBase::detach();1547 1545 } 1548 1546 … … 1612 1610 template <typename _Graph> 1613 1611 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; 1617 1619 1618 1620 typedef _Graph Graph; … … 1647 1649 /// Constructor for creating out-degree map. 1648 1650 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())); 1651 1652 1652 1653 for(typename _Graph::NodeIt it(graph); it != INVALID; ++it) { … … 1655 1656 } 1656 1657 1657 virtual ~OutDegMap() {1658 AlterationNotifier<typename _Graph::Edge>::1659 ObserverBase::detach();1660 }1661 1662 1658 /// Gives back the out-degree of a Node. 1663 1659 int operator[](const Key& key) const {
Note: See TracChangeset
for help on using the changeset viewer.