Changeset 1168:b78a46fe8002 in lemon
- Timestamp:
- 11/07/12 18:10:07 (12 years ago)
- Branch:
- 1.1
- Parents:
- 1158:8d2e55fac752 (diff), 1167:c5990f454032 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent. - Phase:
- public
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
tools/dimacs-solver.cc
r1081 r1168 118 118 if (report) std::cerr << "Read the file: " << ti << '\n'; 119 119 120 ti.restart(); 121 NetworkSimplex<Digraph, Value> ns(g); 120 typedef NetworkSimplex<Digraph, Value> MCF; 121 ti.restart(); 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 boolres = 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: " << ns.totalCost() << '\n'; 131 132 } … … 187 188 188 189 int main(int argc, const char *argv[]) { 189 typedef SmartDigraph Digraph;190 191 typedef Digraph::Arc Arc;192 190 193 191 std::string inputName; -
tools/dimacs-solver.cc
r1167 r1168 3 3 * This file is a part of LEMON, a generic C++ optimization library. 4 4 * 5 * Copyright (C) 2003-20 095 * Copyright (C) 2003-2011 6 6 * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport 7 7 * (Egervary Research Group on Combinatorial Optimization, EGRES). … … 89 89 pre.run(); 90 90 if(report) std::cerr << "Run Preflow: " << ti << '\n'; 91 if(report) std::cerr << "\nMax flow value: " << pre.flowValue() << '\n'; 91 if(report) std::cerr << "\nMax flow value: " << pre.flowValue() << '\n'; 92 92 } 93 93 … … 149 149 if(report) std::cerr << "Run MaxMatching: " << ti << '\n'; 150 150 if(report) std::cerr << "\nCardinality of max matching: " 151 << mat.matchingSize() << '\n'; 151 << mat.matchingSize() << '\n'; 152 152 } 153 153 … … 167 167 exit(1); 168 168 } 169 169 170 170 switch(desc.type) 171 171 { … … 236 236 237 237 DimacsDescriptor desc = dimacsType(is); 238 238 239 239 if(!ap.given("q")) 240 240 { … … 261 261 std::cout << "\n\n"; 262 262 } 263 263 264 264 if(ap.given("double")) 265 265 solve<double>(ap,is,os,desc);
Note: See TracChangeset
for help on using the changeset viewer.