BGL: conversion from vertex_iterator to vertex_descriptor possible?

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? Thanks, Rene -- René Meier Institut für Pharmazeutische Chemie Martin-Luther-Universität Halle email: rene.meier@pharmazie.uni-halle.de Wolfgang-Langenbeck-Str. 4 phone: (49)345 55-25043 06120 Halle (Saale) fax: (49)345 55-27355 Petition für ein Softwarepatent-Freies Europa: http://www.ffii.org/index.de.html

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
participants (2)
-
Doug Gregor
-
Rene Meier