lemon/bits/graph_extender.h
changeset 143 c3b45bb643b0
parent 107 31a2e6d28f61
child 209 765619b7cbb2
equal deleted inserted replaced
3:278139cc0e09 4:00ef713fdf0c
   365     Edge fromId(int id, Edge) const {
   365     Edge fromId(int id, Edge) const {
   366       return Parent::edgeFromId(id);
   366       return Parent::edgeFromId(id);
   367     }
   367     }
   368 
   368 
   369     Node oppositeNode(const Node &n, const Edge &e) const {
   369     Node oppositeNode(const Node &n, const Edge &e) const {
   370       if( n == Parent::source(e))
   370       if( n == Parent::u(e))
   371 	return Parent::target(e);
   371 	return Parent::v(e);
   372       else if( n == Parent::target(e))
   372       else if( n == Parent::v(e))
   373 	return Parent::source(e);
   373 	return Parent::u(e);
   374       else
   374       else
   375 	return INVALID;
   375 	return INVALID;
   376     }
   376     }
   377 
   377 
   378     Arc oppositeArc(const Arc &arc) const {
   378     Arc oppositeArc(const Arc &arc) const {
   379       return Parent::direct(arc, !Parent::direction(arc));
   379       return Parent::direct(arc, !Parent::direction(arc));
   380     }
   380     }
   381 
   381 
   382     using Parent::direct;
   382     using Parent::direct;
   383     Arc direct(const Edge &edge, const Node &node) const {
   383     Arc direct(const Edge &edge, const Node &node) const {
   384       return Parent::direct(edge, Parent::source(edge) == node);
   384       return Parent::direct(edge, Parent::u(edge) == node);
   385     }
   385     }
   386 
   386 
   387     // Alterable extension
   387     // Alterable extension
   388 
   388 
   389     typedef AlterationNotifier<GraphExtender, Node> NodeNotifier;
   389     typedef AlterationNotifier<GraphExtender, Node> NodeNotifier;
   584 
   584 
   585     /// Base node of the iterator
   585     /// Base node of the iterator
   586     ///
   586     ///
   587     /// Returns the base node of the iterator
   587     /// Returns the base node of the iterator
   588     Node baseNode(const IncEdgeIt &edge) const {
   588     Node baseNode(const IncEdgeIt &edge) const {
   589       return edge._direction ? source(edge) : target(edge);
   589       return edge._direction ? u(edge) : v(edge);
   590     }
   590     }
   591     /// Running node of the iterator
   591     /// Running node of the iterator
   592     ///
   592     ///
   593     /// Returns the running node of the iterator
   593     /// Returns the running node of the iterator
   594     Node runningNode(const IncEdgeIt &edge) const {
   594     Node runningNode(const IncEdgeIt &edge) const {
   595       return edge._direction ? target(edge) : source(edge);
   595       return edge._direction ? v(edge) : u(edge);
   596     }
   596     }
   597 
   597 
   598     // Mappable extension
   598     // Mappable extension
   599 
   599 
   600     template <typename _Value>
   600     template <typename _Value>