[Lemon-commits] [lemon_svn] deba: r1305 - in hugo/branches/graph_factory/src: lemon lemon/skeletons test

Lemon SVN svn at lemon.cs.elte.hu
Mon Nov 6 20:44:30 CET 2006


Author: deba
Date: Fri Oct 22 18:09:02 2004
New Revision: 1305

Added:
   hugo/branches/graph_factory/src/test/graph_test.cc
      - copied unchanged from r1302, /hugo/branches/graph_factory/src/test/extended_graph_test.cc
Removed:
   hugo/branches/graph_factory/src/test/extended_graph_test.cc
Modified:
   hugo/branches/graph_factory/src/lemon/preflow.h
   hugo/branches/graph_factory/src/lemon/skeletons/graph.h
   hugo/branches/graph_factory/src/lemon/skeletons/graph_component.h
   hugo/branches/graph_factory/src/lemon/skeletons/maps.h
   hugo/branches/graph_factory/src/test/Makefile.am

Log:
extended_grapg_test.cc renamed to graph_test.cc
graphmap concept moved to skeletons/maps.h
nodeNum changed in preflow
non up to date tests erased from the test/Makefile.am



Modified: hugo/branches/graph_factory/src/lemon/preflow.h
==============================================================================
--- hugo/branches/graph_factory/src/lemon/preflow.h	(original)
+++ hugo/branches/graph_factory/src/lemon/preflow.h	Fri Oct 22 18:09:02 2004
@@ -140,7 +140,7 @@
       Preflow(const Graph& _G, Node _s, Node _t, 
 	      const CapMap& _capacity, FlowMap& _flow) :
 	g(&_G), s(_s), t(_t), capacity(&_capacity),
-	flow(&_flow), n(_G.nodeNum()), level(_G), excess(_G,0), 
+	flow(&_flow), n(countNodes(_G)), level(_G), excess(_G,0), 
 	flow_prop(NO_FLOW), status(AFTER_NOTHING) { }
 
 

Modified: hugo/branches/graph_factory/src/lemon/skeletons/graph.h
==============================================================================
--- hugo/branches/graph_factory/src/lemon/skeletons/graph.h	(original)
+++ hugo/branches/graph_factory/src/lemon/skeletons/graph.h	Fri Oct 22 18:09:02 2004
@@ -785,35 +785,6 @@
     };
 
 
-    template<typename Item, typename T, typename Graph>
-    class GraphMap : public ReadWriteMap<Item, T> {
-      // I really, really don't like the idea that every graph should have
-      // reference maps! --klao
-
-    private:
-      // We state explicitly that graph maps have no default constructor?
-      GraphMap();
-
-    public:
-      explicit GraphMap(Graph const&) {}
-      // value for initializing
-      GraphMap(Graph const&, T) {}
-
-      // this probably should be required:
-      GraphMap(GraphMap const&) {}
-      GraphMap& operator=(GraphMap const&) { return *this; }
-
-      // but this is a absolute no-op! We should provide a more generic
-      // graph-map-copy operation.
-      //
-      // template<typename TT>
-      // GraphMap(GraphMap<TT> const&);
-      //
-      // template<typename TT>
-      // GraphMap& operator=(const GraphMap<TT>&);
-    };
-
-
     /// A minimal GraphBase concept
 
     /// This class describes a minimal concept which can be extended to a

Modified: hugo/branches/graph_factory/src/lemon/skeletons/graph_component.h
==============================================================================
--- hugo/branches/graph_factory/src/lemon/skeletons/graph_component.h	(original)
+++ hugo/branches/graph_factory/src/lemon/skeletons/graph_component.h	Fri Oct 22 18:09:02 2004
@@ -367,7 +367,9 @@
       void constraints() {
 	const Graph& const_graph = graph;
 	int nid = const_graph.maxEdgeId();
+	ignore_unused_variable_warning(nid);
 	int eid = const_graph.maxNodeId();
+	ignore_unused_variable_warning(eid);
       }
 
       Graph& graph;
