Boost logo

Boost :

Subject: [boost] [BGL/PM] Composition of two property maps
From: Matthias Walter (xammy_at_[hidden])
Date: 2010-02-16 07:30:13


Hi,

I currently have a function which gets a graph plus an index-map and
want's to call a BFS. Therefore it needs to build a color-map which maps
vertex_descriptors to colors. As the user already gives a way to map
vertex_descriptor to index, I'd like to use this mapping. What I need is
a way to define a property map as a composition:

composed-map (vertex_descriptor) -> color

via

color-map (index-map (vertex_descriptor)) -> color

whereas index-map (vertex_descriptor) -> index and color-map (index) ->
color

Of course this should not be too difficult to implement, so I'd just
like to ask whether there already exists some kind of implementation,
because I neither found a hint by looking in the docs, nor by digging
through some of the code.

The actual reason I ask is because there might be other ways to come
around the problem, e.g. making the color-map itself use
vertex_descriptors as keys, so maybe my suggested solution is not the best.

best regards
Matthias Walter


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