src/work/marci/bipartite_graph_wrapper.h
changeset 498 eb8bfa683d92
parent 497 500456d50d21
child 499 767f3da8ce0e
equal deleted inserted replaced
2:e4c2da8f611d 3:97804f7304f9
   203       Parent::setSFalseTTrueMap(bipartite_map);
   203       Parent::setSFalseTTrueMap(bipartite_map);
   204     }
   204     }
   205 
   205 
   206     /// the \c bool parameter which can be \c S_Class or \c T_Class shows 
   206     /// the \c bool parameter which can be \c S_Class or \c T_Class shows 
   207     /// the color class where the new node is to be inserted.
   207     /// the color class where the new node is to be inserted.
   208     void addNode(bool);
   208     Node addNode(bool b) {
       
   209       Node n=Parent::graph->addNode();
       
   210       bipartite_map.update();
       
   211       s_false_t_true_map.insert(n, b);
       
   212       return n;
       
   213     }
   209 
   214 
   210     /// A new edge is inserted.
   215     /// A new edge is inserted.
   211     ///\pre \c tail have to be in \c S_Class and \c head in \c T_Class.
   216     ///\pre \c tail have to be in \c S_Class and \c head in \c T_Class.
   212     void addEdge(const Node& tail, const Node& head);
   217     Edge addEdge(const Node& tail, const Node& head) {
   213 
   218       return Parent::graph->addEdge(tail, head);
   214     void erase(const Node&);
   219     }
   215     void erase(const Edge&);
   220 
       
   221     void erase(const Node& n) {
       
   222       s_false_t_true_map.remove(n);
       
   223       Parent::graph->erase(n);
       
   224     }
       
   225     void erase(const Edge& e) {
       
   226       Parent::graph->erase(e);
       
   227     }
   216     
   228     
   217     void clear() {
   229     void clear() {
   218       FOR_EACH_LOC(typename Parent::EdgeIt, e, G) erase(e);
   230       FOR_EACH_LOC(typename Parent::EdgeIt, e, G) erase(e);
   219       FOR_EACH_LOC(typename Parent::NodeIt, n, G) erase(n);
   231       FOR_EACH_LOC(typename Parent::NodeIt, n, G) erase(n);
   220     }
   232     }