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