Changeset 561:6e0525ec5355 in lemon-main for tools
- Timestamp:
- 03/30/09 17:46:37 (16 years ago)
- Branch:
- default
- Children:
- 562:538b3dd9a2c0, 1158:f37f0845cf32
- Phase:
- public
- Location:
- tools
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
tools/dimacs-solver.cc
r532 r561 73 73 template<class Value> 74 74 void solve_max(ArgParser &ap, std::istream &is, std::ostream &, 75 DimacsDescriptor &desc)75 Value infty, DimacsDescriptor &desc) 76 76 { 77 77 bool report = !ap.given("q"); … … 81 81 Timer ti; 82 82 ti.restart(); 83 readDimacsMax(is, g, cap, s, t, desc);83 readDimacsMax(is, g, cap, s, t, infty, desc); 84 84 if(report) std::cerr << "Read the file: " << ti << '\n'; 85 85 ti.restart(); … … 116 116 DimacsDescriptor &desc) 117 117 { 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 118 129 switch(desc.type) 119 130 { … … 123 134 break; 124 135 case DimacsDescriptor::MAX: 125 solve_max<Value>(ap,is,os, desc);136 solve_max<Value>(ap,is,os,infty,desc); 126 137 break; 127 138 case DimacsDescriptor::SP: … … 160 171 .optionGroup("datatype","ldouble") 161 172 .onlyOneGroup("datatype") 173 .stringOption("infcap","Value used for 'very high' capacities","0") 162 174 .run(); 163 175 -
tools/dimacs-to-lgf.cc
r440 r561 97 97 DoubleArcMap lower(digraph), capacity(digraph), cost(digraph); 98 98 DoubleNodeMap supply(digraph); 99 readDimacsMin(is, digraph, lower, capacity, cost, supply, desc);99 readDimacsMin(is, digraph, lower, capacity, cost, supply, 0, desc); 100 100 DigraphWriter<Digraph>(digraph, os). 101 101 nodeMap("supply", supply). … … 112 112 Node s, t; 113 113 DoubleArcMap capacity(digraph); 114 readDimacsMax(is, digraph, capacity, s, t, desc);114 readDimacsMax(is, digraph, capacity, s, t, 0, desc); 115 115 DigraphWriter<Digraph>(digraph, os). 116 116 arcMap("capacity", capacity).
Note: See TracChangeset
for help on using the changeset viewer.