COIN-OR::LEMON - Graph Library

Changeset 1067:54464584b157 in lemon for lemon/lgf_reader.h


Ignore:
Timestamp:
08/02/11 18:13:34 (8 years ago)
Author:
Alpar Juttner <alpar@…>
Branch:
default
Children:
1068:e8afd887d706, 1069:b1b534ddb539, 1070:c8c8801db0a4, 1071:2d583da4ba40, 1072:3dcb45a871c3
Phase:
public
Message:

Allow lgf file without Arc maps (#382)

A single '-' character in the @arcs sectio header indicates that
there is no arc map.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • lemon/lgf_reader.h

    r517 r1067  
    33 * This file is a part of LEMON, a generic C++ optimization library.
    44 *
    5  * Copyright (C) 2003-2008
     5 * Copyright (C) 2003-2011
    66 * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
    77 * (Egervary Research Group on Combinatorial Optimization, EGRES).
     
    964964        int index = 0;
    965965        while (_reader_bits::readToken(line, map)) {
     966          if(map == "-") {
     967              if(index!=0)
     968                throw FormatError("'-' is not allowed as a map name");
     969              else if (line >> std::ws >> c)
     970                throw FormatError("Extra character at the end of line");
     971              else break;
     972            }
    966973          if (maps.find(map) != maps.end()) {
    967974            std::ostringstream msg;
     
    18041811        int index = 0;
    18051812        while (_reader_bits::readToken(line, map)) {
     1813          if(map == "-") {
     1814              if(index!=0)
     1815                throw FormatError("'-' is not allowed as a map name");
     1816              else if (line >> std::ws >> c)
     1817                throw FormatError("Extra character at the end of line");
     1818              else break;
     1819            }
    18061820          if (maps.find(map) != maps.end()) {
    18071821            std::ostringstream msg;
Note: See TracChangeset for help on using the changeset viewer.