Changeset 964:2b6bffe0e7e8 in lemon-main for lemon/lgf_reader.h
- Timestamp:
- 12/20/11 18:15:14 (12 years ago)
- Branch:
- default
- Parents:
- 963:7c4ba7daaf5f (diff), 942:633956ca9421 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent. - Phase:
- public
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
lemon/lgf_reader.h
r877 r964 3 3 * This file is a part of LEMON, a generic C++ optimization library. 4 4 * 5 * Copyright (C) 2003-201 05 * Copyright (C) 2003-2011 6 6 * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport 7 7 * (Egervary Research Group on Combinatorial Optimization, EGRES). … … 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; … … 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; -
lemon/lgf_reader.h
r959 r964 428 428 ///\endcode 429 429 /// 430 /// By default the reader uses the first section in the file of the430 /// By default, the reader uses the first section in the file of the 431 431 /// proper type. If a section has an optional name, then it can be 432 432 /// selected for reading by giving an optional name parameter to the … … 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> … … 1195 1195 1196 1196 }; 1197 1197 1198 1198 /// \ingroup lemon_io 1199 1199 /// … … 1202 1202 /// This function just returns a \ref DigraphReader class. 1203 1203 /// 1204 /// With this function a digraph can be read from an 1204 /// With this function a digraph can be read from an 1205 1205 /// \ref lgf-format "LGF" file or input stream with several maps and 1206 1206 /// attributes. For example, there is network flow problem on a … … 1257 1257 template <typename GR> 1258 1258 class GraphReader; 1259 1259 1260 1260 template <typename TGR> 1261 1261 GraphReader<TGR> graphReader(TGR& graph, std::istream& is = std::cin); … … 1394 1394 friend GraphReader<TGR> graphReader(TGR& graph, std::istream& is); 1395 1395 template <typename TGR> 1396 friend GraphReader<TGR> graphReader(TGR& graph, const std::string& fn); 1396 friend GraphReader<TGR> graphReader(TGR& graph, const std::string& fn); 1397 1397 template <typename TGR> 1398 1398 friend GraphReader<TGR> graphReader(TGR& graph, const char *fn); … … 2078 2078 /// \brief Return a \ref GraphReader class 2079 2079 /// 2080 /// This function just returns a \ref GraphReader class. 2081 /// 2082 /// 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 2083 2083 /// \ref lgf-format "LGF" file or input stream with several maps and 2084 2084 /// attributes. For example, there is weighted matching problem on a … … 2236 2236 /// whitespaces are trimmed from each processed string. 2237 2237 /// 2238 /// For example let's see a section, which contain several2238 /// For example, let's see a section, which contain several 2239 2239 /// integers, which should be inserted into a vector. 2240 2240 ///\code
Note: See TracChangeset
for help on using the changeset viewer.