COIN-OR::LEMON - Graph Library

Changes in / [454:f599fa651202:455:5a1e9fdcfd3a] in lemon-1.2


Ignore:
Files:
2 added
2 deleted
106 edited

Legend:

Unmodified
Added
Removed
  • LICENSE

    r107 r440  
    22copyright/license.
    33
    4 Copyright (C) 2003-2008 Egervary Jeno Kombinatorikus Optimalizalasi
     4Copyright (C) 2003-2009 Egervary Jeno Kombinatorikus Optimalizalasi
    55Kutatocsoport (Egervary Combinatorial Optimization Research Group,
    66EGRES).
  • demo/arg_parser_demo.cc

    r311 r440  
    33 * This file is a part of LEMON, a generic C++ optimization library.
    44 *
    5  * Copyright (C) 2003-2008
     5 * Copyright (C) 2003-2009
    66 * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
    77 * (Egervary Research Group on Combinatorial Optimization, EGRES).
  • demo/graph_to_eps_demo.cc

    r313 r440  
    33 * This file is a part of LEMON, a generic C++ optimization library.
    44 *
    5  * Copyright (C) 2003-2008
     5 * Copyright (C) 2003-2009
    66 * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
    77 * (Egervary Research Group on Combinatorial Optimization, EGRES).
     
    8686    coords(coords).
    8787    title("Sample .eps figure").
    88     copyright("(C) 2003-2008 LEMON Project").
     88    copyright("(C) 2003-2009 LEMON Project").
    8989    run();
    9090
     
    9393    coords(coords).
    9494    title("Sample .eps figure").
    95     copyright("(C) 2003-2008 LEMON Project").
     95    copyright("(C) 2003-2009 LEMON Project").
    9696    absoluteNodeSizes().absoluteArcWidths().
    9797    nodeScale(2).nodeSizes(sizes).
     
    106106  graphToEps(g,"graph_to_eps_demo_out_3_arr.eps").
    107107    title("Sample .eps figure (with arrowheads)").
    108     copyright("(C) 2003-2008 LEMON Project").
     108    copyright("(C) 2003-2009 LEMON Project").
    109109    absoluteNodeSizes().absoluteArcWidths().
    110110    nodeColors(composeMap(palette,colors)).
     
    133133  graphToEps(g,"graph_to_eps_demo_out_4_par.eps").
    134134    title("Sample .eps figure (parallel arcs)").
    135     copyright("(C) 2003-2008 LEMON Project").
     135    copyright("(C) 2003-2009 LEMON Project").
    136136    absoluteNodeSizes().absoluteArcWidths().
    137137    nodeShapes(shapes).
     
    148148  graphToEps(g,"graph_to_eps_demo_out_5_par_arr.eps").
    149149    title("Sample .eps figure (parallel arcs and arrowheads)").
    150     copyright("(C) 2003-2008 LEMON Project").
     150    copyright("(C) 2003-2009 LEMON Project").
    151151    absoluteNodeSizes().absoluteArcWidths().
    152152    nodeScale(2).nodeSizes(sizes).
     
    164164  graphToEps(g,"graph_to_eps_demo_out_6_par_arr_a4.eps").
    165165    title("Sample .eps figure (fits to A4)").
    166     copyright("(C) 2003-2008 LEMON Project").
     166    copyright("(C) 2003-2009 LEMON Project").
    167167    scaleToA4().
    168168    absoluteNodeSizes().absoluteArcWidths().
     
    194194    scale(60).
    195195    title("Sample .eps figure (Palette demo)").
    196     copyright("(C) 2003-2008 LEMON Project").
     196    copyright("(C) 2003-2009 LEMON Project").
    197197    coords(hcoords).
    198198    absoluteNodeSizes().absoluteArcWidths().
  • demo/lgf_demo.cc

    r294 r440  
    33 * This file is a part of LEMON, a generic C++ optimization library.
    44 *
    5  * Copyright (C) 2003-2008
     5 * Copyright (C) 2003-2009
    66 * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
    77 * (Egervary Research Group on Combinatorial Optimization, EGRES).
  • doc/coding_style.dox

    r210 r440  
    33 * This file is a part of LEMON, a generic C++ optimization library.
    44 *
    5  * Copyright (C) 2003-2008
     5 * Copyright (C) 2003-2009
    66 * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
    77 * (Egervary Research Group on Combinatorial Optimization, EGRES).
  • doc/dirs.dox

    r318 r440  
    33 * This file is a part of LEMON, a generic C++ optimization library.
    44 *
    5  * Copyright (C) 2003-2008
     5 * Copyright (C) 2003-2009
    66 * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
    77 * (Egervary Research Group on Combinatorial Optimization, EGRES).
     
    7272\brief Auxiliary tools for implementation.
    7373
    74 This directory contains some auxiliary classes for implementing graphs, 
     74This directory contains some auxiliary classes for implementing graphs,
    7575maps and some other classes.
    7676As a user you typically don't have to deal with these files.
  • doc/groups.dox

    r451 r455  
    33 * This file is a part of LEMON, a generic C++ optimization library.
    44 *
    5  * Copyright (C) 2003-2008
     5 * Copyright (C) 2003-2009
    66 * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
    77 * (Egervary Research Group on Combinatorial Optimization, EGRES).
  • doc/lgf.dox

    r313 r440  
    33 * This file is a part of LEMON, a generic C++ optimization library.
    44 *
    5  * Copyright (C) 2003-2008
     5 * Copyright (C) 2003-2009
    66 * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
    77 * (Egervary Research Group on Combinatorial Optimization, EGRES).
  • doc/license.dox

    r209 r440  
    33 * This file is a part of LEMON, a generic C++ optimization library.
    44 *
    5  * Copyright (C) 2003-2008
     5 * Copyright (C) 2003-2009
    66 * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
    77 * (Egervary Research Group on Combinatorial Optimization, EGRES).
  • doc/mainpage.dox

    r314 r440  
    33 * This file is a part of LEMON, a generic C++ optimization library.
    44 *
    5  * Copyright (C) 2003-2008
     5 * Copyright (C) 2003-2009
    66 * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
    77 * (Egervary Research Group on Combinatorial Optimization, EGRES).
  • doc/migration.dox

    r343 r440  
    33 * This file is a part of LEMON, a generic C++ optimization library.
    44 *
    5  * Copyright (C) 2003-2008
     5 * Copyright (C) 2003-2009
    66 * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
    77 * (Egervary Research Group on Combinatorial Optimization, EGRES).
  • doc/named-param.dox

    r269 r440  
    33 * This file is a part of LEMON, a generic C++ optimization library.
    44 *
    5  * Copyright (C) 2003-2008
     5 * Copyright (C) 2003-2009
    66 * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
    77 * (Egervary Research Group on Combinatorial Optimization, EGRES).
  • doc/namespaces.dox

    r209 r440  
    33 * This file is a part of LEMON, a generic C++ optimization library.
    44 *
    5  * Copyright (C) 2003-2008
     5 * Copyright (C) 2003-2009
    66 * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
    77 * (Egervary Research Group on Combinatorial Optimization, EGRES).
  • doc/template.h

    r209 r440  
    33 * This file is a part of LEMON, a generic C++ optimization library.
    44 *
    5  * Copyright (C) 2003-2008
     5 * Copyright (C) 2003-2009
    66 * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
    77 * (Egervary Research Group on Combinatorial Optimization, EGRES).
  • lemon/Makefile.am

    r418 r445  
    88
    99lemon_libemon_la_SOURCES = \
    10         lemon/arg_parser.cc \
    11         lemon/base.cc \
    12         lemon/color.cc \
    13         lemon/random.cc
     10        lemon/arg_parser.cc \
     11        lemon/base.cc \
     12        lemon/color.cc \
     13        lemon/random.cc
    1414
    1515#lemon_libemon_la_CXXFLAGS = $(GLPK_CFLAGS) $(CPLEX_CFLAGS) $(SOPLEX_CXXFLAGS) $(AM_CXXFLAGS)
     
    1818lemon_HEADERS += \
    1919        lemon/adaptors.h \
    20         lemon/arg_parser.h \
     20        lemon/arg_parser.h \
    2121        lemon/assert.h \
    22         lemon/bfs.h \
    23         lemon/bin_heap.h \
    24         lemon/circulation.h \
    25         lemon/color.h \
     22        lemon/bfs.h \
     23        lemon/bin_heap.h \
     24        lemon/circulation.h \
     25        lemon/color.h \
    2626        lemon/concept_check.h \
    27         lemon/counter.h \
     27        lemon/counter.h \
    2828        lemon/core.h \
    29         lemon/dfs.h \
    30         lemon/dijkstra.h \
    31         lemon/dim2.h \
    32         lemon/dimacs.h \
     29        lemon/dfs.h \
     30        lemon/dijkstra.h \
     31        lemon/dim2.h \
     32        lemon/dimacs.h \
    3333        lemon/elevator.h \
    3434        lemon/error.h \
    3535        lemon/full_graph.h \
    36         lemon/graph_to_eps.h \
    37         lemon/grid_graph.h \
     36        lemon/graph_to_eps.h \
     37        lemon/grid_graph.h \
    3838        lemon/hypercube_graph.h \
    3939        lemon/kruskal.h \
     
    4848        lemon/path.h \
    4949        lemon/preflow.h \
    50         lemon/random.h \
     50        lemon/radix_sort.h \
     51        lemon/random.h \
    5152        lemon/smart_graph.h \
    5253        lemon/suurballe.h \
    53         lemon/time_measure.h \
    54         lemon/tolerance.h \
     54        lemon/time_measure.h \
     55        lemon/tolerance.h \
    5556        lemon/unionfind.h
    5657
     
    5960        lemon/bits/array_map.h \
    6061        lemon/bits/base_extender.h \
    61         lemon/bits/bezier.h \
     62        lemon/bits/bezier.h \
    6263        lemon/bits/default_map.h \
    63         lemon/bits/enable_if.h \
     64        lemon/bits/enable_if.h \
    6465        lemon/bits/graph_adaptor_extender.h \
    6566        lemon/bits/graph_extender.h \
  • lemon/arg_parser.cc

    r311 r440  
    33 * This file is a part of LEMON, a generic C++ optimization library.
    44 *
    5  * Copyright (C) 2003-2008
     5 * Copyright (C) 2003-2009
    66 * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
    77 * (Egervary Research Group on Combinatorial Optimization, EGRES).
  • lemon/arg_parser.h

    r311 r440  
    33 * This file is a part of LEMON, a generic C++ optimization library.
    44 *
    5  * Copyright (C) 2003-2008
     5 * Copyright (C) 2003-2009
    66 * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
    77 * (Egervary Research Group on Combinatorial Optimization, EGRES).
  • lemon/assert.h

    r290 r440  
    33 * This file is a part of LEMON, a generic C++ optimization library.
    44 *
    5  * Copyright (C) 2003-2008
     5 * Copyright (C) 2003-2009
    66 * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
    77 * (Egervary Research Group on Combinatorial Optimization, EGRES).
  • lemon/base.cc

    r220 r440  
    33 * This file is a part of LEMON, a generic C++ optimization library.
    44 *
    5  * Copyright (C) 2003-2008
     5 * Copyright (C) 2003-2009
    66 * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
    77 * (Egervary Research Group on Combinatorial Optimization, EGRES).
  • lemon/bfs.h

    r405 r440  
    33 * This file is a part of LEMON, a generic C++ optimization library.
    44 *
    5  * Copyright (C) 2003-2008
     5 * Copyright (C) 2003-2009
    66 * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
    77 * (Egervary Research Group on Combinatorial Optimization, EGRES).
     
    17421742    /// \pre Either \ref run(Node) "run()" or \ref init()
    17431743    /// must be called before using this function.
    1744     bool reached(Node v) { return (*_reached)[v]; }
     1744    bool reached(Node v) const { return (*_reached)[v]; }
    17451745
    17461746    ///@}
  • lemon/bin_heap.h

    r209 r440  
    33 * This file is a part of LEMON, a generic C++ optimization library.
    44 *
    5  * Copyright (C) 2003-2008
     5 * Copyright (C) 2003-2009
    66 * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
    77 * (Egervary Research Group on Combinatorial Optimization, EGRES).
  • lemon/bits/alteration_notifier.h

    r361 r440  
    33 * This file is a part of LEMON, a generic C++ optimization library.
    44 *
    5  * Copyright (C) 2003-2008
     5 * Copyright (C) 2003-2009
    66 * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
    77 * (Egervary Research Group on Combinatorial Optimization, EGRES).
  • lemon/bits/array_map.h

    r361 r440  
    33 * This file is a part of LEMON, a generic C++ optimization library.
    44 *
    5  * Copyright (C) 2003-2008
     5 * Copyright (C) 2003-2009
    66 * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
    77 * (Egervary Research Group on Combinatorial Optimization, EGRES).
  • lemon/bits/base_extender.h

    r361 r440  
    33 * This file is a part of LEMON, a generic C++ optimization library.
    44 *
    5  * Copyright (C) 2003-2008
     5 * Copyright (C) 2003-2009
    66 * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
    77 * (Egervary Research Group on Combinatorial Optimization, EGRES).
  • lemon/bits/bezier.h

    r314 r440  
    33 * This file is a part of LEMON, a generic C++ optimization library.
    44 *
    5  * Copyright (C) 2003-2008
     5 * Copyright (C) 2003-2009
    66 * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
    77 * (Egervary Research Group on Combinatorial Optimization, EGRES).
  • lemon/bits/default_map.h

    r314 r440  
    33 * This file is a part of LEMON, a generic C++ optimization library.
    44 *
    5  * Copyright (C) 2003-2008
     5 * Copyright (C) 2003-2009
    66 * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
    77 * (Egervary Research Group on Combinatorial Optimization, EGRES).
  • lemon/bits/enable_if.h

    r314 r440  
    33 * This file is a part of LEMON, a generic C++ optimization library.
    44 *
    5  * Copyright (C) 2003-2008
     5 * Copyright (C) 2003-2009
    66 * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
    77 * (Egervary Research Group on Combinatorial Optimization, EGRES).
  • lemon/bits/graph_adaptor_extender.h

    r453 r455  
    33 * This file is a part of LEMON, a generic C++ optimization library.
    44 *
    5  * Copyright (C) 2003-2008
     5 * Copyright (C) 2003-2009
    66 * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
    77 * (Egervary Research Group on Combinatorial Optimization, EGRES).
  • lemon/bits/graph_extender.h

    r361 r440  
    33 * This file is a part of LEMON, a generic C++ optimization library.
    44 *
    5  * Copyright (C) 2003-2008
     5 * Copyright (C) 2003-2009
    66 * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
    77 * (Egervary Research Group on Combinatorial Optimization, EGRES).
  • lemon/bits/map_extender.h

    r314 r440  
    33 * This file is a part of LEMON, a generic C++ optimization library.
    44 *
    5  * Copyright (C) 2003-2008
     5 * Copyright (C) 2003-2009
    66 * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
    77 * (Egervary Research Group on Combinatorial Optimization, EGRES).
  • lemon/bits/path_dump.h

    r209 r440  
    33 * This file is a part of LEMON, a generic C++ optimization library.
    44 *
    5  * Copyright (C) 2003-2008
     5 * Copyright (C) 2003-2009
    66 * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
    77 * (Egervary Research Group on Combinatorial Optimization, EGRES).
  • lemon/bits/traits.h

    r360 r440  
    33 * This file is a part of LEMON, a generic C++ optimization library.
    44 *
    5  * Copyright (C) 2003-2008
     5 * Copyright (C) 2003-2009
    66 * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
    77 * (Egervary Research Group on Combinatorial Optimization, EGRES).
  • lemon/bits/variant.h

    r416 r440  
    33 * This file is a part of LEMON, a generic C++ optimization library.
    44 *
    5  * Copyright (C) 2003-2008
     5 * Copyright (C) 2003-2009
    66 * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
    77 * (Egervary Research Group on Combinatorial Optimization, EGRES).
     
    2222#include <lemon/assert.h>
    2323
    24 /// \file
    25 /// \brief Variant types
     24// \file
     25// \brief Variant types
    2626
    2727namespace lemon {
     
    3737
    3838
    39   /// \brief Simple Variant type for two types
    40   ///
    41   /// Simple Variant type for two types. The Variant type is a type
    42   /// safe union. The C++ has strong limitations for using unions, by
    43   /// example we can not store type with non default constructor or
    44   /// destructor in an union. This class always knowns the current
    45   /// state of the variant and it cares for the proper construction
    46   /// and destruction.
     39  // \brief Simple Variant type for two types
     40  //
     41  // Simple Variant type for two types. The Variant type is a type-safe
     42  // union. C++ has strong limitations for using unions, for
     43  // example you cannot store a type with non-default constructor or
     44  // destructor in a union. This class always knowns the current
     45  // state of the variant and it cares for the proper construction
     46  // and destruction.
    4747  template <typename _First, typename _Second>
    4848  class BiVariant {
    4949  public:
    5050
    51     /// \brief The \c First type.
     51    // \brief The \c First type.
    5252    typedef _First First;
    53     /// \brief The \c Second type.
     53    // \brief The \c Second type.
    5454    typedef _Second Second;
    5555
    56     /// \brief Constructor
    57     ///
    58     /// This constructor initalizes to the default value of the \c First
    59     /// type.
     56    // \brief Constructor
     57    //
     58    // This constructor initalizes to the default value of the \c First
     59    // type.
    6060    BiVariant() {
    6161      flag = true;
     
    6363    }
    6464
    65     /// \brief Constructor
    66     ///
    67     /// This constructor initalizes to the given value of the \c First
    68     /// type.
     65    // \brief Constructor
     66    //
     67    // This constructor initalizes to the given value of the \c First
     68    // type.
    6969    BiVariant(const First& f) {
    7070      flag = true;
     
    7272    }
    7373
    74     /// \brief Constructor
    75     ///
    76     /// This constructor initalizes to the given value of the \c
    77     /// Second type.
     74    // \brief Constructor
     75    //
     76    // This constructor initalizes to the given value of the \c
     77    // Second type.
    7878    BiVariant(const Second& s) {
    7979      flag = false;
     
    8181    }
    8282
    83     /// \brief Copy constructor
    84     ///
    85     /// Copy constructor
     83    // \brief Copy constructor
     84    //
     85    // Copy constructor
    8686    BiVariant(const BiVariant& bivariant) {
    8787      flag = bivariant.flag;
     
    9393    }
    9494
    95     /// \brief Destrcutor
    96     ///
    97     /// Destructor
     95    // \brief Destrcutor
     96    //
     97    // Destructor
    9898    ~BiVariant() {
    9999      destroy();
    100100    }
    101101
    102     /// \brief Set to the default value of the \c First type.
    103     ///
    104     /// This function sets the variant to the default value of the \c
    105     /// First type.
     102    // \brief Set to the default value of the \c First type.
     103    //
     104    // This function sets the variant to the default value of the \c
     105    // First type.
    106106    BiVariant& setFirst() {
    107107      destroy();
     
    111111    }
    112112
    113     /// \brief Set to the given value of the \c First type.
    114     ///
    115     /// This function sets the variant to the given value of the \c
    116     /// First type.
     113    // \brief Set to the given value of the \c First type.
     114    //
     115    // This function sets the variant to the given value of the \c
     116    // First type.
    117117    BiVariant& setFirst(const First& f) {
    118118      destroy();
     
    122122    }
    123123
    124     /// \brief Set to the default value of the \c Second type.
    125     ///
    126     /// This function sets the variant to the default value of the \c
    127     /// Second type.
     124    // \brief Set to the default value of the \c Second type.
     125    //
     126    // This function sets the variant to the default value of the \c
     127    // Second type.
    128128    BiVariant& setSecond() {
    129129      destroy();
     
    133133    }
    134134
    135     /// \brief Set to the given value of the \c Second type.
    136     ///
    137     /// This function sets the variant to the given value of the \c
    138     /// Second type.
     135    // \brief Set to the given value of the \c Second type.
     136    //
     137    // This function sets the variant to the given value of the \c
     138    // Second type.
    139139    BiVariant& setSecond(const Second& s) {
    140140      destroy();
     
    144144    }
    145145
    146     /// \brief Operator form of the \c setFirst()
     146    // \brief Operator form of the \c setFirst()
    147147    BiVariant& operator=(const First& f) {
    148148      return setFirst(f);
    149149    }
    150150
    151     /// \brief Operator form of the \c setSecond()
     151    // \brief Operator form of the \c setSecond()
    152152    BiVariant& operator=(const Second& s) {
    153153      return setSecond(s);
    154154    }
    155155
    156     /// \brief Assign operator
     156    // \brief Assign operator
    157157    BiVariant& operator=(const BiVariant& bivariant) {
    158158      if (this == &bivariant) return *this;
     
    167167    }
    168168
    169     /// \brief Reference to the value
    170     ///
    171     /// Reference to the value of the \c First type.
    172     /// \pre The BiVariant should store value of \c First type.
     169    // \brief Reference to the value
     170    //
     171    // Reference to the value of the \c First type.
     172    // \pre The BiVariant should store value of \c First type.
    173173    First& first() {
    174174      LEMON_DEBUG(flag, "Variant wrong state");
    175       return *reinterpret_cast<First*>(data); 
    176     }
    177 
    178     /// \brief Const reference to the value
    179     ///
    180     /// Const reference to the value of the \c First type.
    181     /// \pre The BiVariant should store value of \c First type.
    182     const First& first() const { 
     175      return *reinterpret_cast<First*>(data);
     176    }
     177
     178    // \brief Const reference to the value
     179    //
     180    // Const reference to the value of the \c First type.
     181    // \pre The BiVariant should store value of \c First type.
     182    const First& first() const {
    183183      LEMON_DEBUG(flag, "Variant wrong state");
    184       return *reinterpret_cast<const First*>(data); 
    185     }
    186 
    187     /// \brief Operator form of the \c first()
     184      return *reinterpret_cast<const First*>(data);
     185    }
     186
     187    // \brief Operator form of the \c first()
    188188    operator First&() { return first(); }
    189     /// \brief Operator form of the const \c first()
     189    // \brief Operator form of the const \c first()
    190190    operator const First&() const { return first(); }
    191191
    192     /// \brief Reference to the value
    193     ///
    194     /// Reference to the value of the \c Second type.
    195     /// \pre The BiVariant should store value of \c Second type.
    196     Second& second() { 
     192    // \brief Reference to the value
     193    //
     194    // Reference to the value of the \c Second type.
     195    // \pre The BiVariant should store value of \c Second type.
     196    Second& second() {
    197197      LEMON_DEBUG(!flag, "Variant wrong state");
    198       return *reinterpret_cast<Second*>(data); 
    199     }
    200 
    201     /// \brief Const reference to the value
    202     ///
    203     /// Const reference to the value of the \c Second type.
    204     /// \pre The BiVariant should store value of \c Second type.
    205     const Second& second() const { 
     198      return *reinterpret_cast<Second*>(data);
     199    }
     200
     201    // \brief Const reference to the value
     202    //
     203    // Const reference to the value of the \c Second type.
     204    // \pre The BiVariant should store value of \c Second type.
     205    const Second& second() const {
    206206      LEMON_DEBUG(!flag, "Variant wrong state");
    207       return *reinterpret_cast<const Second*>(data); 
    208     }
    209 
    210     /// \brief Operator form of the \c second()
     207      return *reinterpret_cast<const Second*>(data);
     208    }
     209
     210    // \brief Operator form of the \c second()
    211211    operator Second&() { return second(); }
    212     /// \brief Operator form of the const \c second()
     212    // \brief Operator form of the const \c second()
    213213    operator const Second&() const { return second(); }
    214214
    215     /// \brief %True when the variant is in the first state
    216     ///
    217     /// %True when the variant stores value of the \c First type.
     215    // \brief %True when the variant is in the first state
     216    //
     217    // %True when the variant stores value of the \c First type.
    218218    bool firstState() const { return flag; }
    219219
    220     /// \brief %True when the variant is in the second state
    221     ///
    222     /// %True when the variant stores value of the \c Second type.
     220    // \brief %True when the variant is in the second state
     221    //
     222    // %True when the variant stores value of the \c Second type.
    223223    bool secondState() const { return !flag; }
    224224
     
    290290  }
    291291
    292   /// \brief Variant type
    293   ///
    294   /// Simple Variant type. The Variant type is a type safe union. The
    295   /// C++ has strong limitations for using unions, for example we
    296   /// cannot store type with non default constructor or destructor in
    297   /// a union. This class always knowns the current state of the
    298   /// variant and it cares for the proper construction and
    299   /// destruction.
    300   ///
    301   /// \param _num The number of the types which can be stored in the
    302   /// variant type.
    303   /// \param _TypeMap This class describes the types of the Variant. The
    304   /// _TypeMap::Map<index>::Type should be a valid type for each index
    305   /// in the range {0, 1, ..., _num - 1}. The \c VariantTypeMap is helper
    306   /// class to define such type mappings up to 10 types.
    307   ///
    308   /// And the usage of the class:
    309   ///\code
    310   /// typedef Variant<3, VariantTypeMap<int, std::string, double> > MyVariant;
    311   /// MyVariant var;
    312   /// var.set<0>(12);
    313   /// std::cout << var.get<0>() << std::endl;
    314   /// var.set<1>("alpha");
    315   /// std::cout << var.get<1>() << std::endl;
    316   /// var.set<2>(0.75);
    317   /// std::cout << var.get<2>() << std::endl;
    318   ///\endcode
    319   ///
    320   /// The result of course:
    321   ///\code
    322   /// 12
    323   /// alpha
    324   /// 0.75
    325   ///\endcode
     292  // \brief Variant type
     293  //
     294  // Simple Variant type. The Variant type is a type-safe union.
     295  // C++ has strong limitations for using unions, for example you
     296  // cannot store type with non-default constructor or destructor in
     297  // a union. This class always knowns the current state of the
     298  // variant and it cares for the proper construction and
     299  // destruction.
     300  //
     301  // \param _num The number of the types which can be stored in the
     302  // variant type.
     303  // \param _TypeMap This class describes the types of the Variant. The
     304  // _TypeMap::Map<index>::Type should be a valid type for each index
     305  // in the range {0, 1, ..., _num - 1}. The \c VariantTypeMap is helper
     306  // class to define such type mappings up to 10 types.
     307  //
     308  // And the usage of the class:
     309  //\code
     310  // typedef Variant<3, VariantTypeMap<int, std::string, double> > MyVariant;
     311  // MyVariant var;
     312  // var.set<0>(12);
     313  // std::cout << var.get<0>() << std::endl;
     314  // var.set<1>("alpha");
     315  // std::cout << var.get<1>() << std::endl;
     316  // var.set<2>(0.75);
     317  // std::cout << var.get<2>() << std::endl;
     318  //\endcode
     319  //
     320  // The result of course:
     321  //\code
     322  // 12
     323  // alpha
     324  // 0.75
     325  //\endcode
    326326  template <int _num, typename _TypeMap>
    327327  class Variant {
     
    332332    typedef _TypeMap TypeMap;
    333333
    334     /// \brief Constructor
    335     ///
    336     /// This constructor initalizes to the default value of the \c type
    337     /// with 0 index.
     334    // \brief Constructor
     335    //
     336    // This constructor initalizes to the default value of the \c type
     337    // with 0 index.
    338338    Variant() {
    339339      flag = 0;
     
    343343
    344344
    345     /// \brief Copy constructor
    346     ///
    347     /// Copy constructor
     345    // \brief Copy constructor
     346    //
     347    // Copy constructor
    348348    Variant(const Variant& variant) {
    349349      flag = variant.flag;
     
    351351    }
    352352
    353     /// \brief Assign operator
    354     ///
    355     /// Assign operator
     353    // \brief Assign operator
     354    //
     355    // Assign operator
    356356    Variant& operator=(const Variant& variant) {
    357357      if (this == &variant) return *this;
     
    364364    }
    365365
    366     /// \brief Destrcutor
    367     ///
    368     /// Destructor
     366    // \brief Destrcutor
     367    //
     368    // Destructor
    369369    ~Variant() {
    370370      _variant_bits::Memory<num - 1, TypeMap>::destroy(flag, data);
    371371    }
    372372
    373     /// \brief Set to the default value of the type with \c _idx index.
    374     ///
    375     /// This function sets the variant to the default value of the
    376     /// type with \c _idx index.
     373    // \brief Set to the default value of the type with \c _idx index.
     374    //
     375    // This function sets the variant to the default value of the
     376    // type with \c _idx index.
    377377    template <int _idx>
    378378    Variant& set() {
     
    384384    }
    385385
    386     /// \brief Set to the given value of the type with \c _idx index.
    387     ///
    388     /// This function sets the variant to the given value of the type
    389     /// with \c _idx index.
     386    // \brief Set to the given value of the type with \c _idx index.
     387    //
     388    // This function sets the variant to the given value of the type
     389    // with \c _idx index.
    390390    template <int _idx>
    391391    Variant& set(const typename _TypeMap::template Map<_idx>::Type& init) {
     
    397397    }
    398398
    399     /// \brief Gets the current value of the type with \c _idx index.
    400     ///
    401     /// Gets the current value of the type with \c _idx index.
     399    // \brief Gets the current value of the type with \c _idx index.
     400    //
     401    // Gets the current value of the type with \c _idx index.
    402402    template <int _idx>
    403403    const typename TypeMap::template Map<_idx>::Type& get() const {
     
    407407    }
    408408
    409     /// \brief Gets the current value of the type with \c _idx index.
    410     ///
    411     /// Gets the current value of the type with \c _idx index.
     409    // \brief Gets the current value of the type with \c _idx index.
     410    //
     411    // Gets the current value of the type with \c _idx index.
    412412    template <int _idx>
    413413    typename _TypeMap::template Map<_idx>::Type& get() {
     
    417417    }
    418418
    419     /// \brief Returns the current state of the variant.
    420     ///
    421     /// Returns the current state of the variant.
     419    // \brief Returns the current state of the variant.
     420    //
     421    // Returns the current state of the variant.
    422422    int state() const {
    423423      return flag;
     
    451451
    452452    template <int _idx, typename _T0, typename _T1, typename _T2,
    453               typename _T3, typename _T5, typename _T4, typename _T6,
     453              typename _T3, typename _T4, typename _T5, typename _T6,
    454454              typename _T7, typename _T8, typename _T9>
    455455    struct Mapper {
     
    470470  }
    471471
    472   /// \brief Helper class for Variant
    473   ///
    474   /// Helper class to define type mappings for Variant. This class
    475   /// converts the template parameters to be mappable by integer.
    476   /// \see Variant
     472  // \brief Helper class for Variant
     473  //
     474  // Helper class to define type mappings for Variant. This class
     475  // converts the template parameters to be mappable by integer.
     476  // \see Variant
    477477  template <
    478478    typename _T0,
    479479    typename _T1 = void, typename _T2 = void, typename _T3 = void,
    480     typename _T5 = void, typename _T4 = void, typename _T6 = void,
     480    typename _T4 = void, typename _T5 = void, typename _T6 = void,
    481481    typename _T7 = void, typename _T8 = void, typename _T9 = void>
    482482  struct VariantTypeMap {
  • lemon/bits/vector_map.h

    r361 r440  
    33 * This file is a part of LEMON, a generic C++ optimization library.
    44 *
    5  * Copyright (C) 2003-2008
     5 * Copyright (C) 2003-2009
    66 * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
    77 * (Egervary Research Group on Combinatorial Optimization, EGRES).
  • lemon/circulation.h

    r402 r440  
    33 * This file is a part of LEMON, a generic C++ optimization library.
    44 *
    5  * Copyright (C) 2003-2008
     5 * Copyright (C) 2003-2009
    66 * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
    77 * (Egervary Research Group on Combinatorial Optimization, EGRES).
     
    420420    /// \pre Either \ref run() or \ref init() must be called before
    421421    /// using this function.
    422     const Elevator& elevator() {
     422    const Elevator& elevator() const {
    423423      return *_level;
    424424    }
     
    645645    /// \pre Either \ref run() or \ref init() must be called before
    646646    /// using this function.
    647     const FlowMap& flowMap() {
     647    const FlowMap& flowMap() const {
    648648      return *_flow;
    649649    }
     
    670670       \sa checkBarrier()
    671671    */
    672     bool barrier(const Node& node)
     672    bool barrier(const Node& node) const
    673673    {
    674674      return (*_level)[node] >= _el;
     
    693693    /// \sa checkBarrier()
    694694    template<class BarrierMap>
    695     void barrierMap(BarrierMap &bar)
     695    void barrierMap(BarrierMap &bar) const
    696696    {
    697697      for(NodeIt n(_g);n!=INVALID;++n)
     
    713713    ///Check if the found flow is a feasible circulation,
    714714    ///
    715     bool checkFlow() {
     715    bool checkFlow() const {
    716716      for(ArcIt e(_g);e!=INVALID;++e)
    717717        if((*_flow)[e]<(*_lo)[e]||(*_flow)[e]>(*_up)[e]) return false;
     
    731731    ///\sa barrier()
    732732    ///\sa barrierMap()
    733     bool checkBarrier()
     733    bool checkBarrier() const
    734734    {
    735735      Value delta=0;
  • lemon/color.cc

    r209 r440  
    33 * This file is a part of LEMON, a generic C++ optimization library.
    44 *
    5  * Copyright (C) 2003-2008
     5 * Copyright (C) 2003-2009
    66 * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
    77 * (Egervary Research Group on Combinatorial Optimization, EGRES).
  • lemon/color.h

    r313 r440  
    33 * This file is a part of LEMON, a generic C++ optimization library.
    44 *
    5  * Copyright (C) 2003-2008
     5 * Copyright (C) 2003-2009
    66 * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
    77 * (Egervary Research Group on Combinatorial Optimization, EGRES).
  • lemon/concept_check.h

    r285 r440  
    33 * This file is a part of LEMON, a generic C++ optimization library.
    44 *
    5  * Copyright (C) 2003-2008
     5 * Copyright (C) 2003-2009
    66 * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
    77 * (Egervary Research Group on Combinatorial Optimization, EGRES).
  • lemon/concepts/digraph.h

    r263 r440  
    33 * This file is a part of LEMON, a generic C++ optimization library.
    44 *
    5  * Copyright (C) 2003-2008
     5 * Copyright (C) 2003-2009
    66 * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
    77 * (Egervary Research Group on Combinatorial Optimization, EGRES).
  • lemon/concepts/graph.h

    r263 r440  
    33 * This file is a part of LEMON, a generic C++ optimization library.
    44 *
    5  * Copyright (C) 2003-2008
     5 * Copyright (C) 2003-2009
    66 * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
    77 * (Egervary Research Group on Combinatorial Optimization, EGRES).
  • lemon/concepts/graph_components.h

    r313 r440  
    33 * This file is a part of LEMON, a generic C++ optimization library.
    44 *
    5  * Copyright (C) 2003-2008
     5 * Copyright (C) 2003-2009
    66 * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
    77 * (Egervary Research Group on Combinatorial Optimization, EGRES).
  • lemon/concepts/heap.h

    r290 r440  
    33 * This file is a part of LEMON, a generic C++ optimization library.
    44 *
    5  * Copyright (C) 2003-2008
     5 * Copyright (C) 2003-2009
    66 * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
    77 * (Egervary Research Group on Combinatorial Optimization, EGRES).
  • lemon/concepts/maps.h

    r314 r440  
    33 * This file is a part of LEMON, a generic C++ optimization library.
    44 *
    5  * Copyright (C) 2003-2008
     5 * Copyright (C) 2003-2009
    66 * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
    77 * (Egervary Research Group on Combinatorial Optimization, EGRES).
  • lemon/concepts/path.h

    r281 r440  
    33 * This file is a part of LEMON, a generic C++ optimization library.
    44 *
    5  * Copyright (C) 2003-2008
     5 * Copyright (C) 2003-2009
    66 * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
    77 * (Egervary Research Group on Combinatorial Optimization, EGRES).
  • lemon/connectivity.h

    r417 r440  
    33 * This file is a part of LEMON, a generic C++ optimization library.
    44 *
    5  * Copyright (C) 2003-2008
     5 * Copyright (C) 2003-2009
    66 * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
    77 * (Egervary Research Group on Combinatorial Optimization, EGRES).
     
    1717 */
    1818
    19 #ifndef LEMON_TOPOLOGY_H
    20 #define LEMON_TOPOLOGY_H
     19#ifndef LEMON_CONNECTIVITY_H
     20#define LEMON_CONNECTIVITY_H
    2121
    2222#include <lemon/dfs.h>
     
    155155  }
    156156
    157   namespace _topology_bits {
     157  namespace _connectivity_bits {
    158158
    159159    template <typename Digraph, typename Iterator >
     
    189189
    190190    template <typename Digraph, typename ArcMap>
    191     struct StronglyConnectedCutEdgesVisitor : public DfsVisitor<Digraph> {
     191    struct StronglyConnectedCutArcsVisitor : public DfsVisitor<Digraph> {
    192192    public:
    193193      typedef typename Digraph::Node Node;
    194194      typedef typename Digraph::Arc Arc;
    195195
    196       StronglyConnectedCutEdgesVisitor(const Digraph& digraph,
    197                                        ArcMap& cutMap,
    198                                        int& cutNum)
     196      StronglyConnectedCutArcsVisitor(const Digraph& digraph,
     197                                      ArcMap& cutMap,
     198                                      int& cutNum)
    199199        : _digraph(digraph), _cutMap(cutMap), _cutNum(cutNum),
    200           _compMap(digraph), _num(0) {
    201       }
    202 
    203       void stop(const Node&) {
     200          _compMap(digraph, -1), _num(-1) {
     201      }
     202
     203      void start(const Node&) {
    204204        ++_num;
    205205      }
     
    249249    if (source == INVALID) return true;
    250250
    251     using namespace _topology_bits;
     251    using namespace _connectivity_bits;
    252252
    253253    typedef DfsVisitor<Digraph> Visitor;
     
    266266
    267267    typedef ReverseDigraph<const Digraph> RDigraph;
     268    typedef typename RDigraph::NodeIt RNodeIt;
    268269    RDigraph rdigraph(digraph);
    269270
     
    276277    rdfs.start();
    277278
    278     for (NodeIt it(rdigraph); it != INVALID; ++it) {
     279    for (RNodeIt it(rdigraph); it != INVALID; ++it) {
    279280      if (!rdfs.reached(it)) {
    280281        return false;
     
    295296  /// direction.
    296297  ///
    297   /// \param graph The graph.
     298  /// \param digraph The graph.
    298299  /// \return The number of components
    299300  /// \note By definition, the empty graph has zero
     
    303304    checkConcept<concepts::Digraph, Digraph>();
    304305
    305     using namespace _topology_bits;
     306    using namespace _connectivity_bits;
    306307
    307308    typedef typename Digraph::Node Node;
     
    375376    checkConcept<concepts::WriteMap<Node, int>, NodeMap>();
    376377
    377     using namespace _topology_bits;
     378    using namespace _connectivity_bits;
    378379
    379380    typedef std::vector<Node> Container;
     
    439440    checkConcept<concepts::WriteMap<Arc, bool>, ArcMap>();
    440441
    441     using namespace _topology_bits;
     442    using namespace _connectivity_bits;
    442443
    443444    typedef std::vector<Node> Container;
     
    464465    int cutNum = 0;
    465466
    466     typedef StronglyConnectedCutEdgesVisitor<RDigraph, ArcMap> RVisitor;
     467    typedef StronglyConnectedCutArcsVisitor<RDigraph, ArcMap> RVisitor;
    467468    RVisitor rvisitor(rgraph, cutMap, cutNum);
    468469
     
    479480  }
    480481
    481   namespace _topology_bits {
     482  namespace _connectivity_bits {
    482483
    483484    template <typename Digraph>
     
    731732    typedef typename Graph::NodeIt NodeIt;
    732733
    733     using namespace _topology_bits;
     734    using namespace _connectivity_bits;
    734735
    735736    typedef CountBiNodeConnectedComponentsVisitor<Graph> Visitor;
     
    774775    checkConcept<concepts::WriteMap<Edge, int>, EdgeMap>();
    775776
    776     using namespace _topology_bits;
     777    using namespace _connectivity_bits;
    777778
    778779    typedef BiNodeConnectedComponentsVisitor<Graph, EdgeMap> Visitor;
     
    814815    checkConcept<concepts::WriteMap<Node, bool>, NodeMap>();
    815816
    816     using namespace _topology_bits;
     817    using namespace _connectivity_bits;
    817818
    818819    typedef BiNodeConnectedCutNodesVisitor<Graph, NodeMap> Visitor;
     
    833834  }
    834835
    835   namespace _topology_bits {
     836  namespace _connectivity_bits {
    836837
    837838    template <typename Digraph>
     
    10541055    typedef typename Graph::NodeIt NodeIt;
    10551056
    1056     using namespace _topology_bits;
     1057    using namespace _connectivity_bits;
    10571058
    10581059    typedef CountBiEdgeConnectedComponentsVisitor<Graph> Visitor;
     
    10961097    checkConcept<concepts::WriteMap<Node, int>, NodeMap>();
    10971098
    1098     using namespace _topology_bits;
     1099    using namespace _connectivity_bits;
    10991100
    11001101    typedef BiEdgeConnectedComponentsVisitor<Graph, NodeMap> Visitor;
     
    11371138    checkConcept<concepts::WriteMap<Edge, bool>, EdgeMap>();
    11381139
    1139     using namespace _topology_bits;
     1140    using namespace _connectivity_bits;
    11401141
    11411142    typedef BiEdgeConnectedCutEdgesVisitor<Graph, EdgeMap> Visitor;
     
    11571158
    11581159
    1159   namespace _topology_bits {
     1160  namespace _connectivity_bits {
    11601161
    11611162    template <typename Digraph, typename IntNodeMap>
     
    11941195  template <typename Digraph, typename NodeMap>
    11951196  void topologicalSort(const Digraph& graph, NodeMap& order) {
    1196     using namespace _topology_bits;
     1197    using namespace _connectivity_bits;
    11971198
    11981199    checkConcept<concepts::Digraph, Digraph>();
     
    12251226  /// that the given graph is DAG.
    12261227  ///
    1227   /// \param graph The graph. It must be directed and acyclic.
     1228  /// \param digraph The graph. It must be directed and acyclic.
    12281229  /// \retval order A readable - writable node map. The values will be set
    12291230  /// from 0 to the number of the nodes in the graph minus one. Each values
     
    12351236  /// \see dag
    12361237  template <typename Digraph, typename NodeMap>
    1237   bool checkedTopologicalSort(const Digraph& graph, NodeMap& order) {
    1238     using namespace _topology_bits;
     1238  bool checkedTopologicalSort(const Digraph& digraph, NodeMap& order) {
     1239    using namespace _connectivity_bits;
    12391240
    12401241    checkConcept<concepts::Digraph, Digraph>();
     
    12461247    typedef typename Digraph::Arc Arc;
    12471248
    1248     order = constMap<Node, int, -1>();
     1249    for (NodeIt it(digraph); it != INVALID; ++it) {
     1250      order.set(it, -1);
     1251    }
    12491252
    12501253    TopologicalSortVisitor<Digraph, NodeMap>
    1251       visitor(order, countNodes(graph));
     1254      visitor(order, countNodes(digraph));
    12521255
    12531256    DfsVisit<Digraph, TopologicalSortVisitor<Digraph, NodeMap> >
    1254       dfs(graph, visitor);
     1257      dfs(digraph, visitor);
    12551258
    12561259    dfs.init();
    1257     for (NodeIt it(graph); it != INVALID; ++it) {
     1260    for (NodeIt it(digraph); it != INVALID; ++it) {
    12581261      if (!dfs.reached(it)) {
    12591262        dfs.addSource(it);
    12601263        while (!dfs.emptyQueue()) {
    1261            Arc edge = dfs.nextArc();
    1262            Node target = graph.target(edge);
     1264           Arc arc = dfs.nextArc();
     1265           Node target = digraph.target(arc);
    12631266           if (dfs.reached(target) && order[target] == -1) {
    12641267             return false;
     
    12801283  /// \see acyclic
    12811284  template <typename Digraph>
    1282   bool dag(const Digraph& graph) {
     1285  bool dag(const Digraph& digraph) {
    12831286
    12841287    checkConcept<concepts::Digraph, Digraph>();
     
    12911294
    12921295    typename Dfs<Digraph>::template SetProcessedMap<ProcessedMap>::
    1293       Create dfs(graph);
    1294 
    1295     ProcessedMap processed(graph);
     1296      Create dfs(digraph);
     1297
     1298    ProcessedMap processed(digraph);
    12961299    dfs.processedMap(processed);
    12971300
    12981301    dfs.init();
    1299     for (NodeIt it(graph); it != INVALID; ++it) {
     1302    for (NodeIt it(digraph); it != INVALID; ++it) {
    13001303      if (!dfs.reached(it)) {
    13011304        dfs.addSource(it);
    13021305        while (!dfs.emptyQueue()) {
    13031306          Arc edge = dfs.nextArc();
    1304           Node target = graph.target(edge);
     1307          Node target = digraph.target(edge);
    13051308          if (dfs.reached(target) && !processed[target]) {
    13061309            return false;
     
    13811384  }
    13821385
    1383   namespace _topology_bits {
     1386  namespace _connectivity_bits {
    13841387
    13851388    template <typename Digraph>
     
    14501453  template<typename Graph>
    14511454  inline bool bipartite(const Graph &graph){
    1452     using namespace _topology_bits;
     1455    using namespace _connectivity_bits;
    14531456
    14541457    checkConcept<concepts::Graph, Graph>();
     
    14901493  template<typename Graph, typename NodeMap>
    14911494  inline bool bipartitePartitions(const Graph &graph, NodeMap &partMap){
    1492     using namespace _topology_bits;
     1495    using namespace _connectivity_bits;
    14931496
    14941497    checkConcept<concepts::Graph, Graph>();
     
    15211524  /// Returns true when there are not loop edges in the graph.
    15221525  template <typename Digraph>
    1523   bool loopFree(const Digraph& graph) {
    1524     for (typename Digraph::ArcIt it(graph); it != INVALID; ++it) {
    1525       if (graph.source(it) == graph.target(it)) return false;
     1526  bool loopFree(const Digraph& digraph) {
     1527    for (typename Digraph::ArcIt it(digraph); it != INVALID; ++it) {
     1528      if (digraph.source(it) == digraph.target(it)) return false;
    15261529    }
    15271530    return true;
     
    15321535  /// Returns true when there are not parallel edges in the graph.
    15331536  template <typename Digraph>
    1534   bool parallelFree(const Digraph& graph) {
    1535     typename Digraph::template NodeMap<bool> reached(graph, false);
    1536     for (typename Digraph::NodeIt n(graph); n != INVALID; ++n) {
    1537       for (typename Digraph::OutArcIt e(graph, n); e != INVALID; ++e) {
    1538         if (reached[graph.target(e)]) return false;
    1539         reached.set(graph.target(e), true);
    1540       }
    1541       for (typename Digraph::OutArcIt e(graph, n); e != INVALID; ++e) {
    1542         reached.set(graph.target(e), false);
     1537  bool parallelFree(const Digraph& digraph) {
     1538    typename Digraph::template NodeMap<bool> reached(digraph, false);
     1539    for (typename Digraph::NodeIt n(digraph); n != INVALID; ++n) {
     1540      for (typename Digraph::OutArcIt a(digraph, n); a != INVALID; ++a) {
     1541        if (reached[digraph.target(a)]) return false;
     1542        reached.set(digraph.target(a), true);
     1543      }
     1544      for (typename Digraph::OutArcIt a(digraph, n); a != INVALID; ++a) {
     1545        reached.set(digraph.target(a), false);
    15431546      }
    15441547    }
     
    15521555  /// the graph.
    15531556  template <typename Digraph>
    1554   bool simpleDigraph(const Digraph& graph) {
    1555     typename Digraph::template NodeMap<bool> reached(graph, false);
    1556     for (typename Digraph::NodeIt n(graph); n != INVALID; ++n) {
     1557  bool simpleDigraph(const Digraph& digraph) {
     1558    typename Digraph::template NodeMap<bool> reached(digraph, false);
     1559    for (typename Digraph::NodeIt n(digraph); n != INVALID; ++n) {
    15571560      reached.set(n, true);
    1558       for (typename Digraph::OutArcIt e(graph, n); e != INVALID; ++e) {
    1559         if (reached[graph.target(e)]) return false;
    1560         reached.set(graph.target(e), true);
    1561       }
    1562       for (typename Digraph::OutArcIt e(graph, n); e != INVALID; ++e) {
    1563         reached.set(graph.target(e), false);
     1561      for (typename Digraph::OutArcIt a(digraph, n); a != INVALID; ++a) {
     1562        if (reached[digraph.target(a)]) return false;
     1563        reached.set(digraph.target(a), true);
     1564      }
     1565      for (typename Digraph::OutArcIt a(digraph, n); a != INVALID; ++a) {
     1566        reached.set(digraph.target(a), false);
    15641567      }
    15651568      reached.set(n, false);
     
    15701573} //namespace lemon
    15711574
    1572 #endif //LEMON_TOPOLOGY_H
     1575#endif //LEMON_CONNECTIVITY_H
  • lemon/core.h

    r319 r440  
    33 * This file is a part of LEMON, a generic C++ optimization library.
    44 *
    5  * Copyright (C) 2003-2008
     5 * Copyright (C) 2003-2009
    66 * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
    77 * (Egervary Research Group on Combinatorial Optimization, EGRES).
     
    11711171    /// Construct a new ConEdgeIt iterating on the edges that
    11721172    /// connects nodes \c u and \c v.
    1173     ConEdgeIt(const Graph& g, Node u, Node v) : _graph(g) {
    1174       Parent::operator=(findEdge(_graph, u, v));
     1173    ConEdgeIt(const Graph& g, Node u, Node v) : _graph(g), _u(u), _v(v) {
     1174      Parent::operator=(findEdge(_graph, _u, _v));
    11751175    }
    11761176
     
    11841184    /// It increments the iterator and gives back the next edge.
    11851185    ConEdgeIt& operator++() {
    1186       Parent::operator=(findEdge(_graph, _graph.u(*this),
    1187                                  _graph.v(*this), *this));
     1186      Parent::operator=(findEdge(_graph, _u, _v, *this));
    11881187      return *this;
    11891188    }
    11901189  private:
    11911190    const Graph& _graph;
     1191    Node _u, _v;
    11921192  };
    11931193
  • lemon/counter.h

    r209 r440  
    33 * This file is a part of LEMON, a generic C++ optimization library.
    44 *
    5  * Copyright (C) 2003-2008
     5 * Copyright (C) 2003-2009
    66 * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
    77 * (Egervary Research Group on Combinatorial Optimization, EGRES).
  • lemon/dfs.h

    r405 r440  
    33 * This file is a part of LEMON, a generic C++ optimization library.
    44 *
    5  * Copyright (C) 2003-2008
     5 * Copyright (C) 2003-2009
    66 * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
    77 * (Egervary Research Group on Combinatorial Optimization, EGRES).
     
    14111411          } else {
    14121412            _visitor->leave(s);
     1413            _visitor->stop(s);
    14131414          }
    14141415        }
     
    16261627    /// \pre Either \ref run(Node) "run()" or \ref init()
    16271628    /// must be called before using this function.
    1628     bool reached(Node v) { return (*_reached)[v]; }
     1629    bool reached(Node v) const { return (*_reached)[v]; }
    16291630
    16301631    ///@}
  • lemon/dijkstra.h

    r408 r440  
    33 * This file is a part of LEMON, a generic C++ optimization library.
    44 *
    5  * Copyright (C) 2003-2008
     5 * Copyright (C) 2003-2009
    66 * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
    77 * (Egervary Research Group on Combinatorial Optimization, EGRES).
  • lemon/dim2.h

    r314 r440  
    33 * This file is a part of LEMON, a generic C++ optimization library.
    44 *
    5  * Copyright (C) 2003-2008
     5 * Copyright (C) 2003-2009
    66 * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
    77 * (Egervary Research Group on Combinatorial Optimization, EGRES).
  • lemon/dimacs.h

    r388 r440  
    33 * This file is a part of LEMON, a generic C++ optimization library.
    44 *
    5  * Copyright (C) 2003-2008
     5 * Copyright (C) 2003-2009
    66 * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
    77 * (Egervary Research Group on Combinatorial Optimization, EGRES).
     
    335335    typedef typename Digraph::ArcIt ArcIt;
    336336
    337     if(!comment.empty()) 
     337    if(!comment.empty())
    338338      os << "c " << comment << std::endl;
    339339    os << "p mat " << g.nodeNum() << " " << g.arcNum() << std::endl;
  • lemon/elevator.h

    r383 r440  
    33 * This file is a part of LEMON, a generic C++ optimization library.
    44 *
    5  * Copyright (C) 2003-2008
     5 * Copyright (C) 2003-2009
    66 * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
    77 * (Egervary Research Group on Combinatorial Optimization, EGRES).
  • lemon/error.h

    r291 r440  
    33 * This file is a part of LEMON, a generic C++ optimization library.
    44 *
    5  * Copyright (C) 2003-2008
     5 * Copyright (C) 2003-2009
    66 * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
    77 * (Egervary Research Group on Combinatorial Optimization, EGRES).
  • lemon/full_graph.h

    r360 r440  
    33 * This file is a part of LEMON, a generic C++ optimization library.
    44 *
    5  * Copyright (C) 2003-2008
     5 * Copyright (C) 2003-2009
    66 * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
    77 * (Egervary Research Group on Combinatorial Optimization, EGRES).
  • lemon/graph_to_eps.h

    r313 r440  
    33 * This file is a part of LEMON, a generic C++ optimization library.
    44 *
    5  * Copyright (C) 2003-2008
     5 * Copyright (C) 2003-2009
    66 * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
    77 * (Egervary Research Group on Combinatorial Optimization, EGRES).
  • lemon/grid_graph.h

    r360 r440  
    33 * This file is a part of LEMON, a generic C++ optimization library.
    44 *
    5  * Copyright (C) 2003-2008
     5 * Copyright (C) 2003-2009
    66 * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
    77 * (Egervary Research Group on Combinatorial Optimization, EGRES).
  • lemon/hao_orlin.h

    r412 r440  
    33 * This file is a part of LEMON, a generic C++ optimization library.
    44 *
    5  * Copyright (C) 2003-2008
     5 * Copyright (C) 2003-2009
    66 * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
    77 * (Egervary Research Group on Combinatorial Optimization, EGRES).
     
    239239          if (reached[t]) continue;
    240240          _sets.push_front(std::list<int>());
    241          
     241
    242242          queue[qlast++] = t;
    243243          reached.set(t, true);
     
    539539          if (reached[t]) continue;
    540540          _sets.push_front(std::list<int>());
    541          
     541
    542542          queue[qlast++] = t;
    543543          reached.set(t, true);
  • lemon/hypercube_graph.h

    r372 r440  
    33 * This file is a part of LEMON, a generic C++ optimization library.
    44 *
    5  * Copyright (C) 2003-2008
     5 * Copyright (C) 2003-2009
    66 * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
    77 * (Egervary Research Group on Combinatorial Optimization, EGRES).
  • lemon/kruskal.h

    r220 r440  
    33 * This file is a part of LEMON, a generic C++ optimization library.
    44 *
    5  * Copyright (C) 2003-2008
     5 * Copyright (C) 2003-2009
    66 * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
    77 * (Egervary Research Group on Combinatorial Optimization, EGRES).
  • lemon/lgf_reader.h

    r319 r440  
    33 * This file is a part of LEMON, a generic C++ optimization library.
    44 *
    5  * Copyright (C) 2003-2008
     5 * Copyright (C) 2003-2009
    66 * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
    77 * (Egervary Research Group on Combinatorial Optimization, EGRES).
     
    871871        readLine();
    872872      }
    873       line.putback(c);
     873      if (readSuccess()) {
     874        line.putback(c);
     875      }
    874876    }
    875877
     
    17001702        readLine();
    17011703      }
    1702       line.putback(c);
     1704      if (readSuccess()) {
     1705        line.putback(c);
     1706      }
    17031707    }
    17041708
     
    22272231        readLine();
    22282232      }
    2229       line.putback(c);
     2233      if (readSuccess()) {
     2234        line.putback(c);
     2235      }
    22302236    }
    22312237
     
    25682574        readLine();
    25692575      }
    2570       line.putback(c);
     2576      if (readSuccess()) {
     2577        line.putback(c);
     2578      }
    25712579    }
    25722580
  • lemon/lgf_writer.h

    r319 r440  
    33 * This file is a part of LEMON, a generic C++ optimization library.
    44 *
    5  * Copyright (C) 2003-2008
     5 * Copyright (C) 2003-2009
    66 * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
    77 * (Egervary Research Group on Combinatorial Optimization, EGRES).
  • lemon/list_graph.h

    r329 r440  
    33 * This file is a part of LEMON, a generic C++ optimization library.
    44 *
    5  * Copyright (C) 2003-2008
     5 * Copyright (C) 2003-2009
    66 * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
    77 * (Egervary Research Group on Combinatorial Optimization, EGRES).
  • lemon/maps.h

    r314 r440  
    33 * This file is a part of LEMON, a generic C++ optimization library.
    44 *
    5  * Copyright (C) 2003-2008
     5 * Copyright (C) 2003-2009
    66 * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
    77 * (Egervary Research Group on Combinatorial Optimization, EGRES).
  • lemon/math.h

    r209 r440  
    33 * This file is a part of LEMON, a generic C++ optimization library.
    44 *
    5  * Copyright (C) 2003-2008
     5 * Copyright (C) 2003-2009
    66 * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
    77 * (Egervary Research Group on Combinatorial Optimization, EGRES).
  • lemon/max_matching.h

    r330 r440  
    33 * This file is a part of LEMON, a generic C++ optimization library.
    44 *
    5  * Copyright (C) 2003-2008
     5 * Copyright (C) 2003-2009
    66 * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
    77 * (Egervary Research Group on Combinatorial Optimization, EGRES).
     
    417417    /// \ref init(), \ref greedyInit() or \ref matchingInit()
    418418    /// functions first, then you can start the algorithm with the \ref
    419     /// startParse() or startDense() functions.
     419    /// startSparse() or startDense() functions.
    420420
    421421    ///@{
  • lemon/nauty_reader.h

    r359 r440  
    33 * This file is a part of LEMON, a generic C++ optimization library.
    44 *
    5  * Copyright (C) 2003-2008
     5 * Copyright (C) 2003-2009
    66 * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
    77 * (Egervary Research Group on Combinatorial Optimization, EGRES).
  • lemon/path.h

    r313 r440  
    33 * This file is a part of LEMON, a generic C++ optimization library.
    44 *
    5  * Copyright (C) 2003-2008
     5 * Copyright (C) 2003-2009
    66 * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
    77 * (Egervary Research Group on Combinatorial Optimization, EGRES).
  • lemon/preflow.h

    r393 r440  
    33 * This file is a part of LEMON, a generic C++ optimization library.
    44 *
    5  * Copyright (C) 2003-2008
     5 * Copyright (C) 2003-2009
    66 * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
    77 * (Egervary Research Group on Combinatorial Optimization, EGRES).
     
    367367    /// \pre Either \ref run() or \ref init() must be called before
    368368    /// using this function.
    369     const Elevator& elevator() {
     369    const Elevator& elevator() const {
    370370      return *_level;
    371371    }
     
    919919    /// \pre Either \ref run() or \ref init() must be called before
    920920    /// using this function.
    921     const FlowMap& flowMap() {
     921    const FlowMap& flowMap() const {
    922922      return *_flow;
    923923    }
  • lemon/random.cc

    r209 r440  
    33 * This file is a part of LEMON, a generic C++ optimization library.
    44 *
    5  * Copyright (C) 2003-2008
     5 * Copyright (C) 2003-2009
    66 * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
    77 * (Egervary Research Group on Combinatorial Optimization, EGRES).
  • lemon/random.h

    r378 r440  
    33 * This file is a part of LEMON, a generic C++ optimization library.
    44 *
    5  * Copyright (C) 2003-2008
     5 * Copyright (C) 2003-2009
    66 * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
    77 * (Egervary Research Group on Combinatorial Optimization, EGRES).
  • lemon/smart_graph.h

    r375 r440  
    33 * This file is a part of LEMON, a generic C++ optimization library.
    44 *
    5  * Copyright (C) 2003-2008
     5 * Copyright (C) 2003-2009
    66 * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
    77 * (Egervary Research Group on Combinatorial Optimization, EGRES).
  • lemon/suurballe.h

    r346 r440  
    1 /* -*- C++ -*-
     1/* -*- mode: C++; indent-tabs-mode: nil; -*-
    22 *
    3  * This file is a part of LEMON, a generic C++ optimization library
     3 * This file is a part of LEMON, a generic C++ optimization library.
    44 *
    5  * Copyright (C) 2003-2008
     5 * Copyright (C) 2003-2009
    66 * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
    77 * (Egervary Research Group on Combinatorial Optimization, EGRES).
     
    5252  ///
    5353  /// \note For finding node-disjoint paths this algorithm can be used
    54   /// with \ref SplitDigraphAdaptor.
     54  /// with \ref SplitNodes.
    5555#ifdef DOXYGEN
    5656  template <typename Digraph, typename LengthMap>
     
    7777
    7878  private:
    79  
     79
    8080    /// \brief Special implementation of the Dijkstra algorithm
    8181    /// for finding shortest paths in the residual network.
     
    107107      // The processed (i.e. permanently labeled) nodes
    108108      std::vector<Node> _proc_nodes;
    109      
     109
    110110      Node _s;
    111111      Node _t;
     
    201201    // The length map
    202202    const LengthMap &_length;
    203    
     203
    204204    // Arc map of the current flow
    205205    FlowMap *_flow;
     
    269269    /// This function sets the potential map.
    270270    ///
    271     /// The potentials provide the dual solution of the underlying 
     271    /// The potentials provide the dual solution of the underlying
    272272    /// minimum cost flow problem.
    273273    ///
     
    331331      for (NodeIt n(_graph); n != INVALID; ++n) (*_potential)[n] = 0;
    332332
    333       _dijkstra = new ResidualDijkstra( _graph, *_flow, _length, 
     333      _dijkstra = new ResidualDijkstra( _graph, *_flow, _length,
    334334                                        *_potential, _pred,
    335335                                        _source, _target );
     
    371371      return _path_num;
    372372    }
    373    
     373
    374374    /// \brief Compute the paths from the flow.
    375375    ///
  • lemon/time_measure.h

    r314 r440  
    33 * This file is a part of LEMON, a generic C++ optimization library.
    44 *
    5  * Copyright (C) 2003-2008
     5 * Copyright (C) 2003-2009
    66 * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
    77 * (Egervary Research Group on Combinatorial Optimization, EGRES).
  • lemon/tolerance.h

    r280 r440  
    33 * This file is a part of LEMON, a generic C++ optimization library.
    44 *
    5  * Copyright (C) 2003-2008
     5 * Copyright (C) 2003-2009
    66 * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
    77 * (Egervary Research Group on Combinatorial Optimization, EGRES).
  • lemon/unionfind.h

    r236 r440  
    33 * This file is a part of LEMON, a generic C++ optimization library.
    44 *
    5  * Copyright (C) 2003-2008
     5 * Copyright (C) 2003-2009
    66 * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
    77 * (Egervary Research Group on Combinatorial Optimization, EGRES).
     
    11781178            if (nodes[nodes[jd].next].size < cmax) {
    11791179              pushLeft(nodes[jd].next, nodes[jd].left);
    1180               if (less(nodes[jd].left, nodes[jd].next)) {
    1181                 nodes[nodes[jd].next].prio = nodes[nodes[jd].left].prio;
    1182                 nodes[nodes[jd].next].item = nodes[nodes[jd].left].item;
     1180              if (less(jd, nodes[jd].next) ||
     1181                  nodes[jd].item == nodes[pd].item) {
     1182                nodes[nodes[jd].next].prio = nodes[jd].prio;
     1183                nodes[nodes[jd].next].item = nodes[jd].item;
    11831184              }
    11841185              popLeft(pd);
     
    11891190              popLeft(nodes[jd].next);
    11901191              pushRight(jd, ld);
    1191               if (less(ld, nodes[jd].left)) {
     1192              if (less(ld, nodes[jd].left) ||
     1193                  nodes[ld].item == nodes[pd].item) {
    11921194                nodes[jd].item = nodes[ld].item;
    1193                 nodes[jd].prio = nodes[jd].prio;
     1195                nodes[jd].prio = nodes[ld].prio;
    11941196              }
    11951197              if (nodes[nodes[jd].next].item == nodes[ld].item) {
     
    12201222            if (nodes[nodes[jd].prev].size < cmax) {
    12211223              pushRight(nodes[jd].prev, nodes[jd].right);
    1222               if (less(nodes[jd].right, nodes[jd].prev)) {
    1223                 nodes[nodes[jd].prev].prio = nodes[nodes[jd].right].prio;
    1224                 nodes[nodes[jd].prev].item = nodes[nodes[jd].right].item;
     1224              if (less(jd, nodes[jd].prev) ||
     1225                  nodes[jd].item == nodes[pd].item) {
     1226                nodes[nodes[jd].prev].prio = nodes[jd].prio;
     1227                nodes[nodes[jd].prev].item = nodes[jd].item;
    12251228              }
    12261229              popRight(pd);
     
    12311234              popRight(nodes[jd].prev);
    12321235              pushLeft(jd, ld);
    1233               if (less(ld, nodes[jd].right)) {
     1236              if (less(ld, nodes[jd].right) ||
     1237                  nodes[ld].item == nodes[pd].item) {
    12341238                nodes[jd].item = nodes[ld].item;
    1235                 nodes[jd].prio = nodes[jd].prio;
     1239                nodes[jd].prio = nodes[ld].prio;
    12361240              }
    12371241              if (nodes[nodes[jd].prev].item == nodes[ld].item) {
     
    12511255      return comp(nodes[id].prio, nodes[jd].prio);
    12521256    }
    1253 
    1254     bool equal(int id, int jd) const {
    1255       return !less(id, jd) && !less(jd, id);
    1256     }
    1257 
    12581257
    12591258  public:
     
    14011400              push(new_id, right_id);
    14021401              pushRight(new_id, ~(classes[r].parent));
    1403               setPrio(new_id);
     1402
     1403              if (less(~classes[r].parent, right_id)) {
     1404                nodes[new_id].item = nodes[~classes[r].parent].item;
     1405                nodes[new_id].prio = nodes[~classes[r].parent].prio;
     1406              } else {
     1407                nodes[new_id].item = nodes[right_id].item;
     1408                nodes[new_id].prio = nodes[right_id].prio;
     1409              }
    14041410
    14051411              id = nodes[id].parent;
     
    14411447              push(new_id, left_id);
    14421448              pushLeft(new_id, ~(classes[l].parent));
    1443               setPrio(new_id);
     1449
     1450              if (less(~classes[l].parent, left_id)) {
     1451                nodes[new_id].item = nodes[~classes[l].parent].item;
     1452                nodes[new_id].prio = nodes[~classes[l].parent].prio;
     1453              } else {
     1454                nodes[new_id].item = nodes[left_id].item;
     1455                nodes[new_id].prio = nodes[left_id].prio;
     1456              }
    14441457
    14451458              id = nodes[id].parent;
  • scripts/chg-len.py

    r376 r422  
    44
    55from mercurial import ui, hg
     6from mercurial import util
     7
     8util.rcpath = lambda : []
    69
    710if len(sys.argv)>1 and sys.argv[1] in ["-h","--help"]:
  • test/CMakeLists.txt

    r410 r445  
    55SET(TESTS
    66  bfs_test
     7  circulation_test
    78  counter_test
    89  dfs_test
     
    1112  dim_test
    1213  error_test
     14  graph_adaptor_test
    1315  graph_copy_test
    1416  graph_test
     
    1921  maps_test
    2022  max_matching_test
     23  radix_sort_test
     24  path_test
     25  preflow_test
    2126  random_test
    22   path_test
     27  suurballe_test
    2328  time_measure_test
    2429  unionfind_test)
  • test/Makefile.am

    r418 r445  
    11EXTRA_DIST += \
    2         test/CMakeLists.txt \
    3         test/min_cost_flow_test.lgf \
    4         test/preflow_graph.lgf
     2        test/CMakeLists.txt
    53
    64noinst_HEADERS += \
    75        test/graph_test.h \
    8         test/test_tools.h
     6        test/test_tools.h
    97
    108check_PROGRAMS += \
    119        test/bfs_test \
    12         test/circulation_test \
    13         test/counter_test \
     10        test/circulation_test \
     11        test/counter_test \
    1412        test/dfs_test \
    1513        test/digraph_test \
    1614        test/dijkstra_test \
    17         test/dim_test \
     15        test/dim_test \
    1816        test/error_test \
    1917        test/graph_adaptor_test \
     
    2119        test/graph_test \
    2220        test/graph_utils_test \
     21        test/hao_orlin_test \
    2322        test/heap_test \
    2423        test/kruskal_test \
    25         test/hao_orlin_test \
    26         test/maps_test \
     24        test/maps_test \
    2725        test/max_matching_test \
    28         test/random_test \
    29         test/path_test \
    30         test/preflow_test \
    31         test/suurballe_test \
    32         test/test_tools_fail \
    33         test/test_tools_pass \
    34         test/time_measure_test \
     26        test/path_test \
     27        test/preflow_test \
     28        test/radix_sort_test \
     29        test/random_test \
     30        test/suurballe_test \
     31        test/test_tools_fail \
     32        test/test_tools_pass \
     33        test/time_measure_test \
    3534        test/unionfind_test
    3635
     
    5756test_path_test_SOURCES = test/path_test.cc
    5857test_preflow_test_SOURCES = test/preflow_test.cc
     58test_radix_sort_test_SOURCES = test/radix_sort_test.cc
    5959test_suurballe_test_SOURCES = test/suurballe_test.cc
    6060test_random_test_SOURCES = test/random_test.cc
  • test/bfs_test.cc

    r293 r440  
    33 * This file is a part of LEMON, a generic C++ optimization library.
    44 *
    5  * Copyright (C) 2003-2008
     5 * Copyright (C) 2003-2009
    66 * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
    77 * (Egervary Research Group on Combinatorial Optimization, EGRES).
  • test/circulation_test.cc

    r403 r440  
    33 * This file is a part of LEMON, a generic C++ optimization library.
    44 *
    5  * Copyright (C) 2003-2008
     5 * Copyright (C) 2003-2009
    66 * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
    77 * (Egervary Research Group on Combinatorial Optimization, EGRES).
  • test/counter_test.cc

    r209 r440  
    33 * This file is a part of LEMON, a generic C++ optimization library.
    44 *
    5  * Copyright (C) 2003-2008
     5 * Copyright (C) 2003-2009
    66 * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
    77 * (Egervary Research Group on Combinatorial Optimization, EGRES).
  • test/dfs_test.cc

    r293 r440  
    33 * This file is a part of LEMON, a generic C++ optimization library.
    44 *
    5  * Copyright (C) 2003-2008
     5 * Copyright (C) 2003-2009
    66 * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
    77 * (Egervary Research Group on Combinatorial Optimization, EGRES).
  • test/digraph_test.cc

    r375 r440  
    33 * This file is a part of LEMON, a generic C++ optimization library.
    44 *
    5  * Copyright (C) 2003-2008
     5 * Copyright (C) 2003-2009
    66 * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
    77 * (Egervary Research Group on Combinatorial Optimization, EGRES).
  • test/dijkstra_test.cc

    r397 r440  
    33 * This file is a part of LEMON, a generic C++ optimization library.
    44 *
    5  * Copyright (C) 2003-2008
     5 * Copyright (C) 2003-2009
    66 * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
    77 * (Egervary Research Group on Combinatorial Optimization, EGRES).
  • test/dim_test.cc

    r253 r440  
    33 * This file is a part of LEMON, a generic C++ optimization library.
    44 *
    5  * Copyright (C) 2003-2008
     5 * Copyright (C) 2003-2009
    66 * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
    77 * (Egervary Research Group on Combinatorial Optimization, EGRES).
  • test/error_test.cc

    r277 r440  
    33 * This file is a part of LEMON, a generic C++ optimization library.
    44 *
    5  * Copyright (C) 2003-2008
     5 * Copyright (C) 2003-2009
    66 * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
    77 * (Egervary Research Group on Combinatorial Optimization, EGRES).
  • test/graph_adaptor_test.cc

    r416 r440  
    33 * This file is a part of LEMON, a generic C++ optimization library.
    44 *
    5  * Copyright (C) 2003-2008
     5 * Copyright (C) 2003-2009
    66 * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
    77 * (Egervary Research Group on Combinatorial Optimization, EGRES).
     
    104104  node_filter[n1] = node_filter[n2] = node_filter[n3] = true;
    105105  arc_filter[a1] = arc_filter[a2] = arc_filter[a3] = true;
    106  
     106
    107107  checkGraphNodeList(adaptor, 3);
    108108  checkGraphArcList(adaptor, 3);
     
    197197
    198198  node_filter[n1] = node_filter[n2] = node_filter[n3] = true;
    199  
     199
    200200  checkGraphNodeList(adaptor, 3);
    201201  checkGraphArcList(adaptor, 3);
     
    269269
    270270  arc_filter[a1] = arc_filter[a2] = arc_filter[a3] = true;
    271  
     271
    272272  checkGraphNodeList(adaptor, 3);
    273273  checkGraphArcList(adaptor, 3);
     
    578578  node_filter[n1] = node_filter[n2] = node_filter[n3] = node_filter[n4] = true;
    579579  edge_filter[e1] = edge_filter[e2] = edge_filter[e3] = edge_filter[e4] = true;
    580  
     580
    581581  checkGraphNodeList(adaptor, 4);
    582582  checkGraphArcList(adaptor, 8);
     
    709709
    710710  node_filter[n1] = node_filter[n2] = node_filter[n3] = node_filter[n4] = true;
    711  
     711
    712712  checkGraphNodeList(adaptor, 4);
    713713  checkGraphArcList(adaptor, 8);
     
    808808
    809809  edge_filter[e1] = edge_filter[e2] = edge_filter[e3] = edge_filter[e4] = true;
    810  
     810
    811811  checkGraphNodeList(adaptor, 4);
    812812  checkGraphArcList(adaptor, 8);
  • test/graph_copy_test.cc

    r282 r440  
    33 * This file is a part of LEMON, a generic C++ optimization library.
    44 *
    5  * Copyright (C) 2003-2008
     5 * Copyright (C) 2003-2009
    66 * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
    77 * (Egervary Research Group on Combinatorial Optimization, EGRES).
  • test/graph_test.cc

    r375 r440  
    33 * This file is a part of LEMON, a generic C++ optimization library.
    44 *
    5  * Copyright (C) 2003-2008
     5 * Copyright (C) 2003-2009
    66 * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
    77 * (Egervary Research Group on Combinatorial Optimization, EGRES).
  • test/graph_test.h

    r374 r440  
    33 * This file is a part of LEMON, a generic C++ optimization library.
    44 *
    5  * Copyright (C) 2003-2008
     5 * Copyright (C) 2003-2009
    66 * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
    77 * (Egervary Research Group on Combinatorial Optimization, EGRES).
  • test/graph_utils_test.cc

    r220 r440  
    33 * This file is a part of LEMON, a generic C++ optimization library.
    44 *
    5  * Copyright (C) 2003-2008
     5 * Copyright (C) 2003-2009
    66 * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
    77 * (Egervary Research Group on Combinatorial Optimization, EGRES).
  • test/hao_orlin_test.cc

    r410 r440  
    33 * This file is a part of LEMON, a generic C++ optimization library.
    44 *
    5  * Copyright (C) 2003-2008
     5 * Copyright (C) 2003-2009
    66 * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
    77 * (Egervary Research Group on Combinatorial Optimization, EGRES).
  • test/heap_test.cc

    r293 r440  
    33 * This file is a part of LEMON, a generic C++ optimization library.
    44 *
    5  * Copyright (C) 2003-2008
     5 * Copyright (C) 2003-2009
    66 * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
    77 * (Egervary Research Group on Combinatorial Optimization, EGRES).
  • test/kruskal_test.cc

    r209 r440  
    33 * This file is a part of LEMON, a generic C++ optimization library.
    44 *
    5  * Copyright (C) 2003-2008
     5 * Copyright (C) 2003-2009
    66 * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
    77 * (Egervary Research Group on Combinatorial Optimization, EGRES).
  • test/maps_test.cc

    r210 r440  
    33 * This file is a part of LEMON, a generic C++ optimization library.
    44 *
    5  * Copyright (C) 2003-2008
     5 * Copyright (C) 2003-2009
    66 * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
    77 * (Egervary Research Group on Combinatorial Optimization, EGRES).
  • test/max_matching_test.cc

    r327 r440  
    33 * This file is a part of LEMON, a generic C++ optimization library.
    44 *
    5  * Copyright (C) 2003-2008
     5 * Copyright (C) 2003-2009
    66 * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
    77 * (Egervary Research Group on Combinatorial Optimization, EGRES).
  • test/path_test.cc

    r209 r440  
    33 * This file is a part of LEMON, a generic C++ optimization library.
    44 *
    5  * Copyright (C) 2003-2008
     5 * Copyright (C) 2003-2009
    66 * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
    77 * (Egervary Research Group on Combinatorial Optimization, EGRES).
  • test/preflow_test.cc

    r394 r440  
    33 * This file is a part of LEMON, a generic C++ optimization library.
    44 *
    5  * Copyright (C) 2003-2008
     5 * Copyright (C) 2003-2009
    66 * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
    77 * (Egervary Research Group on Combinatorial Optimization, EGRES).
     
    1717 */
    1818
    19 #include <fstream>
    20 #include <string>
     19#include <iostream>
    2120
    2221#include "test_tools.h"
     
    2928
    3029using namespace lemon;
     30
     31char test_lgf[] =
     32  "@nodes\n"
     33  "label\n"
     34  "0\n"
     35  "1\n"
     36  "2\n"
     37  "3\n"
     38  "4\n"
     39  "5\n"
     40  "6\n"
     41  "7\n"
     42  "8\n"
     43  "9\n"
     44  "@arcs\n"
     45  "    label capacity\n"
     46  "0 1 0     20\n"
     47  "0 2 1     0\n"
     48  "1 1 2     3\n"
     49  "1 2 3     8\n"
     50  "1 3 4     8\n"
     51  "2 5 5     5\n"
     52  "3 2 6     5\n"
     53  "3 5 7     5\n"
     54  "3 6 8     5\n"
     55  "4 3 9     3\n"
     56  "5 7 10    3\n"
     57  "5 6 11    10\n"
     58  "5 8 12    10\n"
     59  "6 8 13    8\n"
     60  "8 9 14    20\n"
     61  "8 1 15    5\n"
     62  "9 5 16    5\n"
     63  "@attributes\n"
     64  "source 1\n"
     65  "target 8\n";
    3166
    3267void checkPreflowCompile()
     
    124159  typedef Preflow<Digraph, CapMap> PType;
    125160
    126   std::string f_name;
    127   if( getenv("srcdir") )
    128     f_name = std::string(getenv("srcdir"));
    129   else f_name = ".";
    130   f_name += "/test/preflow_graph.lgf";
    131 
    132   std::ifstream file(f_name.c_str());
    133 
    134   check(file, "Input file '" << f_name << "' not found.");
    135 
    136161  Digraph g;
    137162  Node s, t;
    138163  CapMap cap(g);
    139   DigraphReader<Digraph>(g,file).
     164  std::istringstream input(test_lgf);
     165  DigraphReader<Digraph>(g,input).
    140166    arcMap("capacity", cap).
    141167    node("source",s).
  • test/random_test.cc

    r209 r440  
    33 * This file is a part of LEMON, a generic C++ optimization library.
    44 *
    5  * Copyright (C) 2003-2008
     5 * Copyright (C) 2003-2009
    66 * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
    77 * (Egervary Research Group on Combinatorial Optimization, EGRES).
  • test/suurballe_test.cc

    r346 r440  
    1 /* -*- C++ -*-
     1/* -*- mode: C++; indent-tabs-mode: nil; -*-
    22 *
    3  * This file is a part of LEMON, a generic C++ optimization library
     3 * This file is a part of LEMON, a generic C++ optimization library.
    44 *
    5  * Copyright (C) 2003-2008
     5 * Copyright (C) 2003-2009
    66 * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
    77 * (Egervary Research Group on Combinatorial Optimization, EGRES).
     
    1818
    1919#include <iostream>
    20 #include <fstream>
    2120
    2221#include <lemon/list_graph.h>
     
    2928using namespace lemon;
    3029
     30char test_lgf[] =
     31  "@nodes\n"
     32  "label supply1 supply2 supply3\n"
     33  "1     0        20      27\n"
     34  "2     0       -4        0\n"
     35  "3     0        0        0\n"
     36  "4     0        0        0\n"
     37  "5     0        9        0\n"
     38  "6     0       -6        0\n"
     39  "7     0        0        0\n"
     40  "8     0        0        0\n"
     41  "9     0        3        0\n"
     42  "10    0       -2        0\n"
     43  "11    0        0        0\n"
     44  "12    0       -20     -27\n"
     45  "@arcs\n"
     46  "      cost capacity lower1 lower2\n"
     47  " 1  2  70  11       0      8\n"
     48  " 1  3 150   3       0      1\n"
     49  " 1  4  80  15       0      2\n"
     50  " 2  8  80  12       0      0\n"
     51  " 3  5 140   5       0      3\n"
     52  " 4  6  60  10       0      1\n"
     53  " 4  7  80   2       0      0\n"
     54  " 4  8 110   3       0      0\n"
     55  " 5  7  60  14       0      0\n"
     56  " 5 11 120  12       0      0\n"
     57  " 6  3   0   3       0      0\n"
     58  " 6  9 140   4       0      0\n"
     59  " 6 10  90   8       0      0\n"
     60  " 7  1  30   5       0      0\n"
     61  " 8 12  60  16       0      4\n"
     62  " 9 12  50   6       0      0\n"
     63  "10 12  70  13       0      5\n"
     64  "10  2 100   7       0      0\n"
     65  "10  7  60  10       0      0\n"
     66  "11 10  20  14       0      6\n"
     67  "12 11  30  10       0      0\n"
     68  "@attributes\n"
     69  "source  1\n"
     70  "target 12\n"
     71  "@end\n";
     72
    3173// Check the feasibility of the flow
    3274template <typename Digraph, typename FlowMap>
    33 bool checkFlow( const Digraph& gr, const FlowMap& flow, 
     75bool checkFlow( const Digraph& gr, const FlowMap& flow,
    3476                typename Digraph::Node s, typename Digraph::Node t,
    3577                int value )
     
    5496
    5597// Check the optimalitiy of the flow
    56 template < typename Digraph, typename CostMap, 
     98template < typename Digraph, typename CostMap,
    5799           typename FlowMap, typename PotentialMap >
    58100bool checkOptimality( const Digraph& gr, const CostMap& cost,
     
    97139  Node source, target;
    98140
    99   std::string fname;
    100   if(getenv("srcdir"))
    101     fname = std::string(getenv("srcdir"));
    102   else fname = ".";
    103   fname += "/test/min_cost_flow_test.lgf";
    104 
    105   std::ifstream input(fname.c_str());
    106   check(input, "Input file '" << fname << "' not found");
     141  std::istringstream input(test_lgf);
    107142  DigraphReader<ListDigraph>(digraph, input).
    108143    arcMap("cost", length).
     
    110145    node("target", target).
    111146    run();
    112   input.close();
    113  
     147
    114148  // Find 2 paths
    115149  {
     
    119153          "The flow is not feasible");
    120154    check(suurballe.totalLength() == 510, "The flow is not optimal");
    121     check(checkOptimality(digraph, length, suurballe.flowMap(), 
     155    check(checkOptimality(digraph, length, suurballe.flowMap(),
    122156                          suurballe.potentialMap()),
    123157          "Wrong potentials");
     
    134168          "The flow is not feasible");
    135169    check(suurballe.totalLength() == 1040, "The flow is not optimal");
    136     check(checkOptimality(digraph, length, suurballe.flowMap(), 
     170    check(checkOptimality(digraph, length, suurballe.flowMap(),
    137171                          suurballe.potentialMap()),
    138172          "Wrong potentials");
     
    149183          "The flow is not feasible");
    150184    check(suurballe.totalLength() == 1040, "The flow is not optimal");
    151     check(checkOptimality(digraph, length, suurballe.flowMap(), 
     185    check(checkOptimality(digraph, length, suurballe.flowMap(),
    152186                          suurballe.potentialMap()),
    153187          "Wrong potentials");
  • test/test_tools.h

    r209 r440  
    33 * This file is a part of LEMON, a generic C++ optimization library.
    44 *
    5  * Copyright (C) 2003-2008
     5 * Copyright (C) 2003-2009
    66 * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
    77 * (Egervary Research Group on Combinatorial Optimization, EGRES).
  • test/test_tools_fail.cc

    r209 r440  
    33 * This file is a part of LEMON, a generic C++ optimization library.
    44 *
    5  * Copyright (C) 2003-2008
     5 * Copyright (C) 2003-2009
    66 * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
    77 * (Egervary Research Group on Combinatorial Optimization, EGRES).
  • test/test_tools_pass.cc

    r209 r440  
    33 * This file is a part of LEMON, a generic C++ optimization library.
    44 *
    5  * Copyright (C) 2003-2008
     5 * Copyright (C) 2003-2009
    66 * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
    77 * (Egervary Research Group on Combinatorial Optimization, EGRES).
  • test/time_measure_test.cc

    r209 r440  
    33 * This file is a part of LEMON, a generic C++ optimization library.
    44 *
    5  * Copyright (C) 2003-2008
     5 * Copyright (C) 2003-2009
    66 * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
    77 * (Egervary Research Group on Combinatorial Optimization, EGRES).
  • test/unionfind_test.cc

    r209 r440  
    33 * This file is a part of LEMON, a generic C++ optimization library.
    44 *
    5  * Copyright (C) 2003-2008
     5 * Copyright (C) 2003-2009
    66 * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
    77 * (Egervary Research Group on Combinatorial Optimization, EGRES).
  • tools/dimacs-to-lgf.cc

    r387 r440  
    33 * This file is a part of LEMON, a generic C++ optimization library.
    44 *
    5  * Copyright (C) 2003-2008
     5 * Copyright (C) 2003-2009
    66 * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
    77 * (Egervary Research Group on Combinatorial Optimization, EGRES).
Note: See TracChangeset for help on using the changeset viewer.