Ticket #4966: subgraph.hpp.patch
File subgraph.hpp.patch, 1.3 KB (added by , 12 years ago) |
---|
-
boost/graph/subgraph.hpp
old new 346 346 subgraph<G>& g) 347 347 { 348 348 assert(!g.is_root()); 349 typename subgraph<G>::vertex_descriptor u_local, v_global , uu_global;349 typename subgraph<G>::vertex_descriptor u_local, v_global; 350 350 typename subgraph<G>::edge_descriptor e_global; 351 351 352 352 u_local = add_vertex(g.m_graph); … … 371 371 typename subgraph<G>::out_edge_iterator ei, ei_end; 372 372 for(boost::tie(vi, vi_end) = vertices(r); vi != vi_end; ++vi) { 373 373 v_global = *vi; 374 if(g.find_vertex(v_global).second) 374 if (v_global == u_global) 375 continue; // don't insert self loops twice! 376 if (!g.find_vertex(v_global).second) 377 continue; // not a subgraph vertex => try next one 375 378 for(boost::tie(ei, ei_end) = out_edges(*vi, r); ei != ei_end; ++ei) { 376 379 e_global = *ei; 377 uu_global = target(e_global, r); 378 if(uu_global == u_global && g.find_vertex(v_global).second) { 380 if(target(e_global, r) == u_global) { 379 381 g.local_add_edge(g.global_to_local(v_global), u_local, e_global); 380 382 } 381 383 }