# HG changeset patch
# User marci
# Date 1096625323 0
# Node ID ade3cdb9b45d15f36fc972247b79cce24a23f6e3
# Parent  9227ecd7b0bc84ec5882c6ab72e6126f047fae6a
New EdgeSubGraphWrapper class specializing SubGraphWrapper in the way that only the edge-set can be filtered.

diff -r 9227ecd7b0bc -r ade3cdb9b45d src/demo/sub_graph_wrapper_demo.cc
--- a/src/demo/sub_graph_wrapper_demo.cc	Thu Sep 30 17:32:00 2004 +0000
+++ b/src/demo/sub_graph_wrapper_demo.cc	Fri Oct 01 10:08:43 2004 +0000
@@ -55,10 +55,11 @@
     TightEdgeFilter;
   TightEdgeFilter tight_edge_filter(g, dijkstra.distMap(), length);
 
-  ConstMap<Node, bool> const_true_map(true);
+//  ConstMap<Node, bool> const_true_map(true);
   // This graph contains exaclty the tight edges.
-  typedef SubGraphWrapper<Graph, ConstMap<Node, bool>, TightEdgeFilter> SubGW;
-  SubGW gw(g, const_true_map, tight_edge_filter);
+// typedef SubGraphWrapper<Graph, ConstMap<Node, bool>, TightEdgeFilter> SubGW;
+  typedef EdgeSubGraphWrapper<Graph, TightEdgeFilter> SubGW;
+  SubGW gw(g, tight_edge_filter);
 
   ConstMap<Edge, int> const_1_map(1);
   Graph::EdgeMap<int> flow(g, 0);
diff -r 9227ecd7b0bc -r ade3cdb9b45d src/lemon/graph_wrapper.h
--- a/src/lemon/graph_wrapper.h	Thu Sep 30 17:32:00 2004 +0000
+++ b/src/lemon/graph_wrapper.h	Fri Oct 01 10:08:43 2004 +0000
@@ -430,9 +430,8 @@
     TightEdgeFilter;
   TightEdgeFilter tight_edge_filter(g, dijkstra.distMap(), length);
   
-  ConstMap<Node, bool> const_true_map(true);
-  typedef SubGraphWrapper<Graph, ConstMap<Node, bool>, TightEdgeFilter> SubGW;
-  SubGW gw(g, const_true_map, tight_edge_filter);
+  typedef EdgeSubGraphWrapper<Graph, TightEdgeFilter> SubGW;
+  SubGW gw(g, tight_edge_filter);
   \endcode
   Then, the maximum nimber of edge-disjoint \c s-\c t paths are computed 
   with a max flow algorithm Preflow.
@@ -671,6 +670,34 @@
   };
 
 
+  /*! \brief A wrapper for hiding edges from a graph.
+
+  \warning Graph wrappers are in even more experimental state than the other
+  parts of the lib. Use them at you own risk.
+  
+  A wrapper for hiding edges from a graph.
+  This wrapper specializes SubGraphWrapper in the way that only the edge-set 
+  can be filtered.
+  \author Marton Makai
+  */
+  template<typename Graph, typename EdgeFilterMap>
+  class EdgeSubGraphWrapper : 
+    public SubGraphWrapper<Graph, ConstMap<typename Graph::Node,bool>, 
+			   EdgeFilterMap> {
+  public:
+    typedef SubGraphWrapper<Graph, ConstMap<typename Graph::Node,bool>, 
+			    EdgeFilterMap> Parent;
+  protected:
+    ConstMap<typename Graph::Node, bool> const_true_map;
+  public:
+    EdgeSubGraphWrapper(Graph& _graph, EdgeFilterMap& _edge_filter_map) : 
+      Parent(), const_true_map(true) { 
+      Parent::setGraph(_graph);
+      Parent::setNodeFilterMap(const_true_map);
+      Parent::setEdgeFilterMap(_edge_filter_map);
+    }
+  };
+
 
   template<typename Graph>
   class UndirGraphWrapper : public GraphWrapper<Graph> {