From: Vladimir Prus (ghost_at_[hidden])
Date: 2003-08-27 01:21:59
Janusz Piwowarski wrote:
> I found remove_vertex member for vector_as_graph isn't implemented.
> It's my proposal:
> template<class EdgeList, class Allocator>
> remove_vertex(typename EdgeList::value_type u,
> std::vector<EdgeList, Allocator>& g)
> typedef typename EdgeList::iterator iterator;
> clear_vertex(u, g);
> g.erase(g.begin() + u);
> for (std::size_t i = 0; i < g.size(); ++i)
> for ( iterator it = g[i].begin(); it != g[i].end(); ++it )
> // after clear_vertex none *it is equal to u
> if ( *it > u )
The implementation is fine, AFAICT. The only problem with me is the comment:
I couldn't understand it for the first time because "none *it" sounded
confusing. Maybe "*it is never equal to u" is better?
BTW, if you could sumbit unified diff instead of new implementation, that
would be nice. If that's not convenient for you, no problem. I can apply
the thange anyway.
> Unsubscribe & other changes:
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk