tight_edge_filter_map.h File Reference
Detailed Description
Tight edge filter map is bool map on the edges of the graph which filters the edges which are not tight for a node-potential. It is used in the
sub_graph_adaptor_demo.cc file.
#ifndef DEMO_TIGHT_EDGE_FILTER_MAP_H
#define DEMO_TIGHT_EDGE_FILTER_MAP_H
#include <lemon/maps.h>
namespace lemon {
template<typename Graph,
typename NodePotentialMap, typename EdgeDistanceMap>
class TightEdgeFilterMap : public MapBase<typename Graph::Edge, bool> {
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->target(e)] ==
(*edge_distance)[e]+(*node_potential)[g->source(e)]);
}
};
}
#endif //DEMO_TIGHT_EDGE_FILTER_MAP_H
#include <lemon/maps.h>