# HG changeset patch # User Peter Kovacs # Date 2010-02-20 16:51:43 # Node ID 9d380bf271941ce00c6f0edb200f9a81a71959a5 # Parent c841ae1aca299b7274d51c506871c57b73f1311a Use 'long long' flow cost in dimacs-solver.cc (#347) diff --git a/tools/dimacs-solver.cc b/tools/dimacs-solver.cc --- a/tools/dimacs-solver.cc +++ b/tools/dimacs-solver.cc @@ -91,7 +91,7 @@ if(report) std::cerr << "\nMax flow value: " << pre.flowValue() << '\n'; } -template +template void solve_min(ArgParser &ap, std::istream &is, std::ostream &, Value infty, DimacsDescriptor &desc) { @@ -127,7 +127,8 @@ if (report) { std::cerr << "Run NetworkSimplex: " << ti << "\n\n"; std::cerr << "Feasible flow: " << (res ? "found" : "not found") << '\n'; - if (res) std::cerr << "Min flow cost: " << ns.totalCost() << '\n'; + if (res) std::cerr << "Min flow cost: " + << ns.template totalCost() << '\n'; } } @@ -151,7 +152,7 @@ } -template +template void solve(ArgParser &ap, std::istream &is, std::ostream &os, DimacsDescriptor &desc) { @@ -169,7 +170,7 @@ switch(desc.type) { case DimacsDescriptor::MIN: - solve_min(ap,is,os,infty,desc); + solve_min(ap,is,os,infty,desc); break; case DimacsDescriptor::MAX: solve_max(ap,is,os,infty,desc); @@ -264,14 +265,16 @@ } if(ap.given("double")) - solve(ap,is,os,desc); + solve(ap,is,os,desc); else if(ap.given("ldouble")) - solve(ap,is,os,desc); + solve(ap,is,os,desc); #ifdef LEMON_HAVE_LONG_LONG else if(ap.given("long")) - solve(ap,is,os,desc); + solve(ap,is,os,desc); + else solve(ap,is,os,desc); +#else + else solve(ap,is,os,desc); #endif - else solve(ap,is,os,desc); return 0; }