Hello, I read in the documentation that the parameter weight_map of dijkstra_shortest_paths should be a model of Readable Property Map. http://www.boost.org/libs/graph/doc/dijkstra_shortest_paths.html Readable Property Map interface defines a function get(), which has to be contained in each implementation of the interface. OK so far. But when you look at the example provided with the boost library, you see that a simple STL vector is used as weight map. http://www.boost.org/libs/graph/example/dijkstra-example.cpp And STL vector doesn't provide a get() function at all. So the whole thing shouldn't work at all. So where is the magic explanation?:) Ewgenij -- GMX FreeMail: 1 GB Postfach, 5 E-Mail-Adressen, 10 Free SMS. Alle Infos und kostenlose Anmeldung: http://www.gmx.net/de/go/freemail
Sorry, I meant the distance_map as model of Read/Write Property Map. But the question is the same:)
On Jul 3, 2007, at 5:07 AM, Ewgenij Sokolovski wrote:
Hello, I read in the documentation that the parameter weight_map of dijkstra_shortest_paths should be a model of Readable Property Map.
http://www.boost.org/libs/graph/doc/dijkstra_shortest_paths.html
Readable Property Map interface defines a function get(), which has to be contained in each implementation of the interface. OK so far. But when you look at the example provided with the boost library, you see that a simple STL vector is used as weight map.
http://www.boost.org/libs/graph/example/dijkstra-example.cpp
And STL vector doesn't provide a get() function at all. So the whole thing shouldn't work at all. So where is the magic explanation?:)
The magic is on line 139 of boost/property_map.hpp, which turns pointers into property maps. - Doug
participants (2)
-
Doug Gregor
-
Ewgenij Sokolovski