|
Boost Users : |
Subject: Re: [Boost-users] [BGL] destroying a subgraph
From: fabricio (fabricio.olivetti_at_[hidden])
Date: 2009-06-15 17:44:44
well I ended up creating my own implementation of remove_node() for a
subgraph, of course it just removes the edge from the given subgraph
not from the parent graphs (and neither from the children) but it will
work for now!
thank you all
On 10 jun, 19:21, fabricio <fabricio.olive..._at_[hidden]> wrote:
> Hi all,
>
> I have a vector of subgraphs and at certain situations I have to
> remove some vertex from one of them. As this is not possible for now,
> I simply create a temporary subgraph with the vertices I want and
> replace the old one. The problem is that the memory allocated from the
> old one is not freed correctly. What should be the correct procedure
> to do so??
>
> a code snippet:
>
> void modgraph::remove_a_vertex(unsigned idx, Vertex vt)
> {
> Graph* temp_subg = &g.create_subgraph();
> graph_traits < Graph >::vertex_iterator itg, end;
> for (tie(itg,end) = vertices(*subg(idx)); itg != end; ++itg)
> {
> if( (*subg(idx)).local_to_global(*itg) != vt )
> {
> add_vertex(*itg, *temp_subg);
> }
> }
> *subg(idx) = *temp_subg;
>
> }
>
> where subg is a vector of subgraphs.
> _______________________________________________
> Boost-users mailing list
> Boost-us..._at_[hidden]http://lists.boost.org/mailman/listinfo.cgi/boost-users
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