|
Boost Users : |
From: Sean Kelly (sean.kelly_at_[hidden])
Date: 2006-03-17 13:08:39
Hi Doug,
here is the example code that works - XFlatGraph is a listS, listS
adjacency_list. Note if I replace the remove edge expression with
remove_edge(*iter, _graph) the edge is intermittently not removed
thanks
Sean
XFlatGraph& graph = _flat_view->get_graph();
XFlatEdgePMap& edge_pmap = get(kFlatGraphEdgeProperty, graph);
std::list<XFlatView::edge_descriptor> scheduled_for_removal;
XFlatView::edge_iterator current, end;
tie(current, end) = edges(graph);
for(;current!=end;++current) {
if(edge_pmap[*current]->get_impl()->isSimulationOnly()) {
scheduled_for_removal.push_back(*current);
}
}
// Remove edges marked as simualtion only
scheduled_for_removal.unique();
for(std::list<XFlatView::edge_descriptor>::iterator iter =
scheduled_for_removal.begin();
iter != scheduled_for_removal.end();
++iter)
{
remove_edge(source(*iter, graph), target(*iter,graph), graph);
}
System Information:
compiler info:
Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 13.10.3077 for
80x86
Copyright (C) Microsoft Corporation 1984-2002. All rights reserved.
Boost version 1-32
-----Original Message-----
From: boost-users-bounces_at_[hidden] [
mailto:boost-users-bounces_at_[hidden]] On Behalf Of Doug Gregor
Sent: Thursday, March 02, 2006 12:42 PM
To: boost-users_at_[hidden]
Subject: Re: [Boost-users] FW: adjacency_list remove_edge
On Mar 1, 2006, at 6:33 PM, Sean Kelly wrote:
> I have observed the following behavior using the remove_edge function
> and am curious if anyone else has seen this.
>
> remove_edge(edge_descriptor, graph) // occasionally fails in a
> seemingly indeterminant way
>
> remove_edge(source(edge_descriptor, graph),
> target(edge_descriptor, graph),
> graph) // works fine
It sounds like either the edge_descriptor is getting invalidated or
there is a bug somewhere in remove_edge.
> The adjacency list I am using is listS listS, and this is not an issue
> with invalid edge_iterators, i.e. I collect all the edge_descriptors
> to be removed before removing them.
Are you sure that there are no duplicate edge descriptors?
> I can provide more detailed info upon request.
We won't be able to help without more detailed information.
Doug
_______________________________________________
Boost-users mailing list
Boost-users_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