LEMUR Packages: ompl_lemur or_lemur pr_bgl prpy_lemur
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Friends Groups Pages
waste_edge_map.h
Go to the documentation of this file.
1 
10 namespace pr_bgl
11 {
12 
13 // assumes vertex heuristic map is goal-directed (smaller at goal)
14 // that is, enew = eold + h(v_target) - h(v_source)
15 template <typename Graph, typename EdgeMap, typename HeurMap>
17 {
18 public:
19  typedef typename boost::property_traits<EdgeMap>::category category;
20  typedef typename boost::property_traits<EdgeMap>::key_type key_type;
21  typedef typename boost::property_traits<EdgeMap>::value_type value_type;
22  typedef typename boost::property_traits<EdgeMap>::reference reference;
23 
24  Graph & graph;
25  const EdgeMap & edge_map;
26  const HeurMap & heur_map;
27 
28  waste_edge_map(Graph & graph, const EdgeMap & edge_map, const HeurMap & heur_map):
29  graph(graph), edge_map(edge_map), heur_map(heur_map)
30  {
31  }
32 };
33 
34 template <typename Graph, typename EdgeMap, typename HeurMap>
36 make_waste_edge_map(Graph & graph, const EdgeMap & edge_map, const HeurMap & heur_map)
37 {
38  return waste_edge_map<Graph,EdgeMap,HeurMap>(graph, edge_map, heur_map);
39 }
40 
41 template <typename Graph, typename EdgeMap, typename HeurMap>
42 inline const double get(
43  const waste_edge_map<Graph,EdgeMap,HeurMap> & map,
44  const typename boost::graph_traits<Graph>::edge_descriptor & edge)
45 {
46  return get(map.edge_map, edge)
47  + get(map.heur_map, target(edge, map.graph))
48  - get(map.heur_map, source(edge, map.graph));
49 }
50 
51 } // namespace pr_bgl
Definition: waste_edge_map.h:16