Index: test/CMakeLists.txt
===================================================================
--- test/CMakeLists.txt	(revision 593)
+++ test/CMakeLists.txt	(revision 603)
@@ -1,5 +1,5 @@
 INCLUDE_DIRECTORIES(
-  ${CMAKE_SOURCE_DIR}
-  ${CMAKE_BINARY_DIR}
+  ${PROJECT_SOURCE_DIR}
+  ${PROJECT_BINARY_DIR}
 )
 
@@ -8,5 +8,5 @@
 ENDIF(HAVE_GLPK)
 
-LINK_DIRECTORIES(${CMAKE_BINARY_DIR}/lemon)
+LINK_DIRECTORIES(${PROJECT_BINARY_DIR}/lemon)
 
 SET(TESTS
@@ -22,4 +22,5 @@
   error_test
   euler_test
+  gomory_hu_test
   graph_copy_test
   graph_test
@@ -29,5 +30,5 @@
   kruskal_test
   maps_test
-  max_matching_test
+  matching_test
   min_cost_arborescence_test
   min_cost_flow_test
Index: test/Makefile.am
===================================================================
--- test/Makefile.am	(revision 593)
+++ test/Makefile.am	(revision 603)
@@ -18,4 +18,5 @@
 	test/error_test \
 	test/euler_test \
+	test/gomory_hu_test \
 	test/graph_copy_test \
 	test/graph_test \
@@ -25,5 +26,5 @@
 	test/kruskal_test \
 	test/maps_test \
-	test/max_matching_test \
+	test/matching_test \
 	test/min_cost_arborescence_test \
 	test/min_cost_flow_test \
@@ -37,4 +38,6 @@
 	test/time_measure_test \
 	test/unionfind_test
+
+test_test_tools_pass_DEPENDENCIES = demo
 
 if HAVE_LP
@@ -59,4 +62,5 @@
 test_error_test_SOURCES = test/error_test.cc
 test_euler_test_SOURCES = test/euler_test.cc
+test_gomory_hu_test_SOURCES = test/gomory_hu_test.cc
 test_graph_copy_test_SOURCES = test/graph_copy_test.cc
 test_graph_test_SOURCES = test/graph_test.cc
@@ -68,5 +72,5 @@
 test_maps_test_SOURCES = test/maps_test.cc
 test_mip_test_SOURCES = test/mip_test.cc
-test_max_matching_test_SOURCES = test/max_matching_test.cc
+test_matching_test_SOURCES = test/matching_test.cc
 test_min_cost_arborescence_test_SOURCES = test/min_cost_arborescence_test.cc
 test_min_cost_flow_test_SOURCES = test/min_cost_flow_test.cc
Index: test/bfs_test.cc
===================================================================
--- test/bfs_test.cc	(revision 440)
+++ test/bfs_test.cc	(revision 577)
@@ -59,14 +59,16 @@
 
   Digraph G;
-  Node s, t;
+  Node s, t, n;
   Arc e;
-  int l;
+  int l, i;
   bool b;
   BType::DistMap d(G);
   BType::PredMap p(G);
   Path<Digraph> pp;
+  concepts::ReadMap<Node,bool> nm;
 
   {
     BType bfs_test(G);
+    const BType& const_bfs_test = bfs_test;
 
     bfs_test.run(s);
@@ -74,11 +76,24 @@
     bfs_test.run();
 
-    l  = bfs_test.dist(t);
-    e  = bfs_test.predArc(t);
-    s  = bfs_test.predNode(t);
-    b  = bfs_test.reached(t);
-    d  = bfs_test.distMap();
-    p  = bfs_test.predMap();
-    pp = bfs_test.path(t);
+    bfs_test.init();
+    bfs_test.addSource(s);
+    n = bfs_test.processNextNode();
+    n = bfs_test.processNextNode(t, b);
+    n = bfs_test.processNextNode(nm, n);
+    n = const_bfs_test.nextNode();
+    b = const_bfs_test.emptyQueue();
+    i = const_bfs_test.queueSize();
+    
+    bfs_test.start();
+    bfs_test.start(t);
+    bfs_test.start(nm);
+
+    l  = const_bfs_test.dist(t);
+    e  = const_bfs_test.predArc(t);
+    s  = const_bfs_test.predNode(t);
+    b  = const_bfs_test.reached(t);
+    d  = const_bfs_test.distMap();
+    p  = const_bfs_test.predMap();
+    pp = const_bfs_test.path(t);
   }
   {
@@ -87,11 +102,35 @@
       ::SetDistMap<concepts::ReadWriteMap<Node,int> >
       ::SetReachedMap<concepts::ReadWriteMap<Node,bool> >
+      ::SetStandardProcessedMap
       ::SetProcessedMap<concepts::WriteMap<Node,bool> >
-      ::SetStandardProcessedMap
       ::Create bfs_test(G);
+      
+    concepts::ReadWriteMap<Node,Arc> pred_map;
+    concepts::ReadWriteMap<Node,int> dist_map;
+    concepts::ReadWriteMap<Node,bool> reached_map;
+    concepts::WriteMap<Node,bool> processed_map;
+    
+    bfs_test
+      .predMap(pred_map)
+      .distMap(dist_map)
+      .reachedMap(reached_map)
+      .processedMap(processed_map);
 
     bfs_test.run(s);
     bfs_test.run(s,t);
     bfs_test.run();
+    
+    bfs_test.init();
+    bfs_test.addSource(s);
+    n = bfs_test.processNextNode();
+    n = bfs_test.processNextNode(t, b);
+    n = bfs_test.processNextNode(nm, n);
+    n = bfs_test.nextNode();
+    b = bfs_test.emptyQueue();
+    i = bfs_test.queueSize();
+    
+    bfs_test.start();
+    bfs_test.start(t);
+    bfs_test.start(nm);
 
     l  = bfs_test.dist(t);
Index: test/circulation_test.cc
===================================================================
--- test/circulation_test.cc	(revision 602)
+++ test/circulation_test.cc	(revision 603)
@@ -72,16 +72,20 @@
   FlowMap flow;
   BarrierMap bar;
+  VType v;
+  bool b;
 
-  Circulation<Digraph, CapMap, CapMap, SupplyMap>
-    ::SetFlowMap<FlowMap>
-    ::SetElevator<Elev>
-    ::SetStandardElevator<LinkedElev>
-    ::Create circ_test(g,lcap,ucap,supply);
-
-  circ_test.lowerMap(lcap);
-  circ_test.upperMap(ucap);
-  circ_test.supplyMap(supply);
-  flow = circ_test.flowMap();
-  circ_test.flowMap(flow);
+  typedef Circulation<Digraph, CapMap, CapMap, SupplyMap>
+            ::SetFlowMap<FlowMap>
+            ::SetElevator<Elev>
+            ::SetStandardElevator<LinkedElev>
+            ::Create CirculationType;
+  CirculationType circ_test(g, lcap, ucap, supply);
+  const CirculationType& const_circ_test = circ_test;
+   
+  circ_test
+    .lowerMap(lcap)
+    .upperMap(ucap)
+    .supplyMap(supply)
+    .flowMap(flow);
 
   circ_test.init();
@@ -90,7 +94,10 @@
   circ_test.run();
 
-  circ_test.barrier(n);
-  circ_test.barrierMap(bar);
-  circ_test.flow(a);
+  v = const_circ_test.flow(a);
+  const FlowMap& fm = const_circ_test.flowMap();
+  b = const_circ_test.barrier(n);
+  const_circ_test.barrierMap(bar);
+  
+  ignore_unused_variable_warning(fm);
 }
 
Index: test/counter_test.cc
===================================================================
--- test/counter_test.cc	(revision 440)
+++ test/counter_test.cc	(revision 549)
@@ -19,4 +19,7 @@
 #include <lemon/counter.h>
 #include <vector>
+#include <sstream>
+
+#include "test/test_tools.h"
 
 using namespace lemon;
@@ -24,52 +27,76 @@
 template <typename T>
 void bubbleSort(std::vector<T>& v) {
-  Counter op("Bubble Sort - Operations: ");
-  Counter::NoSubCounter as(op, "Assignments: ");
-  Counter::NoSubCounter co(op, "Comparisons: ");
-  for (int i = v.size()-1; i > 0; --i) {
-    for (int j = 0; j < i; ++j) {
-      if (v[j] > v[j+1]) {
-        T tmp = v[j];
-        v[j] = v[j+1];
-        v[j+1] = tmp;
-        as += 3;
+  std::stringstream s1, s2, s3;
+  {
+    Counter op("Bubble Sort - Operations: ", s1);
+    Counter::SubCounter as(op, "Assignments: ", s2);
+    Counter::SubCounter co(op, "Comparisons: ", s3);
+    for (int i = v.size()-1; i > 0; --i) {
+      for (int j = 0; j < i; ++j) {
+        if (v[j] > v[j+1]) {
+          T tmp = v[j];
+          v[j] = v[j+1];
+          v[j+1] = tmp;
+          as += 3;
+        }
+        ++co;
       }
-      ++co;
     }
   }
+  check(s1.str() == "Bubble Sort - Operations: 102\n", "Wrong counter");
+  check(s2.str() == "Assignments: 57\n", "Wrong subcounter");
+  check(s3.str() == "Comparisons: 45\n", "Wrong subcounter");
 }
 
 template <typename T>
 void insertionSort(std::vector<T>& v) {
-  Counter op("Insertion Sort - Operations: ");
-  Counter::NoSubCounter as(op, "Assignments: ");
-  Counter::NoSubCounter co(op, "Comparisons: ");
-  for (int i = 1; i < int(v.size()); ++i) {
-    T value = v[i];
-    ++as;
-    int j = i;
-    while (j > 0 && v[j-1] > value) {
-      v[j] = v[j-1];
-      --j;
-      ++co; ++as;
+  std::stringstream s1, s2, s3;
+  {
+    Counter op("Insertion Sort - Operations: ", s1);
+    Counter::SubCounter as(op, "Assignments: ", s2);
+    Counter::SubCounter co(op, "Comparisons: ", s3);
+    for (int i = 1; i < int(v.size()); ++i) {
+      T value = v[i];
+      ++as;
+      int j = i;
+      while (j > 0 && v[j-1] > value) {
+        v[j] = v[j-1];
+        --j;
+        ++co; ++as;
+      }
+      v[j] = value;
+      ++as;
     }
-    v[j] = value;
-    ++as;
   }
+  check(s1.str() == "Insertion Sort - Operations: 56\n", "Wrong counter");
+  check(s2.str() == "Assignments: 37\n", "Wrong subcounter");
+  check(s3.str() == "Comparisons: 19\n", "Wrong subcounter");
 }
 
 template <typename MyCounter>
-void counterTest() {
-  MyCounter c("Main Counter: ");
-  c++;
-  typename MyCounter::SubCounter d(c, "SubCounter: ");
-  d++;
-  typename MyCounter::SubCounter::NoSubCounter e(d, "SubSubCounter: ");
-  e++;
-  d+=3;
-  c-=4;
-  e-=2;
-  c.reset(2);
-  c.reset();
+void counterTest(bool output) {
+  std::stringstream s1, s2, s3;
+  {
+    MyCounter c("Main Counter: ", s1);
+    c++;
+    typename MyCounter::SubCounter d(c, "SubCounter: ", s2);
+    d++;
+    typename MyCounter::SubCounter::NoSubCounter e(d, "SubSubCounter: ", s3);
+    e++;
+    d+=3;
+    c-=4;
+    e-=2;
+    c.reset(2);
+    c.reset();
+  }
+  if (output) {
+    check(s1.str() == "Main Counter: 3\n", "Wrong Counter");
+    check(s2.str() == "SubCounter: 3\n", "Wrong SubCounter");
+    check(s3.str() == "", "Wrong NoSubCounter");
+  } else {
+    check(s1.str() == "", "Wrong NoCounter");
+    check(s2.str() == "", "Wrong SubCounter");
+    check(s3.str() == "", "Wrong NoSubCounter");
+  }
 }
 
@@ -81,6 +108,6 @@
 int main()
 {
-  counterTest<Counter>();
-  counterTest<NoCounter>();
+  counterTest<Counter>(true);
+  counterTest<NoCounter>(false);
 
   std::vector<int> x(10);
Index: test/dfs_test.cc
===================================================================
--- test/dfs_test.cc	(revision 440)
+++ test/dfs_test.cc	(revision 577)
@@ -63,12 +63,14 @@
   Node s, t;
   Arc e;
-  int l;
+  int l, i;
   bool b;
   DType::DistMap d(G);
   DType::PredMap p(G);
   Path<Digraph> pp;
+  concepts::ReadMap<Arc,bool> am;
 
   {
     DType dfs_test(G);
+    const DType& const_dfs_test = dfs_test;
 
     dfs_test.run(s);
@@ -76,11 +78,22 @@
     dfs_test.run();
 
-    l  = dfs_test.dist(t);
-    e  = dfs_test.predArc(t);
-    s  = dfs_test.predNode(t);
-    b  = dfs_test.reached(t);
-    d  = dfs_test.distMap();
-    p  = dfs_test.predMap();
-    pp = dfs_test.path(t);
+    dfs_test.init();
+    dfs_test.addSource(s);
+    e = dfs_test.processNextArc();
+    e = const_dfs_test.nextArc();
+    b = const_dfs_test.emptyQueue();
+    i = const_dfs_test.queueSize();
+    
+    dfs_test.start();
+    dfs_test.start(t);
+    dfs_test.start(am);
+
+    l  = const_dfs_test.dist(t);
+    e  = const_dfs_test.predArc(t);
+    s  = const_dfs_test.predNode(t);
+    b  = const_dfs_test.reached(t);
+    d  = const_dfs_test.distMap();
+    p  = const_dfs_test.predMap();
+    pp = const_dfs_test.path(t);
   }
   {
@@ -89,11 +102,33 @@
       ::SetDistMap<concepts::ReadWriteMap<Node,int> >
       ::SetReachedMap<concepts::ReadWriteMap<Node,bool> >
+      ::SetStandardProcessedMap
       ::SetProcessedMap<concepts::WriteMap<Node,bool> >
-      ::SetStandardProcessedMap
       ::Create dfs_test(G);
+
+    concepts::ReadWriteMap<Node,Arc> pred_map;
+    concepts::ReadWriteMap<Node,int> dist_map;
+    concepts::ReadWriteMap<Node,bool> reached_map;
+    concepts::WriteMap<Node,bool> processed_map;
+    
+    dfs_test
+      .predMap(pred_map)
+      .distMap(dist_map)
+      .reachedMap(reached_map)
+      .processedMap(processed_map);
 
     dfs_test.run(s);
     dfs_test.run(s,t);
     dfs_test.run();
+    dfs_test.init();
+
+    dfs_test.addSource(s);
+    e = dfs_test.processNextArc();
+    e = dfs_test.nextArc();
+    b = dfs_test.emptyQueue();
+    i = dfs_test.queueSize();
+    
+    dfs_test.start();
+    dfs_test.start(t);
+    dfs_test.start(am);
 
     l  = dfs_test.dist(t);
Index: test/dijkstra_test.cc
===================================================================
--- test/dijkstra_test.cc	(revision 440)
+++ test/dijkstra_test.cc	(revision 577)
@@ -61,7 +61,8 @@
 
   Digraph G;
-  Node s, t;
+  Node s, t, n;
   Arc e;
   VType l;
+  int i;
   bool b;
   DType::DistMap d(G);
@@ -69,10 +70,75 @@
   LengthMap length;
   Path<Digraph> pp;
+  concepts::ReadMap<Node,bool> nm;
 
   {
     DType dijkstra_test(G,length);
+    const DType& const_dijkstra_test = dijkstra_test;
 
     dijkstra_test.run(s);
     dijkstra_test.run(s,t);
+
+    dijkstra_test.init();
+    dijkstra_test.addSource(s);
+    dijkstra_test.addSource(s, 1);
+    n = dijkstra_test.processNextNode();
+    n = const_dijkstra_test.nextNode();
+    b = const_dijkstra_test.emptyQueue();
+    i = const_dijkstra_test.queueSize();
+    
+    dijkstra_test.start();
+    dijkstra_test.start(t);
+    dijkstra_test.start(nm);
+
+    l  = const_dijkstra_test.dist(t);
+    e  = const_dijkstra_test.predArc(t);
+    s  = const_dijkstra_test.predNode(t);
+    b  = const_dijkstra_test.reached(t);
+    b  = const_dijkstra_test.processed(t);
+    d  = const_dijkstra_test.distMap();
+    p  = const_dijkstra_test.predMap();
+    pp = const_dijkstra_test.path(t);
+    l  = const_dijkstra_test.currentDist(t);
+  }
+  {
+    DType
+      ::SetPredMap<concepts::ReadWriteMap<Node,Arc> >
+      ::SetDistMap<concepts::ReadWriteMap<Node,VType> >
+      ::SetStandardProcessedMap
+      ::SetProcessedMap<concepts::WriteMap<Node,bool> >
+      ::SetOperationTraits<DijkstraDefaultOperationTraits<VType> >
+      ::SetHeap<BinHeap<VType, concepts::ReadWriteMap<Node,int> > >
+      ::SetStandardHeap<BinHeap<VType, concepts::ReadWriteMap<Node,int> > >
+      ::SetHeap<BinHeap<VType, concepts::ReadWriteMap<Node,int> >, 
+                concepts::ReadWriteMap<Node,int> >
+      ::Create dijkstra_test(G,length);
+
+    LengthMap length_map;
+    concepts::ReadWriteMap<Node,Arc> pred_map;
+    concepts::ReadWriteMap<Node,VType> dist_map;
+    concepts::WriteMap<Node,bool> processed_map;
+    concepts::ReadWriteMap<Node,int> heap_cross_ref;
+    BinHeap<VType, concepts::ReadWriteMap<Node,int> > heap(heap_cross_ref);
+    
+    dijkstra_test
+      .lengthMap(length_map)
+      .predMap(pred_map)
+      .distMap(dist_map)
+      .processedMap(processed_map)
+      .heap(heap, heap_cross_ref);
+
+    dijkstra_test.run(s);
+    dijkstra_test.run(s,t);
+
+    dijkstra_test.addSource(s);
+    dijkstra_test.addSource(s, 1);
+    n = dijkstra_test.processNextNode();
+    n = dijkstra_test.nextNode();
+    b = dijkstra_test.emptyQueue();
+    i = dijkstra_test.queueSize();
+    
+    dijkstra_test.start();
+    dijkstra_test.start(t);
+    dijkstra_test.start(nm);
 
     l  = dijkstra_test.dist(t);
@@ -80,27 +146,7 @@
     s  = dijkstra_test.predNode(t);
     b  = dijkstra_test.reached(t);
-    d  = dijkstra_test.distMap();
-    p  = dijkstra_test.predMap();
+    b  = dijkstra_test.processed(t);
     pp = dijkstra_test.path(t);
-  }
-  {
-    DType
-      ::SetPredMap<concepts::ReadWriteMap<Node,Arc> >
-      ::SetDistMap<concepts::ReadWriteMap<Node,VType> >
-      ::SetProcessedMap<concepts::WriteMap<Node,bool> >
-      ::SetStandardProcessedMap
-      ::SetOperationTraits<DijkstraDefaultOperationTraits<VType> >
-      ::SetHeap<BinHeap<VType, concepts::ReadWriteMap<Node,int> > >
-      ::SetStandardHeap<BinHeap<VType, concepts::ReadWriteMap<Node,int> > >
-      ::Create dijkstra_test(G,length);
-
-    dijkstra_test.run(s);
-    dijkstra_test.run(s,t);
-
-    l  = dijkstra_test.dist(t);
-    e  = dijkstra_test.predArc(t);
-    s  = dijkstra_test.predNode(t);
-    b  = dijkstra_test.reached(t);
-    pp = dijkstra_test.path(t);
+    l  = dijkstra_test.currentDist(t);
   }
 
Index: test/euler_test.cc
===================================================================
--- test/euler_test.cc	(revision 517)
+++ test/euler_test.cc	(revision 584)
@@ -19,61 +19,64 @@
 #include <lemon/euler.h>
 #include <lemon/list_graph.h>
-#include <test/test_tools.h>
+#include <lemon/adaptors.h>
+#include "test_tools.h"
 
 using namespace lemon;
 
 template <typename Digraph>
-void checkDiEulerIt(const Digraph& g)
+void checkDiEulerIt(const Digraph& g,
+                    const typename Digraph::Node& start = INVALID)
 {
   typename Digraph::template ArcMap<int> visitationNumber(g, 0);
 
-  DiEulerIt<Digraph> e(g);
+  DiEulerIt<Digraph> e(g, start);
+  if (e == INVALID) return;
   typename Digraph::Node firstNode = g.source(e);
   typename Digraph::Node lastNode = g.target(e);
-
-  for (; e != INVALID; ++e)
-  {
-    if (e != INVALID)
-    {
-      lastNode = g.target(e);
-    }
+  if (start != INVALID) {
+    check(firstNode == start, "checkDiEulerIt: Wrong first node");
+  }
+
+  for (; e != INVALID; ++e) {
+    if (e != INVALID) lastNode = g.target(e);
     ++visitationNumber[e];
   }
 
   check(firstNode == lastNode,
-      "checkDiEulerIt: first and last node are not the same");
+      "checkDiEulerIt: First and last nodes are not the same");
 
   for (typename Digraph::ArcIt a(g); a != INVALID; ++a)
   {
     check(visitationNumber[a] == 1,
-        "checkDiEulerIt: not visited or multiple times visited arc found");
+        "checkDiEulerIt: Not visited or multiple times visited arc found");
   }
 }
 
 template <typename Graph>
-void checkEulerIt(const Graph& g)
+void checkEulerIt(const Graph& g,
+                  const typename Graph::Node& start = INVALID)
 {
   typename Graph::template EdgeMap<int> visitationNumber(g, 0);
 
-  EulerIt<Graph> e(g);
-  typename Graph::Node firstNode = g.u(e);
-  typename Graph::Node lastNode = g.v(e);
-
-  for (; e != INVALID; ++e)
-  {
-    if (e != INVALID)
-    {
-      lastNode = g.v(e);
-    }
+  EulerIt<Graph> e(g, start);
+  if (e == INVALID) return;
+  typename Graph::Node firstNode = g.source(typename Graph::Arc(e));
+  typename Graph::Node lastNode = g.target(typename Graph::Arc(e));
+  if (start != INVALID) {
+    check(firstNode == start, "checkEulerIt: Wrong first node");
+  }
+
+  for (; e != INVALID; ++e) {
+    if (e != INVALID) lastNode = g.target(typename Graph::Arc(e));
     ++visitationNumber[e];
   }
 
   check(firstNode == lastNode,
-      "checkEulerIt: first and last node are not the same");
+      "checkEulerIt: First and last nodes are not the same");
 
   for (typename Graph::EdgeIt e(g); e != INVALID; ++e)
   {
     check(visitationNumber[e] == 1,
-        "checkEulerIt: not visited or multiple times visited edge found");
+        "checkEulerIt: Not visited or multiple times visited edge found");
   }
 }
@@ -82,71 +85,138 @@
 {
   typedef ListDigraph Digraph;
-  typedef ListGraph Graph;
-
-  Digraph digraphWithEulerianCircuit;
-  {
-    Digraph& g = digraphWithEulerianCircuit;
-
-    Digraph::Node n0 = g.addNode();
-    Digraph::Node n1 = g.addNode();
-    Digraph::Node n2 = g.addNode();
-
-    g.addArc(n0, n1);
-    g.addArc(n1, n0);
-    g.addArc(n1, n2);
-    g.addArc(n2, n1);
-  }
-
-  Digraph digraphWithoutEulerianCircuit;
-  {
-    Digraph& g = digraphWithoutEulerianCircuit;
-
-    Digraph::Node n0 = g.addNode();
-    Digraph::Node n1 = g.addNode();
-    Digraph::Node n2 = g.addNode();
-
-    g.addArc(n0, n1);
-    g.addArc(n1, n0);
-    g.addArc(n1, n2);
-  }
-
-  Graph graphWithEulerianCircuit;
-  {
-    Graph& g = graphWithEulerianCircuit;
-
-    Graph::Node n0 = g.addNode();
-    Graph::Node n1 = g.addNode();
-    Graph::Node n2 = g.addNode();
-
-    g.addEdge(n0, n1);
-    g.addEdge(n1, n2);
-    g.addEdge(n2, n0);
-  }
-
-  Graph graphWithoutEulerianCircuit;
-  {
-    Graph& g = graphWithoutEulerianCircuit;
-
-    Graph::Node n0 = g.addNode();
-    Graph::Node n1 = g.addNode();
-    Graph::Node n2 = g.addNode();
-
-    g.addEdge(n0, n1);
-    g.addEdge(n1, n2);
-  }
-
-  checkDiEulerIt(digraphWithEulerianCircuit);
-
-  checkEulerIt(graphWithEulerianCircuit);
-
-  check(eulerian(digraphWithEulerianCircuit),
-      "this graph should have an Eulerian circuit");
-  check(!eulerian(digraphWithoutEulerianCircuit),
-      "this graph should not have an Eulerian circuit");
-
-  check(eulerian(graphWithEulerianCircuit),
-      "this graph should have an Eulerian circuit");
-  check(!eulerian(graphWithoutEulerianCircuit),
-      "this graph should have an Eulerian circuit");
+  typedef Undirector<Digraph> Graph;
+  
+  {
+    Digraph d;
+    Graph g(d);
+    
+    checkDiEulerIt(d);
+    checkDiEulerIt(g);
+    checkEulerIt(g);
+
+    check(eulerian(d), "This graph is Eulerian");
+    check(eulerian(g), "This graph is Eulerian");
+  }
+  {
+    Digraph d;
+    Graph g(d);
+    Digraph::Node n = d.addNode();
+
+    checkDiEulerIt(d);
+    checkDiEulerIt(g);
+    checkEulerIt(g);
+
+    check(eulerian(d), "This graph is Eulerian");
+    check(eulerian(g), "This graph is Eulerian");
+  }
+  {
+    Digraph d;
+    Graph g(d);
+    Digraph::Node n = d.addNode();
+    d.addArc(n, n);
+
+    checkDiEulerIt(d);
+    checkDiEulerIt(g);
+    checkEulerIt(g);
+
+    check(eulerian(d), "This graph is Eulerian");
+    check(eulerian(g), "This graph is Eulerian");
+  }
+  {
+    Digraph d;
+    Graph g(d);
+    Digraph::Node n1 = d.addNode();
+    Digraph::Node n2 = d.addNode();
+    Digraph::Node n3 = d.addNode();
+    
+    d.addArc(n1, n2);
+    d.addArc(n2, n1);
+    d.addArc(n2, n3);
+    d.addArc(n3, n2);
+
+    checkDiEulerIt(d);
+    checkDiEulerIt(d, n2);
+    checkDiEulerIt(g);
+    checkDiEulerIt(g, n2);
+    checkEulerIt(g);
+    checkEulerIt(g, n2);
+
+    check(eulerian(d), "This graph is Eulerian");
+    check(eulerian(g), "This graph is Eulerian");
+  }
+  {
+    Digraph d;
+    Graph g(d);
+    Digraph::Node n1 = d.addNode();
+    Digraph::Node n2 = d.addNode();
+    Digraph::Node n3 = d.addNode();
+    Digraph::Node n4 = d.addNode();
+    Digraph::Node n5 = d.addNode();
+    Digraph::Node n6 = d.addNode();
+    
+    d.addArc(n1, n2);
+    d.addArc(n2, n4);
+    d.addArc(n1, n3);
+    d.addArc(n3, n4);
+    d.addArc(n4, n1);
+    d.addArc(n3, n5);
+    d.addArc(n5, n2);
+    d.addArc(n4, n6);
+    d.addArc(n2, n6);
+    d.addArc(n6, n1);
+    d.addArc(n6, n3);
+
+    checkDiEulerIt(d);
+    checkDiEulerIt(d, n1);
+    checkDiEulerIt(d, n5);
+
+    checkDiEulerIt(g);
+    checkDiEulerIt(g, n1);
+    checkDiEulerIt(g, n5);
+    checkEulerIt(g);
+    checkEulerIt(g, n1);
+    checkEulerIt(g, n5);
+
+    check(eulerian(d), "This graph is Eulerian");
+    check(eulerian(g), "This graph is Eulerian");
+  }
+  {
+    Digraph d;
+    Graph g(d);
+    Digraph::Node n0 = d.addNode();
+    Digraph::Node n1 = d.addNode();
+    Digraph::Node n2 = d.addNode();
+    Digraph::Node n3 = d.addNode();
+    Digraph::Node n4 = d.addNode();
+    Digraph::Node n5 = d.addNode();
+    
+    d.addArc(n1, n2);
+    d.addArc(n2, n3);
+    d.addArc(n3, n1);
+
+    checkDiEulerIt(d);
+    checkDiEulerIt(d, n2);
+
+    checkDiEulerIt(g);
+    checkDiEulerIt(g, n2);
+    checkEulerIt(g);
+    checkEulerIt(g, n2);
+
+    check(!eulerian(d), "This graph is not Eulerian");
+    check(!eulerian(g), "This graph is not Eulerian");
+  }
+  {
+    Digraph d;
+    Graph g(d);
+    Digraph::Node n1 = d.addNode();
+    Digraph::Node n2 = d.addNode();
+    Digraph::Node n3 = d.addNode();
+    
+    d.addArc(n1, n2);
+    d.addArc(n2, n3);
+
+    check(!eulerian(d), "This graph is not Eulerian");
+    check(!eulerian(g), "This graph is not Eulerian");
+  }
 
   return 0;
Index: test/gomory_hu_test.cc
===================================================================
--- test/gomory_hu_test.cc	(revision 588)
+++ test/gomory_hu_test.cc	(revision 588)
@@ -0,0 +1,123 @@
+#include <iostream>
+
+#include "test_tools.h"
+#include <lemon/smart_graph.h>
+#include <lemon/concepts/graph.h>
+#include <lemon/concepts/maps.h>
+#include <lemon/lgf_reader.h>
+#include <lemon/gomory_hu.h>
+#include <cstdlib>
+
+using namespace std;
+using namespace lemon;
+
+typedef SmartGraph Graph;
+
+char test_lgf[] =
+  "@nodes\n"
+  "label\n"
+  "0\n"
+  "1\n"
+  "2\n"
+  "3\n"
+  "4\n"
+  "@arcs\n"
+  "     label capacity\n"
+  "0 1  0     1\n"
+  "1 2  1     1\n"
+  "2 3  2     1\n"
+  "0 3  4     5\n"
+  "0 3  5     10\n"
+  "0 3  6     7\n"
+  "4 2  7     1\n"
+  "@attributes\n"
+  "source 0\n"
+  "target 3\n";
+  
+void checkGomoryHuCompile()
+{
+  typedef int Value;
+  typedef concepts::Graph Graph;
+
+  typedef Graph::Node Node;
+  typedef Graph::Edge Edge;
+  typedef concepts::ReadMap<Edge, Value> CapMap;
+  typedef concepts::ReadWriteMap<Node, bool> CutMap;
+
+  Graph g;
+  Node n;
+  CapMap cap;
+  CutMap cut;
+  Value v;
+  int d;
+
+  GomoryHu<Graph, CapMap> gh_test(g, cap);
+  const GomoryHu<Graph, CapMap>&
+    const_gh_test = gh_test;
+
+  gh_test.run();
+
+  n = const_gh_test.predNode(n);
+  v = const_gh_test.predValue(n);
+  d = const_gh_test.rootDist(n);
+  v = const_gh_test.minCutValue(n, n);
+  v = const_gh_test.minCutMap(n, n, cut);
+}
+
+GRAPH_TYPEDEFS(Graph);
+typedef Graph::EdgeMap<int> IntEdgeMap;
+typedef Graph::NodeMap<bool> BoolNodeMap;
+
+int cutValue(const Graph& graph, const BoolNodeMap& cut,
+	     const IntEdgeMap& capacity) {
+
+  int sum = 0;
+  for (EdgeIt e(graph); e != INVALID; ++e) {
+    Node s = graph.u(e);
+    Node t = graph.v(e);
+
+    if (cut[s] != cut[t]) {
+      sum += capacity[e];
+    }
+  }
+  return sum;
+}
+
+
+int main() {
+  Graph graph;
+  IntEdgeMap capacity(graph);
+
+  std::istringstream input(test_lgf);
+  GraphReader<Graph>(graph, input).
+    edgeMap("capacity", capacity).run();
+
+  GomoryHu<Graph> ght(graph, capacity);
+  ght.run();
+
+  for (NodeIt u(graph); u != INVALID; ++u) {
+    for (NodeIt v(graph); v != u; ++v) {
+      Preflow<Graph, IntEdgeMap> pf(graph, capacity, u, v);
+      pf.runMinCut();
+      BoolNodeMap cm(graph);
+      ght.minCutMap(u, v, cm);
+      check(pf.flowValue() == ght.minCutValue(u, v), "Wrong cut 1");
+      check(cm[u] != cm[v], "Wrong cut 2");
+      check(pf.flowValue() == cutValue(graph, cm, capacity), "Wrong cut 3");
+
+      int sum=0;
+      for(GomoryHu<Graph>::MinCutEdgeIt a(ght, u, v);a!=INVALID;++a)
+        sum+=capacity[a]; 
+      check(sum == ght.minCutValue(u, v), "Problem with MinCutEdgeIt");
+
+      sum=0;
+      for(GomoryHu<Graph>::MinCutNodeIt n(ght, u, v,true);n!=INVALID;++n)
+        sum++;
+      for(GomoryHu<Graph>::MinCutNodeIt n(ght, u, v,false);n!=INVALID;++n)
+        sum++;
+      check(sum == countNodes(graph), "Problem with MinCutNodeIt");
+    }
+  }
+  
+  return 0;
+}
Index: test/graph_utils_test.cc
===================================================================
--- test/graph_utils_test.cc	(revision 440)
+++ test/graph_utils_test.cc	(revision 564)
@@ -39,6 +39,6 @@
       digraph.addNode();
     }
-    DescriptorMap<Digraph, Node> nodes(digraph);
-    typename DescriptorMap<Digraph, Node>::InverseMap invNodes(nodes);
+    RangeIdMap<Digraph, Node> nodes(digraph);
+    typename RangeIdMap<Digraph, Node>::InverseMap invNodes(nodes);
     for (int i = 0; i < 100; ++i) {
       int src = rnd[invNodes.size()];
@@ -47,5 +47,5 @@
     }
     typename Digraph::template ArcMap<bool> found(digraph, false);
-    DescriptorMap<Digraph, Arc> arcs(digraph);
+    RangeIdMap<Digraph, Arc> arcs(digraph);
     for (NodeIt src(digraph); src != INVALID; ++src) {
       for (NodeIt trg(digraph); trg != INVALID; ++trg) {
@@ -114,6 +114,6 @@
     graph.addNode();
   }
-  DescriptorMap<Graph, Node> nodes(graph);
-  typename DescriptorMap<Graph, Node>::InverseMap invNodes(nodes);
+  RangeIdMap<Graph, Node> nodes(graph);
+  typename RangeIdMap<Graph, Node>::InverseMap invNodes(nodes);
   for (int i = 0; i < 100; ++i) {
     int src = rnd[invNodes.size()];
@@ -122,5 +122,5 @@
   }
   typename Graph::template EdgeMap<int> found(graph, 0);
-  DescriptorMap<Graph, Edge> edges(graph);
+  RangeIdMap<Graph, Edge> edges(graph);
   for (NodeIt src(graph); src != INVALID; ++src) {
     for (NodeIt trg(graph); trg != INVALID; ++trg) {
Index: test/hao_orlin_test.cc
===================================================================
--- test/hao_orlin_test.cc	(revision 440)
+++ test/hao_orlin_test.cc	(revision 589)
@@ -20,7 +20,10 @@
 
 #include <lemon/smart_graph.h>
+#include <lemon/adaptors.h>
+#include <lemon/concepts/digraph.h>
+#include <lemon/concepts/maps.h>
+#include <lemon/lgf_reader.h>
 #include <lemon/hao_orlin.h>
 
-#include <lemon/lgf_reader.h>
 #include "test_tools.h"
 
@@ -38,25 +41,122 @@
   "5\n"
   "@edges\n"
-  "     label  capacity\n"
-  "0 1  0      2\n"
-  "1 2  1      2\n"
-  "2 0  2      2\n"
-  "3 4  3      2\n"
-  "4 5  4      2\n"
-  "5 3  5      2\n"
-  "2 3  6      3\n";
+  "     cap1 cap2 cap3\n"
+  "0 1  1    1    1   \n"
+  "0 2  2    2    4   \n"
+  "1 2  4    4    4   \n"
+  "3 4  1    1    1   \n"
+  "3 5  2    2    4   \n"
+  "4 5  4    4    4   \n"
+  "5 4  4    4    4   \n"
+  "2 3  1    6    6   \n"
+  "4 0  1    6    6   \n";
+
+void checkHaoOrlinCompile()
+{
+  typedef int Value;
+  typedef concepts::Digraph Digraph;
+
+  typedef Digraph::Node Node;
+  typedef Digraph::Arc Arc;
+  typedef concepts::ReadMap<Arc, Value> CapMap;
+  typedef concepts::WriteMap<Node, bool> CutMap;
+
+  Digraph g;
+  Node n;
+  CapMap cap;
+  CutMap cut;
+  Value v;
+
+  HaoOrlin<Digraph, CapMap> ho_test(g, cap);
+  const HaoOrlin<Digraph, CapMap>&
+    const_ho_test = ho_test;
+
+  ho_test.init();
+  ho_test.init(n);
+  ho_test.calculateOut();
+  ho_test.calculateIn();
+  ho_test.run();
+  ho_test.run(n);
+
+  v = const_ho_test.minCutValue();
+  v = const_ho_test.minCutMap(cut);
+}
+
+template <typename Graph, typename CapMap, typename CutMap>
+typename CapMap::Value 
+  cutValue(const Graph& graph, const CapMap& cap, const CutMap& cut)
+{
+  typename CapMap::Value sum = 0;
+  for (typename Graph::ArcIt a(graph); a != INVALID; ++a) {
+    if (cut[graph.source(a)] && !cut[graph.target(a)])
+      sum += cap[a];
+  }
+  return sum;
+}
 
 int main() {
-  SmartGraph graph;
-  SmartGraph::EdgeMap<int> capacity(graph);
+  SmartDigraph graph;
+  SmartDigraph::ArcMap<int> cap1(graph), cap2(graph), cap3(graph);
+  SmartDigraph::NodeMap<bool> cut(graph);
 
-  istringstream lgfs(lgf);
-  graphReader(graph, lgfs).
-    edgeMap("capacity", capacity).run();
+  istringstream input(lgf);
+  digraphReader(graph, input)
+    .arcMap("cap1", cap1)
+    .arcMap("cap2", cap2)
+    .arcMap("cap3", cap3)
+    .run();
 
-  HaoOrlin<SmartGraph, SmartGraph::EdgeMap<int> > ho(graph, capacity);
-  ho.run();
+  {
+    HaoOrlin<SmartDigraph> ho(graph, cap1);
+    ho.run();
+    ho.minCutMap(cut);
+    
+    check(ho.minCutValue() == 1, "Wrong cut value");
+    check(ho.minCutValue() == cutValue(graph, cap1, cut), "Wrong cut value");
+  }
+  {
+    HaoOrlin<SmartDigraph> ho(graph, cap2);
+    ho.run();
+    ho.minCutMap(cut);
 
-  check(ho.minCutValue() == 3, "Wrong cut value");
+    check(ho.minCutValue() == 1, "Wrong cut value");
+    check(ho.minCutValue() == cutValue(graph, cap2, cut), "Wrong cut value");
+  }
+  {
+    HaoOrlin<SmartDigraph> ho(graph, cap3);
+    ho.run();
+    ho.minCutMap(cut);
+    
+    check(ho.minCutValue() == 1, "Wrong cut value");
+    check(ho.minCutValue() == cutValue(graph, cap3, cut), "Wrong cut value");
+  }
+  
+  typedef Undirector<SmartDigraph> UGraph;
+  UGraph ugraph(graph);
+  
+  {
+    HaoOrlin<UGraph, SmartDigraph::ArcMap<int> > ho(ugraph, cap1);
+    ho.run();
+    ho.minCutMap(cut);
+    
+    check(ho.minCutValue() == 2, "Wrong cut value");
+    check(ho.minCutValue() == cutValue(ugraph, cap1, cut), "Wrong cut value");
+  }
+  {
+    HaoOrlin<UGraph, SmartDigraph::ArcMap<int> > ho(ugraph, cap2);
+    ho.run();
+    ho.minCutMap(cut);
+    
+    check(ho.minCutValue() == 5, "Wrong cut value");
+    check(ho.minCutValue() == cutValue(ugraph, cap2, cut), "Wrong cut value");
+  }
+  {
+    HaoOrlin<UGraph, SmartDigraph::ArcMap<int> > ho(ugraph, cap3);
+    ho.run();
+    ho.minCutMap(cut);
+    
+    check(ho.minCutValue() == 5, "Wrong cut value");
+    check(ho.minCutValue() == cutValue(ugraph, cap3, cut), "Wrong cut value");
+  }
 
   return 0;
Index: test/kruskal_test.cc
===================================================================
--- test/kruskal_test.cc	(revision 440)
+++ test/kruskal_test.cc	(revision 573)
@@ -100,14 +100,14 @@
         "Total cost should be 10");
 
-  edge_cost_map.set(e1, -10);
-  edge_cost_map.set(e2, -9);
-  edge_cost_map.set(e3, -8);
-  edge_cost_map.set(e4, -7);
-  edge_cost_map.set(e5, -6);
-  edge_cost_map.set(e6, -5);
-  edge_cost_map.set(e7, -4);
-  edge_cost_map.set(e8, -3);
-  edge_cost_map.set(e9, -2);
-  edge_cost_map.set(e10, -1);
+  edge_cost_map[e1] = -10;
+  edge_cost_map[e2] = -9;
+  edge_cost_map[e3] = -8;
+  edge_cost_map[e4] = -7;
+  edge_cost_map[e5] = -6;
+  edge_cost_map[e6] = -5;
+  edge_cost_map[e7] = -4;
+  edge_cost_map[e8] = -3;
+  edge_cost_map[e9] = -2;
+  edge_cost_map[e10] = -1;
 
   vector<Edge> tree_edge_vec(5);
Index: test/lp_test.cc
===================================================================
--- test/lp_test.cc	(revision 462)
+++ test/lp_test.cc	(revision 567)
@@ -3,5 +3,5 @@
  * This file is a part of LEMON, a generic C++ optimization library.
  *
- * Copyright (C) 2003-2008
+ * Copyright (C) 2003-2009
  * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
  * (Egervary Research Group on Combinatorial Optimization, EGRES).
@@ -198,4 +198,9 @@
     check(const_cast<const LpSolver::Expr&>(e)[p2]==0, buf.str());
 
+    //Test for clone/new
+    LP* lpnew = lp.newSolver();
+    LP* lpclone = lp.cloneSolver();
+    delete lpnew;
+    delete lpclone;
 
   }
@@ -248,5 +253,6 @@
   if (stat ==  LpSolver::OPTIMAL) {
     std::ostringstream sbuf;
-    sbuf << "Wrong optimal value: the right optimum is " << exp_opt;
+    sbuf << "Wrong optimal value (" << lp.primal() <<") with "
+         << lp.solverName() <<"\n     the right optimum is " << exp_opt;
     check(std::abs(lp.primal()-exp_opt) < 1e-3, sbuf.str());
   }
@@ -356,4 +362,17 @@
 }
 
+template<class LP>
+void cloneTest()
+{
+  //Test for clone/new
+
+  LP* lp = new LP();
+  LP* lpnew = lp->newSolver();
+  LP* lpclone = lp->cloneSolver();
+  delete lp;
+  delete lpnew;
+  delete lpclone;
+}
+
 int main()
 {
@@ -366,4 +385,5 @@
     lpTest(lp_glpk1);
     aTest(lp_glpk2);
+    cloneTest<GlpkLp>();
   }
 #endif
@@ -374,11 +394,7 @@
     lpTest(lp_cplex1);
     aTest(lp_cplex2);
+    cloneTest<CplexLp>();
   } catch (CplexEnv::LicenseError& error) {
-#ifdef LEMON_FORCE_CPLEX_CHECK
     check(false, error.what());
-#else
-    std::cerr << error.what() << std::endl;
-    std::cerr << "Cplex license check failed, lp check skipped" << std::endl;
-#endif
   }
 #endif
@@ -389,4 +405,5 @@
     lpTest(lp_soplex1);
     aTest(lp_soplex2);
+    cloneTest<SoplexLp>();
   }
 #endif
@@ -397,4 +414,5 @@
     lpTest(lp_clp1);
     aTest(lp_clp2);
+    cloneTest<ClpLp>();
   }
 #endif
Index: test/matching_test.cc
===================================================================
--- test/matching_test.cc	(revision 586)
+++ test/matching_test.cc	(revision 586)
@@ -0,0 +1,424 @@
+/* -*- mode: C++; indent-tabs-mode: nil; -*-
+ *
+ * This file is a part of LEMON, a generic C++ optimization library.
+ *
+ * Copyright (C) 2003-2009
+ * 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.
+ *
+ */
+
+#include <iostream>
+#include <sstream>
+#include <vector>
+#include <queue>
+#include <cstdlib>
+
+#include <lemon/matching.h>
+#include <lemon/smart_graph.h>
+#include <lemon/concepts/graph.h>
+#include <lemon/concepts/maps.h>
+#include <lemon/lgf_reader.h>
+#include <lemon/math.h>
+
+#include "test_tools.h"
+
+using namespace std;
+using namespace lemon;
+
+GRAPH_TYPEDEFS(SmartGraph);
+
+
+const int lgfn = 3;
+const std::string lgf[lgfn] = {
+  "@nodes\n"
+  "label\n"
+  "0\n"
+  "1\n"
+  "2\n"
+  "3\n"
+  "4\n"
+  "5\n"
+  "6\n"
+  "7\n"
+  "@edges\n"
+  "     label  weight\n"
+  "7 4  0      984\n"
+  "0 7  1      73\n"
+  "7 1  2      204\n"
+  "2 3  3      583\n"
+  "2 7  4      565\n"
+  "2 1  5      582\n"
+  "0 4  6      551\n"
+  "2 5  7      385\n"
+  "1 5  8      561\n"
+  "5 3  9      484\n"
+  "7 5  10     904\n"
+  "3 6  11     47\n"
+  "7 6  12     888\n"
+  "3 0  13     747\n"
+  "6 1  14     310\n",
+
+  "@nodes\n"
+  "label\n"
+  "0\n"
+  "1\n"
+  "2\n"
+  "3\n"
+  "4\n"
+  "5\n"
+  "6\n"
+  "7\n"
+  "@edges\n"
+  "     label  weight\n"
+  "2 5  0      710\n"
+  "0 5  1      241\n"
+  "2 4  2      856\n"
+  "2 6  3      762\n"
+  "4 1  4      747\n"
+  "6 1  5      962\n"
+  "4 7  6      723\n"
+  "1 7  7      661\n"
+  "2 3  8      376\n"
+  "1 0  9      416\n"
+  "6 7  10     391\n",
+
+  "@nodes\n"
+  "label\n"
+  "0\n"
+  "1\n"
+  "2\n"
+  "3\n"
+  "4\n"
+  "5\n"
+  "6\n"
+  "7\n"
+  "@edges\n"
+  "     label  weight\n"
+  "6 2  0      553\n"
+  "0 7  1      653\n"
+  "6 3  2      22\n"
+  "4 7  3      846\n"
+  "7 2  4      981\n"
+  "7 6  5      250\n"
+  "5 2  6      539\n",
+};
+
+void checkMaxMatchingCompile()
+{
+  typedef concepts::Graph Graph;
+  typedef Graph::Node Node;
+  typedef Graph::Edge Edge;
+  typedef Graph::EdgeMap<bool> MatMap;
+
+  Graph g;
+  Node n;
+  Edge e;
+  MatMap mat(g);
+
+  MaxMatching<Graph> mat_test(g);
+  const MaxMatching<Graph>&
+    const_mat_test = mat_test;
+
+  mat_test.init();
+  mat_test.greedyInit();
+  mat_test.matchingInit(mat);
+  mat_test.startSparse();
+  mat_test.startDense();
+  mat_test.run();
+  
+  const_mat_test.matchingSize();
+  const_mat_test.matching(e);
+  const_mat_test.matching(n);
+  const MaxMatching<Graph>::MatchingMap& mmap =
+    const_mat_test.matchingMap();
+  e = mmap[n];
+  const_mat_test.mate(n);
+
+  MaxMatching<Graph>::Status stat = 
+    const_mat_test.status(n);
+  const MaxMatching<Graph>::StatusMap& smap =
+    const_mat_test.statusMap();
+  stat = smap[n];
+  const_mat_test.barrier(n);
+}
+
+void checkMaxWeightedMatchingCompile()
+{
+  typedef concepts::Graph Graph;
+  typedef Graph::Node Node;
+  typedef Graph::Edge Edge;
+  typedef Graph::EdgeMap<int> WeightMap;
+
+  Graph g;
+  Node n;
+  Edge e;
+  WeightMap w(g);
+
+  MaxWeightedMatching<Graph> mat_test(g, w);
+  const MaxWeightedMatching<Graph>&
+    const_mat_test = mat_test;
+
+  mat_test.init();
+  mat_test.start();
+  mat_test.run();
+  
+  const_mat_test.matchingWeight();
+  const_mat_test.matchingSize();
+  const_mat_test.matching(e);
+  const_mat_test.matching(n);
+  const MaxWeightedMatching<Graph>::MatchingMap& mmap =
+    const_mat_test.matchingMap();
+  e = mmap[n];
+  const_mat_test.mate(n);
+  
+  int k = 0;
+  const_mat_test.dualValue();
+  const_mat_test.nodeValue(n);
+  const_mat_test.blossomNum();
+  const_mat_test.blossomSize(k);
+  const_mat_test.blossomValue(k);
+}
+
+void checkMaxWeightedPerfectMatchingCompile()
+{
+  typedef concepts::Graph Graph;
+  typedef Graph::Node Node;
+  typedef Graph::Edge Edge;
+  typedef Graph::EdgeMap<int> WeightMap;
+
+  Graph g;
+  Node n;
+  Edge e;
+  WeightMap w(g);
+
+  MaxWeightedPerfectMatching<Graph> mat_test(g, w);
+  const MaxWeightedPerfectMatching<Graph>&
+    const_mat_test = mat_test;
+
+  mat_test.init();
+  mat_test.start();
+  mat_test.run();
+  
+  const_mat_test.matchingWeight();
+  const_mat_test.matching(e);
+  const_mat_test.matching(n);
+  const MaxWeightedPerfectMatching<Graph>::MatchingMap& mmap =
+    const_mat_test.matchingMap();
+  e = mmap[n];
+  const_mat_test.mate(n);
+  
+  int k = 0;
+  const_mat_test.dualValue();
+  const_mat_test.nodeValue(n);
+  const_mat_test.blossomNum();
+  const_mat_test.blossomSize(k);
+  const_mat_test.blossomValue(k);
+}
+
+void checkMatching(const SmartGraph& graph,
+                   const MaxMatching<SmartGraph>& mm) {
+  int num = 0;
+
+  IntNodeMap comp_index(graph);
+  UnionFind<IntNodeMap> comp(comp_index);
+
+  int barrier_num = 0;
+
+  for (NodeIt n(graph); n != INVALID; ++n) {
+    check(mm.status(n) == MaxMatching<SmartGraph>::EVEN ||
+          mm.matching(n) != INVALID, "Wrong Gallai-Edmonds decomposition");
+    if (mm.status(n) == MaxMatching<SmartGraph>::ODD) {
+      ++barrier_num;
+    } else {
+      comp.insert(n);
+    }
+  }
+
+  for (EdgeIt e(graph); e != INVALID; ++e) {
+    if (mm.matching(e)) {
+      check(e == mm.matching(graph.u(e)), "Wrong matching");
+      check(e == mm.matching(graph.v(e)), "Wrong matching");
+      ++num;
+    }
+    check(mm.status(graph.u(e)) != MaxMatching<SmartGraph>::EVEN ||
+          mm.status(graph.v(e)) != MaxMatching<SmartGraph>::MATCHED,
+          "Wrong Gallai-Edmonds decomposition");
+
+    check(mm.status(graph.v(e)) != MaxMatching<SmartGraph>::EVEN ||
+          mm.status(graph.u(e)) != MaxMatching<SmartGraph>::MATCHED,
+          "Wrong Gallai-Edmonds decomposition");
+
+    if (mm.status(graph.u(e)) != MaxMatching<SmartGraph>::ODD &&
+        mm.status(graph.v(e)) != MaxMatching<SmartGraph>::ODD) {
+      comp.join(graph.u(e), graph.v(e));
+    }
+  }
+
+  std::set<int> comp_root;
+  int odd_comp_num = 0;
+  for (NodeIt n(graph); n != INVALID; ++n) {
+    if (mm.status(n) != MaxMatching<SmartGraph>::ODD) {
+      int root = comp.find(n);
+      if (comp_root.find(root) == comp_root.end()) {
+        comp_root.insert(root);
+        if (comp.size(n) % 2 == 1) {
+          ++odd_comp_num;
+        }
+      }
+    }
+  }
+
+  check(mm.matchingSize() == num, "Wrong matching");
+  check(2 * num == countNodes(graph) - (odd_comp_num - barrier_num),
+         "Wrong matching");
+  return;
+}
+
+void checkWeightedMatching(const SmartGraph& graph,
+                   const SmartGraph::EdgeMap<int>& weight,
+                   const MaxWeightedMatching<SmartGraph>& mwm) {
+  for (SmartGraph::EdgeIt e(graph); e != INVALID; ++e) {
+    if (graph.u(e) == graph.v(e)) continue;
+    int rw = mwm.nodeValue(graph.u(e)) + mwm.nodeValue(graph.v(e));
+
+    for (int i = 0; i < mwm.blossomNum(); ++i) {
+      bool s = false, t = false;
+      for (MaxWeightedMatching<SmartGraph>::BlossomIt n(mwm, i);
+           n != INVALID; ++n) {
+        if (graph.u(e) == n) s = true;
+        if (graph.v(e) == n) t = true;
+      }
+      if (s == true && t == true) {
+        rw += mwm.blossomValue(i);
+      }
+    }
+    rw -= weight[e] * mwm.dualScale;
+
+    check(rw >= 0, "Negative reduced weight");
+    check(rw == 0 || !mwm.matching(e),
+          "Non-zero reduced weight on matching edge");
+  }
+
+  int pv = 0;
+  for (SmartGraph::NodeIt n(graph); n != INVALID; ++n) {
+    if (mwm.matching(n) != INVALID) {
+      check(mwm.nodeValue(n) >= 0, "Invalid node value");
+      pv += weight[mwm.matching(n)];
+      SmartGraph::Node o = graph.target(mwm.matching(n));
+      check(mwm.mate(n) == o, "Invalid matching");
+      check(mwm.matching(n) == graph.oppositeArc(mwm.matching(o)),
+            "Invalid matching");
+    } else {
+      check(mwm.mate(n) == INVALID, "Invalid matching");
+      check(mwm.nodeValue(n) == 0, "Invalid matching");
+    }
+  }
+
+  int dv = 0;
+  for (SmartGraph::NodeIt n(graph); n != INVALID; ++n) {
+    dv += mwm.nodeValue(n);
+  }
+
+  for (int i = 0; i < mwm.blossomNum(); ++i) {
+    check(mwm.blossomValue(i) >= 0, "Invalid blossom value");
+    check(mwm.blossomSize(i) % 2 == 1, "Even blossom size");
+    dv += mwm.blossomValue(i) * ((mwm.blossomSize(i) - 1) / 2);
+  }
+
+  check(pv * mwm.dualScale == dv * 2, "Wrong duality");
+
+  return;
+}
+
+void checkWeightedPerfectMatching(const SmartGraph& graph,
+                          const SmartGraph::EdgeMap<int>& weight,
+                          const MaxWeightedPerfectMatching<SmartGraph>& mwpm) {
+  for (SmartGraph::EdgeIt e(graph); e != INVALID; ++e) {
+    if (graph.u(e) == graph.v(e)) continue;
+    int rw = mwpm.nodeValue(graph.u(e)) + mwpm.nodeValue(graph.v(e));
+
+    for (int i = 0; i < mwpm.blossomNum(); ++i) {
+      bool s = false, t = false;
+      for (MaxWeightedPerfectMatching<SmartGraph>::BlossomIt n(mwpm, i);
+           n != INVALID; ++n) {
+        if (graph.u(e) == n) s = true;
+        if (graph.v(e) == n) t = true;
+      }
+      if (s == true && t == true) {
+        rw += mwpm.blossomValue(i);
+      }
+    }
+    rw -= weight[e] * mwpm.dualScale;
+
+    check(rw >= 0, "Negative reduced weight");
+    check(rw == 0 || !mwpm.matching(e),
+          "Non-zero reduced weight on matching edge");
+  }
+
+  int pv = 0;
+  for (SmartGraph::NodeIt n(graph); n != INVALID; ++n) {
+    check(mwpm.matching(n) != INVALID, "Non perfect");
+    pv += weight[mwpm.matching(n)];
+    SmartGraph::Node o = graph.target(mwpm.matching(n));
+    check(mwpm.mate(n) == o, "Invalid matching");
+    check(mwpm.matching(n) == graph.oppositeArc(mwpm.matching(o)),
+          "Invalid matching");
+  }
+
+  int dv = 0;
+  for (SmartGraph::NodeIt n(graph); n != INVALID; ++n) {
+    dv += mwpm.nodeValue(n);
+  }
+
+  for (int i = 0; i < mwpm.blossomNum(); ++i) {
+    check(mwpm.blossomValue(i) >= 0, "Invalid blossom value");
+    check(mwpm.blossomSize(i) % 2 == 1, "Even blossom size");
+    dv += mwpm.blossomValue(i) * ((mwpm.blossomSize(i) - 1) / 2);
+  }
+
+  check(pv * mwpm.dualScale == dv * 2, "Wrong duality");
+
+  return;
+}
+
+
+int main() {
+
+  for (int i = 0; i < lgfn; ++i) {
+    SmartGraph graph;
+    SmartGraph::EdgeMap<int> weight(graph);
+
+    istringstream lgfs(lgf[i]);
+    graphReader(graph, lgfs).
+      edgeMap("weight", weight).run();
+
+    MaxMatching<SmartGraph> mm(graph);
+    mm.run();
+    checkMatching(graph, mm);
+
+    MaxWeightedMatching<SmartGraph> mwm(graph, weight);
+    mwm.run();
+    checkWeightedMatching(graph, weight, mwm);
+
+    MaxWeightedPerfectMatching<SmartGraph> mwpm(graph, weight);
+    bool perfect = mwpm.run();
+
+    check(perfect == (mm.matchingSize() * 2 == countNodes(graph)),
+          "Perfect matching found");
+
+    if (perfect) {
+      checkWeightedPerfectMatching(graph, weight, mwpm);
+    }
+  }
+
+  return 0;
+}
Index: test/max_matching_test.cc
===================================================================
--- test/max_matching_test.cc	(revision 440)
+++ 	(revision )
@@ -1,310 +1,0 @@
-/* -*- mode: C++; indent-tabs-mode: nil; -*-
- *
- * This file is a part of LEMON, a generic C++ optimization library.
- *
- * Copyright (C) 2003-2009
- * 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.
- *
- */
-
-#include <iostream>
-#include <sstream>
-#include <vector>
-#include <queue>
-#include <lemon/math.h>
-#include <cstdlib>
-
-#include <lemon/max_matching.h>
-#include <lemon/smart_graph.h>
-#include <lemon/lgf_reader.h>
-
-#include "test_tools.h"
-
-using namespace std;
-using namespace lemon;
-
-GRAPH_TYPEDEFS(SmartGraph);
-
-
-const int lgfn = 3;
-const std::string lgf[lgfn] = {
-  "@nodes\n"
-  "label\n"
-  "0\n"
-  "1\n"
-  "2\n"
-  "3\n"
-  "4\n"
-  "5\n"
-  "6\n"
-  "7\n"
-  "@edges\n"
-  "     label  weight\n"
-  "7 4  0      984\n"
-  "0 7  1      73\n"
-  "7 1  2      204\n"
-  "2 3  3      583\n"
-  "2 7  4      565\n"
-  "2 1  5      582\n"
-  "0 4  6      551\n"
-  "2 5  7      385\n"
-  "1 5  8      561\n"
-  "5 3  9      484\n"
-  "7 5  10     904\n"
-  "3 6  11     47\n"
-  "7 6  12     888\n"
-  "3 0  13     747\n"
-  "6 1  14     310\n",
-
-  "@nodes\n"
-  "label\n"
-  "0\n"
-  "1\n"
-  "2\n"
-  "3\n"
-  "4\n"
-  "5\n"
-  "6\n"
-  "7\n"
-  "@edges\n"
-  "     label  weight\n"
-  "2 5  0      710\n"
-  "0 5  1      241\n"
-  "2 4  2      856\n"
-  "2 6  3      762\n"
-  "4 1  4      747\n"
-  "6 1  5      962\n"
-  "4 7  6      723\n"
-  "1 7  7      661\n"
-  "2 3  8      376\n"
-  "1 0  9      416\n"
-  "6 7  10     391\n",
-
-  "@nodes\n"
-  "label\n"
-  "0\n"
-  "1\n"
-  "2\n"
-  "3\n"
-  "4\n"
-  "5\n"
-  "6\n"
-  "7\n"
-  "@edges\n"
-  "     label  weight\n"
-  "6 2  0      553\n"
-  "0 7  1      653\n"
-  "6 3  2      22\n"
-  "4 7  3      846\n"
-  "7 2  4      981\n"
-  "7 6  5      250\n"
-  "5 2  6      539\n",
-};
-
-void checkMatching(const SmartGraph& graph,
-                   const MaxMatching<SmartGraph>& mm) {
-  int num = 0;
-
-  IntNodeMap comp_index(graph);
-  UnionFind<IntNodeMap> comp(comp_index);
-
-  int barrier_num = 0;
-
-  for (NodeIt n(graph); n != INVALID; ++n) {
-    check(mm.decomposition(n) == MaxMatching<SmartGraph>::EVEN ||
-          mm.matching(n) != INVALID, "Wrong Gallai-Edmonds decomposition");
-    if (mm.decomposition(n) == MaxMatching<SmartGraph>::ODD) {
-      ++barrier_num;
-    } else {
-      comp.insert(n);
-    }
-  }
-
-  for (EdgeIt e(graph); e != INVALID; ++e) {
-    if (mm.matching(e)) {
-      check(e == mm.matching(graph.u(e)), "Wrong matching");
-      check(e == mm.matching(graph.v(e)), "Wrong matching");
-      ++num;
-    }
-    check(mm.decomposition(graph.u(e)) != MaxMatching<SmartGraph>::EVEN ||
-          mm.decomposition(graph.v(e)) != MaxMatching<SmartGraph>::MATCHED,
-          "Wrong Gallai-Edmonds decomposition");
-
-    check(mm.decomposition(graph.v(e)) != MaxMatching<SmartGraph>::EVEN ||
-          mm.decomposition(graph.u(e)) != MaxMatching<SmartGraph>::MATCHED,
-          "Wrong Gallai-Edmonds decomposition");
-
-    if (mm.decomposition(graph.u(e)) != MaxMatching<SmartGraph>::ODD &&
-        mm.decomposition(graph.v(e)) != MaxMatching<SmartGraph>::ODD) {
-      comp.join(graph.u(e), graph.v(e));
-    }
-  }
-
-  std::set<int> comp_root;
-  int odd_comp_num = 0;
-  for (NodeIt n(graph); n != INVALID; ++n) {
-    if (mm.decomposition(n) != MaxMatching<SmartGraph>::ODD) {
-      int root = comp.find(n);
-      if (comp_root.find(root) == comp_root.end()) {
-        comp_root.insert(root);
-        if (comp.size(n) % 2 == 1) {
-          ++odd_comp_num;
-        }
-      }
-    }
-  }
-
-  check(mm.matchingSize() == num, "Wrong matching");
-  check(2 * num == countNodes(graph) - (odd_comp_num - barrier_num),
-         "Wrong matching");
-  return;
-}
-
-void checkWeightedMatching(const SmartGraph& graph,
-                   const SmartGraph::EdgeMap<int>& weight,
-                   const MaxWeightedMatching<SmartGraph>& mwm) {
-  for (SmartGraph::EdgeIt e(graph); e != INVALID; ++e) {
-    if (graph.u(e) == graph.v(e)) continue;
-    int rw = mwm.nodeValue(graph.u(e)) + mwm.nodeValue(graph.v(e));
-
-    for (int i = 0; i < mwm.blossomNum(); ++i) {
-      bool s = false, t = false;
-      for (MaxWeightedMatching<SmartGraph>::BlossomIt n(mwm, i);
-           n != INVALID; ++n) {
-        if (graph.u(e) == n) s = true;
-        if (graph.v(e) == n) t = true;
-      }
-      if (s == true && t == true) {
-        rw += mwm.blossomValue(i);
-      }
-    }
-    rw -= weight[e] * mwm.dualScale;
-
-    check(rw >= 0, "Negative reduced weight");
-    check(rw == 0 || !mwm.matching(e),
-          "Non-zero reduced weight on matching edge");
-  }
-
-  int pv = 0;
-  for (SmartGraph::NodeIt n(graph); n != INVALID; ++n) {
-    if (mwm.matching(n) != INVALID) {
-      check(mwm.nodeValue(n) >= 0, "Invalid node value");
-      pv += weight[mwm.matching(n)];
-      SmartGraph::Node o = graph.target(mwm.matching(n));
-      check(mwm.mate(n) == o, "Invalid matching");
-      check(mwm.matching(n) == graph.oppositeArc(mwm.matching(o)),
-            "Invalid matching");
-    } else {
-      check(mwm.mate(n) == INVALID, "Invalid matching");
-      check(mwm.nodeValue(n) == 0, "Invalid matching");
-    }
-  }
-
-  int dv = 0;
-  for (SmartGraph::NodeIt n(graph); n != INVALID; ++n) {
-    dv += mwm.nodeValue(n);
-  }
-
-  for (int i = 0; i < mwm.blossomNum(); ++i) {
-    check(mwm.blossomValue(i) >= 0, "Invalid blossom value");
-    check(mwm.blossomSize(i) % 2 == 1, "Even blossom size");
-    dv += mwm.blossomValue(i) * ((mwm.blossomSize(i) - 1) / 2);
-  }
-
-  check(pv * mwm.dualScale == dv * 2, "Wrong duality");
-
-  return;
-}
-
-void checkWeightedPerfectMatching(const SmartGraph& graph,
-                          const SmartGraph::EdgeMap<int>& weight,
-                          const MaxWeightedPerfectMatching<SmartGraph>& mwpm) {
-  for (SmartGraph::EdgeIt e(graph); e != INVALID; ++e) {
-    if (graph.u(e) == graph.v(e)) continue;
-    int rw = mwpm.nodeValue(graph.u(e)) + mwpm.nodeValue(graph.v(e));
-
-    for (int i = 0; i < mwpm.blossomNum(); ++i) {
-      bool s = false, t = false;
-      for (MaxWeightedPerfectMatching<SmartGraph>::BlossomIt n(mwpm, i);
-           n != INVALID; ++n) {
-        if (graph.u(e) == n) s = true;
-        if (graph.v(e) == n) t = true;
-      }
-      if (s == true && t == true) {
-        rw += mwpm.blossomValue(i);
-      }
-    }
-    rw -= weight[e] * mwpm.dualScale;
-
-    check(rw >= 0, "Negative reduced weight");
-    check(rw == 0 || !mwpm.matching(e),
-          "Non-zero reduced weight on matching edge");
-  }
-
-  int pv = 0;
-  for (SmartGraph::NodeIt n(graph); n != INVALID; ++n) {
-    check(mwpm.matching(n) != INVALID, "Non perfect");
-    pv += weight[mwpm.matching(n)];
-    SmartGraph::Node o = graph.target(mwpm.matching(n));
-    check(mwpm.mate(n) == o, "Invalid matching");
-    check(mwpm.matching(n) == graph.oppositeArc(mwpm.matching(o)),
-          "Invalid matching");
-  }
-
-  int dv = 0;
-  for (SmartGraph::NodeIt n(graph); n != INVALID; ++n) {
-    dv += mwpm.nodeValue(n);
-  }
-
-  for (int i = 0; i < mwpm.blossomNum(); ++i) {
-    check(mwpm.blossomValue(i) >= 0, "Invalid blossom value");
-    check(mwpm.blossomSize(i) % 2 == 1, "Even blossom size");
-    dv += mwpm.blossomValue(i) * ((mwpm.blossomSize(i) - 1) / 2);
-  }
-
-  check(pv * mwpm.dualScale == dv * 2, "Wrong duality");
-
-  return;
-}
-
-
-int main() {
-
-  for (int i = 0; i < lgfn; ++i) {
-    SmartGraph graph;
-    SmartGraph::EdgeMap<int> weight(graph);
-
-    istringstream lgfs(lgf[i]);
-    graphReader(graph, lgfs).
-      edgeMap("weight", weight).run();
-
-    MaxMatching<SmartGraph> mm(graph);
-    mm.run();
-    checkMatching(graph, mm);
-
-    MaxWeightedMatching<SmartGraph> mwm(graph, weight);
-    mwm.run();
-    checkWeightedMatching(graph, weight, mwm);
-
-    MaxWeightedPerfectMatching<SmartGraph> mwpm(graph, weight);
-    bool perfect = mwpm.run();
-
-    check(perfect == (mm.matchingSize() * 2 == countNodes(graph)),
-          "Perfect matching found");
-
-    if (perfect) {
-      checkWeightedPerfectMatching(graph, weight, mwpm);
-    }
-  }
-
-  return 0;
-}
Index: test/mip_test.cc
===================================================================
--- test/mip_test.cc	(revision 462)
+++ test/mip_test.cc	(revision 567)
@@ -3,5 +3,5 @@
  * This file is a part of LEMON, a generic C++ optimization library.
  *
- * Copyright (C) 2003-2008
+ * Copyright (C) 2003-2009
  * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
  * (Egervary Research Group on Combinatorial Optimization, EGRES).
@@ -19,5 +19,4 @@
 #include "test_tools.h"
 
-
 #ifdef HAVE_CONFIG_H
 #include <lemon/config.h>
@@ -30,4 +29,8 @@
 #ifdef HAVE_GLPK
 #include <lemon/glpk.h>
+#endif
+
+#ifdef HAVE_CBC
+#include <lemon/cbc.h>
 #endif
 
@@ -58,10 +61,9 @@
 void aTest(MipSolver& mip)
 {
- //The following example is very simple
+  //The following example is very simple
 
 
   typedef MipSolver::Row Row;
   typedef MipSolver::Col Col;
-
 
 
@@ -75,5 +77,4 @@
   mip.max();
 
-
   //Unconstrained optimization
   mip.solve();
@@ -81,9 +82,10 @@
 
   //Constraints
-  mip.addRow(2*x1+x2 <=2);
-  mip.addRow(x1-2*x2 <=0);
+  mip.addRow(2 * x1 + x2 <= 2);
+  Row y2 = mip.addRow(x1 - 2 * x2 <= 0);
 
   //Nonnegativity of the variable x1
   mip.colLowerBound(x1, 0);
+
 
   //Maximization of x1
@@ -91,4 +93,5 @@
   double expected_opt=4.0/5.0;
   solveAndCheck(mip, MipSolver::OPTIMAL, expected_opt);
+
 
   //Restrict x2 to integer
@@ -103,8 +106,24 @@
   solveAndCheck(mip, MipSolver::OPTIMAL, expected_opt);
 
-
+  //Erase a variable
+  mip.erase(x2);
+  mip.rowUpperBound(y2, 8);
+  expected_opt=1;
+  solveAndCheck(mip, MipSolver::OPTIMAL, expected_opt);
 
 }
 
+
+template<class MIP>
+void cloneTest()
+{
+
+  MIP* mip = new MIP();
+  MIP* mipnew = mip->newSolver();
+  MIP* mipclone = mip->cloneSolver();
+  delete mip;
+  delete mipnew;
+  delete mipclone;
+}
 
 int main()
@@ -115,4 +134,5 @@
     GlpkMip mip1;
     aTest(mip1);
+    cloneTest<GlpkMip>();
   }
 #endif
@@ -122,11 +142,15 @@
     CplexMip mip2;
     aTest(mip2);
+    cloneTest<CplexMip>();
   } catch (CplexEnv::LicenseError& error) {
-#ifdef LEMON_FORCE_CPLEX_CHECK
     check(false, error.what());
-#else
-    std::cerr << error.what() << std::endl;
-    std::cerr << "Cplex license check failed, lp check skipped" << std::endl;
+  }
 #endif
+
+#ifdef HAVE_CBC
+  {
+    CbcMip mip1;
+    aTest(mip1);
+    cloneTest<CbcMip>();
   }
 #endif
Index: test/preflow_test.cc
===================================================================
--- test/preflow_test.cc	(revision 440)
+++ test/preflow_test.cc	(revision 577)
@@ -85,16 +85,20 @@
   FlowMap flow;
   CutMap cut;
-
-  Preflow<Digraph, CapMap>
-    ::SetFlowMap<FlowMap>
-    ::SetElevator<Elev>
-    ::SetStandardElevator<LinkedElev>
-    ::Create preflow_test(g,cap,n,n);
-
-  preflow_test.capacityMap(cap);
-  flow = preflow_test.flowMap();
-  preflow_test.flowMap(flow);
-  preflow_test.source(n);
-  preflow_test.target(n);
+  VType v;
+  bool b;
+
+  typedef Preflow<Digraph, CapMap>
+            ::SetFlowMap<FlowMap>
+            ::SetElevator<Elev>
+            ::SetStandardElevator<LinkedElev>
+            ::Create PreflowType;
+  PreflowType preflow_test(g, cap, n, n);
+  const PreflowType& const_preflow_test = preflow_test;
+
+  preflow_test
+    .capacityMap(cap)
+    .flowMap(flow)
+    .source(n)
+    .target(n);
 
   preflow_test.init();
@@ -105,9 +109,11 @@
   preflow_test.runMinCut();
 
-  preflow_test.flowValue();
-  preflow_test.minCut(n);
-  preflow_test.minCutMap(cut);
-  preflow_test.flow(e);
-
+  v = const_preflow_test.flowValue();
+  v = const_preflow_test.flow(e);
+  const FlowMap& fm = const_preflow_test.flowMap();
+  b = const_preflow_test.minCut(n);
+  const_preflow_test.minCutMap(cut);
+  
+  ignore_unused_variable_warning(fm);
 }
 
Index: test/time_measure_test.cc
===================================================================
--- test/time_measure_test.cc	(revision 440)
+++ test/time_measure_test.cc	(revision 549)
@@ -40,16 +40,14 @@
   Timer T;
   unsigned int n;
-  for(n=0;T.realTime()<1.0;n++) ;
+  for(n=0;T.realTime()<0.1;n++) ;
   std::cout << T << " (" << n << " time queries)\n";
-  T.restart();
-  while(T.realTime()<2.0) ;
-  std::cout << T << '\n';
+
   TimeStamp full;
   TimeStamp t;
-  t=runningTimeTest(f,1,&n,&full);
+  t=runningTimeTest(f,0.1,&n,&full);
   std::cout << t << " (" << n << " tests)\n";
   std::cout << "Total: " << full << "\n";
 
-  t=runningTimeTest(g,1,&n,&full);
+  t=runningTimeTest(g,0.1,&n,&full);
   std::cout << t << " (" << n << " tests)\n";
   std::cout << "Total: " << full << "\n";
