Boost logo

Boost :

From: Fabian Buske (fbuske_at_[hidden])
Date: 2005-08-06 15:31:33


Hi,

I'm trying to write a dijkstra visitor, that sets the weight of an egde
to the
maximum value after assigning it to a minimum spanning tree.

The visitor is created according to the bacon sample:

  template <typename WeightMap>
        class special_dijkstra_visitor
    : public boost::default_dijkstra_visitor
        {
         public:

                special_dijkstra_visitor(WeightMap&
w):default_dijkstra_visitor(),weight_map_(w){};

                template <typename Edge, typename Graph>
                void edge_relaxed(Edge e, Graph& g)
                {
                        weight_map_[e] = DBL_MAX;
                }

                template <class Edge, class Graph>
                void edge_not_relaxed(Edge e, Graph& g)
                {
                        weight_map_[e] = DBL_MAX;
                }

         private:
                WeightMap weight_map_;

        };

        // Convenience function
  template <typename WeightMap>
  special_dijkstra_visitor<WeightMap>
  visit_special_dijkstra(WeightMap w)
  {
    return special_dijkstra_visitor<WeightMap>(w);
  }

The graph based on an adjacency matrix with property<edge_weight_t, double>

The visitor is called by:
property_map<Graph, edge_weight_t>::type weightmap = get(edge_weight, g);
prim_minimum_spanning_tree(g, root, &p[0], distance, weightmap, indexmap,
visitor(visit_special_dijkstra(weightmap)));

The linux gnu 3.4.4 compiler gives the following error messages
*snip template instance error messages*
/zeug/study/OpenMSLibs/CGAL-3.1-gcc-3.4.4/include/boost/graph/dijkstra_shortest_paths.hpp:120:
error: `
   edge_relaxed' undeclared (first use this function)
/zeug/study/OpenMSLibs/CGAL-3.1-gcc-3.4.4/include/boost/graph/dijkstra_shortest_paths.hpp:122:
error: `
   edge_not_relaxed' undeclared (first use this function)
/zeug/study/OpenMSLibs/CGAL-3.1-gcc-3.4.4/include/boost/graph/dijkstra_shortest_paths.hpp:143:
error: `
   finish_vertex' undeclared (first use this function)
...

I'm wondering, cause I thought deriving from default_dijkstra_visitor
ensures that finish_vertex is allready implemented.

Compiling the bacon sample on the same graph works fine. So I'm really
confused.
Any hints for debugging the code?

Thanks a lot.

Regards
Fabian


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk