COIN-OR::LEMON - Graph Library

Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • lemon/lgf_reader.h

    r646 r1081  
    33 * This file is a part of LEMON, a generic C++ optimization library.
    44 *
    5  * Copyright (C) 2003-2009
     5 * Copyright (C) 2003-2011
    66 * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
    77 * (Egervary Research Group on Combinatorial Optimization, EGRES).
     
    563563    friend DigraphReader<TDGR> digraphReader(TDGR& digraph, std::istream& is);
    564564    template <typename TDGR>
    565     friend DigraphReader<TDGR> digraphReader(TDGR& digraph, 
     565    friend DigraphReader<TDGR> digraphReader(TDGR& digraph,
    566566                                             const std::string& fn);
    567567    template <typename TDGR>
     
    965965        int index = 0;
    966966        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            }
    967974          if (maps.find(map) != maps.end()) {
    968975            std::ostringstream msg;
     
    11881195
    11891196  };
    1190  
     1197
    11911198  /// \ingroup lemon_io
    11921199  ///
     
    11951202  /// This function just returns a \ref DigraphReader class.
    11961203  ///
    1197   /// With this function a digraph can be read from an 
     1204  /// With this function a digraph can be read from an
    11981205  /// \ref lgf-format "LGF" file or input stream with several maps and
    11991206  /// attributes. For example, there is network flow problem on a
     
    12501257  template <typename GR>
    12511258  class GraphReader;
    1252  
     1259
    12531260  template <typename TGR>
    12541261  GraphReader<TGR> graphReader(TGR& graph, std::istream& is = std::cin);
     
    13871394    friend GraphReader<TGR> graphReader(TGR& graph, std::istream& is);
    13881395    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);
    13901397    template <typename TGR>
    13911398    friend GraphReader<TGR> graphReader(TGR& graph, const char *fn);
     
    18351842        int index = 0;
    18361843        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            }
    18371851          if (maps.find(map) != maps.end()) {
    18381852            std::ostringstream msg;
     
    20642078  /// \brief Return a \ref GraphReader class
    20652079  ///
    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
    20692083  /// \ref lgf-format "LGF" file or input stream with several maps and
    20702084  /// attributes. For example, there is weighted matching problem on a
Note: See TracChangeset for help on using the changeset viewer.