|
Boost Users : |
Subject: Re: [Boost-users] [BGL] Searching for index_map
From: Jeremiah Willcock (jewillco_at_[hidden])
Date: 2009-06-15 09:04:45
On Sun, 14 Jun 2009, caligulaemperorofrome_at_[hidden] wrote:
>
> When I run my program the output gives an id to each edge and vertex like so.
>
> <edge id="e262" source="n46" target="n43">
>
> This must be the index. So how can I access this index?
> When I put the following in my code it fails to compile.
> error: âindex_mapâ was not declared in this scope
>
>
> for (tie(edge_iter, edges_end) = edges(g); edge_iter != edges_end; ++edge_iter) {
>
?? Â Â Â Â Â Â get(index_map, *edge_iter, g);
> }
>
> Do I need "get_property(index_map) or something?
> My Graph declaration is as follows.
>
> typedef adjacency_list < listS, vecS, directedS >::edge_descriptor edge_t;
>
> typedef adjacency_list < listS, vecS, directedS >::vertex_descriptor vertex_t;
The two properties are named "vertex_index" and "edge_index". I do not
know if you have one or both of those; I think the settings you gave
produce a vertex_index and not an edge_index, but I'm not sure. If the
edge_index property map does not exist, I suspect the index that is being
output is just the distance from edges(g).beign() to the current edge
iterator.
-- Jeremiah Willcock
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