Changeset 863:d27bbe17b0b8 in lemon0.x for src/work/marci/augmenting_flow.h
 Timestamp:
 09/16/04 13:11:01 (18 years ago)
 Branch:
 default
 Phase:
 public
 Convert:
 svn:c9d7d8f590d60310b91f818b3a526b0e/lemon/trunk@1163
 File:

 1 edited
Legend:
 Unmodified
 Added
 Removed

src/work/marci/augmenting_flow.h
r862 r863 4 4 5 5 #include <vector> 6 //#include <queue>7 //#include <stack>8 6 #include <iostream> 9 7 … … 12 10 #include <hugo/invalid.h> 13 11 #include <hugo/maps.h> 12 #include <tight_edge_filter_map.h> 14 13 15 14 /// \file … … 18 17 19 18 namespace hugo { 20 21 /// \brief A map for filtering the edgeset to those edges22 /// which are tight w.r.t. some node_potential map and23 /// edge_distance map.24 ///25 /// A nodemap node_potential is said to be a potential w.r.t.26 /// an edgemap edge_distance27 /// if and only if for each edge e, node_potential[g.head(e)]28 /// <= edge_distance[e]+node_potential[g.tail(e)]29 /// (or the reverse inequality holds for each edge).30 /// An edge is said to be tight if this inequality holds with equality,31 /// and the map returns true exactly for those edges.32 /// To avoid rounding errors, it is recommended to use this class with exact33 /// types, e.g. with int.34 template<typename Graph,35 typename NodePotentialMap, typename EdgeDistanceMap>36 class TightEdgeFilterMap {37 protected:38 const Graph* g;39 NodePotentialMap* node_potential;40 EdgeDistanceMap* edge_distance;41 public:42 TightEdgeFilterMap(Graph& _g, NodePotentialMap& _node_potential,43 EdgeDistanceMap& _edge_distance) :44 g(&_g), node_potential(&_node_potential),45 edge_distance(&_edge_distance) { }46 // void set(const typename Graph::Node& n, int a) {47 // pot>set(n, a);48 // }49 // int operator[](const typename Graph::Node& n) const {50 // return (*node_potential)[n];51 // }52 bool operator[](const typename Graph::Edge& e) const {53 return ((*node_potential)[g>head(e)] ==54 (*edge_distance)[e]+(*node_potential)[g>tail(e)]);55 }56 };57 19 58 20 /// \addtogroup galgs
Note: See TracChangeset
for help on using the changeset viewer.