Boost logo

Boost :

Subject: Re: [boost] [graph] dfs depending on VertexList container
From: fabien (fabien.castan_at_[hidden])
Date: 2010-09-08 20:31:21


> Does DFS itself use operator[]? I do not see that in the code.
If you compile the main.cpp attached in my first mail, you can see the
error:

boost/graph/depth_first_search.hpp +197
       put(color, u, Color::white());

boost/property_map/property_map.hpp +361
in function put:
     static_cast<const PropertyMap&>(pa)[k] = v;

boost/property_map/shared_array_property_map.hpp:36: error: no match for
'operator[]'

> If your graph has a vertex_index_map property map (filled in
> appropriately), the algorithm should create the color map
> automatically from that. You can also just create your own color map
> and have it as a named argument to depth_first_search (that is simpler
> syntax than needing to write out all of the positional arguments).
Yes, I create my own colormap so that works in all cases.
In my case I use the bundle properties, so there is an automatic
vertex_index_map, isn't it ?
But I find strange that a dfs don't works directly with all containers
and especially if it's only to initialize the colormap...


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