Subject: [Boost-bugs] [Boost C++ Libraries] #2550: remove_edge may invalidate number of edges
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2008-11-29 16:06:54
#2550: remove_edge may invalidate number of edges
--------------------------------------------------------+-------------------
Reporter: Moritz Beber <moritz.beber_at_[hidden]> | Owner: dgregor
Type: Bugs | Status: new
Milestone: Boost 1.38.0 | Component: graph
Version: Boost 1.37.0 | Severity: Problem
Keywords: remove edge |
--------------------------------------------------------+-------------------
I already posted about this problem on the mailing list, but was asked to
file the problem here.
Using an adjacency_matrix and trying to remove an edge that doesn't exist
in the graph invalidates the number of edges. The code in the header shows
this:
template <typename D, typename VP, typename EP, typename GP, typename A>
void
remove_edge(typename adjacency_matrix<D,VP,EP,GP,A>::vertex_descriptor u,
typename adjacency_matrix<D,VP,EP,GP,A>::vertex_descriptor v,
adjacency_matrix<D,VP,EP,GP,A>& g)
{
--(g.m_num_edges);
detail::set_edge_exists(g.get_edge(u,v), false, 0);
}
The counter is decrement in either case.
Cheers.
-- Ticket URL: <https://svn.boost.org/trac/boost/ticket/2550> Boost C++ Libraries <http://www.boost.org/> Boost provides free peer-reviewed portable C++ source libraries.
This archive was generated by hypermail 2.1.7 : 2017-02-16 18:49:59 UTC