Boost logo

Boost Users :

Subject: Re: [Boost-users] Trouble w/ fruchterman-reingold
From: Jeremiah Willcock (jewillco_at_[hidden])
Date: 2012-10-05 11:11:12


On Fri, 5 Oct 2012, eric wrote:

> I created one like such:
>
> property_map<Graph, Topology::point_type> positionMap;
> minstd_rand gen;
> Topology rect_top(gen, -25, -25, 25, 25);
> random_graph_layout(patentGraph, positionMap, rect_top);
>
> and I get the following errors:
>
> 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=boost::rectangle_topology<>::point_type
> 1> ]
> 1> c:\program files
> (x86)\boost\boost_1_51\boost\graph\detail\adjacency_list.hpp(2594) : see
> reference to class template instantiation
> 'boost::vec_adj_list_any_vertex_pa::bind_<Tag,Graph,Property>' being
> compiled
> 1> with
> 1> [
> 1> Tag=boost::rectangle_topology<>::point_type,
> 1> Graph=Graph,
> 1> Property=wmain::Vertex
> 1> ]
>
> I should have mentioned before that I am using vecS now:
>
> typedef adjacency_list<vecS, vecS, undirectedS, Vertex, Edge> Graph;

You need to use the property map name (not its value type) as the second
template argument to property_map. If you are using a bundled property
now, the second argument should be "Topology::point_type Vertex::*". You
also need to get property_map<...>::type (property_map itself is just a
metafunction), and you'll need to initialize positionMap with
"get(&Vertex::<member name>, patentGraph)".

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