Boost logo

Boost Users :

Subject: Re: [Boost-users] [BGL] clear_vertex in subgraph
From: Jeremiah Willcock (jewillco_at_[hidden])
Date: 2011-12-05 18:14:34


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<oei_type, oei_type> 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


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net