Boost logo

Boost Users :

From: Doug Gregor (dgregor_at_[hidden])
Date: 2005-08-05 13:33:18


On Aug 5, 2005, at 3:59 AM, Rene Meier wrote:

> Hello,
>
> I would like to do some topology modification, depending on bundled
> properties of the vertices. So i use:
> std::pair<vertex_iterator, vertex_iterator>
> vertices(const adjacency_list& g)
> to get an iterator range for all vertices, then i make a loop over all
> vertices, search for the properties, maybe i store the iterators of
> some vertices for later use, but the main problem is:
> I can not these iterators in functions like:
>
> std::pair<edge_descriptor, bool>
> add_edge(vertex_descriptor u, vertex_descriptor v,
> adjacency_list& g)
>
> void remove_vertex(vertex_descriptor u, adjacency_list& g)
>
> void clear_vertex(vertex_descriptor u, adjacency_list& g)
>
> and so on...
>
> Thats why i would like to know how to convert an vertex_iterator to an
> vertex_descriptor?

Dereference the iterator to get the descriptor. So if you have

        vertex_iterator vi;

then

        *vi

is the vertex_descriptor it refers to.

        Doug


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