Changes in lemon/lgf_reader.h [646:f63e87b9748e:1081:f1398882a928] in lemon
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
lemon/lgf_reader.h
r646 r1081 3 3 * This file is a part of LEMON, a generic C++ optimization library. 4 4 * 5 * Copyright (C) 2003-20 095 * Copyright (C) 2003-2011 6 6 * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport 7 7 * (Egervary Research Group on Combinatorial Optimization, EGRES). … … 563 563 friend DigraphReader<TDGR> digraphReader(TDGR& digraph, std::istream& is); 564 564 template <typename TDGR> 565 friend DigraphReader<TDGR> digraphReader(TDGR& digraph, 565 friend DigraphReader<TDGR> digraphReader(TDGR& digraph, 566 566 const std::string& fn); 567 567 template <typename TDGR> … … 965 965 int index = 0; 966 966 while (_reader_bits::readToken(line, map)) { 967 if(map == "-") { 968 if(index!=0) 969 throw FormatError("'-' is not allowed as a map name"); 970 else if (line >> std::ws >> c) 971 throw FormatError("Extra character at the end of line"); 972 else break; 973 } 967 974 if (maps.find(map) != maps.end()) { 968 975 std::ostringstream msg; … … 1188 1195 1189 1196 }; 1190 1197 1191 1198 /// \ingroup lemon_io 1192 1199 /// … … 1195 1202 /// This function just returns a \ref DigraphReader class. 1196 1203 /// 1197 /// With this function a digraph can be read from an 1204 /// With this function a digraph can be read from an 1198 1205 /// \ref lgf-format "LGF" file or input stream with several maps and 1199 1206 /// attributes. For example, there is network flow problem on a … … 1250 1257 template <typename GR> 1251 1258 class GraphReader; 1252 1259 1253 1260 template <typename TGR> 1254 1261 GraphReader<TGR> graphReader(TGR& graph, std::istream& is = std::cin); … … 1387 1394 friend GraphReader<TGR> graphReader(TGR& graph, std::istream& is); 1388 1395 template <typename TGR> 1389 friend GraphReader<TGR> graphReader(TGR& graph, const std::string& fn); 1396 friend GraphReader<TGR> graphReader(TGR& graph, const std::string& fn); 1390 1397 template <typename TGR> 1391 1398 friend GraphReader<TGR> graphReader(TGR& graph, const char *fn); … … 1835 1842 int index = 0; 1836 1843 while (_reader_bits::readToken(line, map)) { 1844 if(map == "-") { 1845 if(index!=0) 1846 throw FormatError("'-' is not allowed as a map name"); 1847 else if (line >> std::ws >> c) 1848 throw FormatError("Extra character at the end of line"); 1849 else break; 1850 } 1837 1851 if (maps.find(map) != maps.end()) { 1838 1852 std::ostringstream msg; … … 2064 2078 /// \brief Return a \ref GraphReader class 2065 2079 /// 2066 /// This function just returns a \ref GraphReader class. 2067 /// 2068 /// With this function a graph can be read from an 2080 /// This function just returns a \ref GraphReader class. 2081 /// 2082 /// With this function a graph can be read from an 2069 2083 /// \ref lgf-format "LGF" file or input stream with several maps and 2070 2084 /// attributes. For example, there is weighted matching problem on a
Note: See TracChangeset
for help on using the changeset viewer.