COIN-OR::LEMON - Graph Library

Changes in / [468:68fe66e2b34a:469:04c0631fd332] in lemon-main


Ignore:
Files:
20 added
3 deleted
112 edited

Legend:

Unmodified
Added
Removed
  • .hgignore

    r385 r456  
    2727.deps/*
    2828demo/*.eps
     29m4/libtool.m4
     30m4/ltoptions.m4
     31m4/ltsugar.m4
     32m4/ltversion.m4
     33m4/lt~obsolete.m4
    2934
    3035syntax: regexp
  • 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).
  • configure.ac

    r363 r459  
    5151
    5252dnl Checks for libraries.
    53 #LX_CHECK_GLPK
    54 #LX_CHECK_CPLEX
    55 #LX_CHECK_SOPLEX
     53LX_CHECK_GLPK
     54LX_CHECK_CPLEX
     55LX_CHECK_SOPLEX
     56LX_CHECK_CLP
     57
     58AM_CONDITIONAL([HAVE_LP], [test x"$lx_lp_found" = x"yes"])
     59AM_CONDITIONAL([HAVE_MIP], [test x"$lx_mip_found" = x"yes"])
    5660
    5761dnl Disable/enable building the demo programs.
     
    115119echo C++ compiles flags............ : $WARNINGCXXFLAGS $CXXFLAGS
    116120echo
    117 #echo GLPK support.................. : $lx_glpk_found
    118 #echo CPLEX support................. : $lx_cplex_found
    119 #echo SOPLEX support................ : $lx_soplex_found
    120 #echo
     121echo GLPK support.................. : $lx_glpk_found
     122echo CPLEX support................. : $lx_cplex_found
     123echo SOPLEX support................ : $lx_soplex_found
     124echo CLP support................... : $lx_clp_found
     125echo
    121126echo Build demo programs........... : $enable_demo
    122127echo Build additional tools........ : $enable_tools
  • 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

    r418 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).
     
    6363
    6464/**
    65 @defgroup graph_adaptors Adaptor Classes for graphs
     65@defgroup graph_adaptors Adaptor Classes for Graphs
    6666@ingroup graphs
    67 \brief This group contains several adaptor classes for digraphs and graphs
     67\brief Adaptor classes for digraphs and graphs
     68
     69This group contains several useful adaptor classes for digraphs and graphs.
    6870
    6971The main parts of LEMON are the different graph structures, generic
    70 graph algorithms, graph concepts which couple these, and graph
     72graph algorithms, graph concepts, which couple them, and graph
    7173adaptors. While the previous notions are more or less clear, the
    7274latter one needs further explanation. Graph adaptors are graph classes
     
    7476
    7577A short example makes this much clearer.  Suppose that we have an
    76 instance \c g of a directed graph type say ListDigraph and an algorithm
     78instance \c g of a directed graph type, say ListDigraph and an algorithm
    7779\code
    7880template <typename Digraph>
     
    8284(in time or in memory usage) to copy \c g with the reversed
    8385arcs.  In this case, an adaptor class is used, which (according
    84 to LEMON digraph concepts) works as a digraph.  The adaptor uses the
    85 original digraph structure and digraph operations when methods of the
    86 reversed oriented graph are called.  This means that the adaptor have
    87 minor memory usage, and do not perform sophisticated algorithmic
     86to LEMON \ref concepts::Digraph "digraph concepts") works as a digraph.
     87The adaptor uses the original digraph structure and digraph operations when
     88methods of the reversed oriented graph are called.  This means that the adaptor
     89have minor memory usage, and do not perform sophisticated algorithmic
    8890actions.  The purpose of it is to give a tool for the cases when a
    8991graph have to be used in a specific alteration.  If this alteration is
    90 obtained by a usual construction like filtering the arc-set or
     92obtained by a usual construction like filtering the node or the arc set or
    9193considering a new orientation, then an adaptor is worthwhile to use.
    9294To come back to the reverse oriented graph, in this situation
     
    9799\code
    98100ListDigraph g;
    99 ReverseDigraph<ListGraph> rg(g);
     101ReverseDigraph<ListDigraph> rg(g);
    100102int result = algorithm(rg);
    101103\endcode
    102 After running the algorithm, the original graph \c g is untouched.
    103 This techniques gives rise to an elegant code, and based on stable
     104During running the algorithm, the original digraph \c g is untouched.
     105This techniques give rise to an elegant code, and based on stable
    104106graph adaptors, complex algorithms can be implemented easily.
    105107
    106 In flow, circulation and bipartite matching problems, the residual
     108In flow, circulation and matching problems, the residual
    107109graph is of particular importance. Combining an adaptor implementing
    108 this, shortest path algorithms and minimum mean cycle algorithms,
     110this with shortest path algorithms or minimum mean cycle algorithms,
    109111a range of weighted and cardinality optimization algorithms can be
    110112obtained. For other examples, the interested user is referred to the
     
    113115The behavior of graph adaptors can be very different. Some of them keep
    114116capabilities of the original graph while in other cases this would be
    115 meaningless. This means that the concepts that they are models of depend
    116 on the graph adaptor, and the wrapped graph(s).
    117 If an arc of \c rg is deleted, this is carried out by deleting the
    118 corresponding arc of \c g, thus the adaptor modifies the original graph.
    119 
    120 But for a residual graph, this operation has no sense.
     117meaningless. This means that the concepts that they meet depend
     118on the graph adaptor, and the wrapped graph.
     119For example, if an arc of a reversed digraph is deleted, this is carried
     120out by deleting the corresponding arc of the original digraph, thus the
     121adaptor modifies the original digraph.
     122However in case of a residual digraph, this operation has no sense.
     123
    121124Let us stand one more example here to simplify your work.
    122 RevGraphAdaptor has constructor
     125ReverseDigraph has constructor
    123126\code
    124127ReverseDigraph(Digraph& digraph);
    125128\endcode
    126 This means that in a situation, when a <tt>const ListDigraph&</tt>
     129This means that in a situation, when a <tt>const %ListDigraph&</tt>
    127130reference to a graph is given, then it have to be instantiated with
    128 <tt>Digraph=const ListDigraph</tt>.
     131<tt>Digraph=const %ListDigraph</tt>.
    129132\code
    130133int algorithm1(const ListDigraph& g) {
    131   RevGraphAdaptor<const ListDigraph> rg(g);
     134  ReverseDigraph<const ListDigraph> rg(g);
    132135  return algorithm2(rg);
    133136}
  • 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

    r468 r469  
    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/lp_base.cc \
     14        lemon/lp_skeleton.cc \
     15        lemon/random.cc
    1416
    15 #lemon_libemon_la_CXXFLAGS = $(GLPK_CFLAGS) $(CPLEX_CFLAGS) $(SOPLEX_CXXFLAGS) $(AM_CXXFLAGS)
    16 #lemon_libemon_la_LDFLAGS = $(GLPK_LIBS) $(CPLEX_LIBS) $(SOPLEX_LIBS)
     17
     18lemon_libemon_la_CXXFLAGS = \
     19        $(GLPK_CFLAGS) \
     20        $(CPLEX_CFLAGS) \
     21        $(SOPLEX_CXXFLAGS) \
     22        $(CLP_CXXFLAGS)
     23
     24lemon_libemon_la_LDFLAGS = \
     25        $(GLPK_LIBS) \
     26        $(CPLEX_LIBS) \
     27        $(SOPLEX_LIBS) \
     28        $(CLP_LIBS)
     29
     30if HAVE_GLPK
     31lemon_libemon_la_SOURCES += lemon/glpk.cc
     32endif
     33
     34if HAVE_CPLEX
     35lemon_libemon_la_SOURCES += lemon/cplex.cc
     36endif
     37
     38if HAVE_SOPLEX
     39lemon_libemon_la_SOURCES += lemon/soplex.cc
     40endif
     41
     42if HAVE_CLP
     43lemon_libemon_la_SOURCES += lemon/clp.cc
     44endif
    1745
    1846lemon_HEADERS += \
    1947        lemon/adaptors.h \
    20         lemon/arg_parser.h \
     48        lemon/arg_parser.h \
    2149        lemon/assert.h \
    22         lemon/bfs.h \
    23         lemon/bin_heap.h \
    24         lemon/circulation.h \
    25         lemon/color.h \
     50        lemon/bfs.h \
     51        lemon/bin_heap.h \
     52        lemon/circulation.h \
     53        lemon/clp.h \
     54        lemon/color.h \
    2655        lemon/concept_check.h \
    27         lemon/counter.h \
     56        lemon/counter.h \
    2857        lemon/core.h \
    29         lemon/dfs.h \
    30         lemon/dijkstra.h \
    31         lemon/dim2.h \
    32         lemon/dimacs.h \
     58        lemon/cplex.h \
     59        lemon/dfs.h \
     60        lemon/dijkstra.h \
     61        lemon/dim2.h \
     62        lemon/dimacs.h \
    3363        lemon/edge_set.h \
    3464        lemon/elevator.h \
    3565        lemon/error.h \
    3666        lemon/full_graph.h \
    37         lemon/graph_to_eps.h \
    38         lemon/grid_graph.h \
     67        lemon/glpk.h \
     68        lemon/graph_to_eps.h \
     69        lemon/grid_graph.h \
    3970        lemon/hypercube_graph.h \
    4071        lemon/kruskal.h \
     
    4273        lemon/lgf_reader.h \
    4374        lemon/lgf_writer.h \
     75        lemon/list_graph.h \
     76        lemon/lp.h \
     77        lemon/lp_base.h \
     78        lemon/lp_skeleton.h \
    4479        lemon/list_graph.h \
    4580        lemon/maps.h \
     
    4984        lemon/path.h \
    5085        lemon/preflow.h \
    51         lemon/random.h \
     86        lemon/radix_sort.h \
     87        lemon/random.h \
    5288        lemon/smart_graph.h \
     89        lemon/soplex.h \
    5390        lemon/suurballe.h \
    54         lemon/time_measure.h \
    55         lemon/tolerance.h \
     91        lemon/time_measure.h \
     92        lemon/tolerance.h \
    5693        lemon/unionfind.h
    5794
     
    6097        lemon/bits/array_map.h \
    6198        lemon/bits/base_extender.h \
    62         lemon/bits/bezier.h \
     99        lemon/bits/bezier.h \
    63100        lemon/bits/default_map.h \
    64101        lemon/bits/edge_set_extender.h \
    65         lemon/bits/enable_if.h \
     102        lemon/bits/enable_if.h \
    66103        lemon/bits/graph_adaptor_extender.h \
    67104        lemon/bits/graph_extender.h \
    68105        lemon/bits/map_extender.h \
    69106        lemon/bits/path_dump.h \
     107        lemon/bits/solver_bits.h \
    70108        lemon/bits/traits.h \
    71109        lemon/bits/variant.h \
  • lemon/adaptors.h

    r416 r464  
    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/// \ingroup graph_adaptors
    2323/// \file
    24 /// \brief Several graph adaptors
     24/// \brief Adaptor classes for digraphs and graphs
    2525///
    2626/// This file contains several useful adaptors for digraphs and graphs.
     
    7171    int nodeNum() const { return _digraph->nodeNum(); }
    7272
    73     typedef EdgeNumTagIndicator<Digraph> EdgeNumTag;
     73    typedef ArcNumTagIndicator<Digraph> ArcNumTag;
    7474    int arcNum() const { return _digraph->arcNum(); }
    7575
    76     typedef FindEdgeTagIndicator<Digraph> FindEdgeTag;
    77     Arc findArc(const Node& u, const Node& v, const Arc& prev = INVALID) {
     76    typedef FindArcTagIndicator<Digraph> FindArcTag;
     77    Arc findArc(const Node& u, const Node& v, const Arc& prev = INVALID) const {
    7878      return _digraph->findArc(u, v, prev);
    7979    }
     
    8282    Arc addArc(const Node& u, const Node& v) { return _digraph->addArc(u, v); }
    8383
    84     void erase(const Node& n) const { _digraph->erase(n); }
    85     void erase(const Arc& a) const { _digraph->erase(a); }
    86 
    87     void clear() const { _digraph->clear(); }
     84    void erase(const Node& n) { _digraph->erase(n); }
     85    void erase(const Arc& a) { _digraph->erase(a); }
     86
     87    void clear() { _digraph->clear(); }
    8888
    8989    int id(const Node& n) const { return _digraph->id(n); }
     
    199199    int nodeNum() const { return _graph->nodeNum(); }
    200200
     201    typedef ArcNumTagIndicator<Graph> ArcNumTag;
     202    int arcNum() const { return _graph->arcNum(); }
     203
    201204    typedef EdgeNumTagIndicator<Graph> EdgeNumTag;
    202     int arcNum() const { return _graph->arcNum(); }
    203205    int edgeNum() const { return _graph->edgeNum(); }
    204206
     207    typedef FindArcTagIndicator<Graph> FindArcTag;
     208    Arc findArc(const Node& u, const Node& v,
     209                const Arc& prev = INVALID) const {
     210      return _graph->findArc(u, v, prev);
     211    }
     212
    205213    typedef FindEdgeTagIndicator<Graph> FindEdgeTag;
    206     Arc findArc(const Node& u, const Node& v, const Arc& prev = INVALID) {
    207       return _graph->findArc(u, v, prev);
    208     }
    209     Edge findEdge(const Node& u, const Node& v, const Edge& prev = INVALID) {
     214    Edge findEdge(const Node& u, const Node& v,
     215                  const Edge& prev = INVALID) const {
    210216      return _graph->findEdge(u, v, prev);
    211217    }
     
    331337    Arc addArc(const Node& u, const Node& v) { return Parent::addArc(v, u); }
    332338
    333     typedef FindEdgeTagIndicator<Digraph> FindEdgeTag;
     339    typedef FindArcTagIndicator<Digraph> FindArcTag;
    334340    Arc findArc(const Node& u, const Node& v,
    335                 const Arc& prev = INVALID) {
     341                const Arc& prev = INVALID) const {
    336342      return Parent::findArc(v, u, prev);
    337343    }
     
    341347  /// \ingroup graph_adaptors
    342348  ///
    343   /// \brief A digraph adaptor which reverses the orientation of the arcs.
    344   ///
    345   /// ReverseDigraph reverses the arcs in the adapted digraph. The
    346   /// SubDigraph is conform to the \ref concepts::Digraph
    347   /// "Digraph concept".
    348   ///
    349   /// \tparam _Digraph It must be conform to the \ref concepts::Digraph
    350   /// "Digraph concept". The type can be specified to be const.
    351   template<typename _Digraph>
     349  /// \brief Adaptor class for reversing the orientation of the arcs in
     350  /// a digraph.
     351  ///
     352  /// ReverseDigraph can be used for reversing the arcs in a digraph.
     353  /// It conforms to the \ref concepts::Digraph "Digraph" concept.
     354  ///
     355  /// The adapted digraph can also be modified through this adaptor
     356  /// by adding or removing nodes or arcs, unless the \c GR template
     357  /// parameter is set to be \c const.
     358  ///
     359  /// \tparam GR The type of the adapted digraph.
     360  /// It must conform to the \ref concepts::Digraph "Digraph" concept.
     361  /// It can also be specified to be \c const.
     362  ///
     363  /// \note The \c Node and \c Arc types of this adaptor and the adapted
     364  /// digraph are convertible to each other.
     365  template<typename GR>
     366#ifdef DOXYGEN
     367  class ReverseDigraph {
     368#else
    352369  class ReverseDigraph :
    353     public DigraphAdaptorExtender<ReverseDigraphBase<_Digraph> > {
    354   public:
    355     typedef _Digraph Digraph;
    356     typedef DigraphAdaptorExtender<
    357       ReverseDigraphBase<_Digraph> > Parent;
     370    public DigraphAdaptorExtender<ReverseDigraphBase<GR> > {
     371#endif
     372  public:
     373    /// The type of the adapted digraph.
     374    typedef GR Digraph;
     375    typedef DigraphAdaptorExtender<ReverseDigraphBase<GR> > Parent;
    358376  protected:
    359377    ReverseDigraph() { }
     
    362380    /// \brief Constructor
    363381    ///
    364     /// Creates a reverse digraph adaptor for the given digraph
     382    /// Creates a reverse digraph adaptor for the given digraph.
    365383    explicit ReverseDigraph(Digraph& digraph) {
    366384      Parent::setDigraph(digraph);
     
    368386  };
    369387
    370   /// \brief Just gives back a reverse digraph adaptor
    371   ///
    372   /// Just gives back a reverse digraph adaptor
    373   template<typename Digraph>
    374   ReverseDigraph<const Digraph> reverseDigraph(const Digraph& digraph) {
    375     return ReverseDigraph<const Digraph>(digraph);
     388  /// \brief Returns a read-only ReverseDigraph adaptor
     389  ///
     390  /// This function just returns a read-only \ref ReverseDigraph adaptor.
     391  /// \ingroup graph_adaptors
     392  /// \relates ReverseDigraph
     393  template<typename GR>
     394  ReverseDigraph<const GR> reverseDigraph(const GR& digraph) {
     395    return ReverseDigraph<const GR>(digraph);
    376396  }
     397
    377398
    378399  template <typename _Digraph, typename _NodeFilterMap,
     
    458479    }
    459480
    460     void hide(const Node& n) const { _node_filter->set(n, false); }
    461     void hide(const Arc& a) const { _arc_filter->set(a, false); }
    462 
    463     void unHide(const Node& n) const { _node_filter->set(n, true); }
    464     void unHide(const Arc& a) const { _arc_filter->set(a, true); }
    465 
    466     bool hidden(const Node& n) const { return !(*_node_filter)[n]; }
    467     bool hidden(const Arc& a) const { return !(*_arc_filter)[a]; }
     481    void status(const Node& n, bool v) const { _node_filter->set(n, v); }
     482    void status(const Arc& a, bool v) const { _arc_filter->set(a, v); }
     483
     484    bool status(const Node& n) const { return (*_node_filter)[n]; }
     485    bool status(const Arc& a) const { return (*_arc_filter)[a]; }
    468486
    469487    typedef False NodeNumTag;
    470     typedef False EdgeNumTag;
    471 
    472     typedef FindEdgeTagIndicator<Digraph> FindEdgeTag;
     488    typedef False ArcNumTag;
     489
     490    typedef FindArcTagIndicator<Digraph> FindArcTag;
    473491    Arc findArc(const Node& source, const Node& target,
    474                 const Arc& prev = INVALID) {
     492                const Arc& prev = INVALID) const {
    475493      if (!(*_node_filter)[source] || !(*_node_filter)[target]) {
    476494        return INVALID;
     
    601619    }
    602620
    603     void hide(const Node& n) const { _node_filter->set(n, false); }
    604     void hide(const Arc& e) const { _arc_filter->set(e, false); }
    605 
    606     void unHide(const Node& n) const { _node_filter->set(n, true); }
    607     void unHide(const Arc& e) const { _arc_filter->set(e, true); }
    608 
    609     bool hidden(const Node& n) const { return !(*_node_filter)[n]; }
    610     bool hidden(const Arc& e) const { return !(*_arc_filter)[e]; }
     621    void status(const Node& n, bool v) const { _node_filter->set(n, v); }
     622    void status(const Arc& a, bool v) const { _arc_filter->set(a, v); }
     623
     624    bool status(const Node& n) const { return (*_node_filter)[n]; }
     625    bool status(const Arc& a) const { return (*_arc_filter)[a]; }
    611626
    612627    typedef False NodeNumTag;
    613     typedef False EdgeNumTag;
    614 
    615     typedef FindEdgeTagIndicator<Digraph> FindEdgeTag;
     628    typedef False ArcNumTag;
     629
     630    typedef FindArcTagIndicator<Digraph> FindArcTag;
    616631    Arc findArc(const Node& source, const Node& target,
    617                 const Arc& prev = INVALID) {
     632                const Arc& prev = INVALID) const {
    618633      if (!(*_node_filter)[source] || !(*_node_filter)[target]) {
    619634        return INVALID;
     
    680695  /// \ingroup graph_adaptors
    681696  ///
    682   /// \brief An adaptor for hiding nodes and arcs in a digraph
    683   ///
    684   /// SubDigraph hides nodes and arcs in a digraph. A bool node map
    685   /// and a bool arc map must be specified, which define the filters
    686   /// for nodes and arcs. Just the nodes and arcs with true value are
    687   /// shown in the subdigraph. The SubDigraph is conform to the \ref
    688   /// concepts::Digraph "Digraph concept". If the \c _checked parameter
    689   /// is true, then the arcs incident to filtered nodes are also
    690   /// filtered out.
    691   ///
    692   /// \tparam _Digraph It must be conform to the \ref
    693   /// concepts::Digraph "Digraph concept". The type can be specified
    694   /// to const.
    695   /// \tparam _NodeFilterMap A bool valued node map of the the adapted digraph.
    696   /// \tparam _ArcFilterMap A bool valued arc map of the the adapted digraph.
    697   /// \tparam _checked If the parameter is false then the arc filtering
    698   /// is not checked with respect to node filter. Otherwise, each arc
    699   /// is automatically filtered, which is incident to a filtered node.
     697  /// \brief Adaptor class for hiding nodes and arcs in a digraph
     698  ///
     699  /// SubDigraph can be used for hiding nodes and arcs in a digraph.
     700  /// A \c bool node map and a \c bool arc map must be specified, which
     701  /// define the filters for nodes and arcs.
     702  /// Only the nodes and arcs with \c true filter value are
     703  /// shown in the subdigraph. The arcs that are incident to hidden
     704  /// nodes are also filtered out.
     705  /// This adaptor conforms to the \ref concepts::Digraph "Digraph" concept.
     706  ///
     707  /// The adapted digraph can also be modified through this adaptor
     708  /// by adding or removing nodes or arcs, unless the \c GR template
     709  /// parameter is set to be \c const.
     710  ///
     711  /// \tparam GR The type of the adapted digraph.
     712  /// It must conform to the \ref concepts::Digraph "Digraph" concept.
     713  /// It can also be specified to be \c const.
     714  /// \tparam NF The type of the node filter map.
     715  /// It must be a \c bool (or convertible) node map of the
     716  /// adapted digraph. The default type is
     717  /// \ref concepts::Digraph::NodeMap "GR::NodeMap<bool>".
     718  /// \tparam AF The type of the arc filter map.
     719  /// It must be \c bool (or convertible) arc map of the
     720  /// adapted digraph. The default type is
     721  /// \ref concepts::Digraph::ArcMap "GR::ArcMap<bool>".
     722  ///
     723  /// \note The \c Node and \c Arc types of this adaptor and the adapted
     724  /// digraph are convertible to each other.
    700725  ///
    701726  /// \see FilterNodes
    702727  /// \see FilterArcs
    703   template<typename _Digraph,
    704            typename _NodeFilterMap = typename _Digraph::template NodeMap<bool>,
    705            typename _ArcFilterMap = typename _Digraph::template ArcMap<bool>,
    706            bool _checked = true>
    707   class SubDigraph
    708     : public DigraphAdaptorExtender<
    709       SubDigraphBase<_Digraph, _NodeFilterMap, _ArcFilterMap, _checked> > {
    710   public:
    711     typedef _Digraph Digraph;
    712     typedef _NodeFilterMap NodeFilterMap;
    713     typedef _ArcFilterMap ArcFilterMap;
    714 
    715     typedef DigraphAdaptorExtender<
    716       SubDigraphBase<Digraph, NodeFilterMap, ArcFilterMap, _checked> >
    717     Parent;
     728#ifdef DOXYGEN
     729  template<typename GR, typename NF, typename AF>
     730  class SubDigraph {
     731#else
     732  template<typename GR,
     733           typename NF = typename GR::template NodeMap<bool>,
     734           typename AF = typename GR::template ArcMap<bool> >
     735  class SubDigraph :
     736    public DigraphAdaptorExtender<SubDigraphBase<GR, NF, AF, true> > {
     737#endif
     738  public:
     739    /// The type of the adapted digraph.
     740    typedef GR Digraph;
     741    /// The type of the node filter map.
     742    typedef NF NodeFilterMap;
     743    /// The type of the arc filter map.
     744    typedef AF ArcFilterMap;
     745
     746    typedef DigraphAdaptorExtender<SubDigraphBase<GR, NF, AF, true> >
     747      Parent;
    718748
    719749    typedef typename Parent::Node Node;
     
    726756    /// \brief Constructor
    727757    ///
    728     /// Creates a subdigraph for the given digraph with
    729     /// given node and arc map filters.
     758    /// Creates a subdigraph for the given digraph with the
     759    /// given node and arc filter maps.
    730760    SubDigraph(Digraph& digraph, NodeFilterMap& node_filter,
    731761               ArcFilterMap& arc_filter) {
     
    735765    }
    736766
    737     /// \brief Hides the node of the graph
    738     ///
    739     /// This function hides \c n in the digraph, i.e. the iteration
    740     /// jumps over it. This is done by simply setting the value of \c n
    741     /// to be false in the corresponding node-map.
    742     void hide(const Node& n) const { Parent::hide(n); }
    743 
    744     /// \brief Hides the arc of the graph
    745     ///
    746     /// This function hides \c a in the digraph, i.e. the iteration
    747     /// jumps over it. This is done by simply setting the value of \c a
    748     /// to be false in the corresponding arc-map.
    749     void hide(const Arc& a) const { Parent::hide(a); }
    750 
    751     /// \brief Unhides the node of the graph
    752     ///
    753     /// The value of \c n is set to be true in the node-map which stores
    754     /// hide information. If \c n was hidden previuosly, then it is shown
    755     /// again
    756     void unHide(const Node& n) const { Parent::unHide(n); }
    757 
    758     /// \brief Unhides the arc of the graph
    759     ///
    760     /// The value of \c a is set to be true in the arc-map which stores
    761     /// hide information. If \c a was hidden previuosly, then it is shown
    762     /// again
    763     void unHide(const Arc& a) const { Parent::unHide(a); }
    764 
    765     /// \brief Returns true if \c n is hidden.
    766     ///
    767     /// Returns true if \c n is hidden.
    768     ///
    769     bool hidden(const Node& n) const { return Parent::hidden(n); }
    770 
    771     /// \brief Returns true if \c a is hidden.
    772     ///
    773     /// Returns true if \c a is hidden.
    774     ///
    775     bool hidden(const Arc& a) const { return Parent::hidden(a); }
     767    /// \brief Sets the status of the given node
     768    ///
     769    /// This function sets the status of the given node.
     770    /// It is done by simply setting the assigned value of \c n
     771    /// to \c v in the node filter map.
     772    void status(const Node& n, bool v) const { Parent::status(n, v); }
     773
     774    /// \brief Sets the status of the given arc
     775    ///
     776    /// This function sets the status of the given arc.
     777    /// It is done by simply setting the assigned value of \c a
     778    /// to \c v in the arc filter map.
     779    void status(const Arc& a, bool v) const { Parent::status(a, v); }
     780
     781    /// \brief Returns the status of the given node
     782    ///
     783    /// This function returns the status of the given node.
     784    /// It is \c true if the given node is enabled (i.e. not hidden).
     785    bool status(const Node& n) const { return Parent::status(n); }
     786
     787    /// \brief Returns the status of the given arc
     788    ///
     789    /// This function returns the status of the given arc.
     790    /// It is \c true if the given arc is enabled (i.e. not hidden).
     791    bool status(const Arc& a) const { return Parent::status(a); }
     792
     793    /// \brief Disables the given node
     794    ///
     795    /// This function disables the given node in the subdigraph,
     796    /// so the iteration jumps over it.
     797    /// It is the same as \ref status() "status(n, false)".
     798    void disable(const Node& n) const { Parent::status(n, false); }
     799
     800    /// \brief Disables the given arc
     801    ///
     802    /// This function disables the given arc in the subdigraph,
     803    /// so the iteration jumps over it.
     804    /// It is the same as \ref status() "status(a, false)".
     805    void disable(const Arc& a) const { Parent::status(a, false); }
     806
     807    /// \brief Enables the given node
     808    ///
     809    /// This function enables the given node in the subdigraph.
     810    /// It is the same as \ref status() "status(n, true)".
     811    void enable(const Node& n) const { Parent::status(n, true); }
     812
     813    /// \brief Enables the given arc
     814    ///
     815    /// This function enables the given arc in the subdigraph.
     816    /// It is the same as \ref status() "status(a, true)".
     817    void enable(const Arc& a) const { Parent::status(a, true); }
    776818
    777819  };
    778820
    779   /// \brief Just gives back a subdigraph
    780   ///
    781   /// Just gives back a subdigraph
    782   template<typename Digraph, typename NodeFilterMap, typename ArcFilterMap>
    783   SubDigraph<const Digraph, NodeFilterMap, ArcFilterMap>
    784   subDigraph(const Digraph& digraph, NodeFilterMap& nfm, ArcFilterMap& afm) {
    785     return SubDigraph<const Digraph, NodeFilterMap, ArcFilterMap>
    786       (digraph, nfm, afm);
     821  /// \brief Returns a read-only SubDigraph adaptor
     822  ///
     823  /// This function just returns a read-only \ref SubDigraph adaptor.
     824  /// \ingroup graph_adaptors
     825  /// \relates SubDigraph
     826  template<typename GR, typename NF, typename AF>
     827  SubDigraph<const GR, NF, AF>
     828  subDigraph(const GR& digraph,
     829             NF& node_filter_map, AF& arc_filter_map) {
     830    return SubDigraph<const GR, NF, AF>
     831      (digraph, node_filter_map, arc_filter_map);
    787832  }
    788833
    789   template<typename Digraph, typename NodeFilterMap, typename ArcFilterMap>
    790   SubDigraph<const Digraph, const NodeFilterMap, ArcFilterMap>
    791   subDigraph(const Digraph& digraph,
    792              const NodeFilterMap& nfm, ArcFilterMap& afm) {
    793     return SubDigraph<const Digraph, const NodeFilterMap, ArcFilterMap>
    794       (digraph, nfm, afm);
     834  template<typename GR, typename NF, typename AF>
     835  SubDigraph<const GR, const NF, AF>
     836  subDigraph(const GR& digraph,
     837             const NF& node_filter_map, AF& arc_filter_map) {
     838    return SubDigraph<const GR, const NF, AF>
     839      (digraph, node_filter_map, arc_filter_map);
    795840  }
    796841
    797   template<typename Digraph, typename NodeFilterMap, typename ArcFilterMap>
    798   SubDigraph<const Digraph, NodeFilterMap, const ArcFilterMap>
    799   subDigraph(const Digraph& digraph,
    800              NodeFilterMap& nfm, const ArcFilterMap& afm) {
    801     return SubDigraph<const Digraph, NodeFilterMap, const ArcFilterMap>
    802       (digraph, nfm, afm);
     842  template<typename GR, typename NF, typename AF>
     843  SubDigraph<const GR, NF, const AF>
     844  subDigraph(const GR& digraph,
     845             NF& node_filter_map, const AF& arc_filter_map) {
     846    return SubDigraph<const GR, NF, const AF>
     847      (digraph, node_filter_map, arc_filter_map);
    803848  }
    804849
    805   template<typename Digraph, typename NodeFilterMap, typename ArcFilterMap>
    806   SubDigraph<const Digraph, const NodeFilterMap, const ArcFilterMap>
    807   subDigraph(const Digraph& digraph,
    808              const NodeFilterMap& nfm, const ArcFilterMap& afm) {
    809     return SubDigraph<const Digraph, const NodeFilterMap,
    810       const ArcFilterMap>(digraph, nfm, afm);
     850  template<typename GR, typename NF, typename AF>
     851  SubDigraph<const GR, const NF, const AF>
     852  subDigraph(const GR& digraph,
     853             const NF& node_filter_map, const AF& arc_filter_map) {
     854    return SubDigraph<const GR, const NF, const AF>
     855      (digraph, node_filter_map, arc_filter_map);
    811856  }
    812857
    813858
    814   template <typename _Graph, typename NodeFilterMap,
    815             typename EdgeFilterMap, bool _checked = true>
     859  template <typename _Graph, typename _NodeFilterMap,
     860            typename _EdgeFilterMap, bool _checked = true>
    816861  class SubGraphBase : public GraphAdaptorBase<_Graph> {
    817862  public:
    818863    typedef _Graph Graph;
     864    typedef _NodeFilterMap NodeFilterMap;
     865    typedef _EdgeFilterMap EdgeFilterMap;
     866
    819867    typedef SubGraphBase Adaptor;
    820868    typedef GraphAdaptorBase<_Graph> Parent;
     
    926974    }
    927975
    928     void hide(const Node& n) const { _node_filter_map->set(n, false); }
    929     void hide(const Edge& e) const { _edge_filter_map->set(e, false); }
    930 
    931     void unHide(const Node& n) const { _node_filter_map->set(n, true); }
    932     void unHide(const Edge& e) const { _edge_filter_map->set(e, true); }
    933 
    934     bool hidden(const Node& n) const { return !(*_node_filter_map)[n]; }
    935     bool hidden(const Edge& e) const { return !(*_edge_filter_map)[e]; }
     976    void status(const Node& n, bool v) const { _node_filter_map->set(n, v); }
     977    void status(const Edge& e, bool v) const { _edge_filter_map->set(e, v); }
     978
     979    bool status(const Node& n) const { return (*_node_filter_map)[n]; }
     980    bool status(const Edge& e) const { return (*_edge_filter_map)[e]; }
    936981
    937982    typedef False NodeNumTag;
     983    typedef False ArcNumTag;
    938984    typedef False EdgeNumTag;
    939985
    940     typedef FindEdgeTagIndicator<Graph> FindEdgeTag;
     986    typedef FindArcTagIndicator<Graph> FindArcTag;
    941987    Arc findArc(const Node& u, const Node& v,
    942                 const Arc& prev = INVALID) {
     988                const Arc& prev = INVALID) const {
    943989      if (!(*_node_filter_map)[u] || !(*_node_filter_map)[v]) {
    944990        return INVALID;
     
    950996      return arc;
    951997    }
     998
     999    typedef FindEdgeTagIndicator<Graph> FindEdgeTag;
    9521000    Edge findEdge(const Node& u, const Node& v,
    953                   const Edge& prev = INVALID) {
     1001                  const Edge& prev = INVALID) const {
    9541002      if (!(*_node_filter_map)[u] || !(*_node_filter_map)[v]) {
    9551003        return INVALID;
     
    10401088  };
    10411089
    1042   template <typename _Graph, typename NodeFilterMap, typename EdgeFilterMap>
    1043   class SubGraphBase<_Graph, NodeFilterMap, EdgeFilterMap, false>
     1090  template <typename _Graph, typename _NodeFilterMap, typename _EdgeFilterMap>
     1091  class SubGraphBase<_Graph, _NodeFilterMap, _EdgeFilterMap, false>
    10441092    : public GraphAdaptorBase<_Graph> {
    10451093  public:
    10461094    typedef _Graph Graph;
     1095    typedef _NodeFilterMap NodeFilterMap;
     1096    typedef _EdgeFilterMap EdgeFilterMap;
     1097
    10471098    typedef SubGraphBase Adaptor;
    10481099    typedef GraphAdaptorBase<_Graph> Parent;
     
    11221173    }
    11231174
    1124     void hide(const Node& n) const { _node_filter_map->set(n, false); }
    1125     void hide(const Edge& e) const { _edge_filter_map->set(e, false); }
    1126 
    1127     void unHide(const Node& n) const { _node_filter_map->set(n, true); }
    1128     void unHide(const Edge& e) const { _edge_filter_map->set(e, true); }
    1129 
    1130     bool hidden(const Node& n) const { return !(*_node_filter_map)[n]; }
    1131     bool hidden(const Edge& e) const { return !(*_edge_filter_map)[e]; }
     1175    void status(const Node& n, bool v) const { _node_filter_map->set(n, v); }
     1176    void status(const Edge& e, bool v) const { _edge_filter_map->set(e, v); }
     1177
     1178    bool status(const Node& n) const { return (*_node_filter_map)[n]; }
     1179    bool status(const Edge& e) const { return (*_edge_filter_map)[e]; }
    11321180
    11331181    typedef False NodeNumTag;
     1182    typedef False ArcNumTag;
    11341183    typedef False EdgeNumTag;
    11351184
    1136     typedef FindEdgeTagIndicator<Graph> FindEdgeTag;
     1185    typedef FindArcTagIndicator<Graph> FindArcTag;
    11371186    Arc findArc(const Node& u, const Node& v,
    1138                 const Arc& prev = INVALID) {
     1187                const Arc& prev = INVALID) const {
    11391188      Arc arc = Parent::findArc(u, v, prev);
    11401189      while (arc != INVALID && !(*_edge_filter_map)[arc]) {
     
    11431192      return arc;
    11441193    }
     1194
     1195    typedef FindEdgeTagIndicator<Graph> FindEdgeTag;
    11451196    Edge findEdge(const Node& u, const Node& v,
    1146                   const Edge& prev = INVALID) {
     1197                  const Edge& prev = INVALID) const {
    11471198      Edge edge = Parent::findEdge(u, v, prev);
    11481199      while (edge != INVALID && !(*_edge_filter_map)[edge]) {
     
    12321283  /// \ingroup graph_adaptors
    12331284  ///
    1234   /// \brief A graph adaptor for hiding nodes and edges in an
    1235   /// undirected graph.
    1236   ///
    1237   /// SubGraph hides nodes and edges in a graph. A bool node map and a
    1238   /// bool edge map must be specified, which define the filters for
    1239   /// nodes and edges. Just the nodes and edges with true value are
    1240   /// shown in the subgraph. The SubGraph is conform to the \ref
    1241   /// concepts::Graph "Graph concept". If the \c _checked parameter is
    1242   /// true, then the edges incident to filtered nodes are also
    1243   /// filtered out.
    1244   ///
    1245   /// \tparam _Graph It must be conform to the \ref
    1246   /// concepts::Graph "Graph concept". The type can be specified
    1247   /// to const.
    1248   /// \tparam _NodeFilterMap A bool valued node map of the the adapted graph.
    1249   /// \tparam _EdgeFilterMap A bool valued edge map of the the adapted graph.
    1250   /// \tparam _checked If the parameter is false then the edge filtering
    1251   /// is not checked with respect to node filter. Otherwise, each edge
    1252   /// is automatically filtered, which is incident to a filtered node.
     1285  /// \brief Adaptor class for hiding nodes and edges in an undirected
     1286  /// graph.
     1287  ///
     1288  /// SubGraph can be used for hiding nodes and edges in a graph.
     1289  /// A \c bool node map and a \c bool edge map must be specified, which
     1290  /// define the filters for nodes and edges.
     1291  /// Only the nodes and edges with \c true filter value are
     1292  /// shown in the subgraph. The edges that are incident to hidden
     1293  /// nodes are also filtered out.
     1294  /// This adaptor conforms to the \ref concepts::Graph "Graph" concept.
     1295  ///
     1296  /// The adapted graph can also be modified through this adaptor
     1297  /// by adding or removing nodes or edges, unless the \c GR template
     1298  /// parameter is set to be \c const.
     1299  ///
     1300  /// \tparam GR The type of the adapted graph.
     1301  /// It must conform to the \ref concepts::Graph "Graph" concept.
     1302  /// It can also be specified to be \c const.
     1303  /// \tparam NF The type of the node filter map.
     1304  /// It must be a \c bool (or convertible) node map of the
     1305  /// adapted graph. The default type is
     1306  /// \ref concepts::Graph::NodeMap "GR::NodeMap<bool>".
     1307  /// \tparam EF The type of the edge filter map.
     1308  /// It must be a \c bool (or convertible) edge map of the
     1309  /// adapted graph. The default type is
     1310  /// \ref concepts::Graph::EdgeMap "GR::EdgeMap<bool>".
     1311  ///
     1312  /// \note The \c Node, \c Edge and \c Arc types of this adaptor and the
     1313  /// adapted graph are convertible to each other.
    12531314  ///
    12541315  /// \see FilterNodes
    12551316  /// \see FilterEdges
    1256   template<typename _Graph, typename NodeFilterMap,
    1257            typename EdgeFilterMap, bool _checked = true>
    1258   class SubGraph
    1259     : public GraphAdaptorExtender<
    1260       SubGraphBase<_Graph, NodeFilterMap, EdgeFilterMap, _checked> > {
    1261   public:
    1262     typedef _Graph Graph;
    1263     typedef GraphAdaptorExtender<
    1264       SubGraphBase<_Graph, NodeFilterMap, EdgeFilterMap> > Parent;
     1317#ifdef DOXYGEN
     1318  template<typename GR, typename NF, typename EF>
     1319  class SubGraph {
     1320#else
     1321  template<typename GR,
     1322           typename NF = typename GR::template NodeMap<bool>,
     1323           typename EF = typename GR::template EdgeMap<bool> >
     1324  class SubGraph :
     1325    public GraphAdaptorExtender<SubGraphBase<GR, NF, EF, true> > {
     1326#endif
     1327  public:
     1328    /// The type of the adapted graph.
     1329    typedef GR Graph;
     1330    /// The type of the node filter map.
     1331    typedef NF NodeFilterMap;
     1332    /// The type of the edge filter map.
     1333    typedef EF EdgeFilterMap;
     1334
     1335    typedef GraphAdaptorExtender< SubGraphBase<GR, NF, EF, true> >
     1336      Parent;
    12651337
    12661338    typedef typename Parent::Node Node;
     
    12731345    /// \brief Constructor
    12741346    ///
    1275     /// Creates a subgraph for the given graph with given node and
    1276     /// edge map filters.
    1277     SubGraph(Graph& _graph, NodeFilterMap& node_filter_map,
     1347    /// Creates a subgraph for the given graph with the given node
     1348    /// and edge filter maps.
     1349    SubGraph(Graph& graph, NodeFilterMap& node_filter_map,
    12781350             EdgeFilterMap& edge_filter_map) {
    1279       setGraph(_graph);
     1351      setGraph(graph);
    12801352      setNodeFilterMap(node_filter_map);
    12811353      setEdgeFilterMap(edge_filter_map);
    12821354    }
    12831355
    1284     /// \brief Hides the node of the graph
    1285     ///
    1286     /// This function hides \c n in the graph, i.e. the iteration
    1287     /// jumps over it. This is done by simply setting the value of \c n
    1288     /// to be false in the corresponding node-map.
    1289     void hide(const Node& n) const { Parent::hide(n); }
    1290 
    1291     /// \brief Hides the edge of the graph
    1292     ///
    1293     /// This function hides \c e in the graph, i.e. the iteration
    1294     /// jumps over it. This is done by simply setting the value of \c e
    1295     /// to be false in the corresponding edge-map.
    1296     void hide(const Edge& e) const { Parent::hide(e); }
    1297 
    1298     /// \brief Unhides the node of the graph
    1299     ///
    1300     /// The value of \c n is set to be true in the node-map which stores
    1301     /// hide information. If \c n was hidden previuosly, then it is shown
    1302     /// again
    1303     void unHide(const Node& n) const { Parent::unHide(n); }
    1304 
    1305     /// \brief Unhides the edge of the graph
    1306     ///
    1307     /// The value of \c e is set to be true in the edge-map which stores
    1308     /// hide information. If \c e was hidden previuosly, then it is shown
    1309     /// again
    1310     void unHide(const Edge& e) const { Parent::unHide(e); }
    1311 
    1312     /// \brief Returns true if \c n is hidden.
    1313     ///
    1314     /// Returns true if \c n is hidden.
    1315     ///
    1316     bool hidden(const Node& n) const { return Parent::hidden(n); }
    1317 
    1318     /// \brief Returns true if \c e is hidden.
    1319     ///
    1320     /// Returns true if \c e is hidden.
    1321     ///
    1322     bool hidden(const Edge& e) const { return Parent::hidden(e); }
     1356    /// \brief Sets the status of the given node
     1357    ///
     1358    /// This function sets the status of the given node.
     1359    /// It is done by simply setting the assigned value of \c n
     1360    /// to \c v in the node filter map.
     1361    void status(const Node& n, bool v) const { Parent::status(n, v); }
     1362
     1363    /// \brief Sets the status of the given edge
     1364    ///
     1365    /// This function sets the status of the given edge.
     1366    /// It is done by simply setting the assigned value of \c e
     1367    /// to \c v in the edge filter map.
     1368    void status(const Edge& e, bool v) const { Parent::status(e, v); }
     1369
     1370    /// \brief Returns the status of the given node
     1371    ///
     1372    /// This function returns the status of the given node.
     1373    /// It is \c true if the given node is enabled (i.e. not hidden).
     1374    bool status(const Node& n) const { return Parent::status(n); }
     1375
     1376    /// \brief Returns the status of the given edge
     1377    ///
     1378    /// This function returns the status of the given edge.
     1379    /// It is \c true if the given edge is enabled (i.e. not hidden).
     1380    bool status(const Edge& e) const { return Parent::status(e); }
     1381
     1382    /// \brief Disables the given node
     1383    ///
     1384    /// This function disables the given node in the subdigraph,
     1385    /// so the iteration jumps over it.
     1386    /// It is the same as \ref status() "status(n, false)".
     1387    void disable(const Node& n) const { Parent::status(n, false); }
     1388
     1389    /// \brief Disables the given edge
     1390    ///
     1391    /// This function disables the given edge in the subgraph,
     1392    /// so the iteration jumps over it.
     1393    /// It is the same as \ref status() "status(e, false)".
     1394    void disable(const Edge& e) const { Parent::status(e, false); }
     1395
     1396    /// \brief Enables the given node
     1397    ///
     1398    /// This function enables the given node in the subdigraph.
     1399    /// It is the same as \ref status() "status(n, true)".
     1400    void enable(const Node& n) const { Parent::status(n, true); }
     1401
     1402    /// \brief Enables the given edge
     1403    ///
     1404    /// This function enables the given edge in the subgraph.
     1405    /// It is the same as \ref status() "status(e, true)".
     1406    void enable(const Edge& e) const { Parent::status(e, true); }
     1407
    13231408  };
    13241409
    1325   /// \brief Just gives back a subgraph
    1326   ///
    1327   /// Just gives back a subgraph
    1328   template<typename Graph, typename NodeFilterMap, typename ArcFilterMap>
    1329   SubGraph<const Graph, NodeFilterMap, ArcFilterMap>
    1330   subGraph(const Graph& graph, NodeFilterMap& nfm, ArcFilterMap& efm) {
    1331     return SubGraph<const Graph, NodeFilterMap, ArcFilterMap>(graph, nfm, efm);
     1410  /// \brief Returns a read-only SubGraph adaptor
     1411  ///
     1412  /// This function just returns a read-only \ref SubGraph adaptor.
     1413  /// \ingroup graph_adaptors
     1414  /// \relates SubGraph
     1415  template<typename GR, typename NF, typename EF>
     1416  SubGraph<const GR, NF, EF>
     1417  subGraph(const GR& graph,
     1418           NF& node_filter_map, EF& edge_filter_map) {
     1419    return SubGraph<const GR, NF, EF>
     1420      (graph, node_filter_map, edge_filter_map);
    13321421  }
    13331422
    1334   template<typename Graph, typename NodeFilterMap, typename ArcFilterMap>
    1335   SubGraph<const Graph, const NodeFilterMap, ArcFilterMap>
    1336   subGraph(const Graph& graph,
    1337            const NodeFilterMap& nfm, ArcFilterMap& efm) {
    1338     return SubGraph<const Graph, const NodeFilterMap, ArcFilterMap>
    1339       (graph, nfm, efm);
     1423  template<typename GR, typename NF, typename EF>
     1424  SubGraph<const GR, const NF, EF>
     1425  subGraph(const GR& graph,
     1426           const NF& node_filter_map, EF& edge_filter_map) {
     1427    return SubGraph<const GR, const NF, EF>
     1428      (graph, node_filter_map, edge_filter_map);
    13401429  }
    13411430
    1342   template<typename Graph, typename NodeFilterMap, typename ArcFilterMap>
    1343   SubGraph<const Graph, NodeFilterMap, const ArcFilterMap>
    1344   subGraph(const Graph& graph,
    1345            NodeFilterMap& nfm, const ArcFilterMap& efm) {
    1346     return SubGraph<const Graph, NodeFilterMap, const ArcFilterMap>
    1347       (graph, nfm, efm);
     1431  template<typename GR, typename NF, typename EF>
     1432  SubGraph<const GR, NF, const EF>
     1433  subGraph(const GR& graph,
     1434           NF& node_filter_map, const EF& edge_filter_map) {
     1435    return SubGraph<const GR, NF, const EF>
     1436      (graph, node_filter_map, edge_filter_map);
    13481437  }
    13491438
    1350   template<typename Graph, typename NodeFilterMap, typename ArcFilterMap>
    1351   SubGraph<const Graph, const NodeFilterMap, const ArcFilterMap>
    1352   subGraph(const Graph& graph,
    1353            const NodeFilterMap& nfm, const ArcFilterMap& efm) {
    1354     return SubGraph<const Graph, const NodeFilterMap, const ArcFilterMap>
    1355       (graph, nfm, efm);
     1439  template<typename GR, typename NF, typename EF>
     1440  SubGraph<const GR, const NF, const EF>
     1441  subGraph(const GR& graph,
     1442           const NF& node_filter_map, const EF& edge_filter_map) {
     1443    return SubGraph<const GR, const NF, const EF>
     1444      (graph, node_filter_map, edge_filter_map);
    13561445  }
    13571446
     1447
    13581448  /// \ingroup graph_adaptors
    13591449  ///
    1360   /// \brief An adaptor for hiding nodes from a digraph or a graph.
    1361   ///
    1362   /// FilterNodes adaptor hides nodes in a graph or a digraph. A bool
    1363   /// node map must be specified, which defines the filters for
    1364   /// nodes. Just the unfiltered nodes and the arcs or edges incident
    1365   /// to unfiltered nodes are shown in the subdigraph or subgraph. The
    1366   /// FilterNodes is conform to the \ref concepts::Digraph
    1367   /// "Digraph concept" or \ref concepts::Graph "Graph concept" depending
    1368   /// on the \c _Digraph template parameter. If the \c _checked
    1369   /// parameter is true, then the arc or edges incident to filtered nodes
    1370   /// are also filtered out.
    1371   ///
    1372   /// \tparam _Digraph It must be conform to the \ref
    1373   /// concepts::Digraph "Digraph concept" or \ref concepts::Graph
    1374   /// "Graph concept". The type can be specified to be const.
    1375   /// \tparam _NodeFilterMap A bool valued node map of the the adapted graph.
    1376   /// \tparam _checked If the parameter is false then the arc or edge
    1377   /// filtering is not checked with respect to node filter. In this
    1378   /// case just isolated nodes can be filtered out from the
    1379   /// graph.
     1450  /// \brief Adaptor class for hiding nodes in a digraph or a graph.
     1451  ///
     1452  /// FilterNodes adaptor can be used for hiding nodes in a digraph or a
     1453  /// graph. A \c bool node map must be specified, which defines the filter
     1454  /// for the nodes. Only the nodes with \c true filter value and the
     1455  /// arcs/edges incident to nodes both with \c true filter value are shown
     1456  /// in the subgraph. This adaptor conforms to the \ref concepts::Digraph
     1457  /// "Digraph" concept or the \ref concepts::Graph "Graph" concept
     1458  /// depending on the \c GR template parameter.
     1459  ///
     1460  /// The adapted (di)graph can also be modified through this adaptor
     1461  /// by adding or removing nodes or arcs/edges, unless the \c GR template
     1462  /// parameter is set to be \c const.
     1463  ///
     1464  /// \tparam GR The type of the adapted digraph or graph.
     1465  /// It must conform to the \ref concepts::Digraph "Digraph" concept
     1466  /// or the \ref concepts::Graph "Graph" concept.
     1467  /// It can also be specified to be \c const.
     1468  /// \tparam NF The type of the node filter map.
     1469  /// It must be a \c bool (or convertible) node map of the
     1470  /// adapted (di)graph. The default type is
     1471  /// \ref concepts::Graph::NodeMap "GR::NodeMap<bool>".
     1472  ///
     1473  /// \note The \c Node and <tt>Arc/Edge</tt> types of this adaptor and the
     1474  /// adapted (di)graph are convertible to each other.
    13801475#ifdef DOXYGEN
    1381   template<typename _Digraph,
    1382            typename _NodeFilterMap = typename _Digraph::template NodeMap<bool>,
    1383            bool _checked = true>
     1476  template<typename GR, typename NF>
     1477  class FilterNodes {
    13841478#else
    1385   template<typename _Digraph,
    1386            typename _NodeFilterMap = typename _Digraph::template NodeMap<bool>,
    1387            bool _checked = true,
     1479  template<typename GR,
     1480           typename NF = typename GR::template NodeMap<bool>,
    13881481           typename Enable = void>
     1482  class FilterNodes :
     1483    public DigraphAdaptorExtender<
     1484      SubDigraphBase<GR, NF, ConstMap<typename GR::Arc, bool>, true> > {
    13891485#endif
    1390   class FilterNodes
    1391     : public SubDigraph<_Digraph, _NodeFilterMap,
    1392                         ConstMap<typename _Digraph::Arc, bool>, _checked> {
    1393   public:
    1394 
    1395     typedef _Digraph Digraph;
    1396     typedef _NodeFilterMap NodeFilterMap;
    1397 
    1398     typedef SubDigraph<Digraph, NodeFilterMap,
    1399                        ConstMap<typename Digraph::Arc, bool>, _checked>
    1400     Parent;
     1486  public:
     1487
     1488    typedef GR Digraph;
     1489    typedef NF NodeFilterMap;
     1490
     1491    typedef DigraphAdaptorExtender<
     1492      SubDigraphBase<GR, NF, ConstMap<typename GR::Arc, bool>, true> >
     1493      Parent;
    14011494
    14021495    typedef typename Parent::Node Node;
     
    14131506    /// \brief Constructor
    14141507    ///
    1415     /// Creates an adaptor for the given digraph or graph with
     1508    /// Creates a subgraph for the given digraph or graph with the
    14161509    /// given node filter map.
    1417     FilterNodes(Digraph& _digraph, NodeFilterMap& node_filter) :
    1418       Parent(), const_true_map(true) {
    1419       Parent::setDigraph(_digraph);
     1510    FilterNodes(GR& graph, NodeFilterMap& node_filter) :
     1511      Parent(), const_true_map(true)
     1512    {
     1513      Parent::setDigraph(graph);
    14201514      Parent::setNodeFilterMap(node_filter);
    14211515      Parent::setArcFilterMap(const_true_map);
    14221516    }
    14231517
    1424     /// \brief Hides the node of the graph
    1425     ///
    1426     /// This function hides \c n in the digraph or graph, i.e. the iteration
    1427     /// jumps over it. This is done by simply setting the value of \c n
    1428     /// to be false in the corresponding node map.
    1429     void hide(const Node& n) const { Parent::hide(n); }
    1430 
    1431     /// \brief Unhides the node of the graph
    1432     ///
    1433     /// The value of \c n is set to be true in the node-map which stores
    1434     /// hide information. If \c n was hidden previuosly, then it is shown
    1435     /// again
    1436     void unHide(const Node& n) const { Parent::unHide(n); }
    1437 
    1438     /// \brief Returns true if \c n is hidden.
    1439     ///
    1440     /// Returns true if \c n is hidden.
    1441     ///
    1442     bool hidden(const Node& n) const { return Parent::hidden(n); }
     1518    /// \brief Sets the status of the given node
     1519    ///
     1520    /// This function sets the status of the given node.
     1521    /// It is done by simply setting the assigned value of \c n
     1522    /// to \c v in the node filter map.
     1523    void status(const Node& n, bool v) const { Parent::status(n, v); }
     1524
     1525    /// \brief Returns the status of the given node
     1526    ///
     1527    /// This function returns the status of the given node.
     1528    /// It is \c true if the given node is enabled (i.e. not hidden).
     1529    bool status(const Node& n) const { return Parent::status(n); }
     1530
     1531    /// \brief Disables the given node
     1532    ///
     1533    /// This function disables the given node, so the iteration
     1534    /// jumps over it.
     1535    /// It is the same as \ref status() "status(n, false)".
     1536    void disable(const Node& n) const { Parent::status(n, false); }
     1537
     1538    /// \brief Enables the given node
     1539    ///
     1540    /// This function enables the given node.
     1541    /// It is the same as \ref status() "status(n, true)".
     1542    void enable(const Node& n) const { Parent::status(n, true); }
    14431543
    14441544  };
    14451545
    1446   template<typename _Graph, typename _NodeFilterMap, bool _checked>
    1447   class FilterNodes<_Graph, _NodeFilterMap, _checked,
    1448                     typename enable_if<UndirectedTagIndicator<_Graph> >::type>
    1449     : public SubGraph<_Graph, _NodeFilterMap,
    1450                       ConstMap<typename _Graph::Edge, bool>, _checked> {
    1451   public:
    1452     typedef _Graph Graph;
    1453     typedef _NodeFilterMap NodeFilterMap;
    1454     typedef SubGraph<Graph, NodeFilterMap,
    1455                      ConstMap<typename Graph::Edge, bool> > Parent;
     1546  template<typename GR, typename NF>
     1547  class FilterNodes<GR, NF,
     1548                    typename enable_if<UndirectedTagIndicator<GR> >::type> :
     1549    public GraphAdaptorExtender<
     1550      SubGraphBase<GR, NF, ConstMap<typename GR::Edge, bool>, true> > {
     1551
     1552  public:
     1553    typedef GR Graph;
     1554    typedef NF NodeFilterMap;
     1555    typedef GraphAdaptorExtender<
     1556      SubGraphBase<GR, NF, ConstMap<typename GR::Edge, bool>, true> >
     1557      Parent;
    14561558
    14571559    typedef typename Parent::Node Node;
     
    14721574    }
    14731575
    1474     void hide(const Node& n) const { Parent::hide(n); }
    1475     void unHide(const Node& n) const { Parent::unHide(n); }
    1476     bool hidden(const Node& n) const { return Parent::hidden(n); }
     1576    void status(const Node& n, bool v) const { Parent::status(n, v); }
     1577    bool status(const Node& n) const { return Parent::status(n); }
     1578    void disable(const Node& n) const { Parent::status(n, false); }
     1579    void enable(const Node& n) const { Parent::status(n, true); }
    14771580
    14781581  };
    14791582
    14801583
    1481   /// \brief Just gives back a FilterNodes adaptor
    1482   ///
    1483   /// Just gives back a FilterNodes adaptor
    1484   template<typename Digraph, typename NodeFilterMap>
    1485   FilterNodes<const Digraph, NodeFilterMap>
    1486   filterNodes(const Digraph& digraph, NodeFilterMap& nfm) {
    1487     return FilterNodes<const Digraph, NodeFilterMap>(digraph, nfm);
     1584  /// \brief Returns a read-only FilterNodes adaptor
     1585  ///
     1586  /// This function just returns a read-only \ref FilterNodes adaptor.
     1587  /// \ingroup graph_adaptors
     1588  /// \relates FilterNodes
     1589  template<typename GR, typename NF>
     1590  FilterNodes<const GR, NF>
     1591  filterNodes(const GR& graph, NF& node_filter_map) {
     1592    return FilterNodes<const GR, NF>(graph, node_filter_map);
    14881593  }
    14891594
    1490   template<typename Digraph, typename NodeFilterMap>
    1491   FilterNodes<const Digraph, const NodeFilterMap>
    1492   filterNodes(const Digraph& digraph, const NodeFilterMap& nfm) {
    1493     return FilterNodes<const Digraph, const NodeFilterMap>(digraph, nfm);
     1595  template<typename GR, typename NF>
     1596  FilterNodes<const GR, const NF>
     1597  filterNodes(const GR& graph, const NF& node_filter_map) {
     1598    return FilterNodes<const GR, const NF>(graph, node_filter_map);
    14941599  }
    14951600
    14961601  /// \ingroup graph_adaptors
    14971602  ///
    1498   /// \brief An adaptor for hiding arcs from a digraph.
    1499   ///
    1500   /// FilterArcs adaptor hides arcs in a digraph. A bool arc map must
    1501   /// be specified, which defines the filters for arcs. Just the
    1502   /// unfiltered arcs are shown in the subdigraph. The FilterArcs is
    1503   /// conform to the \ref concepts::Digraph "Digraph concept".
    1504   ///
    1505   /// \tparam _Digraph It must be conform to the \ref concepts::Digraph
    1506   /// "Digraph concept". The type can be specified to be const.
    1507   /// \tparam _ArcFilterMap A bool valued arc map of the the adapted
    1508   /// graph.
    1509   template<typename _Digraph, typename _ArcFilterMap>
     1603  /// \brief Adaptor class for hiding arcs in a digraph.
     1604  ///
     1605  /// FilterArcs adaptor can be used for hiding arcs in a digraph.
     1606  /// A \c bool arc map must be specified, which defines the filter for
     1607  /// the arcs. Only the arcs with \c true filter value are shown in the
     1608  /// subdigraph. This adaptor conforms to the \ref concepts::Digraph
     1609  /// "Digraph" concept.
     1610  ///
     1611  /// The adapted digraph can also be modified through this adaptor
     1612  /// by adding or removing nodes or arcs, unless the \c GR template
     1613  /// parameter is set to be \c const.
     1614  ///
     1615  /// \tparam GR The type of the adapted digraph.
     1616  /// It must conform to the \ref concepts::Digraph "Digraph" concept.
     1617  /// It can also be specified to be \c const.
     1618  /// \tparam AF The type of the arc filter map.
     1619  /// It must be a \c bool (or convertible) arc map of the
     1620  /// adapted digraph. The default type is
     1621  /// \ref concepts::Digraph::ArcMap "GR::ArcMap<bool>".
     1622  ///
     1623  /// \note The \c Node and \c Arc types of this adaptor and the adapted
     1624  /// digraph are convertible to each other.
     1625#ifdef DOXYGEN
     1626  template<typename GR,
     1627           typename AF>
     1628  class FilterArcs {
     1629#else
     1630  template<typename GR,
     1631           typename AF = typename GR::template ArcMap<bool> >
    15101632  class FilterArcs :
    1511     public SubDigraph<_Digraph, ConstMap<typename _Digraph::Node, bool>,
    1512                       _ArcFilterMap, false> {
    1513   public:
    1514     typedef _Digraph Digraph;
    1515     typedef _ArcFilterMap ArcFilterMap;
    1516 
    1517     typedef SubDigraph<Digraph, ConstMap<typename Digraph::Node, bool>,
    1518                        ArcFilterMap, false> Parent;
     1633    public DigraphAdaptorExtender<
     1634      SubDigraphBase<GR, ConstMap<typename GR::Node, bool>, AF, false> > {
     1635#endif
     1636  public:
     1637    /// The type of the adapted digraph.
     1638    typedef GR Digraph;
     1639    /// The type of the arc filter map.
     1640    typedef AF ArcFilterMap;
     1641
     1642    typedef DigraphAdaptorExtender<
     1643      SubDigraphBase<GR, ConstMap<typename GR::Node, bool>, AF, false> >
     1644      Parent;
    15191645
    15201646    typedef typename Parent::Arc Arc;
     
    15311657    /// \brief Constructor
    15321658    ///
    1533     /// Creates a FilterArcs adaptor for the given graph with
    1534     /// given arc map filter.
     1659    /// Creates a subdigraph for the given digraph with the given arc
     1660    /// filter map.
    15351661    FilterArcs(Digraph& digraph, ArcFilterMap& arc_filter)
    15361662      : Parent(), const_true_map(true) {
     
    15401666    }
    15411667
    1542     /// \brief Hides the arc of the graph
    1543     ///
    1544     /// This function hides \c a in the graph, i.e. the iteration
    1545     /// jumps over it. This is done by simply setting the value of \c a
    1546     /// to be false in the corresponding arc map.
    1547     void hide(const Arc& a) const { Parent::hide(a); }
    1548 
    1549     /// \brief Unhides the arc of the graph
    1550     ///
    1551     /// The value of \c a is set to be true in the arc-map which stores
    1552     /// hide information. If \c a was hidden previuosly, then it is shown
    1553     /// again
    1554     void unHide(const Arc& a) const { Parent::unHide(a); }
    1555 
    1556     /// \brief Returns true if \c a is hidden.
    1557     ///
    1558     /// Returns true if \c a is hidden.
    1559     ///
    1560     bool hidden(const Arc& a) const { return Parent::hidden(a); }
     1668    /// \brief Sets the status of the given arc
     1669    ///
     1670    /// This function sets the status of the given arc.
     1671    /// It is done by simply setting the assigned value of \c a
     1672    /// to \c v in the arc filter map.
     1673    void status(const Arc& a, bool v) const { Parent::status(a, v); }
     1674
     1675    /// \brief Returns the status of the given arc
     1676    ///
     1677    /// This function returns the status of the given arc.
     1678    /// It is \c true if the given arc is enabled (i.e. not hidden).
     1679    bool status(const Arc& a) const { return Parent::status(a); }
     1680
     1681    /// \brief Disables the given arc
     1682    ///
     1683    /// This function disables the given arc in the subdigraph,
     1684    /// so the iteration jumps over it.
     1685    /// It is the same as \ref status() "status(a, false)".
     1686    void disable(const Arc& a) const { Parent::status(a, false); }
     1687
     1688    /// \brief Enables the given arc
     1689    ///
     1690    /// This function enables the given arc in the subdigraph.
     1691    /// It is the same as \ref status() "status(a, true)".
     1692    void enable(const Arc& a) const { Parent::status(a, true); }
    15611693
    15621694  };
    15631695
    1564   /// \brief Just gives back an FilterArcs adaptor
    1565   ///
    1566   /// Just gives back an FilterArcs adaptor
    1567   template<typename Digraph, typename ArcFilterMap>
    1568   FilterArcs<const Digraph, ArcFilterMap>
    1569   filterArcs(const Digraph& digraph, ArcFilterMap& afm) {
    1570     return FilterArcs<const Digraph, ArcFilterMap>(digraph, afm);
     1696  /// \brief Returns a read-only FilterArcs adaptor
     1697  ///
     1698  /// This function just returns a read-only \ref FilterArcs adaptor.
     1699  /// \ingroup graph_adaptors
     1700  /// \relates FilterArcs
     1701  template<typename GR, typename AF>
     1702  FilterArcs<const GR, AF>
     1703  filterArcs(const GR& digraph, AF& arc_filter_map) {
     1704    return FilterArcs<const GR, AF>(digraph, arc_filter_map);
    15711705  }
    15721706
    1573   template<typename Digraph, typename ArcFilterMap>
    1574   FilterArcs<const Digraph, const ArcFilterMap>
    1575   filterArcs(const Digraph& digraph, const ArcFilterMap& afm) {
    1576     return FilterArcs<const Digraph, const ArcFilterMap>(digraph, afm);
     1707  template<typename GR, typename AF>
     1708  FilterArcs<const GR, const AF>
     1709  filterArcs(const GR& digraph, const AF& arc_filter_map) {
     1710    return FilterArcs<const GR, const AF>(digraph, arc_filter_map);
    15771711  }
    15781712
    15791713  /// \ingroup graph_adaptors
    15801714  ///
    1581   /// \brief An adaptor for hiding edges from a graph.
    1582   ///
    1583   /// FilterEdges adaptor hides edges in a digraph. A bool edge map must
    1584   /// be specified, which defines the filters for edges. Just the
    1585   /// unfiltered edges are shown in the subdigraph. The FilterEdges is
    1586   /// conform to the \ref concepts::Graph "Graph concept".
    1587   ///
    1588   /// \tparam _Graph It must be conform to the \ref concepts::Graph
    1589   /// "Graph concept". The type can be specified to be const.
    1590   /// \tparam _EdgeFilterMap A bool valued edge map of the the adapted
    1591   /// graph.
    1592   template<typename _Graph, typename _EdgeFilterMap>
     1715  /// \brief Adaptor class for hiding edges in a graph.
     1716  ///
     1717  /// FilterEdges adaptor can be used for hiding edges in a graph.
     1718  /// A \c bool edge map must be specified, which defines the filter for
     1719  /// the edges. Only the edges with \c true filter value are shown in the
     1720  /// subgraph. This adaptor conforms to the \ref concepts::Graph
     1721  /// "Graph" concept.
     1722  ///
     1723  /// The adapted graph can also be modified through this adaptor
     1724  /// by adding or removing nodes or edges, unless the \c GR template
     1725  /// parameter is set to be \c const.
     1726  ///
     1727  /// \tparam GR The type of the adapted graph.
     1728  /// It must conform to the \ref concepts::Graph "Graph" concept.
     1729  /// It can also be specified to be \c const.
     1730  /// \tparam EF The type of the edge filter map.
     1731  /// It must be a \c bool (or convertible) edge map of the
     1732  /// adapted graph. The default type is
     1733  /// \ref concepts::Graph::EdgeMap "GR::EdgeMap<bool>".
     1734  ///
     1735  /// \note The \c Node, \c Edge and \c Arc types of this adaptor and the
     1736  /// adapted graph are convertible to each other.
     1737#ifdef DOXYGEN
     1738  template<typename GR,
     1739           typename EF>
     1740  class FilterEdges {
     1741#else
     1742  template<typename GR,
     1743           typename EF = typename GR::template EdgeMap<bool> >
    15931744  class FilterEdges :
    1594     public SubGraph<_Graph, ConstMap<typename _Graph::Node,bool>,
    1595                     _EdgeFilterMap, false> {
    1596   public:
    1597     typedef _Graph Graph;
    1598     typedef _EdgeFilterMap EdgeFilterMap;
    1599     typedef SubGraph<Graph, ConstMap<typename Graph::Node,bool>,
    1600                      EdgeFilterMap, false> Parent;
     1745    public GraphAdaptorExtender<
     1746      SubGraphBase<GR, ConstMap<typename GR::Node,bool>, EF, false> > {
     1747#endif
     1748  public:
     1749    /// The type of the adapted graph.
     1750    typedef GR Graph;
     1751    /// The type of the edge filter map.
     1752    typedef EF EdgeFilterMap;
     1753
     1754    typedef GraphAdaptorExtender<
     1755      SubGraphBase<GR, ConstMap<typename GR::Node,bool>, EF, false> >
     1756      Parent;
     1757
    16011758    typedef typename Parent::Edge Edge;
     1759
    16021760  protected:
    16031761    ConstMap<typename Graph::Node, bool> const_true_map;
     
    16111769    /// \brief Constructor
    16121770    ///
    1613     /// Creates a FilterEdges adaptor for the given graph with
    1614     /// given edge map filters.
    1615     FilterEdges(Graph& _graph, EdgeFilterMap& edge_filter_map) :
     1771    /// Creates a subgraph for the given graph with the given edge
     1772    /// filter map.
     1773    FilterEdges(Graph& graph, EdgeFilterMap& edge_filter_map) :
    16161774      Parent(), const_true_map(true) {
    1617       Parent::setGraph(_graph);
     1775      Parent::setGraph(graph);
    16181776      Parent::setNodeFilterMap(const_true_map);
    16191777      Parent::setEdgeFilterMap(edge_filter_map);
    16201778    }
    16211779
    1622     /// \brief Hides the edge of the graph
    1623     ///
    1624     /// This function hides \c e in the graph, i.e. the iteration
    1625     /// jumps over it. This is done by simply setting the value of \c e
    1626     /// to be false in the corresponding edge-map.
    1627     void hide(const Edge& e) const { Parent::hide(e); }
    1628 
    1629     /// \brief Unhides the edge of the graph
    1630     ///
    1631     /// The value of \c e is set to be true in the edge-map which stores
    1632     /// hide information. If \c e was hidden previuosly, then it is shown
    1633     /// again
    1634     void unHide(const Edge& e) const { Parent::unHide(e); }
    1635 
    1636     /// \brief Returns true if \c e is hidden.
    1637     ///
    1638     /// Returns true if \c e is hidden.
    1639     ///
    1640     bool hidden(const Edge& e) const { return Parent::hidden(e); }
     1780    /// \brief Sets the status of the given edge
     1781    ///
     1782    /// This function sets the status of the given edge.
     1783    /// It is done by simply setting the assigned value of \c e
     1784    /// to \c v in the edge filter map.
     1785    void status(const Edge& e, bool v) const { Parent::status(e, v); }
     1786
     1787    /// \brief Returns the status of the given edge
     1788    ///
     1789    /// This function returns the status of the given edge.
     1790    /// It is \c true if the given edge is enabled (i.e. not hidden).
     1791    bool status(const Edge& e) const { return Parent::status(e); }
     1792
     1793    /// \brief Disables the given edge
     1794    ///
     1795    /// This function disables the given edge in the subgraph,
     1796    /// so the iteration jumps over it.
     1797    /// It is the same as \ref status() "status(e, false)".
     1798    void disable(const Edge& e) const { Parent::status(e, false); }
     1799
     1800    /// \brief Enables the given edge
     1801    ///
     1802    /// This function enables the given edge in the subgraph.
     1803    /// It is the same as \ref status() "status(e, true)".
     1804    void enable(const Edge& e) const { Parent::status(e, true); }
    16411805
    16421806  };
    16431807
    1644   /// \brief Just gives back a FilterEdges adaptor
    1645   ///
    1646   /// Just gives back a FilterEdges adaptor
    1647   template<typename Graph, typename EdgeFilterMap>
    1648   FilterEdges<const Graph, EdgeFilterMap>
    1649   filterEdges(const Graph& graph, EdgeFilterMap& efm) {
    1650     return FilterEdges<const Graph, EdgeFilterMap>(graph, efm);
     1808  /// \brief Returns a read-only FilterEdges adaptor
     1809  ///
     1810  /// This function just returns a read-only \ref FilterEdges adaptor.
     1811  /// \ingroup graph_adaptors
     1812  /// \relates FilterEdges
     1813  template<typename GR, typename EF>
     1814  FilterEdges<const GR, EF>
     1815  filterEdges(const GR& graph, EF& edge_filter_map) {
     1816    return FilterEdges<const GR, EF>(graph, edge_filter_map);
    16511817  }
    16521818
    1653   template<typename Graph, typename EdgeFilterMap>
    1654   FilterEdges<const Graph, const EdgeFilterMap>
    1655   filterEdges(const Graph& graph, const EdgeFilterMap& efm) {
    1656     return FilterEdges<const Graph, const EdgeFilterMap>(graph, efm);
     1819  template<typename GR, typename EF>
     1820  FilterEdges<const GR, const EF>
     1821  filterEdges(const GR& graph, const EF& edge_filter_map) {
     1822    return FilterEdges<const GR, const EF>(graph, edge_filter_map);
    16571823  }
     1824
    16581825
    16591826  template <typename _Digraph>
     
    16951862      }
    16961863    };
    1697 
    1698 
    16991864
    17001865    void first(Node& n) const {
     
    18462011
    18472012    typedef NodeNumTagIndicator<Digraph> NodeNumTag;
    1848     int nodeNum() const { return 2 * _digraph->arcNum(); }
    1849     typedef EdgeNumTagIndicator<Digraph> EdgeNumTag;
     2013    int nodeNum() const { return _digraph->nodeNum(); }
     2014
     2015    typedef ArcNumTagIndicator<Digraph> ArcNumTag;
    18502016    int arcNum() const { return 2 * _digraph->arcNum(); }
     2017
     2018    typedef ArcNumTag EdgeNumTag;
    18512019    int edgeNum() const { return _digraph->arcNum(); }
    18522020
    1853     typedef FindEdgeTagIndicator<Digraph> FindEdgeTag;
     2021    typedef FindArcTagIndicator<Digraph> FindArcTag;
    18542022    Arc findArc(Node s, Node t, Arc p = INVALID) const {
    18552023      if (p == INVALID) {
     
    18702038    }
    18712039
     2040    typedef FindArcTag FindEdgeTag;
    18722041    Edge findEdge(Node s, Node t, Edge p = INVALID) const {
    18732042      if (s != t) {
     
    18772046          arc = _digraph->findArc(t, s);
    18782047          if (arc != INVALID) return arc;
    1879         } else if (_digraph->s(p) == s) {
     2048        } else if (_digraph->source(p) == s) {
    18802049          Edge arc = _digraph->findArc(s, t, p);
    18812050          if (arc != INVALID) return arc;
     
    19062075      typedef _Value Value;
    19072076      typedef Arc Key;
     2077      typedef typename MapTraits<MapImpl>::ConstReturnValue ConstReturnValue;
     2078      typedef typename MapTraits<MapImpl>::ReturnValue ReturnValue;
     2079      typedef typename MapTraits<MapImpl>::ConstReturnValue ConstReference;
     2080      typedef typename MapTraits<MapImpl>::ReturnValue Reference;
    19082081
    19092082      ArcMapBase(const Adaptor& adaptor) :
     
    19212094      }
    19222095
    1923       typename MapTraits<MapImpl>::ConstReturnValue
    1924       operator[](const Arc& a) const {
     2096      ConstReturnValue operator[](const Arc& a) const {
    19252097        if (direction(a)) {
    19262098          return _forward[a];
     
    19302102      }
    19312103
    1932       typename MapTraits<MapImpl>::ReturnValue
    1933       operator[](const Arc& a) {
     2104      ReturnValue operator[](const Arc& a) {
    19342105        if (direction(a)) {
    19352106          return _forward[a];
     
    19812152      typedef SubMapExtender<Adaptor, ArcMapBase<Value> > Parent;
    19822153
    1983       ArcMap(const Adaptor& adaptor)
     2154      explicit ArcMap(const Adaptor& adaptor)
    19842155        : Parent(adaptor) {}
    19852156
     
    20282199    NodeNotifier& notifier(Node) const { return _digraph->notifier(Node()); }
    20292200
     2201    typedef typename ItemSetTraits<Digraph, Edge>::ItemNotifier EdgeNotifier;
     2202    EdgeNotifier& notifier(Edge) const { return _digraph->notifier(Edge()); }
     2203
    20302204  protected:
    20312205
     
    20422216  /// \ingroup graph_adaptors
    20432217  ///
    2044   /// \brief Undirect the graph
    2045   ///
    2046   /// This adaptor makes an undirected graph from a directed
    2047   /// graph. All arcs of the underlying digraph will be showed in the
    2048   /// adaptor as an edge. The Orienter adaptor is conform to the \ref
    2049   /// concepts::Graph "Graph concept".
    2050   ///
    2051   /// \tparam _Digraph It must be conform to the \ref
    2052   /// concepts::Digraph "Digraph concept". The type can be specified
    2053   /// to const.
    2054   template<typename _Digraph>
    2055   class Undirector
    2056     : public GraphAdaptorExtender<UndirectorBase<_Digraph> > {
    2057   public:
    2058     typedef _Digraph Digraph;
    2059     typedef GraphAdaptorExtender<UndirectorBase<Digraph> > Parent;
     2218  /// \brief Adaptor class for viewing a digraph as an undirected graph.
     2219  ///
     2220  /// Undirector adaptor can be used for viewing a digraph as an undirected
     2221  /// graph. All arcs of the underlying digraph are showed in the
     2222  /// adaptor as an edge (and also as a pair of arcs, of course).
     2223  /// This adaptor conforms to the \ref concepts::Graph "Graph" concept.
     2224  ///
     2225  /// The adapted digraph can also be modified through this adaptor
     2226  /// by adding or removing nodes or edges, unless the \c GR template
     2227  /// parameter is set to be \c const.
     2228  ///
     2229  /// \tparam GR The type of the adapted digraph.
     2230  /// It must conform to the \ref concepts::Digraph "Digraph" concept.
     2231  /// It can also be specified to be \c const.
     2232  ///
     2233  /// \note The \c Node type of this adaptor and the adapted digraph are
     2234  /// convertible to each other, moreover the \c Edge type of the adaptor
     2235  /// and the \c Arc type of the adapted digraph are also convertible to
     2236  /// each other.
     2237  /// (Thus the \c Arc type of the adaptor is convertible to the \c Arc type
     2238  /// of the adapted digraph.)
     2239  template<typename GR>
     2240#ifdef DOXYGEN
     2241  class Undirector {
     2242#else
     2243  class Undirector :
     2244    public GraphAdaptorExtender<UndirectorBase<GR> > {
     2245#endif
     2246  public:
     2247    /// The type of the adapted digraph.
     2248    typedef GR Digraph;
     2249    typedef GraphAdaptorExtender<UndirectorBase<GR> > Parent;
    20602250  protected:
    20612251    Undirector() { }
     
    20642254    /// \brief Constructor
    20652255    ///
    2066     /// Creates a undirected graph from the given digraph
    2067     Undirector(_Digraph& digraph) {
     2256    /// Creates an undirected graph from the given digraph.
     2257    Undirector(Digraph& digraph) {
    20682258      setDigraph(digraph);
    20692259    }
    20702260
    2071     /// \brief ArcMap combined from two original ArcMap
    2072     ///
    2073     /// This class adapts two original digraph ArcMap to
    2074     /// get an arc map on the undirected graph.
    2075     template <typename _ForwardMap, typename _BackwardMap>
     2261    /// \brief Arc map combined from two original arc maps
     2262    ///
     2263    /// This map adaptor class adapts two arc maps of the underlying
     2264    /// digraph to get an arc map of the undirected graph.
     2265    /// Its value type is inherited from the first arc map type
     2266    /// (\c %ForwardMap).
     2267    template <typename ForwardMap, typename BackwardMap>
    20762268    class CombinedArcMap {
    20772269    public:
    20782270
    2079       typedef _ForwardMap ForwardMap;
    2080       typedef _BackwardMap BackwardMap;
     2271      /// The key type of the map
     2272      typedef typename Parent::Arc Key;
     2273      /// The value type of the map
     2274      typedef typename ForwardMap::Value Value;
    20812275
    20822276      typedef typename MapTraits<ForwardMap>::ReferenceMapTag ReferenceMapTag;
    20832277
    2084       typedef typename ForwardMap::Value Value;
    2085       typedef typename Parent::Arc Key;
    2086 
    2087       /// \brief Constructor
    2088       ///
     2278      typedef typename MapTraits<ForwardMap>::ReturnValue ReturnValue;
     2279      typedef typename MapTraits<ForwardMap>::ConstReturnValue ConstReturnValue;
     2280      typedef typename MapTraits<ForwardMap>::ReturnValue Reference;
     2281      typedef typename MapTraits<ForwardMap>::ConstReturnValue ConstReference;
     2282
    20892283      /// Constructor
    20902284      CombinedArcMap(ForwardMap& forward, BackwardMap& backward)
    20912285        : _forward(&forward), _backward(&backward) {}
    20922286
    2093 
    2094       /// \brief Sets the value associated with a key.
    2095       ///
    2096       /// Sets the value associated with a key.
     2287      /// Sets the value associated with the given key.
    20972288      void set(const Key& e, const Value& a) {
    20982289        if (Parent::direction(e)) {
     
    21032294      }
    21042295
    2105       /// \brief Returns the value associated with a key.
    2106       ///
    2107       /// Returns the value associated with a key.
    2108       typename MapTraits<ForwardMap>::ConstReturnValue
    2109       operator[](const Key& e) const {
     2296      /// Returns the value associated with the given key.
     2297      ConstReturnValue operator[](const Key& e) const {
    21102298        if (Parent::direction(e)) {
    21112299          return (*_forward)[e];
     
    21152303      }
    21162304
    2117       /// \brief Returns the value associated with a key.
    2118       ///
    2119       /// Returns the value associated with a key.
    2120       typename MapTraits<ForwardMap>::ReturnValue
    2121       operator[](const Key& e) {
     2305      /// Returns a reference to the value associated with the given key.
     2306      ReturnValue operator[](const Key& e) {
    21222307        if (Parent::direction(e)) {
    21232308          return (*_forward)[e];
     
    21342319    };
    21352320
    2136     /// \brief Just gives back a combined arc map
    2137     ///
    2138     /// Just gives back a combined arc map
     2321    /// \brief Returns a combined arc map
     2322    ///
     2323    /// This function just returns a combined arc map.
    21392324    template <typename ForwardMap, typename BackwardMap>
    21402325    static CombinedArcMap<ForwardMap, BackwardMap>
     
    21662351  };
    21672352
    2168   /// \brief Just gives back an undirected view of the given digraph
    2169   ///
    2170   /// Just gives back an undirected view of the given digraph
    2171   template<typename Digraph>
    2172   Undirector<const Digraph>
    2173   undirector(const Digraph& digraph) {
    2174     return Undirector<const Digraph>(digraph);
     2353  /// \brief Returns a read-only Undirector adaptor
     2354  ///
     2355  /// This function just returns a read-only \ref Undirector adaptor.
     2356  /// \ingroup graph_adaptors
     2357  /// \relates Undirector
     2358  template<typename GR>
     2359  Undirector<const GR> undirector(const GR& digraph) {
     2360    return Undirector<const GR>(digraph);
    21752361  }
     2362
    21762363
    21772364  template <typename _Graph, typename _DirectionMap>
     
    21922379    void first(Arc& i) const { _graph->first(i); }
    21932380    void firstIn(Arc& i, const Node& n) const {
    2194       bool d;
     2381      bool d = true;
    21952382      _graph->firstInc(i, d, n);
    21962383      while (i != INVALID && d == (*_direction)[i]) _graph->nextInc(i, d);
    21972384    }
    21982385    void firstOut(Arc& i, const Node& n ) const {
    2199       bool d;
     2386      bool d = true;
    22002387      _graph->firstInc(i, d, n);
    22012388      while (i != INVALID && d != (*_direction)[i]) _graph->nextInc(i, d);
     
    22252412    int nodeNum() const { return _graph->nodeNum(); }
    22262413
    2227     typedef EdgeNumTagIndicator<Graph> EdgeNumTag;
     2414    typedef EdgeNumTagIndicator<Graph> ArcNumTag;
    22282415    int arcNum() const { return _graph->edgeNum(); }
    22292416
    2230     typedef FindEdgeTagIndicator<Graph> FindEdgeTag;
     2417    typedef FindEdgeTagIndicator<Graph> FindArcTag;
    22312418    Arc findArc(const Node& u, const Node& v,
    2232                 const Arc& prev = INVALID) {
    2233       Arc arc = prev;
    2234       bool d = arc == INVALID ? true : (*_direction)[arc];
    2235       if (d) {
     2419                const Arc& prev = INVALID) const {
     2420      Arc arc = _graph->findEdge(u, v, prev);
     2421      while (arc != INVALID && source(arc) != u) {
    22362422        arc = _graph->findEdge(u, v, arc);
    2237         while (arc != INVALID && !(*_direction)[arc]) {
    2238           _graph->findEdge(u, v, arc);
    2239         }
    2240         if (arc != INVALID) return arc;
    2241       }
    2242       _graph->findEdge(v, u, arc);
    2243       while (arc != INVALID && (*_direction)[arc]) {
    2244         _graph->findEdge(u, v, arc);
    22452423      }
    22462424      return arc;
     
    22522430
    22532431    Arc addArc(const Node& u, const Node& v) {
    2254       Arc arc = _graph->addArc(u, v);
    2255       _direction->set(arc, _graph->source(arc) == u);
     2432      Arc arc = _graph->addEdge(u, v);
     2433      _direction->set(arc, _graph->u(arc) == u);
    22562434      return arc;
    22572435    }
     
    23442522  /// \ingroup graph_adaptors
    23452523  ///
    2346   /// \brief Orients the edges of the graph to get a digraph
    2347   ///
    2348   /// This adaptor orients each edge in the undirected graph. The
    2349   /// direction of the arcs stored in an edge node map.  The arcs can
    2350   /// be easily reverted by the \c reverseArc() member function in the
    2351   /// adaptor. The Orienter adaptor is conform to the \ref
    2352   /// concepts::Digraph "Digraph concept".
    2353   ///
    2354   /// \tparam _Graph It must be conform to the \ref concepts::Graph
    2355   /// "Graph concept". The type can be specified to be const.
    2356   /// \tparam _DirectionMap A bool valued edge map of the the adapted
    2357   /// graph.
    2358   ///
    2359   /// \sa orienter
    2360   template<typename _Graph,
    2361            typename DirectionMap = typename _Graph::template EdgeMap<bool> >
     2524  /// \brief Adaptor class for orienting the edges of a graph to get a digraph
     2525  ///
     2526  /// Orienter adaptor can be used for orienting the edges of a graph to
     2527  /// get a digraph. A \c bool edge map of the underlying graph must be
     2528  /// specified, which define the direction of the arcs in the adaptor.
     2529  /// The arcs can be easily reversed by the \c reverseArc() member function
     2530  /// of the adaptor.
     2531  /// This class conforms to the \ref concepts::Digraph "Digraph" concept.
     2532  ///
     2533  /// The adapted graph can also be modified through this adaptor
     2534  /// by adding or removing nodes or arcs, unless the \c GR template
     2535  /// parameter is set to be \c const.
     2536  ///
     2537  /// \tparam GR The type of the adapted graph.
     2538  /// It must conform to the \ref concepts::Graph "Graph" concept.
     2539  /// It can also be specified to be \c const.
     2540  /// \tparam DM The type of the direction map.
     2541  /// It must be a \c bool (or convertible) edge map of the
     2542  /// adapted graph. The default type is
     2543  /// \ref concepts::Graph::EdgeMap "GR::EdgeMap<bool>".
     2544  ///
     2545  /// \note The \c Node type of this adaptor and the adapted graph are
     2546  /// convertible to each other, moreover the \c Arc type of the adaptor
     2547  /// and the \c Edge type of the adapted graph are also convertible to
     2548  /// each other.
     2549#ifdef DOXYGEN
     2550  template<typename GR,
     2551           typename DM>
     2552  class Orienter {
     2553#else
     2554  template<typename GR,
     2555           typename DM = typename GR::template EdgeMap<bool> >
    23622556  class Orienter :
    2363     public DigraphAdaptorExtender<OrienterBase<_Graph, DirectionMap> > {
    2364   public:
    2365     typedef _Graph Graph;
    2366     typedef DigraphAdaptorExtender<
    2367       OrienterBase<_Graph, DirectionMap> > Parent;
     2557    public DigraphAdaptorExtender<OrienterBase<GR, DM> > {
     2558#endif
     2559  public:
     2560
     2561    /// The type of the adapted graph.
     2562    typedef GR Graph;
     2563    /// The type of the direction edge map.
     2564    typedef DM DirectionMap;
     2565
     2566    typedef DigraphAdaptorExtender<OrienterBase<GR, DM> > Parent;
    23682567    typedef typename Parent::Arc Arc;
    23692568  protected:
     
    23712570  public:
    23722571
    2373     /// \brief Constructor of the adaptor
    2374     ///
    2375     /// Constructor of the adaptor
     2572    /// \brief Constructor
     2573    ///
     2574    /// Constructor of the adaptor.
    23762575    Orienter(Graph& graph, DirectionMap& direction) {
    23772576      setGraph(graph);
     
    23792578    }
    23802579
    2381     /// \brief Reverse arc
    2382     ///
    2383     /// It reverse the given arc. It simply negate the direction in the map.
     2580    /// \brief Reverses the given arc
     2581    ///
     2582    /// This function reverses the given arc.
     2583    /// It is done by simply negate the assigned value of \c a
     2584    /// in the direction map.
    23842585    void reverseArc(const Arc& a) {
    23852586      Parent::reverseArc(a);
     
    23872588  };
    23882589
    2389   /// \brief Just gives back a Orienter
    2390   ///
    2391   /// Just gives back a Orienter
    2392   template<typename Graph, typename DirectionMap>
    2393   Orienter<const Graph, DirectionMap>
    2394   orienter(const Graph& graph, DirectionMap& dm) {
    2395     return Orienter<const Graph, DirectionMap>(graph, dm);
     2590  /// \brief Returns a read-only Orienter adaptor
     2591  ///
     2592  /// This function just returns a read-only \ref Orienter adaptor.
     2593  /// \ingroup graph_adaptors
     2594  /// \relates Orienter
     2595  template<typename GR, typename DM>
     2596  Orienter<const GR, DM>
     2597  orienter(const GR& graph, DM& direction_map) {
     2598    return Orienter<const GR, DM>(graph, direction_map);
    23962599  }
    23972600
    2398   template<typename Graph, typename DirectionMap>
    2399   Orienter<const Graph, const DirectionMap>
    2400   orienter(const Graph& graph, const DirectionMap& dm) {
    2401     return Orienter<const Graph, const DirectionMap>(graph, dm);
     2601  template<typename GR, typename DM>
     2602  Orienter<const GR, const DM>
     2603  orienter(const GR& graph, const DM& direction_map) {
     2604    return Orienter<const GR, const DM>(graph, direction_map);
    24022605  }
    24032606
    24042607  namespace _adaptor_bits {
    24052608
    2406     template<typename _Digraph,
    2407              typename _CapacityMap = typename _Digraph::template ArcMap<int>,
    2408              typename _FlowMap = _CapacityMap,
    2409              typename _Tolerance = Tolerance<typename _CapacityMap::Value> >
     2609    template<typename Digraph,
     2610             typename CapacityMap,
     2611             typename FlowMap,
     2612             typename Tolerance>
    24102613    class ResForwardFilter {
    24112614    public:
    2412 
    2413       typedef _Digraph Digraph;
    2414       typedef _CapacityMap CapacityMap;
    2415       typedef _FlowMap FlowMap;
    2416       typedef _Tolerance Tolerance;
    24172615
    24182616      typedef typename Digraph::Arc Key;
     
    24352633    };
    24362634
    2437     template<typename _Digraph,
    2438              typename _CapacityMap = typename _Digraph::template ArcMap<int>,
    2439              typename _FlowMap = _CapacityMap,
    2440              typename _Tolerance = Tolerance<typename _CapacityMap::Value> >
     2635    template<typename Digraph,
     2636             typename CapacityMap,
     2637             typename FlowMap,
     2638             typename Tolerance>
    24412639    class ResBackwardFilter {
    24422640    public:
    2443 
    2444       typedef _Digraph Digraph;
    2445       typedef _CapacityMap CapacityMap;
    2446       typedef _FlowMap FlowMap;
    2447       typedef _Tolerance Tolerance;
    24482641
    24492642      typedef typename Digraph::Arc Key;
     
    24712664  /// \ingroup graph_adaptors
    24722665  ///
    2473   /// \brief An adaptor for composing the residual graph for directed
     2666  /// \brief Adaptor class for composing the residual digraph for directed
    24742667  /// flow and circulation problems.
    24752668  ///
    2476   /// An adaptor for composing the residual graph for directed flow and
    2477   /// circulation problems.  Let \f$ G=(V, A) \f$ be a directed graph
    2478   /// and let \f$ F \f$ be a number type. Let moreover \f$ f,c:A\to F \f$,
    2479   /// be functions on the arc-set.
    2480   ///
    2481   /// Then Residual implements the digraph structure with
    2482   /// node-set \f$ V \f$ and arc-set \f$ A_{forward}\cup A_{backward} \f$,
    2483   /// where \f$ A_{forward}=\{uv : uv\in A, f(uv)<c(uv)\} \f$ and
    2484   /// \f$ A_{backward}=\{vu : uv\in A, f(uv)>0\} \f$, i.e. the so
    2485   /// called residual graph.  When we take the union
    2486   /// \f$ A_{forward}\cup A_{backward} \f$, multiplicities are counted,
    2487   /// i.e.  if an arc is in both \f$ A_{forward} \f$ and
    2488   /// \f$ A_{backward} \f$, then in the adaptor it appears in both
    2489   /// orientation.
    2490   ///
    2491   /// \tparam _Digraph It must be conform to the \ref concepts::Digraph
    2492   /// "Digraph concept". The type is implicitly const.
    2493   /// \tparam _CapacityMap An arc map of some numeric type, it defines
    2494   /// the capacities in the flow problem. The map is implicitly const.
    2495   /// \tparam _FlowMap An arc map of some numeric type, it defines
    2496   /// the capacities in the flow problem.
    2497   /// \tparam _Tolerance Handler for inexact computation.
    2498   template<typename _Digraph,
    2499            typename _CapacityMap = typename _Digraph::template ArcMap<int>,
    2500            typename _FlowMap = _CapacityMap,
    2501            typename _Tolerance = Tolerance<typename _CapacityMap::Value> >
    2502   class Residual :
     2669  /// ResidualDigraph can be used for composing the \e residual digraph
     2670  /// for directed flow and circulation problems. Let \f$ G=(V, A) \f$
     2671  /// be a directed graph and let \f$ F \f$ be a number type.
     2672  /// Let \f$ flow, cap: A\to F \f$ be functions on the arcs.
     2673  /// This adaptor implements a digraph structure with node set \f$ V \f$
     2674  /// and arc set \f$ A_{forward}\cup A_{backward} \f$,
     2675  /// where \f$ A_{forward}=\{uv : uv\in A, flow(uv)<cap(uv)\} \f$ and
     2676  /// \f$ A_{backward}=\{vu : uv\in A, flow(uv)>0\} \f$, i.e. the so
     2677  /// called residual digraph.
     2678  /// When the union \f$ A_{forward}\cup A_{backward} \f$ is taken,
     2679  /// multiplicities are counted, i.e. the adaptor has exactly
     2680  /// \f$ |A_{forward}| + |A_{backward}|\f$ arcs (it may have parallel
     2681  /// arcs).
     2682  /// This class conforms to the \ref concepts::Digraph "Digraph" concept.
     2683  ///
     2684  /// \tparam GR The type of the adapted digraph.
     2685  /// It must conform to the \ref concepts::Digraph "Digraph" concept.
     2686  /// It is implicitly \c const.
     2687  /// \tparam CM The type of the capacity map.
     2688  /// It must be an arc map of some numerical type, which defines
     2689  /// the capacities in the flow problem. It is implicitly \c const.
     2690  /// The default type is
     2691  /// \ref concepts::Digraph::ArcMap "GR::ArcMap<int>".
     2692  /// \tparam FM The type of the flow map.
     2693  /// It must be an arc map of some numerical type, which defines
     2694  /// the flow values in the flow problem. The default type is \c CM.
     2695  /// \tparam TL The tolerance type for handling inexact computation.
     2696  /// The default tolerance type depends on the value type of the
     2697  /// capacity map.
     2698  ///
     2699  /// \note This adaptor is implemented using Undirector and FilterArcs
     2700  /// adaptors.
     2701  ///
     2702  /// \note The \c Node type of this adaptor and the adapted digraph are
     2703  /// convertible to each other, moreover the \c Arc type of the adaptor
     2704  /// is convertible to the \c Arc type of the adapted digraph.
     2705#ifdef DOXYGEN
     2706  template<typename GR, typename CM, typename FM, typename TL>
     2707  class ResidualDigraph
     2708#else
     2709  template<typename GR,
     2710           typename CM = typename GR::template ArcMap<int>,
     2711           typename FM = CM,
     2712           typename TL = Tolerance<typename CM::Value> >
     2713  class ResidualDigraph :
    25032714    public FilterArcs<
    2504     Undirector<const _Digraph>,
    2505     typename Undirector<const _Digraph>::template CombinedArcMap<
    2506       _adaptor_bits::ResForwardFilter<const _Digraph, _CapacityMap,
    2507                                       _FlowMap, _Tolerance>,
    2508       _adaptor_bits::ResBackwardFilter<const _Digraph, _CapacityMap,
    2509                                        _FlowMap, _Tolerance> > >
     2715      Undirector<const GR>,
     2716      typename Undirector<const GR>::template CombinedArcMap<
     2717        _adaptor_bits::ResForwardFilter<const GR, CM, FM, TL>,
     2718        _adaptor_bits::ResBackwardFilter<const GR, CM, FM, TL> > >
     2719#endif
    25102720  {
    25112721  public:
    25122722
    2513     typedef _Digraph Digraph;
    2514     typedef _CapacityMap CapacityMap;
    2515     typedef _FlowMap FlowMap;
    2516     typedef _Tolerance Tolerance;
     2723    /// The type of the underlying digraph.
     2724    typedef GR Digraph;
     2725    /// The type of the capacity map.
     2726    typedef CM CapacityMap;
     2727    /// The type of the flow map.
     2728    typedef FM FlowMap;
     2729    /// The tolerance type.
     2730    typedef TL Tolerance;
    25172731
    25182732    typedef typename CapacityMap::Value Value;
    2519     typedef Residual Adaptor;
     2733    typedef ResidualDigraph Adaptor;
    25202734
    25212735  protected:
     
    25302744
    25312745    typedef typename Undirected::
    2532     template CombinedArcMap<ForwardFilter, BackwardFilter> ArcFilter;
     2746      template CombinedArcMap<ForwardFilter, BackwardFilter> ArcFilter;
    25332747
    25342748    typedef FilterArcs<Undirected, ArcFilter> Parent;
     
    25442758  public:
    25452759
    2546     /// \brief Constructor of the residual digraph.
    2547     ///
    2548     /// Constructor of the residual graph. The parameters are the digraph,
    2549     /// the flow map, the capacity map and a tolerance object.
    2550     Residual(const Digraph& digraph, const CapacityMap& capacity,
    2551              FlowMap& flow, const Tolerance& tolerance = Tolerance())
     2760    /// \brief Constructor
     2761    ///
     2762    /// Constructor of the residual digraph adaptor. The parameters are the
     2763    /// digraph, the capacity map, the flow map, and a tolerance object.
     2764    ResidualDigraph(const Digraph& digraph, const CapacityMap& capacity,
     2765                    FlowMap& flow, const Tolerance& tolerance = Tolerance())
    25522766      : Parent(), _capacity(&capacity), _flow(&flow), _graph(digraph),
    25532767        _forward_filter(capacity, flow, tolerance),
     
    25612775    typedef typename Parent::Arc Arc;
    25622776
    2563     /// \brief Gives back the residual capacity of the arc.
    2564     ///
    2565     /// Gives back the residual capacity of the arc.
     2777    /// \brief Returns the residual capacity of the given arc.
     2778    ///
     2779    /// Returns the residual capacity of the given arc.
    25662780    Value residualCapacity(const Arc& a) const {
    25672781      if (Undirected::direction(a)) {
     
    25722786    }
    25732787
    2574     /// \brief Augment on the given arc in the residual graph.
    2575     ///
    2576     /// Augment on the given arc in the residual graph. It increase
    2577     /// or decrease the flow on the original arc depend on the direction
    2578     /// of the residual arc.
     2788    /// \brief Augments on the given arc in the residual digraph.
     2789    ///
     2790    /// Augments on the given arc in the residual digraph. It increases
     2791    /// or decreases the flow value on the original arc according to the
     2792    /// direction of the residual arc.
    25792793    void augment(const Arc& a, const Value& v) const {
    25802794      if (Undirected::direction(a)) {
     
    25852799    }
    25862800
    2587     /// \brief Returns the direction of the arc.
    2588     ///
    2589     /// Returns true when the arc is same oriented as the original arc.
     2801    /// \brief Returns \c true if the given residual arc is a forward arc.
     2802    ///
     2803    /// Returns \c true if the given residual arc has the same orientation
     2804    /// as the original arc, i.e. it is a so called forward arc.
    25902805    static bool forward(const Arc& a) {
    25912806      return Undirected::direction(a);
    25922807    }
    25932808
    2594     /// \brief Returns the direction of the arc.
    2595     ///
    2596     /// Returns true when the arc is opposite oriented as the original arc.
     2809    /// \brief Returns \c true if the given residual arc is a backward arc.
     2810    ///
     2811    /// Returns \c true if the given residual arc has the opposite orientation
     2812    /// than the original arc, i.e. it is a so called backward arc.
    25972813    static bool backward(const Arc& a) {
    25982814      return !Undirected::direction(a);
    25992815    }
    26002816
    2601     /// \brief Gives back the forward oriented residual arc.
    2602     ///
    2603     /// Gives back the forward oriented residual arc.
     2817    /// \brief Returns the forward oriented residual arc.
     2818    ///
     2819    /// Returns the forward oriented residual arc related to the given
     2820    /// arc of the underlying digraph.
    26042821    static Arc forward(const typename Digraph::Arc& a) {
    26052822      return Undirected::direct(a, true);
    26062823    }
    26072824
    2608     /// \brief Gives back the backward oriented residual arc.
    2609     ///
    2610     /// Gives back the backward oriented residual arc.
     2825    /// \brief Returns the backward oriented residual arc.
     2826    ///
     2827    /// Returns the backward oriented residual arc related to the given
     2828    /// arc of the underlying digraph.
    26112829    static Arc backward(const typename Digraph::Arc& a) {
    26122830      return Undirected::direct(a, false);
     
    26152833    /// \brief Residual capacity map.
    26162834    ///
    2617     /// In generic residual graph the residual capacity can be obtained
    2618     /// as a map.
     2835    /// This map adaptor class can be used for obtaining the residual
     2836    /// capacities as an arc map of the residual digraph.
     2837    /// Its value type is inherited from the capacity map.
    26192838    class ResidualCapacity {
    26202839    protected:
    26212840      const Adaptor* _adaptor;
    26222841    public:
    2623       /// The Key type
     2842      /// The key type of the map
    26242843      typedef Arc Key;
    2625       /// The Value type
    2626       typedef typename _CapacityMap::Value Value;
     2844      /// The value type of the map
     2845      typedef typename CapacityMap::Value Value;
    26272846
    26282847      /// Constructor
    26292848      ResidualCapacity(const Adaptor& adaptor) : _adaptor(&adaptor) {}
    26302849
    2631       /// \e
     2850      /// Returns the value associated with the given residual arc
    26322851      Value operator[](const Arc& a) const {
    26332852        return _adaptor->residualCapacity(a);
     
    26362855    };
    26372856
     2857    /// \brief Returns a residual capacity map
     2858    ///
     2859    /// This function just returns a residual capacity map.
     2860    ResidualCapacity residualCapacity() const {
     2861      return ResidualCapacity(*this);
     2862    }
     2863
    26382864  };
     2865
     2866  /// \brief Returns a (read-only) Residual adaptor
     2867  ///
     2868  /// This function just returns a (read-only) \ref Residual adaptor.
     2869  /// \ingroup graph_adaptors
     2870  /// \relates Residual
     2871  template<typename GR, typename CM, typename FM>
     2872  ResidualDigraph<GR, CM, FM>
     2873  residualDigraph(const GR& digraph, const CM& capacity_map, FM& flow_map) {
     2874    return ResidualDigraph<GR, CM, FM> (digraph, capacity_map, flow_map);
     2875  }
     2876
    26392877
    26402878  template <typename _Digraph>
     
    28853123
    28863124    typedef True NodeNumTag;
    2887 
    28883125    int nodeNum() const {
    28893126      return  2 * countNodes(*_digraph);
    28903127    }
    28913128
    2892     typedef True EdgeNumTag;
     3129    typedef True ArcNumTag;
    28933130    int arcNum() const {
    28943131      return countArcs(*_digraph) + countNodes(*_digraph);
    28953132    }
    28963133
    2897     typedef True FindEdgeTag;
     3134    typedef True FindArcTag;
    28983135    Arc findArc(const Node& u, const Node& v,
    28993136                const Arc& prev = INVALID) const {
    2900       if (inNode(u)) {
    2901         if (outNode(v)) {
    2902           if (static_cast<const DigraphNode&>(u) ==
    2903               static_cast<const DigraphNode&>(v) && prev == INVALID) {
    2904             return Arc(u);
    2905           }
     3137      if (inNode(u) && outNode(v)) {
     3138        if (static_cast<const DigraphNode&>(u) ==
     3139            static_cast<const DigraphNode&>(v) && prev == INVALID) {
     3140          return Arc(u);
    29063141        }
    2907       } else {
    2908         if (inNode(v)) {
    2909           return Arc(::lemon::findArc(*_digraph, u, v, prev));
    2910         }
     3142      }
     3143      else if (outNode(u) && inNode(v)) {
     3144        return Arc(::lemon::findArc(*_digraph, u, v, prev));
    29113145      }
    29123146      return INVALID;
     
    29223156      typedef Node Key;
    29233157      typedef _Value Value;
     3158      typedef typename MapTraits<NodeImpl>::ReferenceMapTag ReferenceMapTag;
     3159      typedef typename MapTraits<NodeImpl>::ReturnValue ReturnValue;
     3160      typedef typename MapTraits<NodeImpl>::ConstReturnValue ConstReturnValue;
     3161      typedef typename MapTraits<NodeImpl>::ReturnValue Reference;
     3162      typedef typename MapTraits<NodeImpl>::ConstReturnValue ConstReference;
    29243163
    29253164      NodeMapBase(const Adaptor& adaptor)
     
    29343173      }
    29353174
    2936       typename MapTraits<NodeImpl>::ReturnValue
    2937       operator[](const Node& key) {
     3175      ReturnValue operator[](const Node& key) {
    29383176        if (Adaptor::inNode(key)) { return _in_map[key]; }
    29393177        else { return _out_map[key]; }
    29403178      }
    29413179
    2942       typename MapTraits<NodeImpl>::ConstReturnValue
    2943       operator[](const Node& key) const {
     3180      ConstReturnValue operator[](const Node& key) const {
    29443181        if (Adaptor::inNode(key)) { return _in_map[key]; }
    29453182        else { return _out_map[key]; }
     
    29583195      typedef Arc Key;
    29593196      typedef _Value Value;
     3197      typedef typename MapTraits<ArcImpl>::ReferenceMapTag ReferenceMapTag;
     3198      typedef typename MapTraits<ArcImpl>::ReturnValue ReturnValue;
     3199      typedef typename MapTraits<ArcImpl>::ConstReturnValue ConstReturnValue;
     3200      typedef typename MapTraits<ArcImpl>::ReturnValue Reference;
     3201      typedef typename MapTraits<ArcImpl>::ConstReturnValue ConstReference;
    29603202
    29613203      ArcMapBase(const Adaptor& adaptor)
     
    29733215      }
    29743216
    2975       typename MapTraits<ArcImpl>::ReturnValue
    2976       operator[](const Arc& key) {
     3217      ReturnValue operator[](const Arc& key) {
    29773218        if (Adaptor::origArc(key)) {
    29783219          return _arc_map[key._item.first()];
     
    29823223      }
    29833224
    2984       typename MapTraits<ArcImpl>::ConstReturnValue
    2985       operator[](const Arc& key) const {
     3225      ConstReturnValue operator[](const Arc& key) const {
    29863226        if (Adaptor::origArc(key)) {
    29873227          return _arc_map[key._item.first()];
     
    30643304  /// \ingroup graph_adaptors
    30653305  ///
    3066   /// \brief Split the nodes of a directed graph
    3067   ///
    3068   /// The SplitNodes adaptor splits each node into an in-node and an
    3069   /// out-node. Formaly, the adaptor replaces each \f$ u \f$ node in
    3070   /// the digraph with two nodes(namely node \f$ u_{in} \f$ and node
    3071   /// \f$ u_{out} \f$). If there is a \f$ (v, u) \f$ arc in the
    3072   /// original digraph the new target of the arc will be \f$ u_{in} \f$
    3073   /// and similarly the source of the original \f$ (u, v) \f$ arc
    3074   /// will be \f$ u_{out} \f$.  The adaptor will add for each node in
    3075   /// the original digraph an additional arc which connects
    3076   /// \f$ (u_{in}, u_{out}) \f$.
    3077   ///
    3078   /// The aim of this class is to run algorithm with node costs if the
    3079   /// algorithm can use directly just arc costs. In this case we should use
    3080   /// a \c SplitNodes and set the node cost of the graph to the
    3081   /// bind arc in the adapted graph.
    3082   ///
    3083   /// \tparam _Digraph It must be conform to the \ref concepts::Digraph
    3084   /// "Digraph concept". The type can be specified to be const.
    3085   template <typename _Digraph>
     3306  /// \brief Adaptor class for splitting the nodes of a digraph.
     3307  ///
     3308  /// SplitNodes adaptor can be used for splitting each node into an
     3309  /// \e in-node and an \e out-node in a digraph. Formaly, the adaptor
     3310  /// replaces each node \f$ u \f$ in the digraph with two nodes,
     3311  /// namely node \f$ u_{in} \f$ and node \f$ u_{out} \f$.
     3312  /// If there is a \f$ (v, u) \f$ arc in the original digraph, then the
     3313  /// new target of the arc will be \f$ u_{in} \f$ and similarly the
     3314  /// source of each original \f$ (u, v) \f$ arc will be \f$ u_{out} \f$.
     3315  /// The adaptor adds an additional \e bind \e arc from \f$ u_{in} \f$
     3316  /// to \f$ u_{out} \f$ for each node \f$ u \f$ of the original digraph.
     3317  ///
     3318  /// The aim of this class is running an algorithm with respect to node
     3319  /// costs or capacities if the algorithm considers only arc costs or
     3320  /// capacities directly.
     3321  /// In this case you can use \c SplitNodes adaptor, and set the node
     3322  /// costs/capacities of the original digraph to the \e bind \e arcs
     3323  /// in the adaptor.
     3324  ///
     3325  /// \tparam GR The type of the adapted digraph.
     3326  /// It must conform to the \ref concepts::Digraph "Digraph" concept.
     3327  /// It is implicitly \c const.
     3328  ///
     3329  /// \note The \c Node type of this adaptor is converible to the \c Node
     3330  /// type of the adapted digraph.
     3331  template <typename GR>
     3332#ifdef DOXYGEN
     3333  class SplitNodes {
     3334#else
    30863335  class SplitNodes
    3087     : public DigraphAdaptorExtender<SplitNodesBase<_Digraph> > {
    3088   public:
    3089     typedef _Digraph Digraph;
    3090     typedef DigraphAdaptorExtender<SplitNodesBase<Digraph> > Parent;
     3336    : public DigraphAdaptorExtender<SplitNodesBase<const GR> > {
     3337#endif
     3338  public:
     3339    typedef GR Digraph;
     3340    typedef DigraphAdaptorExtender<SplitNodesBase<const GR> > Parent;
    30913341
    30923342    typedef typename Digraph::Node DigraphNode;
     
    30963346    typedef typename Parent::Arc Arc;
    30973347
    3098     /// \brief Constructor of the adaptor.
     3348    /// \brief Constructor
    30993349    ///
    31003350    /// Constructor of the adaptor.
    3101     SplitNodes(Digraph& g) {
     3351    SplitNodes(const Digraph& g) {
    31023352      Parent::setDigraph(g);
    31033353    }
    31043354
    3105     /// \brief Returns true when the node is in-node.
    3106     ///
    3107     /// Returns true when the node is in-node.
     3355    /// \brief Returns \c true if the given node is an in-node.
     3356    ///
     3357    /// Returns \c true if the given node is an in-node.
    31083358    static bool inNode(const Node& n) {
    31093359      return Parent::inNode(n);
    31103360    }
    31113361
    3112     /// \brief Returns true when the node is out-node.
    3113     ///
    3114     /// Returns true when the node is out-node.
     3362    /// \brief Returns \c true if the given node is an out-node.
     3363    ///
     3364    /// Returns \c true if the given node is an out-node.
    31153365    static bool outNode(const Node& n) {
    31163366      return Parent::outNode(n);
    31173367    }
    31183368
    3119     /// \brief Returns true when the arc is arc in the original digraph.
    3120     ///
    3121     /// Returns true when the arc is arc in the original digraph.
     3369    /// \brief Returns \c true if the given arc is an original arc.
     3370    ///
     3371    /// Returns \c true if the given arc is one of the arcs in the
     3372    /// original digraph.
    31223373    static bool origArc(const Arc& a) {
    31233374      return Parent::origArc(a);
    31243375    }
    31253376
    3126     /// \brief Returns true when the arc binds an in-node and an out-node.
    3127     ///
    3128     /// Returns true when the arc binds an in-node and an out-node.
     3377    /// \brief Returns \c true if the given arc is a bind arc.
     3378    ///
     3379    /// Returns \c true if the given arc is a bind arc, i.e. it connects
     3380    /// an in-node and an out-node.
    31293381    static bool bindArc(const Arc& a) {
    31303382      return Parent::bindArc(a);
    31313383    }
    31323384
    3133     /// \brief Gives back the in-node created from the \c node.
    3134     ///
    3135     /// Gives back the in-node created from the \c node.
     3385    /// \brief Returns the in-node created from the given original node.
     3386    ///
     3387    /// Returns the in-node created from the given original node.
    31363388    static Node inNode(const DigraphNode& n) {
    31373389      return Parent::inNode(n);
    31383390    }
    31393391
    3140     /// \brief Gives back the out-node created from the \c node.
    3141     ///
    3142     /// Gives back the out-node created from the \c node.
     3392    /// \brief Returns the out-node created from the given original node.
     3393    ///
     3394    /// Returns the out-node created from the given original node.
    31433395    static Node outNode(const DigraphNode& n) {
    31443396      return Parent::outNode(n);
    31453397    }
    31463398
    3147     /// \brief Gives back the arc binds the two part of the node.
    3148     ///
    3149     /// Gives back the arc binds the two part of the node.
     3399    /// \brief Returns the bind arc that corresponds to the given
     3400    /// original node.
     3401    ///
     3402    /// Returns the bind arc in the adaptor that corresponds to the given
     3403    /// original node, i.e. the arc connecting the in-node and out-node
     3404    /// of \c n.
    31503405    static Arc arc(const DigraphNode& n) {
    31513406      return Parent::arc(n);
    31523407    }
    31533408
    3154     /// \brief Gives back the arc of the original arc.
    3155     ///
    3156     /// Gives back the arc of the original arc.
     3409    /// \brief Returns the arc that corresponds to the given original arc.
     3410    ///
     3411    /// Returns the arc in the adaptor that corresponds to the given
     3412    /// original arc.
    31573413    static Arc arc(const DigraphArc& a) {
    31583414      return Parent::arc(a);
    31593415    }
    31603416
    3161     /// \brief NodeMap combined from two original NodeMap
    3162     ///
    3163     /// This class adapt two of the original digraph NodeMap to
    3164     /// get a node map on the adapted digraph.
     3417    /// \brief Node map combined from two original node maps
     3418    ///
     3419    /// This map adaptor class adapts two node maps of the original digraph
     3420    /// to get a node map of the split digraph.
     3421    /// Its value type is inherited from the first node map type
     3422    /// (\c InNodeMap).
    31653423    template <typename InNodeMap, typename OutNodeMap>
    31663424    class CombinedNodeMap {
    31673425    public:
    31683426
     3427      /// The key type of the map
    31693428      typedef Node Key;
     3429      /// The value type of the map
    31703430      typedef typename InNodeMap::Value Value;
    31713431
    3172       /// \brief Constructor
    3173       ///
    3174       /// Constructor.
     3432      typedef typename MapTraits<InNodeMap>::ReferenceMapTag ReferenceMapTag;
     3433      typedef typename MapTraits<InNodeMap>::ReturnValue ReturnValue;
     3434      typedef typename MapTraits<InNodeMap>::ConstReturnValue ConstReturnValue;
     3435      typedef typename MapTraits<InNodeMap>::ReturnValue Reference;
     3436      typedef typename MapTraits<InNodeMap>::ConstReturnValue ConstReference;
     3437
     3438      /// Constructor
    31753439      CombinedNodeMap(InNodeMap& in_map, OutNodeMap& out_map)
    31763440        : _in_map(in_map), _out_map(out_map) {}
    31773441
    3178       /// \brief The subscript operator.
    3179       ///
    3180       /// The subscript operator.
     3442      /// Returns the value associated with the given key.
     3443      Value operator[](const Key& key) const {
     3444        if (Parent::inNode(key)) {
     3445          return _in_map[key];
     3446        } else {
     3447          return _out_map[key];
     3448        }
     3449      }
     3450
     3451      /// Returns a reference to the value associated with the given key.
    31813452      Value& operator[](const Key& key) {
    31823453        if (Parent::inNode(key)) {
     
    31873458      }
    31883459
    3189       /// \brief The const subscript operator.
    3190       ///
    3191       /// The const subscript operator.
    3192       Value operator[](const Key& key) const {
    3193         if (Parent::inNode(key)) {
    3194           return _in_map[key];
    3195         } else {
    3196           return _out_map[key];
    3197         }
    3198       }
    3199 
    3200       /// \brief The setter function of the map.
    3201       ///
    3202       /// The setter function of the map.
     3460      /// Sets the value associated with the given key.
    32033461      void set(const Key& key, const Value& value) {
    32043462        if (Parent::inNode(key)) {
     
    32173475
    32183476
    3219     /// \brief Just gives back a combined node map
    3220     ///
    3221     /// Just gives back a combined node map
     3477    /// \brief Returns a combined node map
     3478    ///
     3479    /// This function just returns a combined node map.
    32223480    template <typename InNodeMap, typename OutNodeMap>
    32233481    static CombinedNodeMap<InNodeMap, OutNodeMap>
     
    32453503    }
    32463504
    3247     /// \brief ArcMap combined from an original ArcMap and a NodeMap
    3248     ///
    3249     /// This class adapt an original ArcMap and a NodeMap to get an
    3250     /// arc map on the adapted digraph
    3251     template <typename DigraphArcMap, typename DigraphNodeMap>
     3505    /// \brief Arc map combined from an arc map and a node map of the
     3506    /// original digraph.
     3507    ///
     3508    /// This map adaptor class adapts an arc map and a node map of the
     3509    /// original digraph to get an arc map of the split digraph.
     3510    /// Its value type is inherited from the original arc map type
     3511    /// (\c ArcMap).
     3512    template <typename ArcMap, typename NodeMap>
    32523513    class CombinedArcMap {
    32533514    public:
    32543515
     3516      /// The key type of the map
    32553517      typedef Arc Key;
    3256       typedef typename DigraphArcMap::Value Value;
    3257 
    3258       /// \brief Constructor
    3259       ///
    3260       /// Constructor.
    3261       CombinedArcMap(DigraphArcMap& arc_map, DigraphNodeMap& node_map)
     3518      /// The value type of the map
     3519      typedef typename ArcMap::Value Value;
     3520
     3521      typedef typename MapTraits<ArcMap>::ReferenceMapTag ReferenceMapTag;
     3522      typedef typename MapTraits<ArcMap>::ReturnValue ReturnValue;
     3523      typedef typename MapTraits<ArcMap>::ConstReturnValue ConstReturnValue;
     3524      typedef typename MapTraits<ArcMap>::ReturnValue Reference;
     3525      typedef typename MapTraits<ArcMap>::ConstReturnValue ConstReference;
     3526
     3527      /// Constructor
     3528      CombinedArcMap(ArcMap& arc_map, NodeMap& node_map)
    32623529        : _arc_map(arc_map), _node_map(node_map) {}
    32633530
    3264       /// \brief The subscript operator.
    3265       ///
    3266       /// The subscript operator.
     3531      /// Returns the value associated with the given key.
     3532      Value operator[](const Key& arc) const {
     3533        if (Parent::origArc(arc)) {
     3534          return _arc_map[arc];
     3535        } else {
     3536          return _node_map[arc];
     3537        }
     3538      }
     3539
     3540      /// Returns a reference to the value associated with the given key.
     3541      Value& operator[](const Key& arc) {
     3542        if (Parent::origArc(arc)) {
     3543          return _arc_map[arc];
     3544        } else {
     3545          return _node_map[arc];
     3546        }
     3547      }
     3548
     3549      /// Sets the value associated with the given key.
    32673550      void set(const Arc& arc, const Value& val) {
    32683551        if (Parent::origArc(arc)) {
     
    32733556      }
    32743557
    3275       /// \brief The const subscript operator.
    3276       ///
    3277       /// The const subscript operator.
    3278       Value operator[](const Key& arc) const {
    3279         if (Parent::origArc(arc)) {
    3280           return _arc_map[arc];
    3281         } else {
    3282           return _node_map[arc];
    3283         }
    3284       }
    3285 
    3286       /// \brief The const subscript operator.
    3287       ///
    3288       /// The const subscript operator.
    3289       Value& operator[](const Key& arc) {
    3290         if (Parent::origArc(arc)) {
    3291           return _arc_map[arc];
    3292         } else {
    3293           return _node_map[arc];
    3294         }
    3295       }
    3296 
    32973558    private:
    3298       DigraphArcMap& _arc_map;
    3299       DigraphNodeMap& _node_map;
     3559      ArcMap& _arc_map;
     3560      NodeMap& _node_map;
    33003561    };
    33013562
    3302     /// \brief Just gives back a combined arc map
    3303     ///
    3304     /// Just gives back a combined arc map
    3305     template <typename DigraphArcMap, typename DigraphNodeMap>
    3306     static CombinedArcMap<DigraphArcMap, DigraphNodeMap>
    3307     combinedArcMap(DigraphArcMap& arc_map, DigraphNodeMap& node_map) {
    3308       return CombinedArcMap<DigraphArcMap, DigraphNodeMap>(arc_map, node_map);
    3309     }
    3310 
    3311     template <typename DigraphArcMap, typename DigraphNodeMap>
    3312     static CombinedArcMap<const DigraphArcMap, DigraphNodeMap>
    3313     combinedArcMap(const DigraphArcMap& arc_map, DigraphNodeMap& node_map) {
    3314       return CombinedArcMap<const DigraphArcMap,
    3315         DigraphNodeMap>(arc_map, node_map);
    3316     }
    3317 
    3318     template <typename DigraphArcMap, typename DigraphNodeMap>
    3319     static CombinedArcMap<DigraphArcMap, const DigraphNodeMap>
    3320     combinedArcMap(DigraphArcMap& arc_map, const DigraphNodeMap& node_map) {
    3321       return CombinedArcMap<DigraphArcMap,
    3322         const DigraphNodeMap>(arc_map, node_map);
    3323     }
    3324 
    3325     template <typename DigraphArcMap, typename DigraphNodeMap>
    3326     static CombinedArcMap<const DigraphArcMap, const DigraphNodeMap>
    3327     combinedArcMap(const DigraphArcMap& arc_map,
    3328                    const DigraphNodeMap& node_map) {
    3329       return CombinedArcMap<const DigraphArcMap,
    3330         const DigraphNodeMap>(arc_map, node_map);
     3563    /// \brief Returns a combined arc map
     3564    ///
     3565    /// This function just returns a combined arc map.
     3566    template <typename ArcMap, typename NodeMap>
     3567    static CombinedArcMap<ArcMap, NodeMap>
     3568    combinedArcMap(ArcMap& arc_map, NodeMap& node_map) {
     3569      return CombinedArcMap<ArcMap, NodeMap>(arc_map, node_map);
     3570    }
     3571
     3572    template <typename ArcMap, typename NodeMap>
     3573    static CombinedArcMap<const ArcMap, NodeMap>
     3574    combinedArcMap(const ArcMap& arc_map, NodeMap& node_map) {
     3575      return CombinedArcMap<const ArcMap, NodeMap>(arc_map, node_map);
     3576    }
     3577
     3578    template <typename ArcMap, typename NodeMap>
     3579    static CombinedArcMap<ArcMap, const NodeMap>
     3580    combinedArcMap(ArcMap& arc_map, const NodeMap& node_map) {
     3581      return CombinedArcMap<ArcMap, const NodeMap>(arc_map, node_map);
     3582    }
     3583
     3584    template <typename ArcMap, typename NodeMap>
     3585    static CombinedArcMap<const ArcMap, const NodeMap>
     3586    combinedArcMap(const ArcMap& arc_map, const NodeMap& node_map) {
     3587      return CombinedArcMap<const ArcMap, const NodeMap>(arc_map, node_map);
    33313588    }
    33323589
    33333590  };
    33343591
    3335   /// \brief Just gives back a node splitter
    3336   ///
    3337   /// Just gives back a node splitter
    3338   template<typename Digraph>
    3339   SplitNodes<Digraph>
    3340   splitNodes(const Digraph& digraph) {
    3341     return SplitNodes<Digraph>(digraph);
     3592  /// \brief Returns a (read-only) SplitNodes adaptor
     3593  ///
     3594  /// This function just returns a (read-only) \ref SplitNodes adaptor.
     3595  /// \ingroup graph_adaptors
     3596  /// \relates SplitNodes
     3597  template<typename GR>
     3598  SplitNodes<GR>
     3599  splitNodes(const GR& digraph) {
     3600    return SplitNodes<GR>(digraph);
    33423601  }
    33433602
    3344 
    33453603} //namespace lemon
    33463604
  • 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

    r420 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/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

    r416 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).
     
    174174  };
    175175
    176 
    177   /// \ingroup digraphbits
    178   ///
    179   /// \brief Extender for the GraphAdaptors
    180176  template <typename _Graph>
    181177  class GraphAdaptorExtender : public _Graph {
  • 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

    r420 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.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/config.h.in

    r1 r459  
     1/* Define to 1 if you have any LP solver. */
     2#undef HAVE_LP
     3
     4/* Define to 1 if you have any MIP solver. */
     5#undef HAVE_MIP
     6
    17/* Define to 1 if you have CPLEX. */
    28#undef HAVE_CPLEX
     
    410/* Define to 1 if you have GLPK. */
    511#undef HAVE_GLPK
     12
     13/* Define to 1 if you have SOPLEX */
     14#undef HAVE_SOPLEX
     15
     16/* Define to 1 if you have CLP */
     17#undef HAVE_CLP
  • lemon/connectivity.h

    r419 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).
     
    296296  /// direction.
    297297  ///
    298   /// \param graph The graph.
     298  /// \param digraph The graph.
    299299  /// \return The number of components
    300300  /// \note By definition, the empty graph has zero
     
    12261226  /// that the given graph is DAG.
    12271227  ///
    1228   /// \param graph The graph. It must be directed and acyclic.
     1228  /// \param digraph The graph. It must be directed and acyclic.
    12291229  /// \retval order A readable - writable node map. The values will be set
    12301230  /// from 0 to the number of the nodes in the graph minus one. Each values
  • 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

    r421 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/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

    r420 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.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;
  • m4/lx_check_cplex.m4

    r187 r457  
    6363    if test x"$lx_cplex_found" = x"yes"; then
    6464      AC_DEFINE([HAVE_CPLEX], [1], [Define to 1 if you have CPLEX.])
     65      lx_lp_found=yes
     66      AC_DEFINE([HAVE_LP], [1], [Define to 1 if you have any LP solver.])
     67      lx_mip_found=yes
     68      AC_DEFINE([HAVE_MIP], [1], [Define to 1 if you have any MIP solver.])
    6569      AC_MSG_RESULT([yes])
    6670    else
  • m4/lx_check_glpk.m4

    r187 r459  
    4343      }
    4444
     45      #if (GLP_MAJOR_VERSION < 4) \
     46         || (GLP_MAJOR_VERSION == 4 && GLP_MINOR_VERSION < 33)
     47      #error Supported GLPK versions: 4.33 or above
     48      #endif
     49
    4550      int main(int argc, char** argv)
    4651      {
     
    6166    if test x"$lx_glpk_found" = x"yes"; then
    6267      AC_DEFINE([HAVE_GLPK], [1], [Define to 1 if you have GLPK.])
     68      lx_lp_found=yes
     69      AC_DEFINE([HAVE_LP], [1], [Define to 1 if you have any LP solver.])
     70      lx_mip_found=yes
     71      AC_DEFINE([HAVE_MIP], [1], [Define to 1 if you have any MIP solver.])
    6372      AC_MSG_RESULT([yes])
    6473    else
  • m4/lx_check_soplex.m4

    r187 r457  
    5757    if test x"$lx_soplex_found" = x"yes"; then
    5858      AC_DEFINE([HAVE_SOPLEX], [1], [Define to 1 if you have SOPLEX.])
     59      lx_lp_found=yes
     60      AC_DEFINE([HAVE_LP], [1], [Define to 1 if you have any LP solver.])
    5961      AC_MSG_RESULT([yes])
    6062    else
  • test/CMakeLists.txt

    r468 r469  
    44
    55SET(TESTS
     6  adaptors_test
    67  bfs_test
     8  circulation_test
    79  counter_test
    810  dfs_test
     
    1820  heap_test
    1921  kruskal_test
     22  lp_test
     23  mip_test
    2024  maps_test
    2125  max_matching_test
     26  radix_sort_test
     27  path_test
     28  preflow_test
    2229  random_test
    23   path_test
     30  suurballe_test
    2431  time_measure_test
    2532  unionfind_test)
  • test/Makefile.am

    r468 r469  
    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 += \
     9        test/adaptors_test \
    1110        test/bfs_test \
    12         test/circulation_test \
    13         test/counter_test \
     11        test/circulation_test \
     12        test/counter_test \
    1413        test/dfs_test \
    1514        test/digraph_test \
    1615        test/dijkstra_test \
    17         test/dim_test \
     16        test/dim_test \
    1817        test/edge_set_test \
    1918        test/error_test \
    20         test/graph_adaptor_test \
    2119        test/graph_copy_test \
    2220        test/graph_test \
    2321        test/graph_utils_test \
     22        test/hao_orlin_test \
    2423        test/heap_test \
    2524        test/kruskal_test \
    26         test/hao_orlin_test \
    27         test/maps_test \
     25        test/maps_test \
    2826        test/max_matching_test \
    29         test/random_test \
    30         test/path_test \
    31         test/preflow_test \
    32         test/suurballe_test \
    33         test/test_tools_fail \
    34         test/test_tools_pass \
    35         test/time_measure_test \
     27        test/path_test \
     28        test/preflow_test \
     29        test/radix_sort_test \
     30        test/random_test \
     31        test/suurballe_test \
     32        test/test_tools_fail \
     33        test/test_tools_pass \
     34        test/time_measure_test \
    3635        test/unionfind_test
     36
     37if HAVE_LP
     38check_PROGRAMS += test/lp_test
     39endif HAVE_LP
     40if HAVE_MIP
     41check_PROGRAMS += test/mip_test
     42endif HAVE_MIP
    3743
    3844TESTS += $(check_PROGRAMS)
    3945XFAIL_TESTS += test/test_tools_fail$(EXEEXT)
    4046
     47test_adaptors_test_SOURCES = test/adaptors_test.cc
    4148test_bfs_test_SOURCES = test/bfs_test.cc
    4249test_circulation_test_SOURCES = test/circulation_test.cc
     
    4855test_edge_set_test_SOURCES = test/edge_set_test.cc
    4956test_error_test_SOURCES = test/error_test.cc
    50 test_graph_adaptor_test_SOURCES = test/graph_adaptor_test.cc
    5157test_graph_copy_test_SOURCES = test/graph_copy_test.cc
    5258test_graph_test_SOURCES = test/graph_test.cc
     
    5561test_kruskal_test_SOURCES = test/kruskal_test.cc
    5662test_hao_orlin_test_SOURCES = test/hao_orlin_test.cc
     63test_lp_test_SOURCES = test/lp_test.cc
    5764test_maps_test_SOURCES = test/maps_test.cc
     65test_mip_test_SOURCES = test/mip_test.cc
    5866test_max_matching_test_SOURCES = test/max_matching_test.cc
    5967test_path_test_SOURCES = test/path_test.cc
    6068test_preflow_test_SOURCES = test/preflow_test.cc
     69test_radix_sort_test_SOURCES = test/radix_sort_test.cc
    6170test_suurballe_test_SOURCES = test/suurballe_test.cc
    6271test_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_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).
  • tools/lemon-0.x-to-1.x.sh

    r366 r466  
    9393        -e "s/\<BoundingBox\>/Box/g"\
    9494        -e "s/\<readNauty\>/readNautyGraph/g"\
     95        -e "s/\<RevDigraphAdaptor\>/ReverseDigraph/g"\
     96        -e "s/\<revDigraphAdaptor\>/reverseDigraph/g"\
     97        -e "s/\<SubDigraphAdaptor\>/SubDigraph/g"\
     98        -e "s/\<subDigraphAdaptor\>/subDigraph/g"\
     99        -e "s/\<SubGraphAdaptor\>/SubGraph/g"\
     100        -e "s/\<subGraphAdaptor\>/subGraph/g"\
     101        -e "s/\<NodeSubDigraphAdaptor\>/FilterNodes/g"\
     102        -e "s/\<nodeSubDigraphAdaptor\>/filterNodes/g"\
     103        -e "s/\<ArcSubDigraphAdaptor\>/FilterArcs/g"\
     104        -e "s/\<arcSubDigraphAdaptor\>/filterArcs/g"\
     105        -e "s/\<UndirDigraphAdaptor\>/Undirector/g"\
     106        -e "s/\<undirDigraphAdaptor\>/undirector/g"\
     107        -e "s/\<ResDigraphAdaptor\>/ResidualDigraph/g"\
     108        -e "s/\<resDigraphAdaptor\>/residualDigraph/g"\
     109        -e "s/\<SplitDigraphAdaptor\>/SplitNodes/g"\
     110        -e "s/\<splitDigraphAdaptor\>/splitNodes/g"\
     111        -e "s/\<SubGraphAdaptor\>/SubGraph/g"\
     112        -e "s/\<subGraphAdaptor\>/subGraph/g"\
     113        -e "s/\<NodeSubGraphAdaptor\>/FilterNodes/g"\
     114        -e "s/\<nodeSubGraphAdaptor\>/filterNodes/g"\
     115        -e "s/\<ArcSubGraphAdaptor\>/FilterEdges/g"\
     116        -e "s/\<arcSubGraphAdaptor\>/filterEdges/g"\
     117        -e "s/\<DirGraphAdaptor\>/Orienter/g"\
     118        -e "s/\<dirGraphAdaptor\>/orienter/g"\
    95119    <$i > $TMP
    96120    mv $TMP $i
Note: See TracChangeset for help on using the changeset viewer.