# HG changeset patch
# User Peter Kovacs <kpeter@inf.elte.hu>
# Date 1332956396 -7200
# Node ID e1ee6ea9abc1d036caaf84bdbe060681a63ad309
# Parent 141f9c0db4a3892de5feca4ebdbc8776191567cd
Fix a bug + remove redundant typedefs in dimacs-solver (#440)
diff --git a/tools/dimacs-solver.cc b/tools/dimacs-solver.cc
a
|
b
|
|
117 | 117 | } |
118 | 118 | if (report) std::cerr << "Read the file: " << ti << '\n'; |
119 | 119 | |
| 120 | typedef NetworkSimplex<Digraph, Value> MCF; |
120 | 121 | ti.restart(); |
121 | | NetworkSimplex<Digraph, Value> ns(g); |
| 122 | MCF ns(g); |
122 | 123 | ns.lowerMap(lower).upperMap(cap).costMap(cost).supplyMap(sup); |
123 | 124 | if (sum_sup > 0) ns.supplyType(ns.LEQ); |
124 | 125 | if (report) std::cerr << "Setup NetworkSimplex class: " << ti << '\n'; |
125 | 126 | ti.restart(); |
126 | | bool res = ns.run(); |
| 127 | typename MCF::ProblemType res = ns.run(); |
127 | 128 | if (report) { |
128 | 129 | std::cerr << "Run NetworkSimplex: " << ti << "\n\n"; |
129 | | std::cerr << "Feasible flow: " << (res ? "found" : "not found") << '\n'; |
| 130 | std::cerr << "Feasible flow: " << (res == MCF::OPTIMAL ? "found" : "not found") << '\n'; |
130 | 131 | if (res) std::cerr << "Min flow cost: " |
131 | 132 | << ns.template totalCost<LargeValue>() << '\n'; |
132 | 133 | } |
… |
… |
|
187 | 188 | } |
188 | 189 | |
189 | 190 | int main(int argc, const char *argv[]) { |
190 | | typedef SmartDigraph Digraph; |
191 | | |
192 | | typedef Digraph::Arc Arc; |
193 | 191 | |
194 | 192 | std::string inputName; |
195 | 193 | std::string outputName; |