@@ -626,7 +628,7 @@
 	  edge = it;
 	}
       }
-      Graph graph;
+      Graph& graph;
     };
 
 
@@ -661,15 +663,17 @@
 	  function_requires<ReadMapConcept<EdgeIdMap> >();
 	  EdgeIdMap edge_map(graph);
 	  int n = edge_map.maxId();
+	  ignore_unused_variable_warning(n);
 	}
 	{
 	  typedef typename Graph::NodeIdMap NodeIdMap;
 	  function_requires<ReadMapConcept<NodeIdMap> >();
 	  NodeIdMap node_map(graph);
 	  int n = node_map.maxId();
+	  ignore_unused_variable_warning(n);
 	}
       }
-      Graph graph;
+      Graph& graph;
     };
 
 
@@ -717,64 +721,28 @@
       void constraints() {
 	{ // int map test
 	  typedef typename Graph::template NodeMap<int> IntNodeMap;
-	  function_requires<ReferenceMapConcept<IntNodeMap> >();
-	  const Graph& cgraph = graph;
-	  IntNodeMap igm(cgraph);
-	  IntNodeMap const &ccigm = igm;
-	  IntNodeMap igvm(graph, 42);
-	  IntNodeMap cigm(igm);
-	  cigm=igm;  
+	  function_requires<GraphMapConcept<IntNodeMap> >();
 	} { // bool map test
 	  typedef typename Graph::template NodeMap<bool> BoolNodeMap;
-	  function_requires<ReferenceMapConcept<BoolNodeMap> >();
-	  const Graph& cgraph = graph;
-	  BoolNodeMap igm(cgraph);
-	  BoolNodeMap const &ccigm = igm;
-	  BoolNodeMap igvm(graph, false);
-	  BoolNodeMap cigm(igm);
-	  cigm=igm;  
+	  function_requires<GraphMapConcept<BoolNodeMap> >();
 	} { // Type map test
 	  typedef typename Graph::template NodeMap<Type> TypeNodeMap;
-	  function_requires<ReferenceMapConcept<TypeNodeMap> >();
-	  const Graph& cgraph = graph;
-	  TypeNodeMap igm(cgraph);
-	  TypeNodeMap const &ccigm = igm;
-	  TypeNodeMap igvm(graph, Type(42));
-	  TypeNodeMap cigm(igm);
-	  cigm=igm;  
+	  function_requires<GraphMapConcept<TypeNodeMap> >();
 	} 
 
 	{ // int map test
 	  typedef typename Graph::template EdgeMap<int> IntEdgeMap;
-	  function_requires<ReferenceMapConcept<IntEdgeMap> >();
-	  const Graph& cgraph = graph;
-	  IntEdgeMap igm(cgraph);
-	  IntEdgeMap const &ccigm = igm;
-	  IntEdgeMap igvm(graph, 42);
-	  IntEdgeMap cigm(igm);
-	  cigm=igm;  
+	  function_requires<GraphMapConcept<IntEdgeMap> >();
 	} { // bool map test
 	  typedef typename Graph::template EdgeMap<bool> BoolEdgeMap;
-	  function_requires<ReferenceMapConcept<BoolEdgeMap> >();
-	  const Graph& cgraph = graph;
-	  BoolEdgeMap igm(cgraph);
-	  BoolEdgeMap const &ccigm = igm;
-	  BoolEdgeMap igvm(graph, false);
-	  BoolEdgeMap cigm(igm);
-	  cigm=igm;  
+	  function_requires<GraphMapConcept<BoolEdgeMap> >();
 	} { // Type map test
 	  typedef typename Graph::template EdgeMap<Type> TypeEdgeMap;
-	  function_requires<ReferenceMapConcept<TypeEdgeMap> >();
-	  const Graph& cgraph = graph;
-	  TypeEdgeMap igm(cgraph);
-	  TypeEdgeMap const &ccigm = igm;
-	  TypeEdgeMap igvm(graph, Type(42));
-	  TypeEdgeMap cigm(igm);
-	  cigm=igm;  
+	  function_requires<GraphMapConcept<TypeEdgeMap> >();
 	} 
       }
 
