839 |
839 |
840 static Edge fromId(int id, Edge) { |
840 static Edge fromId(int id, Edge) { |
841 return Parent::edgeFromId(id); |
841 return Parent::edgeFromId(id); |
842 } |
842 } |
843 |
843 |
|
844 Node u(Edge e) const { return this->redNode(e); } |
|
845 Node v(Edge e) const { return this->blueNode(e); } |
|
846 |
844 Node oppositeNode(const Node &n, const Edge &e) const { |
847 Node oppositeNode(const Node &n, const Edge &e) const { |
845 if( n == Parent::u(e)) |
848 if( n == u(e)) |
846 return Parent::v(e); |
849 return v(e); |
847 else if( n == Parent::v(e)) |
850 else if( n == v(e)) |
848 return Parent::u(e); |
851 return u(e); |
849 else |
852 else |
850 return INVALID; |
853 return INVALID; |
851 } |
854 } |
852 |
855 |
853 Arc oppositeArc(const Arc &arc) const { |
856 Arc oppositeArc(const Arc &arc) const { |
854 return Parent::direct(arc, !Parent::direction(arc)); |
857 return Parent::direct(arc, !Parent::direction(arc)); |
855 } |
858 } |
856 |
859 |
857 using Parent::direct; |
860 using Parent::direct; |
858 Arc direct(const Edge &edge, const Node &node) const { |
861 Arc direct(const Edge &edge, const Node &node) const { |
859 return Parent::direct(edge, Parent::u(edge) == node); |
862 return Parent::direct(edge, Parent::redNode(edge) == node); |
860 } |
863 } |
861 |
864 |
862 // Alterable extension |
865 // Alterable extension |
863 |
866 |
864 typedef AlterationNotifier<BpGraphExtender, Node> NodeNotifier; |
867 typedef AlterationNotifier<BpGraphExtender, Node> NodeNotifier; |