00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #ifndef LEMON_TIGHT_EDGE_FILTER_MAP_H
00020 #define LEMON_TIGHT_EDGE_FILTER_MAP_H
00021
00022 #include <lemon/maps.h>
00023
00024
00025
00026
00027
00028 namespace lemon {
00029
00049 template<typename Graph,
00050 typename NodePotentialMap, typename EdgeDistanceMap>
00051 class TightEdgeFilterMap : public MapBase<typename Graph::Edge, bool> {
00052 protected:
00053 const Graph* g;
00054 NodePotentialMap* node_potential;
00055 EdgeDistanceMap* edge_distance;
00056 public:
00057 TightEdgeFilterMap(Graph& _g, NodePotentialMap& _node_potential,
00058 EdgeDistanceMap& _edge_distance) :
00059 g(&_g), node_potential(&_node_potential),
00060 edge_distance(&_edge_distance) { }
00061 bool operator[](const typename Graph::Edge& e) const {
00062 return ((*node_potential)[g->target(e)] ==
00063 (*edge_distance)[e]+(*node_potential)[g->source(e)]);
00064 }
00065 };
00066
00067 }
00068
00069 #endif //LEMON_TIGHT_EDGE_FILTER_MAP_H