Boost logo

Boost Users :

Subject: Re: [Boost-users] [graph][BGL] Why can not I use edge_index_t?
From: Jeremiah Willcock (jewillco_at_[hidden])
Date: 2013-03-13 09:54:16


On Wed, 13 Mar 2013, bminano wrote:

> Hello,
>
> I want to create an iterator_property_map to iterate over the edges, but I
> cannot declare the following:
> typedef property_map<Graph, edge_index_t>::const_type EdgeIndexMap;
> The compilation gives me an error.
>
> I am using an adjacency list with vertex and edge properties. I can use a
> vertex_index_t, so I assumed that I could use the equivalent for edges. But
> I don't understand why I can't.
>
> This is my adjacency list:
> typedef boost::adjacency_list<vecS, distributedS&lt;mpi_process_group,
> vecS>, bidirectionalS, property<vertex_index_t, int>, EdgeProperties> Graph;
>
> Have anyone deal with something similar?

None of the adjacency_list graph types provides edge_index_t as a built-in
property map as far as I know. If you need that map, you will need to
define it as an internal property and fill it in yourself (and update it
if/when your graph changes). If you just need to use it for property
maps, internal properties are much easier. If you are not mutating your
graph's structure, the compressed_sparse_row_graph type provides an
edge_index_t property automatically as well.

-- 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