Boost logo

Boost Users :

Subject: Re: [Boost-users] BGL Properties
From: Cedric Laczny (cedric.laczny_at_[hidden])
Date: 2011-01-27 09:43:36


On Thursday, 27. January 2011 14:23:45 David Doria wrote:
> I have two questions:
>
> 1) I am trying to iterate through the edges of a graph and output
> their edge weights. I am confused though. I know how to output the
> "edges", but they are actually just a (vertex, vertex) pair which
> defines the edge. So do I index *edgePair.first into the EdgeWeightMap
> to get the weight of the edge starting from vertex *edgePair.first? Or
> how else would I get the weight associated with a particular edge?
>
> Code snippet:
> http://stackoverflow.com/questions/4810589/output-bgl-edge-weights
>
> 2) I have created a struct, and used it as a template parameter to
> adjacency_list. However, when I try to add_edge(vertex1, vertex2,
> property, graph) , the compiler complains "no matching function call".
> Can anyone see where I've gone wrong?
>
> Code snippet:
> http://stackoverflow.com/questions/4810235/bgl-bundled-properties-add-edge-
> no-matching-function
>
> Any suggestions on either of these?
>

You need to specify the vertex properties as empty (something like
"no_property" IIRC). You did specify the edge weight as the parameter of the
VertexProperties, but it should look like this:
adjacency_list<OutEdgeList, VertexList, Directed,
               VertexProperties, EdgeProperties,
               GraphProperties, EdgeList>

The g++-4.3.4 output contains something like "Value =
boost::detail::error_property_not_found" which tells you that some property
was not available while you tried to access it.

> Thanks,
>
> David
> _______________________________________________
> Boost-users mailing list
> Boost-users_at_[hidden]
> http://lists.boost.org/mailman/listinfo.cgi/boost-users

Best,

Cedric


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