gravatar
kpeter (Peter Kovacs)
kpeter@inf.elte.hu
Small improvements in DIMACS solver (#226)
0 1 0
default
1 file changed with 5 insertions and 12 deletions:
↑ Collapse diff ↑
Ignore white space 12 line context
... ...
@@ -15,16 +15,15 @@
15 15
 * purpose.
16 16
 *
17 17
 */
18 18

	
19 19
///\ingroup tools
20 20
///\file
21
///\brief DIMACS to LGF converter.
21
///\brief DIMACS problem solver.
22 22
///
23
/// This program converts various DIMACS formats to the LEMON Digraph Format
24
/// (LGF).
23
/// This program solves various problems given in DIMACS format.
25 24
///
26 25
/// See
27 26
/// \verbatim
28 27
///  dimacs-solver --help
29 28
/// \endverbatim
30 29
/// for more info on usage.
... ...
@@ -117,14 +116,13 @@
117 116
           DimacsDescriptor &desc)
118 117
{
119 118
  switch(desc.type)
120 119
    {
121 120
    case DimacsDescriptor::MIN:
122 121
      std::cerr <<
123
        "\n\n Sorry, the min. cost flow solver is not yet available.\n"
124
                << std::endl;
122
        "\n\n Sorry, the min. cost flow solver is not yet available.\n";
125 123
      break;
126 124
    case DimacsDescriptor::MAX:
127 125
      solve_max<Value>(ap,is,os,desc);
128 126
      break;
129 127
    case DimacsDescriptor::SP:
130 128
      solve_sp<Value>(ap,is,os,desc);
... ...
@@ -138,17 +136,12 @@
138 136
}
139 137

	
140 138
int main(int argc, const char *argv[]) {
141 139
  typedef SmartDigraph Digraph;
142 140

	
143 141
  typedef Digraph::Arc Arc;
144
  typedef Digraph::Node Node;
145
  typedef Digraph::ArcIt ArcIt;
146
  typedef Digraph::NodeIt NodeIt;
147
  typedef Digraph::ArcMap<double> DoubleArcMap;
148
  typedef Digraph::NodeMap<double> DoubleNodeMap;
149 142

	
150 143
  std::string inputName;
151 144
  std::string outputName;
152 145

	
153 146
  ArgParser ap(argc, argv);
154 147
  ap.other("[INFILE [OUTFILE]]",
... ...
@@ -185,13 +178,13 @@
185 178
      }
186 179
    case 0:
187 180
      break;
188 181
    default:
189 182
      std::cerr << ap.commandName() << ": too many arguments\n";
190 183
      return 1;
191
  }
184
    }
192 185
  std::istream& is = (ap.files().size()<1 ? std::cin : input);
193 186
  std::ostream& os = (ap.files().size()<2 ? std::cout : output);
194 187

	
195 188
  DimacsDescriptor desc = dimacsType(is);
196 189
  
197 190
  if(!ap.given("q"))
... ...
@@ -213,13 +206,13 @@
213 206
        default:
214 207
          exit(1);
215 208
          break;
216 209
        }
217 210
      std::cout << "\nNum of nodes: " << desc.nodeNum;
218 211
      std::cout << "\nNum of arcs:  " << desc.edgeNum;
219
      std::cout << '\n' << std::endl;
212
      std::cout << "\n\n";
220 213
    }
221 214
    
222 215
  if(ap.given("double"))
223 216
    solve<double>(ap,is,os,desc);
224 217
  else if(ap.given("ldouble"))
225 218
    solve<long double>(ap,is,os,desc);
0 comments (0 inline)