Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

tight_edge_filter_map.h

00001 /* -*- C++ -*-
00002  * demo/tight_edge_filter_map.h - Part of LEMON, a generic C++ optimization
00003  * library
00004  *
00005  * Copyright (C) 2005 Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
00006  * (Egervary Research Group on Combinatorial Optimization, EGRES).
00007  *
00008  * Permission to use, modify and distribute this software is granted
00009  * provided that this copyright notice appears in all copies. For
00010  * precise terms see the accompanying LICENSE file.
00011  *
00012  * This software is provided "AS IS" with no warranty of any kind,
00013  * express or implied, and with no claim as to its suitability for any
00014  * purpose.
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 // /// \file
00024 // /// \brief Maximum flow algorithms.
00025 // /// \ingroup galgs
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 } //namespace lemon
00067 
00068 #endif //LEMON_TIGHT_EDGE_FILTER_MAP_H

Generated on Sat Aug 27 14:14:50 2005 for LEMON by  doxygen 1.4.4