[Lemon-commits] [lemon_svn] alpar: r2358 - hugo/trunk/lemon

Lemon SVN svn at lemon.cs.elte.hu
Mon Nov 6 20:52:02 CET 2006


Author: alpar
Date: Thu Nov 17 11:16:29 2005
New Revision: 2358

Modified:
   hugo/trunk/lemon/list_graph.h

Log:
split(Edge) member function added.

Modified: hugo/trunk/lemon/list_graph.h
==============================================================================
--- hugo/trunk/lemon/list_graph.h	(original)
+++ hugo/trunk/lemon/list_graph.h	Thu Nov 17 11:16:29 2005
@@ -430,6 +430,22 @@
       return b;
     }
       
+    ///Split an edge.
+
+    ///This function splits an edge. First a new node \c b is added to the graph,
+    ///then the original edge is re-targetes to \c b. Finally an edge
+    ///from \c b to the original target is added.
+    ///\return The newly created node.
+    ///\warning This functionality cannot be used together with the Snapshot
+    ///feature.
+    Node split(Edge e) 
+    {
+      Node b = addNode();
+      addEdge(b,target(e));
+      changeTarget(e,b);
+      return b;
+    }
+      
     ///Class to make a snapshot of the graph and to restrore to it later.
 
     ///Class to make a snapshot of the graph and to restrore to it later.



More information about the Lemon-commits mailing list