Boost logo

Boost :

From: Vladimir Prus (ghost_at_[hidden])
Date: 2003-10-16 05:44:59


Hi Wynand,

Wynand Winterbach wrote:
> A BGL question:
> Does anyone know of an elegant way to solve the following problem?:
>
> For an arbitrary graph, edge indices are computed, so that properties
> may be quickly adjusted via something like std::vector.
>
> Now, it's a real pain (and it reduces readability) to have to explicitly
> use a construction like
> some_edge_property[ edge_index[ edge ] ]
> instead of just
> some_edge_property[ edge ]
>
> I'm writing something I call a "chaining property map", which takes
> two property maps P1:T1->T2 and P2:T2->T3 and produces a new
> "chained" map P3:T1->T3.
>
> In other words, it's just a compose1 for property maps. However,
> there must be a better (or at least existing) method of doing this?

There's boost/vector_property_map.hpp which solves this problem for one
specific case when the second property map is implemented by vector. Seems
like it's exactly what you're after, so maybe you can try that file?

HTH,
Volodya


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk