Changeset 1281:164ca6938d09 in lemon-0.x for src/lemon/list_graph.h
- Timestamp:
- 03/31/05 15:29:05 (20 years ago)
- Branch:
- default
- Phase:
- public
- Convert:
- svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/lemon/trunk@1713
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/lemon/list_graph.h
r1184 r1281 369 369 /// 370 370 ///\note The <tt>Edge</tt>s 371 ///referencing themoved edge remain371 ///referencing a moved edge remain 372 372 ///valid. However <tt>InEdge</tt>'s and <tt>OutEdge</tt>'s 373 373 ///may be invalidated. … … 391 391 } 392 392 393 393 ///Split a node. 394 395 ///This function splits a node. First new node is added to the graph, then 396 ///the source of each outgoing edge of \c n is moved to this new node. 397 ///If \c connect is \c true (this is the default value), then a new edge 398 ///from \c n to the newly created node is also added. 399 ///\return The newly created node. 400 /// 401 ///\note The <tt>Edge</tt>s 402 ///referencing a moved edge remain 403 ///valid. However <tt>InEdge</tt>'s and <tt>OutEdge</tt>'s 404 ///may be invalidated. 405 ///\todo It could be implemented in a bit faster way. 406 Node split(Node n, bool connect = true) 407 { 408 Node b = addNode(); 409 for(OutEdgeIt e(*this,n);e!=INVALID;) { 410 OutEdgeIt f=e; 411 ++f; 412 moveSource(e,b); 413 e=f; 414 } 415 if(connect) addEdge(n,b); 416 return b; 417 } 418 394 419 ///Class to make a snapshot of the graph and to restrore to it later. 395 420
Note: See TracChangeset
for help on using the changeset viewer.