-      Graph graph;
+      Graph& graph;
     };
 
 
@@ -804,7 +772,7 @@
 	typename Graph::Edge edge;
 	edge = graph.addEdge(node_a, node_b);      
       }
-      Graph graph;
+      Graph& graph;
     };
 
     class ErasableGraphComponent : virtual public BaseGraphComponent {
@@ -829,7 +797,7 @@
 	graph.erase(edge);      
       }
 
-      Graph graph;
+      Graph& graph;
     };
 
     class ClearableGraphComponent : virtual public BaseGraphComponent {
@@ -849,7 +817,7 @@
       void constraints() {
 	graph.clear();
       }
-      Graph graph;
+      Graph& graph;
     };
 
   }

Modified: hugo/branches/graph_factory/src/lemon/skeletons/maps.h
==============================================================================
--- hugo/branches/graph_factory/src/lemon/skeletons/maps.h	(original)
+++ hugo/branches/graph_factory/src/lemon/skeletons/maps.h	Fri Oct 22 18:09:02 2004
@@ -116,6 +116,34 @@
     };
 
 
+    template<typename Item, typename T, typename Graph>
+    class GraphMap : public ReadWriteMap<Item, T> {
+      // I really, really don't like the idea that every graph should have
+      // reference maps! --klao
+
+    private:
+      // We state explicitly that graph maps have no default constructor?
+      GraphMap();
+
+    public:
+      explicit GraphMap(Graph const&) {}
+      // value for initializing
+      GraphMap(Graph const&, T) {}
+
+      // this probably should be required:
+      GraphMap(GraphMap const&) {}
+      GraphMap& operator=(GraphMap const&) { return *this; }
+
+      // but this is a absolute no-op! We should provide a more generic
+      // graph-map-copy operation.
+      //
+      // template<typename TT>
+      // GraphMap(GraphMap<TT> const&);
+      //
+      // template<typename TT>
+      // GraphMap& operator=(const GraphMap<TT>&);
+    };
+
 
     /****************  Concept-checking classes  ****************/
 
@@ -187,6 +215,15 @@
       KeyType k;
       ValueType v;
     };
+
+    /// \todo GraphMapConceptCheck
+
+    template<typename GraphMap>
+    struct GraphMapConcept {
+      void constraints() {
+	function_requires< ReferenceMapConcept<GraphMap> >();	
+      }
+    };
     
 
     // @}

Modified: hugo/branches/graph_factory/src/test/Makefile.am
==============================================================================
--- hugo/branches/graph_factory/src/test/Makefile.am	(original)
+++ hugo/branches/graph_factory/src/test/Makefile.am	Fri Oct 22 18:09:02 2004
@@ -9,9 +9,6 @@
 	dfs_test \
 	dijkstra_test \
 	graph_test \
-	sym_graph_test \
-	graph_factory_test \
-	graph_wrapper_test \
 	kruskal_test \
 	min_cost_flow_test \
 	new_graph_test \
@@ -31,9 +28,6 @@
 dfs_test_SOURCES = dfs_test.cc
 dijkstra_test_SOURCES = dijkstra_test.cc
 graph_test_SOURCES = graph_test.cc
-sym_graph_test_SOURCES = sym_graph_test.cc
-graph_wrapper_test_SOURCES = graph_wrapper_test.cc
-graph_factory_test_SOURCES = graph_factory_test.cc
 kruskal_test_SOURCES = kruskal_test.cc
 min_cost_flow_test_SOURCES = min_cost_flow_test.cc
 new_graph_test_SOURCES = new_graph_test.cc



More information about the Lemon-commits mailing list