Boost logo

Boost Users :

Subject: Re: [Boost-users] Trouble w/ fruchterman-reingold
From: Jeremiah Willcock (jewillco_at_[hidden])
Date: 2012-10-04 15:40:14


On Thu, 4 Oct 2012, eric wrote:

> Wow, okay ... thank you. I have to admit that this is all a little bit of
> voodoo for me. There are a lot of things going on behind the scenes that I
> don't understand.
>
> I'm trying to get my toy prototype into what I need it to be, but as soon as
> I switch from defining my Vertex this way:
>
> typedef property<vertex_index_t, int, property&lt;vertex_position_t, Point>
>> Vertex;
>
> to defining it this way:
>
> struct Vertex
> {
> int property1;
> int property2;
> };
>
> I start getting this compiler error:
>
> 1>c:\program files
> (x86)\boost\boost_1_51\boost\graph\detail\adjacency_list.hpp(2540) : error
> C2039: 'type' : is not a member of 'boost::property_value<PropertyList,Tag>'
> 1> with
> 1> [
> 1> PropertyList=wmain::Vertex,
> 1> Tag=int
> 1> ]
>
> That comes from "struct vec_adj_list_any_vertex_pa", which I assume is the
> vector adjacency_list vertex property ... accessor? Anyway, I don't know
> how to get my property_value to have a "::type" ... or where the
> property_value comes from in the first place, for that matter.

property_value is a traits class that looks up the type information about
a property map. I don't know why Tag is set to "int"; it would usually
have the name of the property map that is not being found (likely
vertex_index_t in your case). That might be elsewhere in the
instantiation stack, though.

> Could you help me understand? Or if there is something I could read that
> would clear it all up for me, that would be awesome, too. I trolled through
> the docs, but haven't hit on something that makes me understand what is
> going on.

I don't know if there is a good explanation now, but since you changed the
definition of Vertex, you are no longer providing a vertex_index_t
property map (assuming you are using listS as vertex container), and so
you'll need to provide either that or a displacement map to
fruchterman_reingold as an explicit argument. See the vertex_index_map
part of
http://www.boost.org/doc/libs/1_51_0/libs/graph/doc/fruchterman_reingold.html
for how to pass a custom vertex index map to the algorithm.

-- Jeremiah Willcock


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net