|
Boost Users : |
Subject: Re: [Boost-users] Boost Graph: edge indices
From: Trevor Harmon (Trevor.W.Harmon_at_[hidden])
Date: 2010-04-01 14:48:11
On Apr 1, 2010, at 5:31 AM, Gábor Szuromi wrote:
> The edge_index internal property map is not created by default, so you
> have to define it explicitly:
Any particular reason why vertex indices are created (and updated) by
default but edge indices are not? Perhaps it was just decided that the
former is often needed while the latter not so often...
> typedef adjacency_list<vecS, vecS, directedS, Foo*,
> property<edge_index_t, std::size_t> > MyGraph;
> typedef property_map<MyGraph, edge_index_t>::type MyEdgeIndexMap;
> ...
> // Retrieve the edge index map associated with the graph
> MyEdgeIndexMap emap = get(edge_index, g);
> ...
> // Convert the edge descriptor to an integer value
> cout << index[ get(emap, e, g) ] << endl;
Thanks for the tip. However, I think that last line is wrong. It
should be:
cout << index[ get(emap, e) ] << endl;
Trevor
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