Boost logo

Boost Users :

From: Krishna Roskin (krish_at_[hidden])
Date: 2007-07-12 15:17:10


On Jul 12, 2007, at 3:27 AM, Ewgenij Sokolovski wrote:

> Ewgenij Sokolovski <ewgenijkkg <at> gmx.de> writes:
>> Nobody knows the answer?:) Am I the only one confronted with this
>> question? I
>> mean I could define a structure to include my distance and pass it
>> as a bundled
>> property but isn't that a rather unclean way to manage the problem?

What you're looking for is get(edge_bundle, map). Use

weight_map(get(edge_bundle, map))

for your call to dijkstra_shortest_paths.

Enjoy.

-krish

> Sorry, I used the false button:) The original question was:
>
>
> Hello, I want to apply dijkstra_shortest_paths to my Graph. I have
> added the
> lengths of the edges with while
> adding the edges with the function
>
> add_edge(vi, vj, distance, *nodesGraph)
>
> where vi, vj are the vertex descriptors, distance is the length of
> the edge and
> nodesGraph is a pointer to my
> graph. Now I need to provide an appropriate property map for the
> bundled
> property "distance". In the
> manual I read that I have to provide a member pointer to the
> property value:
>
> file:///usr/share/doc/packages/boost-doc/libs/graph/doc/bundles.html
>
> But in my case I do not have a class with members like 'Highway' in
> the manual.
> In my case the bundled property
> is represented by a single float value. And so I need access to it,
> not to some
> members of it. I tried to write
> weight_map(get(&float, myGraph)) instead of weight_map(get
> (&Highway::miles,
> map)) in the example,
> but then I get a compiler message "expected primary expression
> before ","
> token". So how can I access the
> distance? Or comes the compiler message due to some other bug in my
> code?
>
> Ewgenij
>
> _______________________________________________
> Boost-users mailing list
> Boost-users_at_[hidden]
> http://lists.boost.org/mailman/listinfo.cgi/boost-users

-- 
Krishna Roskin
Center for Biomolecular Science and Engineering, UC Santa Cruz
mailto:krish_at_[hidden]
http://www.soe.ucsc.edu/~krish/
"It is our blasphemy which has made us great, and will
sustain us, and which the gods secretly admire in us."
         --Roger Zelazny, A Rose for Eccclesiastes

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