COIN-OR::LEMON - Graph Library

Changeset 1167:c5990f454032 in lemon for tools/dimacs-solver.cc


Ignore:
Timestamp:
03/28/12 19:39:56 (13 years ago)
Author:
Peter Kovacs <kpeter@…>
Branch:
default
Children:
1168:b78a46fe8002, 1169:774349a16ba0, 1170:764826c6e2b4, 1171:7e368d9b67f7
Phase:
public
Message:

Fix a bug + remove redundant typedefs in dimacs-solver (#440)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • tools/dimacs-solver.cc

    r691 r1167  
    118118  if (report) std::cerr << "Read the file: " << ti << '\n';
    119119
    120   ti.restart();
    121   NetworkSimplex<Digraph, Value> ns(g);
     120  typedef NetworkSimplex<Digraph, Value> MCF;
     121  ti.restart();
     122  MCF ns(g);
    122123  ns.lowerMap(lower).upperMap(cap).costMap(cost).supplyMap(sup);
    123124  if (sum_sup > 0) ns.supplyType(ns.LEQ);
    124125  if (report) std::cerr << "Setup NetworkSimplex class: " << ti << '\n';
    125126  ti.restart();
    126   bool res = ns.run();
     127  typename MCF::ProblemType res = ns.run();
    127128  if (report) {
    128129    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';
    130131    if (res) std::cerr << "Min flow cost: " << ns.totalCost() << '\n';
    131132  }
     
    187188
    188189int main(int argc, const char *argv[]) {
    189   typedef SmartDigraph Digraph;
    190 
    191   typedef Digraph::Arc Arc;
    192190
    193191  std::string inputName;
Note: See TracChangeset for help on using the changeset viewer.