Changeset 1284:b941d044f87b in lemon-0.x
- Timestamp:
- 03/31/05 16:04:13 (20 years ago)
- Branch:
- default
- Phase:
- public
- Convert:
- svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/lemon/trunk@1716
- Location:
- src/lemon
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
src/lemon/list_graph.h
r1281 r1284 393 393 ///Split a node. 394 394 395 ///This function splits a node. First new node is added to the graph, then396 ///the source of each outgoing edge of \c n is moved to this new node.395 ///This function splits a node. First a new node is added to the graph, 396 ///then the source of each outgoing edge of \c n is moved to this new node. 397 397 ///If \c connect is \c true (this is the default value), then a new edge 398 398 ///from \c n to the newly created node is also added. … … 403 403 ///valid. However <tt>InEdge</tt>'s and <tt>OutEdge</tt>'s 404 404 ///may be invalidated. 405 ///\warning This functionality cannot be used together with the SnapShot 406 ///feature. 405 407 ///\todo It could be implemented in a bit faster way. 406 408 Node split(Node n, bool connect = true) -
src/lemon/smart_graph.h
r1274 r1284 220 220 } 221 221 222 Node _split(Node n, bool connect = true) 223 { 224 Node b = addNode(); 225 nodes[b.n].first_out=nodes[n.n].first_out; 226 nodes[n.n].first_out=-1; 227 for(int i=nodes[b.n].first_out;i!=-1;i++) edges[i].source=b.n; 228 if(connect) addEdge(n,b); 229 return b; 230 } 231 222 232 }; 223 233 … … 285 295 286 296 public: 297 298 ///Split a node. 299 300 ///This function splits a node. First a new node is added to the graph, 301 ///then the source of each outgoing edge of \c n is moved to this new node. 302 ///If \c connect is \c true (this is the default value), then a new edge 303 ///from \c n to the newly created node is also added. 304 ///\return The newly created node. 305 /// 306 ///\note The <tt>Edge</tt>s 307 ///referencing a moved edge remain 308 ///valid. However <tt>InEdge</tt>'s and <tt>OutEdge</tt>'s 309 ///may be invalidated. 310 ///\warning This functionality cannot be used together with the SnapShot 311 ///feature. 312 ///\todo It could be implemented in a bit faster way. 313 Node split(Node n, bool connect = true) 314 { 315 return _split(n,connect); 316 } 317 318 287 319 ///Class to make a snapshot of the graph and to restrore to it later. 288 320
Note: See TracChangeset
for help on using the changeset viewer.