diff -r 70b199792735 -r ad40f7d32846 tools/dimacs-solver.cc --- a/tools/dimacs-solver.cc Fri Aug 09 11:07:27 2013 +0200 +++ b/tools/dimacs-solver.cc Sun Aug 11 15:28:12 2013 +0200 @@ -2,7 +2,7 @@ * * This file is a part of LEMON, a generic C++ optimization library. * - * Copyright (C) 2003-2009 + * Copyright (C) 2003-2010 * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport * (Egervary Research Group on Combinatorial Optimization, EGRES). * @@ -88,10 +88,10 @@ ti.restart(); pre.run(); if(report) std::cerr << "Run Preflow: " << ti << '\n'; - if(report) std::cerr << "\nMax flow value: " << pre.flowValue() << '\n'; + 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) { @@ -128,7 +128,8 @@ if (report) { std::cerr << "Run NetworkSimplex: " << ti << "\n\n"; std::cerr << "Feasible flow: " << (res == MCF::OPTIMAL ? "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'; } } @@ -148,11 +149,11 @@ mat.run(); if(report) std::cerr << "Run MaxMatching: " << ti << '\n'; if(report) std::cerr << "\nCardinality of max matching: " - << mat.matchingSize() << '\n'; + << mat.matchingSize() << '\n'; } -template +template void solve(ArgParser &ap, std::istream &is, std::ostream &os, DimacsDescriptor &desc) { @@ -166,11 +167,11 @@ << std::endl; exit(1); } - + 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); @@ -235,7 +236,7 @@ std::ostream& os = (ap.files().size()<2 ? std::cout : output); DimacsDescriptor desc = dimacsType(is); - + if(!ap.given("q")) { std::cout << "Problem type: "; @@ -260,16 +261,18 @@ std::cout << "\nNum of arcs: " << desc.edgeNum; std::cout << "\n\n"; } - + 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; }