Boost logo

Boost :

Subject: Re: [boost] [graph] dfs depending on VertexList container
From: Jeremiah Willcock (jewillco_at_[hidden])
Date: 2010-09-08 20:35:20


On Thu, 9 Sep 2010, fabien wrote:

>
>> 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[]'

Could you please send your full error trace? It also appears that you are
not passing in your color map in main.cpp; it might still be trying to
create one and complaining that it doesn't have a vertex_index map. If
the type of "k" in the property_map.hpp line in the error message is
something like void*, that would indicate a vertex_index map problem.

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

It's not just to initialize the color map, but to use it during the
algorithm as well.

-- Jeremiah Willcock


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