COIN-OR::LEMON - Graph Library

Changeset 561:6e0525ec5355 in lemon-1.2 for tools/dimacs-solver.cc


Ignore:
Timestamp:
03/30/09 17:46:37 (11 years ago)
Author:
Alpar Juttner <alpar@…>
Branch:
default
Children:
562:538b3dd9a2c0, 1005:f37f0845cf32
Phase:
public
Message:

Accept negative values as unbounded capacity in dimacs readers (#243)
and some doc improvements.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • tools/dimacs-solver.cc

    r532 r561  
    7373template<class Value>
    7474void solve_max(ArgParser &ap, std::istream &is, std::ostream &,
    75               DimacsDescriptor &desc)
     75               Value infty, DimacsDescriptor &desc)
    7676{
    7777  bool report = !ap.given("q");
     
    8181  Timer ti;
    8282  ti.restart();
    83   readDimacsMax(is, g, cap, s, t, desc);
     83  readDimacsMax(is, g, cap, s, t, infty, desc);
    8484  if(report) std::cerr << "Read the file: " << ti << '\n';
    8585  ti.restart();
     
    116116           DimacsDescriptor &desc)
    117117{
     118  std::stringstream iss(ap["infcap"]);
     119  Value infty;
     120  iss >> infty;
     121  if(iss.fail())
     122    {
     123      std::cerr << "Cannot interpret '"
     124                << static_cast<std::string>(ap["infcap"]) << "' as infinite"
     125                << std::endl;
     126      exit(1);
     127    }
     128 
    118129  switch(desc.type)
    119130    {
     
    123134      break;
    124135    case DimacsDescriptor::MAX:
    125       solve_max<Value>(ap,is,os,desc);
     136      solve_max<Value>(ap,is,os,infty,desc);
    126137      break;
    127138    case DimacsDescriptor::SP:
     
    160171    .optionGroup("datatype","ldouble")
    161172    .onlyOneGroup("datatype")
     173    .stringOption("infcap","Value used for 'very high' capacities","0")
    162174    .run();
    163175
Note: See TracChangeset for help on using the changeset viewer.