diff -r 7c4ba7daaf5f -r 2b6bffe0e7e8 lemon/dimacs.h --- a/lemon/dimacs.h Tue Dec 20 17:44:38 2011 +0100 +++ b/lemon/dimacs.h Tue Dec 20 18:15:14 2011 +0100 @@ -2,7 +2,7 @@ * * This file is a part of LEMON, a generic C++ optimization library. * - * Copyright (C) 2003-2009 + * Copyright (C) 2003-2010 * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport * (Egervary Research Group on Combinatorial Optimization, EGRES). * @@ -61,7 +61,7 @@ ///Discover the type of a DIMACS file ///This function starts seeking the beginning of the given file for the - ///problem type and size info. + ///problem type and size info. ///The found data is returned in a special struct that can be evaluated ///and passed to the appropriate reader function. DimacsDescriptor dimacsType(std::istream& is) @@ -212,7 +212,7 @@ infty = std::numeric_limits::has_infinity ? std::numeric_limits::infinity() : std::numeric_limits::max(); - + while (is >> c) { switch (c) { case 'c': // comment line @@ -237,7 +237,7 @@ getline(is, str); e = g.addArc(nodes[i], nodes[j]); capacity.set(e, _cap); - } + } else if (desc.type==DimacsDescriptor::MAX) { is >> i >> j >> _cap; getline(is, str); @@ -362,11 +362,11 @@ { g.addArc(s,t); } - + /// \brief DIMACS plain (di)graph reader function. /// /// This function reads a plain (di)graph without any designated nodes - /// and maps (e.g. a matching instance) from DIMACS format, i.e. from + /// and maps (e.g. a matching instance) from DIMACS format, i.e. from /// DIMACS files having a line starting with /// \code /// p mat @@ -392,7 +392,7 @@ for (int k = 1; k <= desc.nodeNum; ++k) { nodes[k] = g.addNode(); } - + while (is >> c) { switch (c) { case 'c': // comment line