[Lemon-commits] Alpar Juttner: Merge bugfix #440

Lemon HG hg at lemon.cs.elte.hu
Thu Nov 8 09:31:38 CET 2012


details:   http://lemon.cs.elte.hu/hg/lemon/rev/764826c6e2b4
changeset: 1170:764826c6e2b4
user:      Alpar Juttner <alpar [at] cs.elte.hu>
date:      Thu Nov 08 09:07:41 2012 +0100
description:
	Merge bugfix #440

diffstat:

 tools/dimacs-solver.cc |  10 ++++------
 1 files changed, 4 insertions(+), 6 deletions(-)

diffs (34 lines):

diff --git a/tools/dimacs-solver.cc b/tools/dimacs-solver.cc
--- a/tools/dimacs-solver.cc
+++ b/tools/dimacs-solver.cc
@@ -117,16 +117,17 @@
   }
   if (report) std::cerr << "Read the file: " << ti << '\n';
 
+  typedef NetworkSimplex<Digraph, Value> MCF;
   ti.restart();
-  NetworkSimplex<Digraph, Value> ns(g);
+  MCF ns(g);
   ns.lowerMap(lower).upperMap(cap).costMap(cost).supplyMap(sup);
   if (sum_sup > 0) ns.supplyType(ns.LEQ);
   if (report) std::cerr << "Setup NetworkSimplex class: " << ti << '\n';
   ti.restart();
-  bool res = ns.run();
+  typename MCF::ProblemType res = ns.run();
   if (report) {
     std::cerr << "Run NetworkSimplex: " << ti << "\n\n";
-    std::cerr << "Feasible flow: " << (res ? "found" : "not found") << '\n';
+    std::cerr << "Feasible flow: " << (res == MCF::OPTIMAL ? "found" : "not found") << '\n';
     if (res) std::cerr << "Min flow cost: "
                        << ns.template totalCost<LargeValue>() << '\n';
   }
@@ -187,9 +188,6 @@
 }
 
 int main(int argc, const char *argv[]) {
-  typedef SmartDigraph Digraph;
-
-  typedef Digraph::Arc Arc;
 
   std::string inputName;
   std::string outputName;



More information about the Lemon-commits mailing list