# HG changeset patch # User marci # Date 1095333061 0 # Node ID d27bbe17b0b83d3c9224a00944e66350fe86370b # Parent 732f2acb7239748ac945810b76ee8d710e025f00 An edge-map which shows the tight edges w.r.t a potential and an edge-distance function. diff -r 732f2acb7239 -r d27bbe17b0b8 src/work/marci/augmenting_flow.h --- a/src/work/marci/augmenting_flow.h Thu Sep 16 10:59:52 2004 +0000 +++ b/src/work/marci/augmenting_flow.h Thu Sep 16 11:11:01 2004 +0000 @@ -3,14 +3,13 @@ #define HUGO_AUGMENTING_FLOW_H #include -//#include -//#include #include #include #include #include #include +#include /// \file /// \brief Maximum flow algorithms. @@ -18,43 +17,6 @@ namespace hugo { - /// \brief A map for filtering the edge-set to those edges - /// which are tight w.r.t. some node_potential map and - /// edge_distance map. - /// - /// A node-map node_potential is said to be a potential w.r.t. - /// an edge-map edge_distance - /// if and only if for each edge e, node_potential[g.head(e)] - /// <= edge_distance[e]+node_potential[g.tail(e)] - /// (or the reverse inequality holds for each edge). - /// An edge is said to be tight if this inequality holds with equality, - /// and the map returns true exactly for those edges. - /// To avoid rounding errors, it is recommended to use this class with exact - /// types, e.g. with int. - template - class TightEdgeFilterMap { - protected: - const Graph* g; - NodePotentialMap* node_potential; - EdgeDistanceMap* edge_distance; - public: - TightEdgeFilterMap(Graph& _g, NodePotentialMap& _node_potential, - EdgeDistanceMap& _edge_distance) : - g(&_g), node_potential(&_node_potential), - edge_distance(&_edge_distance) { } -// void set(const typename Graph::Node& n, int a) { -// pot->set(n, a); -// } -// int operator[](const typename Graph::Node& n) const { -// return (*node_potential)[n]; -// } - bool operator[](const typename Graph::Edge& e) const { - return ((*node_potential)[g->head(e)] == - (*edge_distance)[e]+(*node_potential)[g->tail(e)]); - } - }; - /// \addtogroup galgs /// @{ /// Class for augmenting path flow algorithms. diff -r 732f2acb7239 -r d27bbe17b0b8 src/work/marci/tight_edge_filter_map.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/work/marci/tight_edge_filter_map.h Thu Sep 16 11:11:01 2004 +0000 @@ -0,0 +1,46 @@ +// -*- C++ -*- +#ifndef HUGO_TIGHT_EDGE_FILTER_MAP_H +#define HUGO_TIGHT_EDGE_FILTER_MAP_H + +// /// \file +// /// \brief Maximum flow algorithms. +// /// \ingroup galgs + +namespace hugo { + + /// \brief A map for filtering the edge-set to those edges + /// which are tight w.r.t. some node_potential map and + /// edge_distance map. + /// + /// A node-map node_potential is said to be a potential w.r.t. + /// an edge-map edge_distance + /// if and only if for each edge e, node_potential[g.head(e)] + /// <= edge_distance[e]+node_potential[g.tail(e)] + /// (or the reverse inequality holds for each edge). + /// An edge is said to be tight if this inequality holds with equality, + /// and the map returns true exactly for those edges. + /// To avoid rounding errors, it is recommended to use this class with exact + /// types, e.g. with int. + template + class TightEdgeFilterMap { + protected: + const Graph* g; + NodePotentialMap* node_potential; + EdgeDistanceMap* edge_distance; + public: + TightEdgeFilterMap(Graph& _g, NodePotentialMap& _node_potential, + EdgeDistanceMap& _edge_distance) : + g(&_g), node_potential(&_node_potential), + edge_distance(&_edge_distance) { } + bool operator[](const typename Graph::Edge& e) const { + return ((*node_potential)[g->head(e)] == + (*edge_distance)[e]+(*node_potential)[g->tail(e)]); + } + }; + +} //namespace hugo + +#endif //HUGO_TIGHT_EDGE_FILTER_MAP_H + +