# Changeset 949:54464584b157 in lemon-main

Ignore:
Timestamp:
08/02/11 18:13:34 (9 years ago)
Branch:
default
Children:
950:2d583da4ba40, 951: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.

Files:
4 edited

Unmodified
Removed
• ## doc/lgf.dox

 r313 \endcode The \c \@arcs section is very similar to the \c \@nodes section, it again starts with a header line describing the names of the maps, but the \c "label" map is not obligatory here. The following lines describe the arcs. The first two tokens of each line are the source and the target node of the arc, respectively, then come the map The \c \@arcs section is very similar to the \c \@nodes section, it again starts with a header line describing the names of the maps, but the \c "label" map is not obligatory here. The following lines describe the arcs. The first two tokens of each line are the source and the target node of the arc, respectively, then come the map values. The source and target tokens must be node labels. \endcode If there is no map in the \c \@arcs section at all, then it must be indicated by a sole '-' sign in the first line. \code @arcs - 1   2 1   3 2   3 \endcode The \c \@edges is just a synonym of \c \@arcs. The \@arcs section can also store the edge set of an undirected graph. In such case there is a conventional method for store arc maps in the file, if two columns has the same caption with \c '+' and \c '-' prefix, then these columns have the same caption with \c '+' and \c '-' prefix, then these columns can be regarded as the values of an arc map.

 r498 * This file is a part of LEMON, a generic C++ optimization library. * * Copyright (C) 2003-2008 * Copyright (C) 2003-2011 * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport * (Egervary Research Group on Combinatorial Optimization, EGRES). int index = 0; while (_reader_bits::readToken(line, map)) { if(map == "-") { if(index!=0) throw FormatError("'-' is not allowed as a map name"); else if (line >> std::ws >> c) throw FormatError("Extra character at the end of line"); else break; } if (maps.find(map) != maps.end()) { std::ostringstream msg; int index = 0; while (_reader_bits::readToken(line, map)) { if(map == "-") { if(index!=0) throw FormatError("'-' is not allowed as a map name"); else if (line >> std::ws >> c) throw FormatError("Extra character at the end of line"); else break; } if (maps.find(map) != maps.end()) { std::ostringstream msg;
• ## test/CMakeLists.txt

 r510 heap_test kruskal_test lgf_test maps_test random_test
• ## test/Makefile.am

 r228 test/heap_test \ test/kruskal_test \ test/lgf_test \ test/maps_test \ test/random_test \ test_heap_test_SOURCES = test/heap_test.cc test_kruskal_test_SOURCES = test/kruskal_test.cc test_lgf_test_SOURCES = test/lgf_test.cc test_maps_test_SOURCES = test/maps_test.cc test_path_test_SOURCES = test/path_test.cc
Note: See TracChangeset for help on using the changeset viewer.