Boost logo

Boost Users :

From: Torsten Sadowski (tsadowski_at_[hidden])
Date: 2008-05-05 17:45:32


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_at_[hidden]
> http://lists.boost.org/mailman/listinfo.cgi/boost-users


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