diff --git a/tools/dimacs-solver.cc b/tools/dimacs-solver.cc --- a/tools/dimacs-solver.cc +++ b/tools/dimacs-solver.cc @@ -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) { @@ -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'; } } @@ -147,11 +148,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) { @@ -165,11 +166,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); @@ -237,7 +238,7 @@ std::ostream& os = (ap.files().size()<2 ? std::cout : output); DimacsDescriptor desc = dimacsType(is); - + if(!ap.given("q")) { std::cout << "Problem type: "; @@ -262,16 +263,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; }