Boost logo

Boost Users :

From: Stephan Diederich (stephan.diederich_at_[hidden])
Date: 2007-08-02 05:52:26


Hi Anton,

On 8/2/07, Anton A. Patrushev <anton_at_[hidden]> wrote:
> Hi,
> How to initialize edge index map?
> I tried following:
>
> typedef adjacency_list<vecS, vecS, directedS, Vertex, Edge>
> graph_t;

You are using bundled properties,

[snip]
> for(tie(ei, ei_end) = edges(graph); ei != ei_end; ++ei, ++index)
> put(edge_index, graph, *ei, index);

but you are trying to access a property list.
If you are using bundled properties and your Edge looks like:
struct Edge{
 std::size_t edge_index;
};
the initialization reads:

for(tie(ei, ei_end) = edges(graph); ei != ei_end; ++ei, ++index)
  graph[*ei].edge_index = index;

If you were using property lists and typedef you adjacency_list like
typedef adjacency_list<vecS, vecS, directedS, Vertex,
property<edge_intex_t, std::size_t> > graph_t;
your initialization would worked.

See http://tinyurl.com/r7gv6 and http://tinyurl.com/35adta for details.

HTH,
Stephan


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