COIN-OR::LEMON - Graph Library

Changeset 1168:b78a46fe8002 in lemon


Ignore:
Timestamp:
11/07/12 18:10:07 (7 years ago)
Author:
Alpar Juttner <alpar@…>
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
Message:

Merge bugfix #440 to branch 1.1

Files:
2 edited

Legend:

Unmodified
Added
Removed
  • tools/dimacs-solver.cc

    r1081 r1168  
    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;
  • tools/dimacs-solver.cc

    r1167 r1168  
    33 * This file is a part of LEMON, a generic C++ optimization library.
    44 *
    5  * Copyright (C) 2003-2009
     5 * Copyright (C) 2003-2011
    66 * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
    77 * (Egervary Research Group on Combinatorial Optimization, EGRES).
     
    8989  pre.run();
    9090  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';
    9292}
    9393
     
    149149  if(report) std::cerr << "Run MaxMatching: " << ti << '\n';
    150150  if(report) std::cerr << "\nCardinality of max matching: "
    151                        << mat.matchingSize() << '\n'; 
     151                       << mat.matchingSize() << '\n';
    152152}
    153153
     
    167167      exit(1);
    168168    }
    169  
     169
    170170  switch(desc.type)
    171171    {
     
    236236
    237237  DimacsDescriptor desc = dimacsType(is);
    238  
     238
    239239  if(!ap.given("q"))
    240240    {
     
    261261      std::cout << "\n\n";
    262262    }
    263    
     263
    264264  if(ap.given("double"))
    265265    solve<double>(ap,is,os,desc);
Note: See TracChangeset for help on using the changeset viewer.