BGL write_graphviz won't compile with listS or setS

I cannot get calls to write_graphviz to work when using anything other than vecS for the vertex and edge descriptors. I get the following error: graphviz.hpp:255: error: no matching function for call to ‘get (boost ::bgl_named_params <boost::bundle_property_map<boost::adjacency_list<boost::listS, boost::vecS, boost::directedS, VertInfo, boost::no_property, boost::no_property, boost::listS>, size_t, VertInfo, int>, boost::vertex_index_t, boost::no_property>&, const long unsigned int&)’ I am using bundled properties for the vertex properties, as shown below. Any ideas as to why the setS and listS containers do not work with write_graphvis? James --------------------------------- struct VertInfo { string name; int index; }; template<typename GraphT> struct VertWriter{ typedef typename graph_traits<GraphT>::vertex_descriptor Vertex; VertWriter( GraphT& _g ) : g(_g) {} void operator()( ostream& os, const Vertex& v ) const{ os << "[label=\"" << g[v].name << "\"]"; } private: GraphT& g; }; int main() { // typedef adjacency_list< vecS, vecS, directedS, VertInfo > Graph; // works. typedef adjacency_list< listS, listS, directedS, VertInfo > Graph; // doesn't work. Graph G; // populate the graph with vertex info set on each vertex... VertWriter<Graph> vw(G); boost::default_writer dw; write_graphviz( cout, G, vw, dw, dw ); } ----------------------------------- NOTE: I have also tried write_graphviz( cout, G, vw, dw, dw, vertex_index_map( boost::get(&VertInfo::index,G) ) ); which gives the same compiler error.

Dear All, has anybody tried to integrate boost::spirit with a lexer generated by Flex? I'm having: int yylex (boost::any &yylval); The boost::any may be changed later into boost::variant. Any tips would be helpful. Any experiences how fast such a parser is running? Thanks Peter

has anybody tried to integrate boost::spirit with a lexer generated by Flex? I'm having:
int yylex (boost::any &yylval);
The boost::any may be changed later into boost::variant. Any tips would be helpful. Any experiences how fast such a parser is running?
You can use the multi_pass iterator in the Spirit library for encapsulating a flex based lexer. Regards Hartmut

Hi, I'm using write_graphviz with listS and internal properties. I think I had a similar problem until I explicitly used the vertex_index_t property. The vertex index is implicit with vecS because it is the vertex desriptor in this case. Cheers, Torsten Am 05.05.2008 um 22:24 schrieb James Sutherland:
I cannot get calls to write_graphviz to work when using anything other than vecS for the vertex and edge descriptors. I get the following error:
graphviz.hpp:255: error: no matching function for call to ‘get (boost ::bgl_named_params <boost::bundle_property_map<boost::adjacency_list<boost::listS, boost::vecS, boost::directedS, VertInfo, boost::no_property, boost::no_property, boost::listS>, size_t, VertInfo, int>, boost::vertex_index_t, boost::no_property>&, const long unsigned int&)’
I am using bundled properties for the vertex properties, as shown below.
Any ideas as to why the setS and listS containers do not work with write_graphvis?
James
---------------------------------
struct VertInfo { string name; int index; };
template<typename GraphT> struct VertWriter{ typedef typename graph_traits<GraphT>::vertex_descriptor Vertex; VertWriter( GraphT& _g ) : g(_g) {} void operator()( ostream& os, const Vertex& v ) const{ os << "[label=\"" << g[v].name << "\"]"; } private: GraphT& g; };
int main() { // typedef adjacency_list< vecS, vecS, directedS, VertInfo > Graph; // works. typedef adjacency_list< listS, listS, directedS, VertInfo > Graph; // doesn't work.
Graph G;
// populate the graph with vertex info set on each vertex...
VertWriter<Graph> vw(G); boost::default_writer dw; write_graphviz( cout, G, vw, dw, dw ); }
-----------------------------------
NOTE: I have also tried write_graphviz( cout, G, vw, dw, dw, vertex_index_map( boost::get(&VertInfo::index,G) ) ); which gives the same compiler error. _______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users

On May 5, 2008, at 3:45 PM, Torsten Sadowski wrote:
Hi,
I'm using write_graphviz with listS and internal properties. I think I had a similar problem until I explicitly used the vertex_index_t property. The vertex index is implicit with vecS because it is the vertex desriptor in this case.
Cheers, Torsten
Torsten, How would you change the vertex descriptor struct? From my original example, would the following be on the right track? template<class Graph> struct VertInfo { string name; typename Graph::vertex_index_t index; };

I am not sure. My graph is defined thus: // Declarations of properties enum vertex_pnt_t { vertex_pnt = 0 }; namespace boost { BOOST_INSTALL_PROPERTY( vertex, pnt);} enum vertex_isinside_t { vertex_isinside = 1 }; namespace boost { BOOST_INSTALL_PROPERTY( vertex, isinside );} // Declarations for my dual graph typedef boost::property<vertex_pnt_t, gp_Pnt, boost::property<vertex_isinside_t, Standard_Boolean, boost::property<boost::vertex_index_t, int> > > VertexProp; typedef boost::property<boost::edge_index_t, int> EdgeProp; typedef boost::adjacency_list<boost::listS, boost::listS, boost::undirectedS, VertexProp, EdgeProp > TMESH_ConnectivityGraph; Torsten
Torsten,
How would you change the vertex descriptor struct? From my original example, would the following be on the right track?
template<class Graph> struct VertInfo { string name; typename Graph::vertex_index_t index; }; _______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users

I am not sure. My graph is defined thus:
// Declarations of properties enum vertex_pnt_t { vertex_pnt = 0 }; namespace boost { BOOST_INSTALL_PROPERTY( vertex, pnt);} enum vertex_isinside_t { vertex_isinside = 1 }; namespace boost { BOOST_INSTALL_PROPERTY( vertex, isinside );}
// Declarations for my dual graph typedef boost::property<vertex_pnt_t, gp_Pnt, boost::property<vertex_isinside_t, Standard_Boolean, boost::property<boost::vertex_index_t, int> > > VertexProp; typedef boost::property<boost::edge_index_t, int> EdgeProp; typedef boost::adjacency_list<boost::listS, boost::listS, boost::undirectedS, VertexProp, EdgeProp > TMESH_ConnectivityGraph;
Torsten
Thanks. Perhaps I will try this using property lists as you have. I am using bundled properties (a really nice feature), and am unable thus far to get write_graphviz to work with listS and bundled properties. I don't see any examples in BGL of this, so perhaps it is a bug, or unsupported... James
participants (4)
-
Hartmut Kaiser
-
James Sutherland
-
peter_foelsche@agilent.com
-
Torsten Sadowski