src/work/marci/leda/leda_graph_wrapper.h
changeset 986 e997802b855c
parent 921 818510fa3d99
child 987 87f7c54892df
equal deleted inserted replaced
9:22f1e7f2cdc5 10:a398bf342fc1
   211 //       It e;
   211 //       It e;
   212 //       first(e, v);
   212 //       first(e, v);
   213 //       return e; 
   213 //       return e; 
   214 //     }
   214 //     }
   215 
   215 
   216     ///Gives back the head node of an edge.
   216     ///Gives back the target node of an edge.
   217     Node head(Edge e) const { 
   217     Node target(Edge e) const { 
   218       return Node(l_graph->target(e.l_e)); 
   218       return Node(l_graph->target(e.l_e)); 
   219     }
   219     }
   220     ///Gives back the tail node of an edge.
   220     ///Gives back the source node of an edge.
   221     Node tail(Edge e) const { 
   221     Node source(Edge e) const { 
   222       return Node(l_graph->source(e.l_e)); 
   222       return Node(l_graph->source(e.l_e)); 
   223     }
   223     }
   224   
   224   
   225     Node aNode(InEdgeIt e) const { return head(e); }
   225     Node aNode(InEdgeIt e) const { return target(e); }
   226     Node aNode(OutEdgeIt e) const { return tail(e); }
   226     Node aNode(OutEdgeIt e) const { return source(e); }
   227     //   Node aNode(SymEdgeIt) const {}
   227     //   Node aNode(SymEdgeIt) const {}
   228 
   228 
   229     Node bNode(InEdgeIt e) const { return tail(e); }
   229     Node bNode(InEdgeIt e) const { return source(e); }
   230     Node bNode(OutEdgeIt e) const { return head(e); }
   230     Node bNode(OutEdgeIt e) const { return target(e); }
   231     //   Node bNode(SymEdgeIt) const {}
   231     //   Node bNode(SymEdgeIt) const {}
   232 
   232 
   233     /// Checks if a node iterator is valid
   233     /// Checks if a node iterator is valid
   234     bool valid(Node n) const { return n.l_n; }
   234     bool valid(Node n) const { return n.l_n; }
   235     /// Checks if an edge iterator is valid
   235     /// Checks if an edge iterator is valid
   242 
   242 
   243     //void setInvalid(Node &) const {};
   243     //void setInvalid(Node &) const {};
   244     //void setInvalid(Edge &) const {};
   244     //void setInvalid(Edge &) const {};
   245   
   245   
   246     Node addNode() const { return Node(l_graph->new_node()); }
   246     Node addNode() const { return Node(l_graph->new_node()); }
   247     Edge addEdge(Node tail, Node head) const { 
   247     Edge addEdge(Node source, Node target) const { 
   248       return Edge(l_graph->new_edge(tail.l_n, head.l_n));
   248       return Edge(l_graph->new_edge(source.l_n, target.l_n));
   249     }
   249     }
   250     
   250     
   251     void erase(Node n) const { l_graph->del_node(n.l_n); }
   251     void erase(Node n) const { l_graph->del_node(n.l_n); }
   252     void erase(Edge e) const { l_graph->del_edge(e.l_e); }
   252     void erase(Edge e) const { l_graph->del_edge(e.l_e); }
   253 
   253