
Hi,
I trying to wrap my head about the usage of
iterator_property_map

On Mon, May 31, 2010 at 1:09 PM, Arne Schwabe
Hi,
I trying to wrap my head about the usage of iterator_property_map
What I am trying to do is the following:
create a map like color with key a graph_node and value type of a struct like
struct foo { int numbervists; int color; }
so I can use that in a breadth first like algorithm. The example shows me how to do it for an int but do not know how to change
typedef boost::graph_traits<Graph>::edge_descriptor Edge;
typedef boost::property_map
::type EdgeID_PMap; EdgeID_PMap edge_id = get(boost::edge_index(), G); boost::iterator_property_map
capacity_pa(capacity, edge_id), flow_pa(flow, edge_id); to use foo instead of int. In my understanding, I would have to change int* to a RandomAccessIterator to to Iterator that has foo as value type. But I am kind of lost how to construct such a thing.
Arne
___
The following code sample should help you figure it out.
#include Foo_pmap_t;
Foo_pmap_t dist_pmap(foo_store.begin(), identity_property_map()); }
-Sandeep
participants (2)
-
Arne Schwabe
-
Sandeep Gupta