COIN-OR::LEMON - Graph Library

Ignore:
Files:
1 added
5 deleted
25 edited

Legend:

Unmodified
Added
Removed
  • AUTHORS

    r1072 r320  
    2424
    2525Again, please visit the history of the old LEMON repository for more
    26 details: http://lemon.cs.elte.hu/hg/lemon-0.x
     26details: http://lemon.cs.elte.hu/svn/lemon/trunk
  • cmake/FindCOIN.cmake

    r1063 r681  
    66FIND_LIBRARY(COIN_CBC_LIBRARY
    77  NAMES Cbc libCbc
    8   HINTS ${COIN_ROOT_DIR}/lib/coin
    98  HINTS ${COIN_ROOT_DIR}/lib
    109)
    1110FIND_LIBRARY(COIN_CBC_SOLVER_LIBRARY
    1211  NAMES CbcSolver libCbcSolver
    13   HINTS ${COIN_ROOT_DIR}/lib/coin
    1412  HINTS ${COIN_ROOT_DIR}/lib
    1513)
    1614FIND_LIBRARY(COIN_CGL_LIBRARY
    1715  NAMES Cgl libCgl
    18   HINTS ${COIN_ROOT_DIR}/lib/coin
    1916  HINTS ${COIN_ROOT_DIR}/lib
    2017)
    2118FIND_LIBRARY(COIN_CLP_LIBRARY
    2219  NAMES Clp libClp
    23   HINTS ${COIN_ROOT_DIR}/lib/coin
    2420  HINTS ${COIN_ROOT_DIR}/lib
    2521)
    2622FIND_LIBRARY(COIN_COIN_UTILS_LIBRARY
    2723  NAMES CoinUtils libCoinUtils
    28   HINTS ${COIN_ROOT_DIR}/lib/coin
    2924  HINTS ${COIN_ROOT_DIR}/lib
    3025)
    3126FIND_LIBRARY(COIN_OSI_LIBRARY
    3227  NAMES Osi libOsi
    33   HINTS ${COIN_ROOT_DIR}/lib/coin
    3428  HINTS ${COIN_ROOT_DIR}/lib
    3529)
    3630FIND_LIBRARY(COIN_OSI_CBC_LIBRARY
    3731  NAMES OsiCbc libOsiCbc
    38   HINTS ${COIN_ROOT_DIR}/lib/coin
    3932  HINTS ${COIN_ROOT_DIR}/lib
    4033)
    4134FIND_LIBRARY(COIN_OSI_CLP_LIBRARY
    4235  NAMES OsiClp libOsiClp
    43   HINTS ${COIN_ROOT_DIR}/lib/coin
    4436  HINTS ${COIN_ROOT_DIR}/lib
    4537)
    4638FIND_LIBRARY(COIN_OSI_VOL_LIBRARY
    4739  NAMES OsiVol libOsiVol
    48   HINTS ${COIN_ROOT_DIR}/lib/coin
    4940  HINTS ${COIN_ROOT_DIR}/lib
    5041)
    5142FIND_LIBRARY(COIN_VOL_LIBRARY
    5243  NAMES Vol libVol
    53   HINTS ${COIN_ROOT_DIR}/lib/coin
    5444  HINTS ${COIN_ROOT_DIR}/lib
    5545)
     
    6656  COIN_OSI_CBC_LIBRARY
    6757  COIN_OSI_CLP_LIBRARY
    68   # COIN_OSI_VOL_LIBRARY
    69   # COIN_VOL_LIBRARY
     58  COIN_OSI_VOL_LIBRARY
     59  COIN_VOL_LIBRARY
    7060)
    7161
    7262IF(COIN_FOUND)
    7363  SET(COIN_INCLUDE_DIRS ${COIN_INCLUDE_DIR})
    74   SET(COIN_LIBRARIES "${COIN_CBC_LIBRARY};${COIN_CBC_SOLVER_LIBRARY};${COIN_CGL_LIBRARY};${COIN_CLP_LIBRARY};${COIN_COIN_UTILS_LIBRARY};${COIN_OSI_LIBRARY};${COIN_OSI_CBC_LIBRARY};${COIN_OSI_CLP_LIBRARY}")
     64  SET(COIN_LIBRARIES "${COIN_CBC_LIBRARY};${COIN_CBC_SOLVER_LIBRARY};${COIN_CGL_LIBRARY};${COIN_CLP_LIBRARY};${COIN_COIN_UTILS_LIBRARY};${COIN_OSI_LIBRARY};${COIN_OSI_CBC_LIBRARY};${COIN_OSI_CLP_LIBRARY};${COIN_OSI_VOL_LIBRARY};${COIN_VOL_LIBRARY}")
    7565  SET(COIN_CLP_LIBRARIES "${COIN_CLP_LIBRARY};${COIN_COIN_UTILS_LIBRARY}")
    7666  SET(COIN_CBC_LIBRARIES ${COIN_LIBRARIES})
  • configure.ac

    r1037 r727  
    9999dnl Add dependencies on files generated by configure.
    100100AC_SUBST([CONFIG_STATUS_DEPENDENCIES],
    101   ['$(top_srcdir)/doc/Doxyfile.in $(top_srcdir)/doc/mainpage.dox.in $(top_srcdir)/lemon/lemon.pc.in $(top_srcdir)/cmake/version.cmake.in'])
     101  ['$(top_srcdir)/doc/Doxyfile.in $(top_srcdir)/lemon/lemon.pc.in $(top_srcdir)/cmake/version.cmake.in'])
    102102
    103103AC_CONFIG_FILES([
     
    106106cmake/version.cmake
    107107doc/Doxyfile
    108 doc/mainpage.dox
    109108lemon/lemon.pc
    110109])
  • doc/CMakeLists.txt

    r1037 r1033  
    99  ${PROJECT_SOURCE_DIR}/doc/Doxyfile.in
    1010  ${PROJECT_BINARY_DIR}/doc/Doxyfile
    11   @ONLY
    12 )
    13 
    14 CONFIGURE_FILE(
    15   ${PROJECT_SOURCE_DIR}/doc/mainpage.dox.in
    16   ${PROJECT_BINARY_DIR}/doc/mainpage.dox
    1711  @ONLY
    1812)
  • doc/Doxyfile.in

    r1037 r1033  
    1 # Doxyfile 1.7.3
     1# Doxyfile 1.5.9
    22
    33#---------------------------------------------------------------------------
     
    55#---------------------------------------------------------------------------
    66DOXYFILE_ENCODING      = UTF-8
    7 PROJECT_NAME           =
    8 PROJECT_NUMBER         =
    9 PROJECT_BRIEF          =
    10 PROJECT_LOGO           =
     7PROJECT_NAME           = @PACKAGE_NAME@
     8PROJECT_NUMBER         = @PACKAGE_VERSION@
    119OUTPUT_DIRECTORY       =
    1210CREATE_SUBDIRS         = NO
     
    3230OPTIMIZE_FOR_FORTRAN   = NO
    3331OPTIMIZE_OUTPUT_VHDL   = NO
    34 EXTENSION_MAPPING      =
    3532BUILTIN_STL_SUPPORT    = YES
    3633CPP_CLI_SUPPORT        = NO
     
    5855HIDE_SCOPE_NAMES       = YES
    5956SHOW_INCLUDE_FILES     = YES
    60 FORCE_LOCAL_INCLUDES   = NO
    6157INLINE_INFO            = YES
    6258SORT_MEMBER_DOCS       = NO
    6359SORT_BRIEF_DOCS        = NO
    64 SORT_MEMBERS_CTORS_1ST = NO
    6560SORT_GROUP_NAMES       = NO
    6661SORT_BY_SCOPE_NAME     = NO
    67 STRICT_PROTO_MATCHING  = NO
    6862GENERATE_TODOLIST      = YES
    6963GENERATE_TESTLIST      = YES
     
    9791                         "@abs_top_srcdir@/demo" \
    9892                         "@abs_top_srcdir@/tools" \
    99                          "@abs_top_srcdir@/test/test_tools.h" \
    100                          "@abs_top_builddir@/doc/mainpage.dox"
     93                         "@abs_top_srcdir@/test/test_tools.h"
    10194INPUT_ENCODING         = UTF-8
    10295FILE_PATTERNS          = *.h \
     
    118111FILTER_PATTERNS        =
    119112FILTER_SOURCE_FILES    = NO
    120 FILTER_SOURCE_PATTERNS =
    121113#---------------------------------------------------------------------------
    122114# configuration options related to source browsing
     
    145137HTML_FOOTER            =
    146138HTML_STYLESHEET        =
    147 HTML_COLORSTYLE_HUE    = 220
    148 HTML_COLORSTYLE_SAT    = 100
    149 HTML_COLORSTYLE_GAMMA  = 80
    150 HTML_TIMESTAMP         = YES
    151139HTML_ALIGN_MEMBERS     = YES
    152 HTML_DYNAMIC_SECTIONS  = YES
     140HTML_DYNAMIC_SECTIONS  = NO
    153141GENERATE_DOCSET        = NO
    154142DOCSET_FEEDNAME        = "Doxygen generated docs"
    155143DOCSET_BUNDLE_ID       = org.doxygen.Project
    156 DOCSET_PUBLISHER_ID    = org.doxygen.Publisher
    157 DOCSET_PUBLISHER_NAME  = Publisher
    158144GENERATE_HTMLHELP      = NO
    159145CHM_FILE               =
     
    167153QHP_NAMESPACE          = org.doxygen.Project
    168154QHP_VIRTUAL_FOLDER     = doc
    169 QHP_CUST_FILTER_NAME   =
    170 QHP_CUST_FILTER_ATTRS  =
    171 QHP_SECT_FILTER_ATTRS  =
    172155QHG_LOCATION           =
    173 GENERATE_ECLIPSEHELP   = NO
    174 ECLIPSE_DOC_ID         = org.doxygen.Project
    175156DISABLE_INDEX          = NO
    176157ENUM_VALUES_PER_LINE   = 4
    177158GENERATE_TREEVIEW      = NO
    178 USE_INLINE_TREES       = NO
    179159TREEVIEW_WIDTH         = 250
    180 EXT_LINKS_IN_WINDOW    = NO
    181160FORMULA_FONTSIZE       = 10
    182 FORMULA_TRANSPARENT    = YES
    183 USE_MATHJAX            = NO
    184 MATHJAX_RELPATH        = http://www.mathjax.org/mathjax
    185 SEARCHENGINE           = YES
    186 SERVER_BASED_SEARCH    = NO
    187161#---------------------------------------------------------------------------
    188162# configuration options related to the LaTeX output
     
    201175LATEX_BATCHMODE        = NO
    202176LATEX_HIDE_INDICES     = NO
    203 LATEX_SOURCE_CODE      = NO
    204177#---------------------------------------------------------------------------
    205178# configuration options related to the RTF output
     
    250223SKIP_FUNCTION_MACROS   = YES
    251224#---------------------------------------------------------------------------
    252 # Configuration::additions related to external references
     225# Options related to the search engine   
    253226#---------------------------------------------------------------------------
    254227TAGFILES               = "@abs_top_builddir@/doc/libstdc++.tag = http://gcc.gnu.org/onlinedocs/libstdc++/latest-doxygen/  "
     
    264237HIDE_UNDOC_RELATIONS   = YES
    265238HAVE_DOT               = YES
    266 DOT_NUM_THREADS        = 0
    267239DOT_FONTNAME           = FreeSans
    268240DOT_FONTSIZE           = 10
     
    282254DOT_PATH               =
    283255DOTFILE_DIRS           =
    284 MSCFILE_DIRS           =
    285256DOT_GRAPH_MAX_NODES    = 50
    286257MAX_DOT_GRAPH_DEPTH    = 0
     
    289260GENERATE_LEGEND        = YES
    290261DOT_CLEANUP            = YES
     262#---------------------------------------------------------------------------
     263# Configuration::additions related to the search engine   
     264#---------------------------------------------------------------------------
     265SEARCHENGINE           = NO
  • doc/DoxygenLayout.xml

    r1036 r316  
    33  <navindex>
    44    <tab type="mainpage" visible="yes" title=""/>
    5     <tab type="modules" visible="yes" title="" intro=""/>
     5    <tab type="modules" visible="yes" title=""/>
    66    <tab type="classes" visible="yes" title="">
    7       <tab type="classes" visible="yes" title="" intro=""/>
    8       <tab type="classindex" visible="$ALPHABETICAL_INDEX" title=""/>
    9       <tab type="hierarchy" visible="yes" title="" intro=""/>
    10       <tab type="classmembers" visible="yes" title="" intro=""/>
     7      <tab type="classes" visible="yes" title=""/>
     8      <tab type="classindex" visible="$ALPHABETICAL_INDEX" title=""/> 
     9      <tab type="hierarchy" visible="yes" title=""/>
     10      <tab type="classmembers" visible="yes" title=""/>
    1111    </tab>
    1212    <tab type="namespaces" visible="yes" title="">
    13       <tab type="namespaces" visible="yes" title="" intro=""/>
    14       <tab type="namespacemembers" visible="yes" title="" intro=""/>
     13      <tab type="namespaces" visible="yes" title=""/>
     14      <tab type="namespacemembers" visible="yes" title=""/>
    1515    </tab>
    1616    <tab type="files" visible="yes" title="">
    17       <tab type="files" visible="yes" title="" intro=""/>
    18       <tab type="globals" visible="yes" title="" intro=""/>
     17      <tab type="files" visible="yes" title=""/>
     18      <tab type="globals" visible="yes" title=""/>
    1919    </tab>
    20     <tab type="dirs" visible="yes" title="" intro=""/>
    21     <tab type="examples" visible="yes" title="" intro=""/>
    22     <tab type="pages" visible="yes" title="" intro=""/>
     20    <tab type="dirs" visible="yes" title=""/>
     21    <tab type="examples" visible="yes" title=""/> 
     22    <tab type="pages" visible="yes" title=""/>
    2323  </navindex>
    2424
  • doc/lgf.dox

    r1069 r463  
    6464\endcode
    6565
    66 The \c \@arcs section is very similar to the \c \@nodes section, it
    67 again starts with a header line describing the names of the maps, but
    68 the \c "label" map is not obligatory here. The following lines
    69 describe the arcs. The first two tokens of each line are the source
    70 and the target node of the arc, respectively, then come the map
     66The \c \@arcs section is very similar to the \c \@nodes section,
     67it again starts with a header line describing the names of the maps,
     68but the \c "label" map is not obligatory here. The following lines
     69describe the arcs. The first two tokens of each line are
     70the source and the target node of the arc, respectively, then come the map
    7171values. The source and target tokens must be node labels.
    7272
     
    7979\endcode
    8080
    81 If there is no map in the \c \@arcs section at all, then it must be
    82 indicated by a sole '-' sign in the first line.
    83 
    84 \code
    85  @arcs
    86          -
    87  1   2
    88  1   3
    89  2   3
    90 \endcode
    91 
    9281The \c \@edges is just a synonym of \c \@arcs. The \@arcs section can
    9382also store the edge set of an undirected graph. In such case there is
    9483a conventional method for store arc maps in the file, if two columns
    95 have the same caption with \c '+' and \c '-' prefix, then these columns
     84has the same caption with \c '+' and \c '-' prefix, then these columns
    9685can be regarded as the values of an arc map.
    9786
  • lemon/Makefile.am

    r1102 r714  
    11EXTRA_DIST += \
    22        lemon/lemon.pc.in \
    3         lemon/lemon.pc.cmake \
    43        lemon/CMakeLists.txt \
    54        lemon/config.h.cmake
     
    6160        lemon/bfs.h \
    6261        lemon/bin_heap.h \
    63         lemon/bucket_heap.h \
    6462        lemon/cbc.h \
    6563        lemon/circulation.h \
     
    7977        lemon/error.h \
    8078        lemon/euler.h \
    81         lemon/fib_heap.h \
    8279        lemon/full_graph.h \
    8380        lemon/glpk.h \
     
    103100        lemon/path.h \
    104101        lemon/preflow.h \
    105         lemon/radix_heap.h \
    106102        lemon/radix_sort.h \
    107103        lemon/random.h \
  • lemon/bin_heap.h

    r730 r631  
    3434  ///\brief A Binary Heap implementation.
    3535  ///
    36   ///This class implements the \e binary \e heap data structure.
    37   ///
     36  ///This class implements the \e binary \e heap data structure. 
     37  /// 
    3838  ///A \e heap is a data structure for storing items with specified values
    3939  ///called \e priorities in such a way that finding the item with minimum
    40   ///priority is efficient. \c CMP specifies the ordering of the priorities.
     40  ///priority is efficient. \c Comp specifies the ordering of the priorities.
    4141  ///In a heap one can change the priority of an item, add or erase an
    4242  ///item, etc.
     
    4545  ///\tparam IM A read and writable item map with int values, used internally
    4646  ///to handle the cross references.
    47   ///\tparam CMP A functor class for the ordering of the priorities.
     47  ///\tparam Comp A functor class for the ordering of the priorities.
    4848  ///The default is \c std::less<PR>.
    4949  ///
    5050  ///\sa FibHeap
    5151  ///\sa Dijkstra
    52   template <typename PR, typename IM, typename CMP = std::less<PR> >
     52  template <typename PR, typename IM, typename Comp = std::less<PR> >
    5353  class BinHeap {
    5454
     
    6363    typedef std::pair<Item,Prio> Pair;
    6464    ///\e
    65     typedef CMP Compare;
     65    typedef Comp Compare;
    6666
    6767    /// \brief Type to represent the items states.
  • lemon/bits/map_extender.h

    r867 r664  
    5050    typedef typename Parent::ConstReference ConstReference;
    5151
    52     typedef typename Parent::ReferenceMapTag ReferenceMapTag;
    53 
    5452    class MapIt;
    5553    class ConstMapIt;
     
    8583      typedef typename Map::Value Value;
    8684
    87       MapIt() : map(NULL) {}
    88 
    89       MapIt(Invalid i) : Parent(i), map(NULL) {}
    90 
    91       explicit MapIt(Map& _map) : map(&_map) {
    92         map->notifier()->first(*this);
     85      MapIt() {}
     86
     87      MapIt(Invalid i) : Parent(i) { }
     88
     89      explicit MapIt(Map& _map) : map(_map) {
     90        map.notifier()->first(*this);
    9391      }
    9492
    9593      MapIt(const Map& _map, const Item& item)
    96         : Parent(item), map(&_map) {}
     94        : Parent(item), map(_map) {}
    9795
    9896      MapIt& operator++() {
    99         map->notifier()->next(*this);
     97        map.notifier()->next(*this);
    10098        return *this;
    10199      }
    102100
    103101      typename MapTraits<Map>::ConstReturnValue operator*() const {
    104         return (*map)[*this];
     102        return map[*this];
    105103      }
    106104
    107105      typename MapTraits<Map>::ReturnValue operator*() {
    108         return (*map)[*this];
     106        return map[*this];
    109107      }
    110108
    111109      void set(const Value& value) {
    112         map->set(*this, value);
    113       }
    114 
    115     protected:
    116       Map* map;
     110        map.set(*this, value);
     111      }
     112
     113    protected:
     114      Map& map;
    117115
    118116    };
     
    125123      typedef typename Map::Value Value;
    126124
    127       ConstMapIt() : map(NULL) {}
    128 
    129       ConstMapIt(Invalid i) : Parent(i), map(NULL) {}
    130 
    131       explicit ConstMapIt(Map& _map) : map(&_map) {
    132         map->notifier()->first(*this);
     125      ConstMapIt() {}
     126
     127      ConstMapIt(Invalid i) : Parent(i) { }
     128
     129      explicit ConstMapIt(Map& _map) : map(_map) {
     130        map.notifier()->first(*this);
    133131      }
    134132
     
    137135
    138136      ConstMapIt& operator++() {
    139         map->notifier()->next(*this);
     137        map.notifier()->next(*this);
    140138        return *this;
    141139      }
     
    146144
    147145    protected:
    148       const Map* map;
     146      const Map& map;
    149147    };
    150148
     
    153151
    154152    public:
    155       ItemIt() : map(NULL) {}
    156 
    157 
    158       ItemIt(Invalid i) : Parent(i), map(NULL) {}
    159 
    160       explicit ItemIt(Map& _map) : map(&_map) {
    161         map->notifier()->first(*this);
     153
     154      ItemIt() {}
     155
     156      ItemIt(Invalid i) : Parent(i) { }
     157
     158      explicit ItemIt(Map& _map) : map(_map) {
     159        map.notifier()->first(*this);
    162160      }
    163161
    164162      ItemIt(const Map& _map, const Item& item)
    165         : Parent(item), map(&_map) {}
     163        : Parent(item), map(_map) {}
    166164
    167165      ItemIt& operator++() {
    168         map->notifier()->next(*this);
    169         return *this;
    170       }
    171 
    172     protected:
    173       const Map* map;
     166        map.notifier()->next(*this);
     167        return *this;
     168      }
     169
     170    protected:
     171      const Map& map;
    174172
    175173    };
     
    194192    typedef typename Parent::ConstReference ConstReference;
    195193
    196     typedef typename Parent::ReferenceMapTag ReferenceMapTag;
    197 
    198194    class MapIt;
    199195    class ConstMapIt;
     
    232228      typedef typename Map::Value Value;
    233229
    234       MapIt() : map(NULL) {}
    235 
    236       MapIt(Invalid i) : Parent(i), map(NULL) { }
    237 
    238       explicit MapIt(Map& _map) : map(&_map) {
    239         map->graph.first(*this);
     230      MapIt() {}
     231
     232      MapIt(Invalid i) : Parent(i) { }
     233
     234      explicit MapIt(Map& _map) : map(_map) {
     235        map.graph.first(*this);
    240236      }
    241237
    242238      MapIt(const Map& _map, const Item& item)
    243         : Parent(item), map(&_map) {}
     239        : Parent(item), map(_map) {}
    244240
    245241      MapIt& operator++() {
    246         map->graph.next(*this);
     242        map.graph.next(*this);
    247243        return *this;
    248244      }
    249245
    250246      typename MapTraits<Map>::ConstReturnValue operator*() const {
    251         return (*map)[*this];
     247        return map[*this];
    252248      }
    253249
    254250      typename MapTraits<Map>::ReturnValue operator*() {
    255         return (*map)[*this];
     251        return map[*this];
    256252      }
    257253
    258254      void set(const Value& value) {
    259         map->set(*this, value);
    260       }
    261 
    262     protected:
    263       Map* map;
     255        map.set(*this, value);
     256      }
     257
     258    protected:
     259      Map& map;
    264260
    265261    };
     
    272268      typedef typename Map::Value Value;
    273269
    274       ConstMapIt() : map(NULL) {}
    275 
    276       ConstMapIt(Invalid i) : Parent(i), map(NULL) { }
    277 
    278       explicit ConstMapIt(Map& _map) : map(&_map) {
    279         map->graph.first(*this);
     270      ConstMapIt() {}
     271
     272      ConstMapIt(Invalid i) : Parent(i) { }
     273
     274      explicit ConstMapIt(Map& _map) : map(_map) {
     275        map.graph.first(*this);
    280276      }
    281277
    282278      ConstMapIt(const Map& _map, const Item& item)
    283         : Parent(item), map(&_map) {}
     279        : Parent(item), map(_map) {}
    284280
    285281      ConstMapIt& operator++() {
    286         map->graph.next(*this);
     282        map.graph.next(*this);
    287283        return *this;
    288284      }
    289285
    290286      typename MapTraits<Map>::ConstReturnValue operator*() const {
    291         return (*map)[*this];
    292       }
    293 
    294     protected:
    295       const Map* map;
     287        return map[*this];
     288      }
     289
     290    protected:
     291      const Map& map;
    296292    };
    297293
     
    300296
    301297    public:
    302       ItemIt() : map(NULL) {}
    303 
    304 
    305       ItemIt(Invalid i) : Parent(i), map(NULL) { }
    306 
    307       explicit ItemIt(Map& _map) : map(&_map) {
    308         map->graph.first(*this);
     298
     299      ItemIt() {}
     300
     301      ItemIt(Invalid i) : Parent(i) { }
     302
     303      explicit ItemIt(Map& _map) : map(_map) {
     304        map.graph.first(*this);
    309305      }
    310306
    311307      ItemIt(const Map& _map, const Item& item)
    312         : Parent(item), map(&_map) {}
     308        : Parent(item), map(_map) {}
    313309
    314310      ItemIt& operator++() {
    315         map->graph.next(*this);
    316         return *this;
    317       }
    318 
    319     protected:
    320       const Map* map;
     311        map.graph.next(*this);
     312        return *this;
     313      }
     314
     315    protected:
     316      const Map& map;
    321317
    322318    };
  • lemon/bits/path_dump.h

    r973 r576  
    5050
    5151    bool empty() const {
    52       return predMap[target] == INVALID;
     52      return predMap[target] != INVALID;
    5353    }
    5454
     
    124124
    125125    bool empty() const {
    126       return predMatrixMap(source, target) == INVALID;
     126      return source != target;
    127127    }
    128128
  • lemon/concepts/maps.h

    r765 r576  
    183183      template<typename _ReferenceMap>
    184184      struct Constraints {
    185         typename enable_if<typename _ReferenceMap::ReferenceMapTag, void>::type
    186         constraints() {
     185        void constraints() {
    187186          checkConcept<ReadWriteMap<K, T>, _ReferenceMap >();
    188187          ref = m[key];
  • lemon/core.h

    r984 r718  
    395395      static void copy(const From& from, Digraph &to,
    396396                       NodeRefMap& nodeRefMap, ArcRefMap& arcRefMap) {
    397         to.clear();
    398397        for (typename From::NodeIt it(from); it != INVALID; ++it) {
    399398          nodeRefMap[it] = to.addNode();
     
    423422      static void copy(const From& from, Graph &to,
    424423                       NodeRefMap& nodeRefMap, EdgeRefMap& edgeRefMap) {
    425         to.clear();
    426424        for (typename From::NodeIt it(from); it != INVALID; ++it) {
    427425          nodeRefMap[it] = to.addNode();
  • lemon/dfs.h

    r1009 r631  
    558558    void start(Node t)
    559559    {
    560       while ( !emptyQueue() && !(*_reached)[t] )
     560      while ( !emptyQueue() && G->target(_stack[_stack_head])!=t )
    561561        processNextArc();
    562562    }
     
    15101510    /// with addSource() before using this function.
    15111511    void start(Node t) {
    1512       while ( !emptyQueue() && !(*_reached)[t] )
     1512      while ( !emptyQueue() && _digraph->target(_stack[_stack_head]) != t )
    15131513        processNextArc();
    15141514    }
  • lemon/glpk.h

    r900 r697  
    2626#include <lemon/lp_base.h>
    2727
     28// forward declaration
     29#if !defined _GLP_PROB && !defined GLP_PROB
     30#define _GLP_PROB
     31#define GLP_PROB
     32typedef struct { double _opaque_prob; } glp_prob;
     33/* LP/MIP problem object */
     34#endif
     35
    2836namespace lemon {
    2937
    30   namespace _solver_bits {
    31     class VoidPtr {
    32     private:
    33       void *_ptr;     
    34     public:
    35       VoidPtr() : _ptr(0) {}
    36 
    37       template <typename T>
    38       VoidPtr(T* ptr) : _ptr(reinterpret_cast<void*>(ptr)) {}
    39 
    40       template <typename T>
    41       VoidPtr& operator=(T* ptr) {
    42         _ptr = reinterpret_cast<void*>(ptr);
    43         return *this;
    44       }
    45 
    46       template <typename T>
    47       operator T*() const { return reinterpret_cast<T*>(_ptr); }
    48     };
    49   }
    5038
    5139  /// \brief Base interface for the GLPK LP and MIP solver
     
    5644  protected:
    5745
    58     _solver_bits::VoidPtr lp;
     46    typedef glp_prob LPX;
     47    glp_prob* lp;
    5948
    6049    GlpkBase();
     
    134123
    135124    ///Pointer to the underlying GLPK data structure.
    136     _solver_bits::VoidPtr lpx() {return lp;}
     125    LPX *lpx() {return lp;}
    137126    ///Const pointer to the underlying GLPK data structure.
    138     _solver_bits::VoidPtr lpx() const {return lp;}
     127    const LPX *lpx() const {return lp;}
    139128
    140129    ///Returns the constraint identifier understood by GLPK.
  • lemon/graph_to_eps.h

    r908 r664  
    685685#else
    686686      os << bits::getWinFormattedDate();
    687       os << std::endl;
    688687#endif
    689688    }
     689    os << std::endl;
    690690
    691691    if (_autoArcWidthScale) {
  • lemon/lgf_reader.h

    r1069 r646  
    33 * This file is a part of LEMON, a generic C++ optimization library.
    44 *
    5  * Copyright (C) 2003-2011
     5 * Copyright (C) 2003-2009
    66 * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
    77 * (Egervary Research Group on Combinatorial Optimization, EGRES).
     
    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             }
    974967          if (maps.find(map) != maps.end()) {
    975968            std::ostringstream msg;
     
    18421835        int index = 0;
    18431836        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             }
    18511837          if (maps.find(map) != maps.end()) {
    18521838            std::ostringstream msg;
  • lemon/lp_base.h

    r1092 r631  
    16051605  inline LpBase::Constr operator<=(const LpBase::Expr &e,
    16061606                                   const LpBase::Expr &f) {
    1607     return LpBase::Constr(0, f - e, LpBase::NaN);
     1607    return LpBase::Constr(0, f - e, LpBase::INF);
    16081608  }
    16091609
     
    16231623  inline LpBase::Constr operator<=(const LpBase::Expr &e,
    16241624                                   const LpBase::Value &f) {
    1625     return LpBase::Constr(LpBase::NaN, e, f);
     1625    return LpBase::Constr(- LpBase::INF, e, f);
    16261626  }
    16271627
     
    16321632  inline LpBase::Constr operator>=(const LpBase::Expr &e,
    16331633                                   const LpBase::Expr &f) {
    1634     return LpBase::Constr(0, e - f, LpBase::NaN);
     1634    return LpBase::Constr(0, e - f, LpBase::INF);
    16351635  }
    16361636
     
    16521652  inline LpBase::Constr operator>=(const LpBase::Expr &e,
    16531653                                   const LpBase::Value &f) {
    1654     return LpBase::Constr(f, e, LpBase::NaN);
     1654    return LpBase::Constr(f, e, LpBase::INF);
    16551655  }
    16561656
  • lemon/path.h

    r867 r606  
    7171    template <typename CPath>
    7272    Path(const CPath& cpath) {
    73       pathCopy(cpath, *this);
     73      copyPath(*this, cpath);
    7474    }
    7575
     
    7979    template <typename CPath>
    8080    Path& operator=(const CPath& cpath) {
    81       pathCopy(cpath, *this);
     81      copyPath(*this, cpath);
    8282      return *this;
    8383    }
     
    259259    template <typename CPath>
    260260    SimplePath(const CPath& cpath) {
    261       pathCopy(cpath, *this);
     261      copyPath(*this, cpath);
    262262    }
    263263
     
    268268    template <typename CPath>
    269269    SimplePath& operator=(const CPath& cpath) {
    270       pathCopy(cpath, *this);
     270      copyPath(*this, cpath);
    271271      return *this;
    272272    }
     
    438438    template <typename CPath>
    439439    ListPath(const CPath& cpath) : first(0), last(0) {
    440       pathCopy(cpath, *this);
     440      copyPath(*this, cpath);
    441441    }
    442442
     
    454454    template <typename CPath>
    455455    ListPath& operator=(const CPath& cpath) {
    456       pathCopy(cpath, *this);
     456      copyPath(*this, cpath);
    457457      return *this;
    458458    }
     
    764764    template <typename CPath>
    765765    StaticPath(const CPath& cpath) : arcs(0) {
    766       pathCopy(cpath, *this);
     766      copyPath(*this, cpath);
    767767    }
    768768
     
    780780    template <typename CPath>
    781781    StaticPath& operator=(const CPath& cpath) {
    782       pathCopy(cpath, *this);
     782      copyPath(*this, cpath);
    783783      return *this;
    784784    }
     
    929929    };
    930930
    931     template <typename From, typename To,
    932               bool buildEnable = BuildTagIndicator<To>::value>
     931    template <typename Target, typename Source,
     932              bool buildEnable = BuildTagIndicator<Target>::value>
    933933    struct PathCopySelectorForward {
    934       static void copy(const From& from, To& to) {
    935         to.clear();
    936         for (typename From::ArcIt it(from); it != INVALID; ++it) {
    937           to.addBack(it);
     934      static void copy(Target& target, const Source& source) {
     935        target.clear();
     936        for (typename Source::ArcIt it(source); it != INVALID; ++it) {
     937          target.addBack(it);
    938938        }
    939939      }
    940940    };
    941941
    942     template <typename From, typename To>
    943     struct PathCopySelectorForward<From, To, true> {
    944       static void copy(const From& from, To& to) {
    945         to.clear();
    946         to.build(from);
    947       }
    948     };
    949 
    950     template <typename From, typename To,
    951               bool buildEnable = BuildTagIndicator<To>::value>
     942    template <typename Target, typename Source>
     943    struct PathCopySelectorForward<Target, Source, true> {
     944      static void copy(Target& target, const Source& source) {
     945        target.clear();
     946        target.build(source);
     947      }
     948    };
     949
     950    template <typename Target, typename Source,
     951              bool buildEnable = BuildTagIndicator<Target>::value>
    952952    struct PathCopySelectorBackward {
    953       static void copy(const From& from, To& to) {
    954         to.clear();
    955         for (typename From::RevArcIt it(from); it != INVALID; ++it) {
    956           to.addFront(it);
     953      static void copy(Target& target, const Source& source) {
     954        target.clear();
     955        for (typename Source::RevArcIt it(source); it != INVALID; ++it) {
     956          target.addFront(it);
    957957        }
    958958      }
    959959    };
    960960
    961     template <typename From, typename To>
    962     struct PathCopySelectorBackward<From, To, true> {
    963       static void copy(const From& from, To& to) {
    964         to.clear();
    965         to.buildRev(from);
     961    template <typename Target, typename Source>
     962    struct PathCopySelectorBackward<Target, Source, true> {
     963      static void copy(Target& target, const Source& source) {
     964        target.clear();
     965        target.buildRev(source);
    966966      }
    967967    };
    968968
    969969   
    970     template <typename From, typename To,
    971               bool revEnable = RevPathTagIndicator<From>::value>
     970    template <typename Target, typename Source,
     971              bool revEnable = RevPathTagIndicator<Source>::value>
    972972    struct PathCopySelector {
    973       static void copy(const From& from, To& to) {
    974         PathCopySelectorForward<From, To>::copy(from, to);
     973      static void copy(Target& target, const Source& source) {
     974        PathCopySelectorForward<Target, Source>::copy(target, source);
    975975      }     
    976976    };
    977977
    978     template <typename From, typename To>
    979     struct PathCopySelector<From, To, true> {
    980       static void copy(const From& from, To& to) {
    981         PathCopySelectorBackward<From, To>::copy(from, to);
     978    template <typename Target, typename Source>
     979    struct PathCopySelector<Target, Source, true> {
     980      static void copy(Target& target, const Source& source) {
     981        PathCopySelectorBackward<Target, Source>::copy(target, source);
    982982      }     
    983983    };
     
    988988  /// \brief Make a copy of a path.
    989989  ///
    990   /// This function makes a copy of a path.
    991   template <typename From, typename To>
    992   void pathCopy(const From& from, To& to) {
    993     checkConcept<concepts::PathDumper<typename From::Digraph>, From>();
    994     _path_bits::PathCopySelector<From, To>::copy(from, to);
    995   }
    996 
    997   /// \brief Deprecated version of \ref pathCopy().
    998   ///
    999   /// Deprecated version of \ref pathCopy() (only for reverse compatibility).
    1000   template <typename To, typename From>
    1001   void copyPath(To& to, const From& from) {
    1002     pathCopy(from, to);
     990  ///  This function makes a copy of a path.
     991  template <typename Target, typename Source>
     992  void copyPath(Target& target, const Source& source) {
     993    checkConcept<concepts::PathDumper<typename Source::Digraph>, Source>();
     994    _path_bits::PathCopySelector<Target, Source>::copy(target, source);
    1003995  }
    1004996
     
    10241016  /// \brief The source of a path
    10251017  ///
    1026   /// This function returns the source node of the given path.
    1027   /// If the path is empty, then it returns \c INVALID.
     1018  /// This function returns the source of the given path.
    10281019  template <typename Digraph, typename Path>
    10291020  typename Digraph::Node pathSource(const Digraph& digraph, const Path& path) {
    1030     return path.empty() ? INVALID : digraph.source(path.front());
     1021    return digraph.source(path.front());
    10311022  }
    10321023
    10331024  /// \brief The target of a path
    10341025  ///
    1035   /// This function returns the target node of the given path.
    1036   /// If the path is empty, then it returns \c INVALID.
     1026  /// This function returns the target of the given path.
    10371027  template <typename Digraph, typename Path>
    10381028  typename Digraph::Node pathTarget(const Digraph& digraph, const Path& path) {
    1039     return path.empty() ? INVALID : digraph.target(path.back());
     1029    return digraph.target(path.back());
    10401030  }
    10411031
  • test/CMakeLists.txt

    r1069 r1033  
    77  ${PROJECT_BINARY_DIR}/lemon
    88)
    9 
    10 SET(TEST_WITH_VALGRIND "NO" CACHE STRING
    11   "Run the test with valgrind (YES/NO).")
    12 SET(VALGRIND_FLAGS "" CACHE STRING "Valgrind flags used by the tests.")
    139
    1410SET(TESTS
     
    3228  heap_test
    3329  kruskal_test
    34   lgf_test
    3530  maps_test
    3631  matching_test
     
    6762  TARGET_LINK_LIBRARIES(lp_test ${LP_TEST_LIBS})
    6863  ADD_TEST(lp_test lp_test)
    69   ADD_DEPENDENCIES(check lp_test)
    7064
    7165  IF(WIN32 AND LEMON_HAVE_GLPK)
     
    109103  TARGET_LINK_LIBRARIES(mip_test ${MIP_TEST_LIBS})
    110104  ADD_TEST(mip_test mip_test)
    111   ADD_DEPENDENCIES(check mip_test)
    112105
    113106  IF(WIN32 AND LEMON_HAVE_GLPK)
     
    137130  ENDIF()
    138131  TARGET_LINK_LIBRARIES(${TEST_NAME} lemon)
    139     IF(TEST_WITH_VALGRIND)
    140       ADD_TEST(${TEST_NAME}
    141         valgrind --error-exitcode=1 ${VALGRIND_FLAGS}
    142         ${CMAKE_CURRENT_BINARY_DIR}/${TEST_NAME} )
    143     ELSE()
    144       ADD_TEST(${TEST_NAME} ${TEST_NAME})
    145     ENDIF()
     132  ADD_TEST(${TEST_NAME} ${TEST_NAME})
    146133  ADD_DEPENDENCIES(check ${TEST_NAME})
    147134ENDFOREACH()
  • test/Makefile.am

    r1102 r696  
    2626        test/heap_test \
    2727        test/kruskal_test \
    28         test/lgf_test \
    2928        test/maps_test \
    3029        test/matching_test \
     
    7271test_kruskal_test_SOURCES = test/kruskal_test.cc
    7372test_hao_orlin_test_SOURCES = test/hao_orlin_test.cc
    74 test_lgf_test_SOURCES = test/lgf_test.cc
    7573test_lp_test_SOURCES = test/lp_test.cc
    7674test_maps_test_SOURCES = test/maps_test.cc
  • test/dfs_test.cc

    r1009 r632  
    5151  "@attributes\n"
    5252  "source 0\n"
    53   "target 5\n"
    54   "source1 6\n"
    55   "target1 3\n";
    56 
     53  "target 5\n";
    5754
    5855void checkDfsCompile()
     
    183180  Digraph G;
    184181  Node s, t;
    185   Node s1, t1;
    186182
    187183  std::istringstream input(test_lgf);
     
    189185    node("source", s).
    190186    node("target", t).
    191     node("source1", s1).
    192     node("target1", t1).
    193187    run();
    194188
     
    217211
    218212  {
    219   Dfs<Digraph> dfs(G);
    220   check(dfs.run(s1,t1) && dfs.reached(t1),"Node 3 is reachable from Node 6.");
    221   }
    222  
    223   {
    224213    NullMap<Node,Arc> myPredMap;
    225214    dfs(G).predMap(myPredMap).run(s);
  • test/graph_copy_test.cc

    r984 r463  
    3030  const int nn = 10;
    3131
    32   // Build a digraph
    3332  SmartDigraph from;
    3433  SmartDigraph::NodeMap<int> fnm(from);
     
    5352  }
    5453
    55   // Test digraph copy
    5654  ListDigraph to;
    5755  ListDigraph::NodeMap<int> tnm(to);
     
    7169    nodeCrossRef(ncr).arcCrossRef(ecr).
    7270    node(fn, tn).arc(fa, ta).run();
    73  
    74   check(countNodes(from) == countNodes(to), "Wrong copy.");
    75   check(countArcs(from) == countArcs(to), "Wrong copy.");
    7671
    7772  for (SmartDigraph::NodeIt it(from); it != INVALID; ++it) {
     
    9691  check(tn == nr[fn], "Wrong copy.");
    9792  check(ta == er[fa], "Wrong copy.");
    98 
    99   // Test repeated copy
    100   digraphCopy(from, to).run();
    101  
    102   check(countNodes(from) == countNodes(to), "Wrong copy.");
    103   check(countArcs(from) == countArcs(to), "Wrong copy.");
    10493}
    10594
     
    10796  const int nn = 10;
    10897
    109   // Build a graph
    11098  SmartGraph from;
    11199  SmartGraph::NodeMap<int> fnm(from);
     
    135123  }
    136124
    137   // Test graph copy
    138125  ListGraph to;
    139126  ListGraph::NodeMap<int> tnm(to);
     
    157144    nodeCrossRef(ncr).arcCrossRef(acr).edgeCrossRef(ecr).
    158145    node(fn, tn).arc(fa, ta).edge(fe, te).run();
    159 
    160   check(countNodes(from) == countNodes(to), "Wrong copy.");
    161   check(countEdges(from) == countEdges(to), "Wrong copy.");
    162   check(countArcs(from) == countArcs(to), "Wrong copy.");
    163146
    164147  for (SmartGraph::NodeIt it(from); it != INVALID; ++it) {
     
    198181  check(ta == ar[fa], "Wrong copy.");
    199182  check(te == er[fe], "Wrong copy.");
    200 
    201   // Test repeated copy
    202   graphCopy(from, to).run();
    203  
    204   check(countNodes(from) == countNodes(to), "Wrong copy.");
    205   check(countEdges(from) == countEdges(to), "Wrong copy.");
    206   check(countArcs(from) == countArcs(to), "Wrong copy.");
    207183}
    208184
  • test/heap_test.cc

    r728 r463  
    3232
    3333#include <lemon/bin_heap.h>
    34 #include <lemon/fib_heap.h>
    35 #include <lemon/radix_heap.h>
    36 #include <lemon/bucket_heap.h>
    3734
    3835#include "test_tools.h"
     
    187184  }
    188185
    189   {
    190     typedef FibHeap<Prio, ItemIntMap> IntHeap;
    191     checkConcept<Heap<Prio, ItemIntMap>, IntHeap>();
    192     heapSortTest<IntHeap>();
    193     heapIncreaseTest<IntHeap>();
    194 
    195     typedef FibHeap<Prio, IntNodeMap > NodeHeap;
    196     checkConcept<Heap<Prio, IntNodeMap >, NodeHeap>();
    197     dijkstraHeapTest<NodeHeap>(digraph, length, source);
    198   }
    199 
    200   {
    201     typedef RadixHeap<ItemIntMap> IntHeap;
    202     checkConcept<Heap<Prio, ItemIntMap>, IntHeap>();
    203     heapSortTest<IntHeap>();
    204     heapIncreaseTest<IntHeap>();
    205 
    206     typedef RadixHeap<IntNodeMap > NodeHeap;
    207     checkConcept<Heap<Prio, IntNodeMap >, NodeHeap>();
    208     dijkstraHeapTest<NodeHeap>(digraph, length, source);
    209   }
    210 
    211   {
    212     typedef BucketHeap<ItemIntMap> IntHeap;
    213     checkConcept<Heap<Prio, ItemIntMap>, IntHeap>();
    214     heapSortTest<IntHeap>();
    215     heapIncreaseTest<IntHeap>();
    216 
    217     typedef BucketHeap<IntNodeMap > NodeHeap;
    218     checkConcept<Heap<Prio, IntNodeMap >, NodeHeap>();
    219     dijkstraHeapTest<NodeHeap>(digraph, length, source);
    220   }
    221 
    222 
    223186  return 0;
    224187}
  • test/lp_test.cc

    r1092 r678  
    167167    c = ((2 >= p1) >= 3);
    168168
    169     { //Tests for #430
    170       LP::Col v=lp.addCol();
    171       LP::Constr c = v >= -3;
    172       c = c <= 4;
    173       LP::Constr c2;
    174       c2 = -3 <= v <= 4;
    175     }
    176 
    177169    e[x[3]]=2;
    178170    e[x[3]]=4;
Note: See TracChangeset for help on using the changeset viewer.