Fix a bug + remove redundant typedefs in dimacs-solver (#440)
authorPeter Kovacs <kpeter@inf.elte.hu>
Wed, 28 Mar 2012 19:39:56 +0200
changeset 794c5990f454032
parent 792 761fe0846f49
child 795 b78a46fe8002
child 796 7e368d9b67f7
Fix a bug + remove redundant typedefs in dimacs-solver (#440)
tools/dimacs-solver.cc
     1.1 --- a/tools/dimacs-solver.cc	Thu Sep 13 11:45:36 2012 +0200
     1.2 +++ b/tools/dimacs-solver.cc	Wed Mar 28 19:39:56 2012 +0200
     1.3 @@ -117,16 +117,17 @@
     1.4    }
     1.5    if (report) std::cerr << "Read the file: " << ti << '\n';
     1.6  
     1.7 +  typedef NetworkSimplex<Digraph, Value> MCF;
     1.8    ti.restart();
     1.9 -  NetworkSimplex<Digraph, Value> ns(g);
    1.10 +  MCF ns(g);
    1.11    ns.lowerMap(lower).upperMap(cap).costMap(cost).supplyMap(sup);
    1.12    if (sum_sup > 0) ns.supplyType(ns.LEQ);
    1.13    if (report) std::cerr << "Setup NetworkSimplex class: " << ti << '\n';
    1.14    ti.restart();
    1.15 -  bool res = ns.run();
    1.16 +  typename MCF::ProblemType res = ns.run();
    1.17    if (report) {
    1.18      std::cerr << "Run NetworkSimplex: " << ti << "\n\n";
    1.19 -    std::cerr << "Feasible flow: " << (res ? "found" : "not found") << '\n';
    1.20 +    std::cerr << "Feasible flow: " << (res == MCF::OPTIMAL ? "found" : "not found") << '\n';
    1.21      if (res) std::cerr << "Min flow cost: " << ns.totalCost() << '\n';
    1.22    }
    1.23  }
    1.24 @@ -186,9 +187,6 @@
    1.25  }
    1.26  
    1.27  int main(int argc, const char *argv[]) {
    1.28 -  typedef SmartDigraph Digraph;
    1.29 -
    1.30 -  typedef Digraph::Arc Arc;
    1.31  
    1.32    std::string inputName;
    1.33    std::string outputName;