split(Edge) member function added.
authoralpar
Thu, 17 Nov 2005 10:16:29 +0000
changeset 1812a6f019fa6e7a
parent 1811 597ce92fae73
child 1813 5c5d1574667d
split(Edge) member function added.
lemon/list_graph.h
     1.1 --- a/lemon/list_graph.h	Thu Nov 17 10:14:55 2005 +0000
     1.2 +++ b/lemon/list_graph.h	Thu Nov 17 10:16:29 2005 +0000
     1.3 @@ -430,6 +430,22 @@
     1.4        return b;
     1.5      }
     1.6        
     1.7 +    ///Split an edge.
     1.8 +
     1.9 +    ///This function splits an edge. First a new node \c b is added to the graph,
    1.10 +    ///then the original edge is re-targetes to \c b. Finally an edge
    1.11 +    ///from \c b to the original target is added.
    1.12 +    ///\return The newly created node.
    1.13 +    ///\warning This functionality cannot be used together with the Snapshot
    1.14 +    ///feature.
    1.15 +    Node split(Edge e) 
    1.16 +    {
    1.17 +      Node b = addNode();
    1.18 +      addEdge(b,target(e));
    1.19 +      changeTarget(e,b);
    1.20 +      return b;
    1.21 +    }
    1.22 +      
    1.23      ///Class to make a snapshot of the graph and to restrore to it later.
    1.24  
    1.25      ///Class to make a snapshot of the graph and to restrore to it later.