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.

/* -*- C++ -*-
 *
 * This file is a part of LEMON, a generic C++ optimization library
 *
 * Copyright (C) 2003-2008
 * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
 * (Egervary Research Group on Combinatorial Optimization, EGRES).
 *
 * Permission to use, modify and distribute this software is granted
 * provided that this copyright notice appears in all copies. For
 * precise terms see the accompanying LICENSE file.
 *
 * This software is provided "AS IS" with no warranty of any kind,
 * express or implied, and with no claim as to its suitability for any
 * purpose.
 *
 */

#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)]);
    }
  };

} //namespace lemon

#endif //DEMO_TIGHT_EDGE_FILTER_MAP_H
#include <lemon/maps.h>


Classes

class  TightEdgeFilterMap< Graph, NodePotentialMap, EdgeDistanceMap >
 A map for filtering the edge-set to those edges which are tight w.r.t. a node-potential and edge-distance. More...

Namespaces

namespace  lemon
 The namespace of LEMON.

Generated on Thu Jun 4 04:03:10 2009 for LEMON by  doxygen 1.5.9