Index: lemon/preflow.h
===================================================================
--- lemon/preflow.h	(revision 1385)
+++ lemon/preflow.h	(revision 1270)
@@ -477,5 +477,5 @@
     /// flow to the given \c flowMap. The \c flowMap should contain a
     /// flow or at least a preflow, i.e. at each node excluding the
-    /// source node the incoming flow should be greater or equal to the
+    /// source node the incoming flow should greater or equal to the
     /// outgoing flow.
     /// \return \c false if the given \c flowMap is not a preflow.
@@ -496,5 +496,5 @@
           excess -= (*_flow)[e];
         }
-        if (_tolerance.negative(excess) && n != _source) return false;
+        if (excess < 0 && n != _source) return false;
         (*_excess)[n] = excess;
       }
@@ -640,5 +640,5 @@
           (*_excess)[n] = excess;
 
-          if (_tolerance.nonZero(excess)) {
+          if (excess != 0) {
             if (new_level + 1 < _level->maxLevel()) {
               _level->liftHighestActive(new_level + 1);
@@ -721,5 +721,5 @@
           (*_excess)[n] = excess;
 
-          if (_tolerance.nonZero(excess)) {
+          if (excess != 0) {
             if (new_level + 1 < _level->maxLevel()) {
               _level->liftActiveOn(level, new_level + 1);
@@ -792,5 +792,5 @@
         if (!reached[n]) {
           _level->dirtyTopButOne(n);
-        } else if (_tolerance.positive((*_excess)[n]) && _target != n) {
+        } else if ((*_excess)[n] > 0 && _target != n) {
           _level->activate(n);
         }
@@ -853,5 +853,5 @@
         (*_excess)[n] = excess;
 
-        if (_tolerance.nonZero(excess)) {
+        if (excess != 0) {
           if (new_level + 1 < _level->maxLevel()) {
             _level->liftHighestActive(new_level + 1);
Index: test/max_flow_test.cc
===================================================================
--- test/max_flow_test.cc	(revision 1385)
+++ test/max_flow_test.cc	(revision 1270)
@@ -27,5 +27,4 @@
 #include <lemon/lgf_reader.h>
 #include <lemon/elevator.h>
-#include <lemon/tolerance.h>
 
 using namespace lemon;
@@ -67,35 +66,4 @@
   "target 8\n";
 
-char test_lgf_float[] =
-  "@nodes\n"
-  "label\n"
-  "0\n"
-  "1\n"
-  "2\n"
-  "3\n"
-  "4\n"
-  "5\n"
-  "6\n"
-  "7\n"
-  "8\n"
-  "9\n"
-  "@arcs\n"
-  "      capacity\n"
-  "0 1 0.1\n"
-  "0 2 0.1\n"
-  "0 3 0.1\n"
-  "1 4 0.1\n"
-  "2 4 0.1\n"
-  "3 4 0.1\n"
-  "4 5 0.3\n"
-  "5 6 0.1\n"
-  "5 7 0.1\n"
-  "5 8 0.1\n"
-  "6 9 0.1\n"
-  "7 9 0.1\n"
-  "8 9 0.1\n"
-  "@attributes\n"
-  "source 0\n"
-  "target 9\n";
 
 // Checks the general interface of a max flow algorithm
@@ -198,4 +166,6 @@
   typedef concepts::Digraph Digraph;
   typedef concepts::ReadMap<Digraph::Arc, Value> CapMap;
+  typedef Elevator<Digraph, Digraph::Node> Elev;
+  typedef LinkedElevator<Digraph, Digraph::Node> LinkedElev;
 
   Digraph g;
@@ -215,11 +185,11 @@
 
 template <typename T>
-T cutValue(const SmartDigraph& g,
-           const SmartDigraph::NodeMap<bool>& cut,
-           const SmartDigraph::ArcMap<T>& cap) {
-
-  T c = 0;
-  for (SmartDigraph::ArcIt e(g); e != INVALID; ++e) {
-    if (cut[g.source(e)] && !cut[g.target(e)]) c += cap[e];
+T cutValue (const SmartDigraph& g,
+              const SmartDigraph::NodeMap<bool>& cut,
+              const SmartDigraph::ArcMap<T>& cap) {
+
+  T c=0;
+  for(SmartDigraph::ArcIt e(g); e!=INVALID; ++e) {
+    if (cut[g.source(e)] && !cut[g.target(e)]) c+=cap[e];
   }
   return c;
@@ -230,9 +200,8 @@
                const SmartDigraph::ArcMap<T>& flow,
                const SmartDigraph::ArcMap<T>& cap,
-               SmartDigraph::Node s, SmartDigraph::Node t,
-               const Tolerance<T>& tol) {
+               SmartDigraph::Node s, SmartDigraph::Node t) {
 
   for (SmartDigraph::ArcIt e(g); e != INVALID; ++e) {
-    if (tol.negative(flow[e]) || tol.less(cap[e], flow[e])) return false;
+    if (flow[e] < 0 || flow[e] > cap[e]) return false;
   }
 
@@ -246,27 +215,26 @@
       sum -= flow[e];
     }
-    if (tol.nonZero(sum)) return false;
+    if (sum != 0) return false;
   }
   return true;
 }
 
-void checkInitPreflow()
+void initFlowTest()
 {
   DIGRAPH_TYPEDEFS(SmartDigraph);
 
   SmartDigraph g;
-  SmartDigraph::ArcMap<int> cap(g), iflow(g);
-  Node s = g.addNode(); Node t = g.addNode();
-  Node n1 = g.addNode(); Node n2 = g.addNode();
+  SmartDigraph::ArcMap<int> cap(g),iflow(g);
+  Node s=g.addNode(); Node t=g.addNode();
+  Node n1=g.addNode(); Node n2=g.addNode();
   Arc a;
-  a = g.addArc(s, n1); cap[a] = 20; iflow[a] = 20;
-  a = g.addArc(n1, n2); cap[a] = 10; iflow[a] = 0;
-  a = g.addArc(n2, t); cap[a] = 20; iflow[a] = 0;
-
-  Preflow<SmartDigraph> pre(g, cap, s, t);
+  a=g.addArc(s,n1); cap[a]=20; iflow[a]=20;
+  a=g.addArc(n1,n2); cap[a]=10; iflow[a]=0;
+  a=g.addArc(n2,t); cap[a]=20; iflow[a]=0;
+
+  Preflow<SmartDigraph> pre(g,cap,s,t);
   pre.init(iflow);
   pre.startFirstPhase();
-
-  check(pre.flowValue() == 10, "Incorrect max flow value.");
+  check(pre.flowValue() == 10, "The incorrect max flow value.");
   check(pre.minCut(s), "Wrong min cut (Node s).");
   check(pre.minCut(n1), "Wrong min cut (Node n1).");
@@ -276,5 +244,5 @@
 
 template <typename MF, typename SF>
-void checkMaxFlowAlg(const char *input_lgf,  typename MF::Value expected) {
+void checkMaxFlowAlg() {
   typedef SmartDigraph Digraph;
   DIGRAPH_TYPEDEFS(Digraph);
@@ -285,14 +253,12 @@
   typedef BoolNodeMap CutMap;
 
-  Tolerance<Value> tol;
-
   Digraph g;
   Node s, t;
   CapMap cap(g);
-  std::istringstream input(input_lgf);
-  DigraphReader<Digraph>(g, input)
+  std::istringstream input(test_lgf);
+  DigraphReader<Digraph>(g,input)
       .arcMap("capacity", cap)
-      .node("source", s)
-      .node("target", t)
+      .node("source",s)
+      .node("target",t)
       .run();
 
@@ -300,7 +266,5 @@
   max_flow.run();
 
-  check(!tol.different(expected, max_flow.flowValue()),
-        "Incorrect max flow value.");
-  check(checkFlow(g, max_flow.flowMap(), cap, s, t, tol),
+  check(checkFlow(g, max_flow.flowMap(), cap, s, t),
         "The flow is not feasible.");
 
@@ -309,10 +273,13 @@
   Value min_cut_value = cutValue(g, min_cut, cap);
 
-  check(!tol.different(expected, min_cut_value),
-        "Incorrect min cut value.");
+  check(max_flow.flowValue() == min_cut_value,
+        "The max flow value is not equal to the min cut value.");
 
   FlowMap flow(g);
-  for (ArcIt e(g); e != INVALID; ++e) flow[e] = 13 * max_flow.flowMap()[e];
-  for (ArcIt e(g); e != INVALID; ++e) cap[e] = 17 * cap[e];
+  for (ArcIt e(g); e != INVALID; ++e) flow[e] = max_flow.flowMap()[e];
+
+  Value flow_value = max_flow.flowValue();
+
+  for (ArcIt e(g); e != INVALID; ++e) cap[e] = 2 * cap[e];
   max_flow.init(flow);
 
@@ -323,12 +290,11 @@
   min_cut_value = cutValue(g, min_cut1, cap);
 
-  check(!tol.different(17 * expected, max_flow.flowValue()),
-        "Incorrect max flow value.");
-  check(!tol.different(17 * expected, min_cut_value),
-        "Incorrect min cut value.");
+  check(max_flow.flowValue() == min_cut_value &&
+        min_cut_value == 2 * flow_value,
+        "The max flow value or the min cut value is wrong.");
 
   SF::startSecondPhase(max_flow);       // start second phase of the algorithm
 
-  check(checkFlow(g, max_flow.flowMap(), cap, s, t, tol),
+  check(checkFlow(g, max_flow.flowMap(), cap, s, t),
         "The flow is not feasible.");
 
@@ -337,8 +303,8 @@
   min_cut_value = cutValue(g, min_cut2, cap);
 
-  check(!tol.different(17 * expected, max_flow.flowValue()),
-        "Incorrect max flow value.");
-  check(!tol.different(17 * expected, min_cut_value),
-        "Incorrect min cut value.");
+  check(max_flow.flowValue() == min_cut_value &&
+        min_cut_value == 2 * flow_value,
+        "The max flow value or the min cut value was not doubled");
+
 
   max_flow.flowMap(flow);
@@ -359,7 +325,7 @@
   CutMap min_cut3(g);
   max_flow.minCutMap(min_cut3);
-  min_cut_value = cutValue(g, min_cut3, cap);
-
-  check(!tol.different(max_flow.flowValue(), min_cut_value),
+  min_cut_value=cutValue(g, min_cut3, cap);
+
+  check(max_flow.flowValue() == min_cut_value,
         "The max flow value or the min cut value is wrong.");
 }
@@ -414,26 +380,15 @@
   typedef Preflow<SmartDigraph, SmartDigraph::ArcMap<int> > PType1;
   typedef Preflow<SmartDigraph, SmartDigraph::ArcMap<float> > PType2;
-  typedef Preflow<SmartDigraph, SmartDigraph::ArcMap<double> > PType3;
-
-  checkMaxFlowAlg<PType1, PreflowStartFunctions<PType1> >(test_lgf, 13);
-  checkMaxFlowAlg<PType2, PreflowStartFunctions<PType2> >(test_lgf, 13);
-  checkMaxFlowAlg<PType3, PreflowStartFunctions<PType3> >(test_lgf, 13);
-
-  checkMaxFlowAlg<PType2, PreflowStartFunctions<PType2> >(test_lgf_float, 0.3);
-  checkMaxFlowAlg<PType3, PreflowStartFunctions<PType3> >(test_lgf_float, 0.3);
-
-  checkInitPreflow();
+  checkMaxFlowAlg<PType1, PreflowStartFunctions<PType1> >();
+  checkMaxFlowAlg<PType2, PreflowStartFunctions<PType2> >();
+  initFlowTest();
 
   // Check EdmondsKarp
   typedef EdmondsKarp<SmartDigraph, SmartDigraph::ArcMap<int> > EKType1;
   typedef EdmondsKarp<SmartDigraph, SmartDigraph::ArcMap<float> > EKType2;
-  typedef EdmondsKarp<SmartDigraph, SmartDigraph::ArcMap<double> > EKType3;
-
-  checkMaxFlowAlg<EKType1, GeneralStartFunctions<EKType1> >(test_lgf, 13);
-  checkMaxFlowAlg<EKType2, GeneralStartFunctions<EKType2> >(test_lgf, 13);
-  checkMaxFlowAlg<EKType3, GeneralStartFunctions<EKType3> >(test_lgf, 13);
-
-  checkMaxFlowAlg<EKType2, GeneralStartFunctions<EKType2> >(test_lgf_float, 0.3);
-  checkMaxFlowAlg<EKType3, GeneralStartFunctions<EKType3> >(test_lgf_float, 0.3);
+  checkMaxFlowAlg<EKType1, GeneralStartFunctions<EKType1> >();
+  checkMaxFlowAlg<EKType2, GeneralStartFunctions<EKType2> >();
+
+  initFlowTest();
 
   return 0;
