
According to Ticket #4753 https://svn.boost.org/trac/boost/ticket/4753 clear vertex should work on subgraph BUT according to documentation clear_vertex should remove all edges of specified vertex but in the boost 1.47 implementation of clear_vertex of subgarph it removes only the out_edges() is there a prbolem with documentation or the issue was not fixed?
The code of subgraph is:
template <typename G>void clear_vertex(typename subgraph<G>::vertex_descriptor v, subgraph<G>& g) { while (true) { typedef typename subgraph<G>::out_edge_iterator oei_type; std::pair
p = out_edges(v, g); if (p.first == p.second) break; remove_edge(*p.first, g); } } Thanks
Avishay

On Mon, 5 Dec 2011, Avishay Ben Shabtai wrote:
According to Ticket #4753 clear vertex should work on subgraph BUT according to documentation clear_vertex should remove all edges of specified vertex but in the boost 1.47 implementation of clear_vertex of subgarph it removes only the out_edges() is there a prbolem with documentation or the issue was not fixed?
The code of subgraph is:
template <typename G> void clear_vertex(typename subgraph<G>::vertex_descriptor v, subgraph<G>& g) { while (true) { typedef typename subgraph<G>::out_edge_iterator oei_type; std::pair
p = out_edges(v, g); if (p.first == p.second) break; remove_edge(*p.first, g); } }
The clear_vertex function for subgraphs is undocumented; it is only "officially" in adjacency_list and adjacency_matrix. It should be fixed, however. I generally recommend not using subgraph anyway; filtered_graph is simpler for most use cases. -- Jeremiah Willcock
participants (2)
-
Avishay Ben Shabtai
-
Jeremiah Willcock