COIN-OR::LEMON - Graph Library

Ignore:
Files:
33 edited

Legend:

Unmodified
Added
Removed
  • doc/groups.dox

    r606 r478  
    2121/**
    2222@defgroup datas Data Structures
    23 This group contains the several data structures implemented in LEMON.
     23This group describes the several data structures implemented in LEMON.
    2424*/
    2525
     
    143143\brief Graph types between real graphs and graph adaptors.
    144144
    145 This group contains some graph types between real graphs and graph adaptors.
     145This group describes some graph types between real graphs and graph adaptors.
    146146These classes wrap graphs to give new functionality as the adaptors do it.
    147147On the other hand they are not light-weight structures as the adaptors.
     
    153153\brief Map structures implemented in LEMON.
    154154
    155 This group contains the map structures implemented in LEMON.
     155This group describes the map structures implemented in LEMON.
    156156
    157157LEMON provides several special purpose maps and map adaptors that e.g. combine
     
    166166\brief Special graph-related maps.
    167167
    168 This group contains maps that are specifically designed to assign
     168This group describes maps that are specifically designed to assign
    169169values to the nodes and arcs/edges of graphs.
    170170
     
    178178\brief Tools to create new maps from existing ones
    179179
    180 This group contains map adaptors that are used to create "implicit"
     180This group describes map adaptors that are used to create "implicit"
    181181maps from other maps.
    182182
     
    241241\brief Two dimensional data storages implemented in LEMON.
    242242
    243 This group contains two dimensional data storages implemented in LEMON.
     243This group describes two dimensional data storages implemented in LEMON.
    244244*/
    245245
     
    249249\brief %Path structures implemented in LEMON.
    250250
    251 This group contains the path structures implemented in LEMON.
     251This group describes the path structures implemented in LEMON.
    252252
    253253LEMON provides flexible data structures to work with paths.
     
    265265\brief Auxiliary data structures implemented in LEMON.
    266266
    267 This group contains some data structures implemented in LEMON in
     267This group describes some data structures implemented in LEMON in
    268268order to make it easier to implement combinatorial algorithms.
    269269*/
     
    271271/**
    272272@defgroup algs Algorithms
    273 \brief This group contains the several algorithms
     273\brief This group describes the several algorithms
    274274implemented in LEMON.
    275275
    276 This group contains the several algorithms
     276This group describes the several algorithms
    277277implemented in LEMON.
    278278*/
     
    283283\brief Common graph search algorithms.
    284284
    285 This group contains the common graph search algorithms, namely
     285This group describes the common graph search algorithms, namely
    286286\e breadth-first \e search (BFS) and \e depth-first \e search (DFS).
    287287*/
     
    292292\brief Algorithms for finding shortest paths.
    293293
    294 This group contains the algorithms for finding shortest paths in digraphs.
     294This group describes the algorithms for finding shortest paths in digraphs.
    295295
    296296 - \ref Dijkstra algorithm for finding shortest paths from a source node
     
    313313\brief Algorithms for finding maximum flows.
    314314
    315 This group contains the algorithms for finding maximum flows and
     315This group describes the algorithms for finding maximum flows and
    316316feasible circulations.
    317317
     
    346346\brief Algorithms for finding minimum cost flows and circulations.
    347347
    348 This group contains the algorithms for finding minimum cost flows and
     348This group describes the algorithms for finding minimum cost flows and
    349349circulations.
    350350
     
    383383\brief Algorithms for finding minimum cut in graphs.
    384384
    385 This group contains the algorithms for finding minimum cut in graphs.
     385This group describes the algorithms for finding minimum cut in graphs.
    386386
    387387The \e minimum \e cut \e problem is to find a non-empty and non-complete
     
    400400- \ref NagamochiIbaraki "Nagamochi-Ibaraki algorithm" for
    401401  calculating minimum cut in undirected graphs.
    402 - \ref GomoryHu "Gomory-Hu tree computation" for calculating
     402- \ref GomoryHuTree "Gomory-Hu tree computation" for calculating
    403403  all-pairs minimum cut in undirected graphs.
    404404
     
    412412\brief Algorithms for discovering the graph properties
    413413
    414 This group contains the algorithms for discovering the graph properties
     414This group describes the algorithms for discovering the graph properties
    415415like connectivity, bipartiteness, euler property, simplicity etc.
    416416
     
    424424\brief Algorithms for planarity checking, embedding and drawing
    425425
    426 This group contains the algorithms for planarity checking,
     426This group describes the algorithms for planarity checking,
    427427embedding and drawing.
    428428
     
    475475\brief Algorithms for finding a minimum cost spanning tree in a graph.
    476476
    477 This group contains the algorithms for finding a minimum cost spanning
     477This group describes the algorithms for finding a minimum cost spanning
    478478tree in a graph.
    479479*/
     
    484484\brief Auxiliary algorithms implemented in LEMON.
    485485
    486 This group contains some algorithms implemented in LEMON
     486This group describes some algorithms implemented in LEMON
    487487in order to make it easier to implement complex algorithms.
    488488*/
     
    493493\brief Approximation algorithms.
    494494
    495 This group contains the approximation and heuristic algorithms
     495This group describes the approximation and heuristic algorithms
    496496implemented in LEMON.
    497497*/
     
    499499/**
    500500@defgroup gen_opt_group General Optimization Tools
    501 \brief This group contains some general optimization frameworks
     501\brief This group describes some general optimization frameworks
    502502implemented in LEMON.
    503503
    504 This group contains some general optimization frameworks
     504This group describes some general optimization frameworks
    505505implemented in LEMON.
    506506*/
     
    511511\brief Lp and Mip solver interfaces for LEMON.
    512512
    513 This group contains Lp and Mip solver interfaces for LEMON. The
     513This group describes Lp and Mip solver interfaces for LEMON. The
    514514various LP solvers could be used in the same manner with this
    515515interface.
     
    530530\brief Metaheuristics for LEMON library.
    531531
    532 This group contains some metaheuristic optimization tools.
     532This group describes some metaheuristic optimization tools.
    533533*/
    534534
     
    545545\brief Simple basic graph utilities.
    546546
    547 This group contains some simple basic graph utilities.
     547This group describes some simple basic graph utilities.
    548548*/
    549549
     
    553553\brief Tools for development, debugging and testing.
    554554
    555 This group contains several useful tools for development,
     555This group describes several useful tools for development,
    556556debugging and testing.
    557557*/
     
    562562\brief Simple tools for measuring the performance of algorithms.
    563563
    564 This group contains simple tools for measuring the performance
     564This group describes simple tools for measuring the performance
    565565of algorithms.
    566566*/
     
    571571\brief Exceptions defined in LEMON.
    572572
    573 This group contains the exceptions defined in LEMON.
     573This group describes the exceptions defined in LEMON.
    574574*/
    575575
     
    578578\brief Graph Input-Output methods
    579579
    580 This group contains the tools for importing and exporting graphs
     580This group describes the tools for importing and exporting graphs
    581581and graph related data. Now it supports the \ref lgf-format
    582582"LEMON Graph Format", the \c DIMACS format and the encapsulated
     
    589589\brief Reading and writing LEMON Graph Format.
    590590
    591 This group contains methods for reading and writing
     591This group describes methods for reading and writing
    592592\ref lgf-format "LEMON Graph Format".
    593593*/
     
    598598\brief General \c EPS drawer and graph exporter
    599599
    600 This group contains general \c EPS drawing methods and special
     600This group describes general \c EPS drawing methods and special
    601601graph exporting tools.
    602602*/
     
    622622\brief Skeleton classes and concept checking classes
    623623
    624 This group contains the data/algorithm skeletons and concept checking
     624This group describes the data/algorithm skeletons and concept checking
    625625classes implemented in LEMON.
    626626
     
    652652\brief Skeleton and concept checking classes for graph structures
    653653
    654 This group contains the skeletons and concept checking classes of LEMON's
     654This group describes the skeletons and concept checking classes of LEMON's
    655655graph structures and helper classes used to implement these.
    656656*/
     
    661661\brief Skeleton and concept checking classes for maps
    662662
    663 This group contains the skeletons and concept checking classes of maps.
     663This group describes the skeletons and concept checking classes of maps.
    664664*/
    665665
  • doc/mainpage.dox

    r606 r463  
    4646"Quick Tour to LEMON" which will guide you along.
    4747
    48 If you already feel like using our library, see the
    49 <a class="el" href="http://lemon.cs.elte.hu/pub/tutorial/">LEMON Tutorial</a>.
     48If you already feel like using our library, see the page that tells you
     49\ref getstart "How to start using LEMON".
     50
     51If you
     52want to see how LEMON works, see
     53some \ref demoprograms "demo programs".
    5054
    5155If you know what you are looking for then try to find it under the
    52 <a class="el" href="modules.html">Modules</a> section.
     56<a class="el" href="modules.html">Modules</a>
     57section.
    5358
    5459If you are a user of the old (0.x) series of LEMON, please check out the
  • lemon/adaptors.h

    r606 r566  
    22552255    /// This map adaptor class adapts two arc maps of the underlying
    22562256    /// digraph to get an arc map of the undirected graph.
    2257     /// Its value type is inherited from the first arc map type (\c FW).
    2258     /// \tparam FW The type of the "foward" arc map.
    2259     /// \tparam BK The type of the "backward" arc map.
    2260     template <typename FW, typename BK>
     2257    /// Its value type is inherited from the first arc map type
     2258    /// (\c %ForwardMap).
     2259    template <typename ForwardMap, typename BackwardMap>
    22612260    class CombinedArcMap {
    22622261    public:
     
    22652264      typedef typename Parent::Arc Key;
    22662265      /// The value type of the map
    2267       typedef typename FW::Value Value;
    2268 
    2269       typedef typename MapTraits<FW>::ReferenceMapTag ReferenceMapTag;
    2270 
    2271       typedef typename MapTraits<FW>::ReturnValue ReturnValue;
    2272       typedef typename MapTraits<FW>::ConstReturnValue ConstReturnValue;
    2273       typedef typename MapTraits<FW>::ReturnValue Reference;
    2274       typedef typename MapTraits<FW>::ConstReturnValue ConstReference;
     2266      typedef typename ForwardMap::Value Value;
     2267
     2268      typedef typename MapTraits<ForwardMap>::ReferenceMapTag ReferenceMapTag;
     2269
     2270      typedef typename MapTraits<ForwardMap>::ReturnValue ReturnValue;
     2271      typedef typename MapTraits<ForwardMap>::ConstReturnValue ConstReturnValue;
     2272      typedef typename MapTraits<ForwardMap>::ReturnValue Reference;
     2273      typedef typename MapTraits<ForwardMap>::ConstReturnValue ConstReference;
    22752274
    22762275      /// Constructor
    2277       CombinedArcMap(FW& forward, BK& backward)
     2276      CombinedArcMap(ForwardMap& forward, BackwardMap& backward)
    22782277        : _forward(&forward), _backward(&backward) {}
    22792278
     
    23072306    protected:
    23082307
    2309       FW* _forward;
    2310       BK* _backward;
     2308      ForwardMap* _forward;
     2309      BackwardMap* _backward;
    23112310
    23122311    };
     
    23152314    ///
    23162315    /// This function just returns a combined arc map.
    2317     template <typename FW, typename BK>
    2318     static CombinedArcMap<FW, BK>
    2319     combinedArcMap(FW& forward, BK& backward) {
    2320       return CombinedArcMap<FW, BK>(forward, backward);
    2321     }
    2322 
    2323     template <typename FW, typename BK>
    2324     static CombinedArcMap<const FW, BK>
    2325     combinedArcMap(const FW& forward, BK& backward) {
    2326       return CombinedArcMap<const FW, BK>(forward, backward);
    2327     }
    2328 
    2329     template <typename FW, typename BK>
    2330     static CombinedArcMap<FW, const BK>
    2331     combinedArcMap(FW& forward, const BK& backward) {
    2332       return CombinedArcMap<FW, const BK>(forward, backward);
    2333     }
    2334 
    2335     template <typename FW, typename BK>
    2336     static CombinedArcMap<const FW, const BK>
    2337     combinedArcMap(const FW& forward, const BK& backward) {
    2338       return CombinedArcMap<const FW, const BK>(forward, backward);
     2316    template <typename ForwardMap, typename BackwardMap>
     2317    static CombinedArcMap<ForwardMap, BackwardMap>
     2318    combinedArcMap(ForwardMap& forward, BackwardMap& backward) {
     2319      return CombinedArcMap<ForwardMap, BackwardMap>(forward, backward);
     2320    }
     2321
     2322    template <typename ForwardMap, typename BackwardMap>
     2323    static CombinedArcMap<const ForwardMap, BackwardMap>
     2324    combinedArcMap(const ForwardMap& forward, BackwardMap& backward) {
     2325      return CombinedArcMap<const ForwardMap,
     2326        BackwardMap>(forward, backward);
     2327    }
     2328
     2329    template <typename ForwardMap, typename BackwardMap>
     2330    static CombinedArcMap<ForwardMap, const BackwardMap>
     2331    combinedArcMap(ForwardMap& forward, const BackwardMap& backward) {
     2332      return CombinedArcMap<ForwardMap,
     2333        const BackwardMap>(forward, backward);
     2334    }
     2335
     2336    template <typename ForwardMap, typename BackwardMap>
     2337    static CombinedArcMap<const ForwardMap, const BackwardMap>
     2338    combinedArcMap(const ForwardMap& forward, const BackwardMap& backward) {
     2339      return CombinedArcMap<const ForwardMap,
     2340        const BackwardMap>(forward, backward);
    23392341    }
    23402342
     
    34053407    /// This map adaptor class adapts two node maps of the original digraph
    34063408    /// to get a node map of the split digraph.
    3407     /// Its value type is inherited from the first node map type (\c IN).
    3408     /// \tparam IN The type of the node map for the in-nodes.
    3409     /// \tparam OUT The type of the node map for the out-nodes.
    3410     template <typename IN, typename OUT>
     3409    /// Its value type is inherited from the first node map type
     3410    /// (\c InNodeMap).
     3411    template <typename InNodeMap, typename OutNodeMap>
    34113412    class CombinedNodeMap {
    34123413    public:
     
    34153416      typedef Node Key;
    34163417      /// The value type of the map
    3417       typedef typename IN::Value Value;
    3418 
    3419       typedef typename MapTraits<IN>::ReferenceMapTag ReferenceMapTag;
    3420       typedef typename MapTraits<IN>::ReturnValue ReturnValue;
    3421       typedef typename MapTraits<IN>::ConstReturnValue ConstReturnValue;
    3422       typedef typename MapTraits<IN>::ReturnValue Reference;
    3423       typedef typename MapTraits<IN>::ConstReturnValue ConstReference;
     3418      typedef typename InNodeMap::Value Value;
     3419
     3420      typedef typename MapTraits<InNodeMap>::ReferenceMapTag ReferenceMapTag;
     3421      typedef typename MapTraits<InNodeMap>::ReturnValue ReturnValue;
     3422      typedef typename MapTraits<InNodeMap>::ConstReturnValue ConstReturnValue;
     3423      typedef typename MapTraits<InNodeMap>::ReturnValue Reference;
     3424      typedef typename MapTraits<InNodeMap>::ConstReturnValue ConstReference;
    34243425
    34253426      /// Constructor
    3426       CombinedNodeMap(IN& in_map, OUT& out_map)
     3427      CombinedNodeMap(InNodeMap& in_map, OutNodeMap& out_map)
    34273428        : _in_map(in_map), _out_map(out_map) {}
    34283429
     
    34563457    private:
    34573458
    3458       IN& _in_map;
    3459       OUT& _out_map;
     3459      InNodeMap& _in_map;
     3460      OutNodeMap& _out_map;
    34603461
    34613462    };
     
    34653466    ///
    34663467    /// This function just returns a combined node map.
    3467     template <typename IN, typename OUT>
    3468     static CombinedNodeMap<IN, OUT>
    3469     combinedNodeMap(IN& in_map, OUT& out_map) {
    3470       return CombinedNodeMap<IN, OUT>(in_map, out_map);
    3471     }
    3472 
    3473     template <typename IN, typename OUT>
    3474     static CombinedNodeMap<const IN, OUT>
    3475     combinedNodeMap(const IN& in_map, OUT& out_map) {
    3476       return CombinedNodeMap<const IN, OUT>(in_map, out_map);
    3477     }
    3478 
    3479     template <typename IN, typename OUT>
    3480     static CombinedNodeMap<IN, const OUT>
    3481     combinedNodeMap(IN& in_map, const OUT& out_map) {
    3482       return CombinedNodeMap<IN, const OUT>(in_map, out_map);
    3483     }
    3484 
    3485     template <typename IN, typename OUT>
    3486     static CombinedNodeMap<const IN, const OUT>
    3487     combinedNodeMap(const IN& in_map, const OUT& out_map) {
    3488       return CombinedNodeMap<const IN, const OUT>(in_map, out_map);
     3468    template <typename InNodeMap, typename OutNodeMap>
     3469    static CombinedNodeMap<InNodeMap, OutNodeMap>
     3470    combinedNodeMap(InNodeMap& in_map, OutNodeMap& out_map) {
     3471      return CombinedNodeMap<InNodeMap, OutNodeMap>(in_map, out_map);
     3472    }
     3473
     3474    template <typename InNodeMap, typename OutNodeMap>
     3475    static CombinedNodeMap<const InNodeMap, OutNodeMap>
     3476    combinedNodeMap(const InNodeMap& in_map, OutNodeMap& out_map) {
     3477      return CombinedNodeMap<const InNodeMap, OutNodeMap>(in_map, out_map);
     3478    }
     3479
     3480    template <typename InNodeMap, typename OutNodeMap>
     3481    static CombinedNodeMap<InNodeMap, const OutNodeMap>
     3482    combinedNodeMap(InNodeMap& in_map, const OutNodeMap& out_map) {
     3483      return CombinedNodeMap<InNodeMap, const OutNodeMap>(in_map, out_map);
     3484    }
     3485
     3486    template <typename InNodeMap, typename OutNodeMap>
     3487    static CombinedNodeMap<const InNodeMap, const OutNodeMap>
     3488    combinedNodeMap(const InNodeMap& in_map, const OutNodeMap& out_map) {
     3489      return CombinedNodeMap<const InNodeMap,
     3490        const OutNodeMap>(in_map, out_map);
    34893491    }
    34903492
     
    34943496    /// This map adaptor class adapts an arc map and a node map of the
    34953497    /// original digraph to get an arc map of the split digraph.
    3496     /// Its value type is inherited from the original arc map type (\c AM).
    3497     /// \tparam AM The type of the arc map.
    3498     /// \tparam NM the type of the node map.
    3499     template <typename AM, typename NM>
     3498    /// Its value type is inherited from the original arc map type
     3499    /// (\c ArcMap).
     3500    template <typename ArcMap, typename NodeMap>
    35003501    class CombinedArcMap {
    35013502    public:
     
    35043505      typedef Arc Key;
    35053506      /// The value type of the map
    3506       typedef typename AM::Value Value;
    3507 
    3508       typedef typename MapTraits<AM>::ReferenceMapTag ReferenceMapTag;
    3509       typedef typename MapTraits<AM>::ReturnValue ReturnValue;
    3510       typedef typename MapTraits<AM>::ConstReturnValue ConstReturnValue;
    3511       typedef typename MapTraits<AM>::ReturnValue Reference;
    3512       typedef typename MapTraits<AM>::ConstReturnValue ConstReference;
     3507      typedef typename ArcMap::Value Value;
     3508
     3509      typedef typename MapTraits<ArcMap>::ReferenceMapTag ReferenceMapTag;
     3510      typedef typename MapTraits<ArcMap>::ReturnValue ReturnValue;
     3511      typedef typename MapTraits<ArcMap>::ConstReturnValue ConstReturnValue;
     3512      typedef typename MapTraits<ArcMap>::ReturnValue Reference;
     3513      typedef typename MapTraits<ArcMap>::ConstReturnValue ConstReference;
    35133514
    35143515      /// Constructor
    3515       CombinedArcMap(AM& arc_map, NM& node_map)
     3516      CombinedArcMap(ArcMap& arc_map, NodeMap& node_map)
    35163517        : _arc_map(arc_map), _node_map(node_map) {}
    35173518
     
    35443545
    35453546    private:
    3546 
    3547       AM& _arc_map;
    3548       NM& _node_map;
    3549 
     3547      ArcMap& _arc_map;
     3548      NodeMap& _node_map;
    35503549    };
    35513550
  • lemon/bin_heap.h

    r606 r463  
    3434  ///\brief A Binary Heap implementation.
    3535  ///
    36   ///This class implements the \e binary \e heap data structure.
    37   ///
    38   ///A \e heap is a data structure for storing items with specified values
    39   ///called \e priorities in such a way that finding the item with minimum
    40   ///priority is efficient. \c Comp specifies the ordering of the priorities.
    41   ///In a heap one can change the priority of an item, add or erase an
    42   ///item, etc.
     36  ///This class implements the \e binary \e heap data structure. A \e heap
     37  ///is a data structure for storing items with specified values called \e
     38  ///priorities in such a way that finding the item with minimum priority is
     39  ///efficient. \c Compare specifies the ordering of the priorities. In a heap
     40  ///one can change the priority of an item, add or erase an item, etc.
    4341  ///
    44   ///\tparam PR Type of the priority of the items.
    45   ///\tparam IM A read and writable item map with int values, used internally
     42  ///\tparam _Prio Type of the priority of the items.
     43  ///\tparam _ItemIntMap A read and writable Item int map, used internally
    4644  ///to handle the cross references.
    47   ///\tparam Comp A functor class for the ordering of the priorities.
    48   ///The default is \c std::less<PR>.
     45  ///\tparam _Compare A class for the ordering of the priorities. The
     46  ///default is \c std::less<_Prio>.
    4947  ///
    5048  ///\sa FibHeap
    5149  ///\sa Dijkstra
    52   template <typename PR, typename IM, typename Comp = std::less<PR> >
     50  template <typename _Prio, typename _ItemIntMap,
     51            typename _Compare = std::less<_Prio> >
    5352  class BinHeap {
    5453
    5554  public:
    5655    ///\e
    57     typedef IM ItemIntMap;
    58     ///\e
    59     typedef PR Prio;
     56    typedef _ItemIntMap ItemIntMap;
     57    ///\e
     58    typedef _Prio Prio;
    6059    ///\e
    6160    typedef typename ItemIntMap::Key Item;
     
    6362    typedef std::pair<Item,Prio> Pair;
    6463    ///\e
    65     typedef Comp Compare;
     64    typedef _Compare Compare;
    6665
    6766    /// \brief Type to represent the items states.
     
    7170    /// heap's point of view, but may be useful to the user.
    7271    ///
    73     /// The item-int map must be initialized in such way that it assigns
    74     /// \c PRE_HEAP (<tt>-1</tt>) to any element to be put in the heap.
     72    /// The ItemIntMap \e should be initialized in such way that it maps
     73    /// PRE_HEAP (-1) to any element to be put in the heap...
    7574    enum State {
    76       IN_HEAP = 0,    ///< \e
    77       PRE_HEAP = -1,  ///< \e
    78       POST_HEAP = -2  ///< \e
     75      IN_HEAP = 0,
     76      PRE_HEAP = -1,
     77      POST_HEAP = -2
    7978    };
    8079
    8180  private:
    82     std::vector<Pair> _data;
    83     Compare _comp;
    84     ItemIntMap &_iim;
     81    std::vector<Pair> data;
     82    Compare comp;
     83    ItemIntMap &iim;
    8584
    8685  public:
     
    8887    ///
    8988    /// The constructor.
    90     /// \param map should be given to the constructor, since it is used
    91     /// internally to handle the cross references. The value of the map
    92     /// must be \c PRE_HEAP (<tt>-1</tt>) for every item.
    93     explicit BinHeap(ItemIntMap &map) : _iim(map) {}
    94 
    95     /// \brief The constructor.
    96     ///
    97     /// The constructor.
    98     /// \param map should be given to the constructor, since it is used
     89    /// \param _iim should be given to the constructor, since it is used
    9990    /// internally to handle the cross references. The value of the map
    10091    /// should be PRE_HEAP (-1) for each element.
    101     ///
    102     /// \param comp The comparator function object.
    103     BinHeap(ItemIntMap &map, const Compare &comp)
    104       : _iim(map), _comp(comp) {}
     92    explicit BinHeap(ItemIntMap &_iim) : iim(_iim) {}
     93
     94    /// \brief The constructor.
     95    ///
     96    /// The constructor.
     97    /// \param _iim should be given to the constructor, since it is used
     98    /// internally to handle the cross references. The value of the map
     99    /// should be PRE_HEAP (-1) for each element.
     100    ///
     101    /// \param _comp The comparator function object.
     102    BinHeap(ItemIntMap &_iim, const Compare &_comp)
     103      : iim(_iim), comp(_comp) {}
    105104
    106105
     
    108107    ///
    109108    /// \brief Returns the number of items stored in the heap.
    110     int size() const { return _data.size(); }
     109    int size() const { return data.size(); }
    111110
    112111    /// \brief Checks if the heap stores no items.
    113112    ///
    114113    /// Returns \c true if and only if the heap stores no items.
    115     bool empty() const { return _data.empty(); }
     114    bool empty() const { return data.empty(); }
    116115
    117116    /// \brief Make empty this heap.
     
    122121    /// each item to \c PRE_HEAP.
    123122    void clear() {
    124       _data.clear();
     123      data.clear();
    125124    }
    126125
     
    130129    static int second_child(int i) { return 2*i+2; }
    131130    bool less(const Pair &p1, const Pair &p2) const {
    132       return _comp(p1.second, p2.second);
     131      return comp(p1.second, p2.second);
    133132    }
    134133
    135134    int bubble_up(int hole, Pair p) {
    136135      int par = parent(hole);
    137       while( hole>0 && less(p,_data[par]) ) {
    138         move(_data[par],hole);
     136      while( hole>0 && less(p,data[par]) ) {
     137        move(data[par],hole);
    139138        hole = par;
    140139        par = parent(hole);
     
    147146      int child = second_child(hole);
    148147      while(child < length) {
    149         if( less(_data[child-1], _data[child]) ) {
     148        if( less(data[child-1], data[child]) ) {
    150149          --child;
    151150        }
    152         if( !less(_data[child], p) )
     151        if( !less(data[child], p) )
    153152          goto ok;
    154         move(_data[child], hole);
     153        move(data[child], hole);
    155154        hole = child;
    156155        child = second_child(hole);
    157156      }
    158157      child--;
    159       if( child<length && less(_data[child], p) ) {
    160         move(_data[child], hole);
     158      if( child<length && less(data[child], p) ) {
     159        move(data[child], hole);
    161160        hole=child;
    162161      }
     
    167166
    168167    void move(const Pair &p, int i) {
    169       _data[i] = p;
    170       _iim.set(p.first, i);
     168      data[i] = p;
     169      iim.set(p.first, i);
    171170    }
    172171
     
    177176    /// \param p The pair to insert.
    178177    void push(const Pair &p) {
    179       int n = _data.size();
    180       _data.resize(n+1);
     178      int n = data.size();
     179      data.resize(n+1);
    181180      bubble_up(n, p);
    182181    }
     
    195194    /// \pre The heap must be nonempty.
    196195    Item top() const {
    197       return _data[0].first;
     196      return data[0].first;
    198197    }
    199198
     
    203202    /// \pre The heap must be nonempty.
    204203    Prio prio() const {
    205       return _data[0].second;
     204      return data[0].second;
    206205    }
    207206
     
    212211    /// \pre The heap must be non-empty.
    213212    void pop() {
    214       int n = _data.size()-1;
    215       _iim.set(_data[0].first, POST_HEAP);
     213      int n = data.size()-1;
     214      iim.set(data[0].first, POST_HEAP);
    216215      if (n > 0) {
    217         bubble_down(0, _data[n], n);
    218       }
    219       _data.pop_back();
     216        bubble_down(0, data[n], n);
     217      }
     218      data.pop_back();
    220219    }
    221220
     
    226225    /// \pre The item should be in the heap.
    227226    void erase(const Item &i) {
    228       int h = _iim[i];
    229       int n = _data.size()-1;
    230       _iim.set(_data[h].first, POST_HEAP);
     227      int h = iim[i];
     228      int n = data.size()-1;
     229      iim.set(data[h].first, POST_HEAP);
    231230      if( h < n ) {
    232         if ( bubble_up(h, _data[n]) == h) {
    233           bubble_down(h, _data[n], n);
     231        if ( bubble_up(h, data[n]) == h) {
     232          bubble_down(h, data[n], n);
    234233        }
    235234      }
    236       _data.pop_back();
     235      data.pop_back();
    237236    }
    238237
     
    241240    ///
    242241    /// This function returns the priority of item \c i.
    243     /// \param i The item.
    244242    /// \pre \c i must be in the heap.
     243    /// \param i The item.
    245244    Prio operator[](const Item &i) const {
    246       int idx = _iim[i];
    247       return _data[idx].second;
     245      int idx = iim[i];
     246      return data[idx].second;
    248247    }
    249248
     
    256255    /// \param p The priority.
    257256    void set(const Item &i, const Prio &p) {
    258       int idx = _iim[i];
     257      int idx = iim[i];
    259258      if( idx < 0 ) {
    260259        push(i,p);
    261260      }
    262       else if( _comp(p, _data[idx].second) ) {
     261      else if( comp(p, data[idx].second) ) {
    263262        bubble_up(idx, Pair(i,p));
    264263      }
    265264      else {
    266         bubble_down(idx, Pair(i,p), _data.size());
     265        bubble_down(idx, Pair(i,p), data.size());
    267266      }
    268267    }
     
    271270    ///
    272271    /// This method decreases the priority of item \c i to \c p.
    273     /// \param i The item.
    274     /// \param p The priority.
    275272    /// \pre \c i must be stored in the heap with priority at least \c
    276273    /// p relative to \c Compare.
     274    /// \param i The item.
     275    /// \param p The priority.
    277276    void decrease(const Item &i, const Prio &p) {
    278       int idx = _iim[i];
     277      int idx = iim[i];
    279278      bubble_up(idx, Pair(i,p));
    280279    }
     
    283282    ///
    284283    /// This method sets the priority of item \c i to \c p.
    285     /// \param i The item.
    286     /// \param p The priority.
    287284    /// \pre \c i must be stored in the heap with priority at most \c
    288285    /// p relative to \c Compare.
     286    /// \param i The item.
     287    /// \param p The priority.
    289288    void increase(const Item &i, const Prio &p) {
    290       int idx = _iim[i];
    291       bubble_down(idx, Pair(i,p), _data.size());
     289      int idx = iim[i];
     290      bubble_down(idx, Pair(i,p), data.size());
    292291    }
    293292
     
    301300    /// \param i The item.
    302301    State state(const Item &i) const {
    303       int s = _iim[i];
     302      int s = iim[i];
    304303      if( s>=0 )
    305304        s=0;
     
    321320          erase(i);
    322321        }
    323         _iim[i] = st;
     322        iim[i] = st;
    324323        break;
    325324      case IN_HEAP:
     
    335334    /// with the same prioriority as prevoiusly the \c i item.
    336335    void replace(const Item& i, const Item& j) {
    337       int idx = _iim[i];
    338       _iim.set(i, _iim[j]);
    339       _iim.set(j, idx);
    340       _data[idx].first = j;
     336      int idx = iim[i];
     337      iim.set(i, iim[j]);
     338      iim.set(j, idx);
     339      data[idx].first = j;
    341340    }
    342341
  • lemon/bits/edge_set_extender.h

    r606 r566  
    2525#include <lemon/bits/map_extender.h>
    2626
    27 //\ingroup digraphbits
    28 //\file
    29 //\brief Extenders for the arc set types
     27///\ingroup digraphbits
     28///\file
     29///\brief Extenders for the arc set types
    3030namespace lemon {
    3131
    32   // \ingroup digraphbits
    33   //
    34   // \brief Extender for the ArcSets
     32  /// \ingroup digraphbits
     33  ///
     34  /// \brief Extender for the ArcSets
    3535  template <typename Base>
    3636  class ArcSetExtender : public Base {
     
    7373    // Alteration notifier extensions
    7474
    75     // The arc observer registry.
     75    /// The arc observer registry.
    7676    typedef AlterationNotifier<ArcSetExtender, Arc> ArcNotifier;
    7777
     
    8484    using Parent::notifier;
    8585
    86     // Gives back the arc alteration notifier.
     86    /// \brief Gives back the arc alteration notifier.
     87    ///
     88    /// Gives back the arc alteration notifier.
    8789    ArcNotifier& notifier(Arc) const {
    8890      return arc_notifier;
     
    184186    };
    185187
    186     // \brief Base node of the iterator
    187     //
    188     // Returns the base node (ie. the source in this case) of the iterator
     188    /// \brief Base node of the iterator
     189    ///
     190    /// Returns the base node (ie. the source in this case) of the iterator
    189191    Node baseNode(const OutArcIt &e) const {
    190192      return Parent::source(static_cast<const Arc&>(e));
    191193    }
    192     // \brief Running node of the iterator
    193     //
    194     // Returns the running node (ie. the target in this case) of the
    195     // iterator
     194    /// \brief Running node of the iterator
     195    ///
     196    /// Returns the running node (ie. the target in this case) of the
     197    /// iterator
    196198    Node runningNode(const OutArcIt &e) const {
    197199      return Parent::target(static_cast<const Arc&>(e));
    198200    }
    199201
    200     // \brief Base node of the iterator
    201     //
    202     // Returns the base node (ie. the target in this case) of the iterator
     202    /// \brief Base node of the iterator
     203    ///
     204    /// Returns the base node (ie. the target in this case) of the iterator
    203205    Node baseNode(const InArcIt &e) const {
    204206      return Parent::target(static_cast<const Arc&>(e));
    205207    }
    206     // \brief Running node of the iterator
    207     //
    208     // Returns the running node (ie. the source in this case) of the
    209     // iterator
     208    /// \brief Running node of the iterator
     209    ///
     210    /// Returns the running node (ie. the source in this case) of the
     211    /// iterator
    210212    Node runningNode(const InArcIt &e) const {
    211213      return Parent::source(static_cast<const Arc&>(e));
     
    270272
    271273
    272   // \ingroup digraphbits
    273   //
    274   // \brief Extender for the EdgeSets
     274  /// \ingroup digraphbits
     275  ///
     276  /// \brief Extender for the EdgeSets
    275277  template <typename Base>
    276278  class EdgeSetExtender : public Base {
     
    491493    };
    492494
    493     // \brief Base node of the iterator
    494     //
    495     // Returns the base node (ie. the source in this case) of the iterator
     495    /// \brief Base node of the iterator
     496    ///
     497    /// Returns the base node (ie. the source in this case) of the iterator
    496498    Node baseNode(const OutArcIt &e) const {
    497499      return Parent::source(static_cast<const Arc&>(e));
    498500    }
    499     // \brief Running node of the iterator
    500     //
    501     // Returns the running node (ie. the target in this case) of the
    502     // iterator
     501    /// \brief Running node of the iterator
     502    ///
     503    /// Returns the running node (ie. the target in this case) of the
     504    /// iterator
    503505    Node runningNode(const OutArcIt &e) const {
    504506      return Parent::target(static_cast<const Arc&>(e));
    505507    }
    506508
    507     // \brief Base node of the iterator
    508     //
    509     // Returns the base node (ie. the target in this case) of the iterator
     509    /// \brief Base node of the iterator
     510    ///
     511    /// Returns the base node (ie. the target in this case) of the iterator
    510512    Node baseNode(const InArcIt &e) const {
    511513      return Parent::target(static_cast<const Arc&>(e));
    512514    }
    513     // \brief Running node of the iterator
    514     //
    515     // Returns the running node (ie. the source in this case) of the
    516     // iterator
     515    /// \brief Running node of the iterator
     516    ///
     517    /// Returns the running node (ie. the source in this case) of the
     518    /// iterator
    517519    Node runningNode(const InArcIt &e) const {
    518520      return Parent::source(static_cast<const Arc&>(e));
    519521    }
    520522
    521     // Base node of the iterator
    522     //
    523     // Returns the base node of the iterator
     523    /// Base node of the iterator
     524    ///
     525    /// Returns the base node of the iterator
    524526    Node baseNode(const IncEdgeIt &e) const {
    525527      return e.direction ? u(e) : v(e);
    526528    }
    527     // Running node of the iterator
    528     //
    529     // Returns the running node of the iterator
     529    /// Running node of the iterator
     530    ///
     531    /// Returns the running node of the iterator
    530532    Node runningNode(const IncEdgeIt &e) const {
    531533      return e.direction ? v(e) : u(e);
  • lemon/circulation.h

    r606 r525  
    216216    ///@{
    217217
    218     template <typename T>
     218    template <typename _FlowMap>
    219219    struct SetFlowMapTraits : public Traits {
    220       typedef T FlowMap;
     220      typedef _FlowMap FlowMap;
    221221      static FlowMap *createFlowMap(const Digraph&) {
    222222        LEMON_ASSERT(false, "FlowMap is not initialized");
     
    230230    /// \ref named-templ-param "Named parameter" for setting FlowMap
    231231    /// type.
    232     template <typename T>
     232    template <typename _FlowMap>
    233233    struct SetFlowMap
    234234      : public Circulation<Digraph, LCapMap, UCapMap, DeltaMap,
    235                            SetFlowMapTraits<T> > {
     235                           SetFlowMapTraits<_FlowMap> > {
    236236      typedef Circulation<Digraph, LCapMap, UCapMap, DeltaMap,
    237                           SetFlowMapTraits<T> > Create;
     237                          SetFlowMapTraits<_FlowMap> > Create;
    238238    };
    239239
    240     template <typename T>
     240    template <typename _Elevator>
    241241    struct SetElevatorTraits : public Traits {
    242       typedef T Elevator;
     242      typedef _Elevator Elevator;
    243243      static Elevator *createElevator(const Digraph&, int) {
    244244        LEMON_ASSERT(false, "Elevator is not initialized");
     
    256256    /// \ref run() or \ref init().
    257257    /// \sa SetStandardElevator
    258     template <typename T>
     258    template <typename _Elevator>
    259259    struct SetElevator
    260260      : public Circulation<Digraph, LCapMap, UCapMap, DeltaMap,
    261                            SetElevatorTraits<T> > {
     261                           SetElevatorTraits<_Elevator> > {
    262262      typedef Circulation<Digraph, LCapMap, UCapMap, DeltaMap,
    263                           SetElevatorTraits<T> > Create;
     263                          SetElevatorTraits<_Elevator> > Create;
    264264    };
    265265
    266     template <typename T>
     266    template <typename _Elevator>
    267267    struct SetStandardElevatorTraits : public Traits {
    268       typedef T Elevator;
     268      typedef _Elevator Elevator;
    269269      static Elevator *createElevator(const Digraph& digraph, int max_level) {
    270270        return new Elevator(digraph, max_level);
     
    284284    /// before calling \ref run() or \ref init().
    285285    /// \sa SetElevator
    286     template <typename T>
     286    template <typename _Elevator>
    287287    struct SetStandardElevator
    288288      : public Circulation<Digraph, LCapMap, UCapMap, DeltaMap,
    289                        SetStandardElevatorTraits<T> > {
     289                       SetStandardElevatorTraits<_Elevator> > {
    290290      typedef Circulation<Digraph, LCapMap, UCapMap, DeltaMap,
    291                       SetStandardElevatorTraits<T> > Create;
     291                      SetStandardElevatorTraits<_Elevator> > Create;
    292292    };
    293293
     
    683683    ///
    684684    /// \note This function calls \ref barrier() for each node,
    685     /// so it runs in O(n) time.
     685    /// so it runs in \f$O(n)\f$ time.
    686686    ///
    687687    /// \pre Either \ref run() or \ref init() must be called before
  • lemon/concepts/graph.h

    r606 r576  
    602602      /// \brief Opposite node on an arc
    603603      ///
    604       /// \return The opposite of the given node on the given edge.
     604      /// \return the opposite of the given Node on the given Edge
    605605      Node oppositeNode(Node, Edge) const { return INVALID; }
    606606
    607607      /// \brief First node of the edge.
    608608      ///
    609       /// \return The first node of the given edge.
     609      /// \return the first node of the given Edge.
    610610      ///
    611611      /// Naturally edges don't have direction and thus
    612       /// don't have source and target node. However we use \c u() and \c v()
    613       /// methods to query the two nodes of the arc. The direction of the
    614       /// arc which arises this way is called the inherent direction of the
     612      /// don't have source and target node. But we use these two methods
     613      /// to query the two nodes of the arc. The direction of the arc
     614      /// which arises this way is called the inherent direction of the
    615615      /// edge, and is used to define the "default" direction
    616616      /// of the directed versions of the arcs.
    617       /// \sa v()
    618       /// \sa direction()
     617      /// \sa direction
    619618      Node u(Edge) const { return INVALID; }
    620619
    621620      /// \brief Second node of the edge.
    622       ///
    623       /// \return The second node of the given edge.
    624       ///
    625       /// Naturally edges don't have direction and thus
    626       /// don't have source and target node. However we use \c u() and \c v()
    627       /// methods to query the two nodes of the arc. The direction of the
    628       /// arc which arises this way is called the inherent direction of the
    629       /// edge, and is used to define the "default" direction
    630       /// of the directed versions of the arcs.
    631       /// \sa u()
    632       /// \sa direction()
    633621      Node v(Edge) const { return INVALID; }
    634622
  • lemon/concepts/graph_components.h

    r606 r581  
    2121///\brief The concept of graph components.
    2222
     23
    2324#ifndef LEMON_CONCEPTS_GRAPH_COMPONENTS_H
    2425#define LEMON_CONCEPTS_GRAPH_COMPONENTS_H
     
    4445
    4546#ifndef DOXYGEN
    46     template <char sel = '0'>
     47    template <char _selector = '0'>
    4748#endif
    4849    class GraphItem {
     
    296297    /// The most of the base digraphs should conform to this concept.
    297298    /// The id's are unique and immutable.
    298     template <typename BAS = BaseDigraphComponent>
    299     class IDableDigraphComponent : public BAS {
    300     public:
    301 
    302       typedef BAS Base;
     299    template <typename _Base = BaseDigraphComponent>
     300    class IDableDigraphComponent : public _Base {
     301    public:
     302
     303      typedef _Base Base;
    303304      typedef typename Base::Node Node;
    304305      typedef typename Base::Arc Arc;
     
    374375    /// most of the base undirected graphs should conform to this
    375376    /// concept.  The id's are unique and immutable.
    376     template <typename BAS = BaseGraphComponent>
    377     class IDableGraphComponent : public IDableDigraphComponent<BAS> {
    378     public:
    379 
    380       typedef BAS Base;
     377    template <typename _Base = BaseGraphComponent>
     378    class IDableGraphComponent : public IDableDigraphComponent<_Base> {
     379    public:
     380
     381      typedef _Base Base;
    381382      typedef typename Base::Edge Edge;
    382383
    383       using IDableDigraphComponent<Base>::id;
     384      using IDableDigraphComponent<_Base>::id;
    384385
    385386      /// \brief Gives back an unique integer id for the Edge.
     
    425426    /// Skeleton class for graph NodeIt and ArcIt.
    426427    ///
    427     template <typename GR, typename Item>
    428     class GraphItemIt : public Item {
     428    template <typename _Graph, typename _Item>
     429    class GraphItemIt : public _Item {
    429430    public:
    430431      /// \brief Default constructor.
     
    442443      /// Sets the iterator to the first item of \c the graph.
    443444      ///
    444       explicit GraphItemIt(const GR&) {}
     445      explicit GraphItemIt(const _Graph&) {}
    445446      /// \brief Invalid constructor \& conversion.
    446447      ///
     
    479480          ++(++it1);
    480481
    481           Item bi = it1;
     482          _Item bi = it1;
    482483          bi = it2;
    483484        }
    484         GR& g;
     485        _Graph& g;
    485486      };
    486487    };
     
    489490    ///
    490491    /// \note Because InArcIt and OutArcIt may not inherit from the same
    491     /// base class, the \c sel is a additional template parameter (selector).
    492     /// For InArcIt you should instantiate it with character 'i' and for
     492    /// base class, the _selector is a additional template parameter. For
     493    /// InArcIt you should instantiate it with character 'i' and for
    493494    /// OutArcIt with 'o'.
    494     template <typename GR,
    495               typename Item = typename GR::Arc,
    496               typename Base = typename GR::Node,
    497               char sel = '0'>
    498     class GraphIncIt : public Item {
     495    template <typename _Graph,
     496              typename _Item = typename _Graph::Arc,
     497              typename _Base = typename _Graph::Node,
     498              char _selector = '0'>
     499    class GraphIncIt : public _Item {
    499500    public:
    500501      /// \brief Default constructor.
     
    507508      /// Copy constructor.
    508509      ///
    509       GraphIncIt(GraphIncIt const& gi) : Item(gi) {}
     510      GraphIncIt(GraphIncIt const& gi) : _Item(gi) {}
    510511      /// \brief Sets the iterator to the first arc incoming into or outgoing
    511512      /// from the node.
     
    514515      /// from the node.
    515516      ///
    516       explicit GraphIncIt(const GR&, const Base&) {}
     517      explicit GraphIncIt(const _Graph&, const _Base&) {}
    517518      /// \brief Invalid constructor \& conversion.
    518519      ///
     
    546547      struct Constraints {
    547548        void constraints() {
    548           checkConcept<GraphItem<sel>, _GraphIncIt>();
     549          checkConcept<GraphItem<_selector>, _GraphIncIt>();
    549550          _GraphIncIt it1(graph, node);
    550551          _GraphIncIt it2;
     
    553554          ++it2 = it1;
    554555          ++(++it1);
    555           Item e = it1;
     556          _Item e = it1;
    556557          e = it2;
    557558
    558559        }
    559560
    560         Item arc;
    561         Base node;
    562         GR graph;
     561        _Item arc;
     562        _Base node;
     563        _Graph graph;
    563564        _GraphIncIt it;
    564565      };
     
    571572    /// iterator based iterable interface for the digraph structure.
    572573    /// This concept is part of the Digraph concept.
    573     template <typename BAS = BaseDigraphComponent>
    574     class IterableDigraphComponent : public BAS {
    575 
    576     public:
    577 
    578       typedef BAS Base;
     574    template <typename _Base = BaseDigraphComponent>
     575    class IterableDigraphComponent : public _Base {
     576
     577    public:
     578
     579      typedef _Base Base;
    579580      typedef typename Base::Node Node;
    580581      typedef typename Base::Arc Arc;
     
    756757    /// based iterable interface for the undirected graph structure.
    757758    /// This concept is part of the Graph concept.
    758     template <typename BAS = BaseGraphComponent>
    759     class IterableGraphComponent : public IterableDigraphComponent<BAS> {
    760     public:
    761 
    762       typedef BAS Base;
     759    template <typename _Base = BaseGraphComponent>
     760    class IterableGraphComponent : public IterableDigraphComponent<_Base> {
     761    public:
     762
     763      typedef _Base Base;
    763764      typedef typename Base::Node Node;
    764765      typedef typename Base::Arc Arc;
     
    773774      /// @{
    774775
    775       using IterableDigraphComponent<Base>::first;
    776       using IterableDigraphComponent<Base>::next;
     776      using IterableDigraphComponent<_Base>::first;
     777      using IterableDigraphComponent<_Base>::next;
    777778
    778779      /// \brief Gives back the first edge in the iterating
     
    808809      void nextInc(Edge&, bool&) const {}
    809810
    810       using IterableDigraphComponent<Base>::baseNode;
    811       using IterableDigraphComponent<Base>::runningNode;
     811      using IterableDigraphComponent<_Base>::baseNode;
     812      using IterableDigraphComponent<_Base>::runningNode;
    812813
    813814      /// @}
     
    875876
    876877        const _Graph& graph;
     878
    877879      };
    878880    };
     
    886888    /// alteration occured in the digraph all the observers will
    887889    /// notified about it.
    888     template <typename BAS = BaseDigraphComponent>
    889     class AlterableDigraphComponent : public BAS {
    890     public:
    891 
    892       typedef BAS Base;
     890    template <typename _Base = BaseDigraphComponent>
     891    class AlterableDigraphComponent : public _Base {
     892    public:
     893
     894      typedef _Base Base;
    893895      typedef typename Base::Node Node;
    894896      typedef typename Base::Arc Arc;
     
    944946    /// alteration occured in the graph all the observers will
    945947    /// notified about it.
    946     template <typename BAS = BaseGraphComponent>
    947     class AlterableGraphComponent : public AlterableDigraphComponent<BAS> {
    948     public:
    949 
    950       typedef BAS Base;
     948    template <typename _Base = BaseGraphComponent>
     949    class AlterableGraphComponent : public AlterableDigraphComponent<_Base> {
     950    public:
     951
     952      typedef _Base Base;
    951953      typedef typename Base::Edge Edge;
    952954
     
    973975
    974976        const _Graph& graph;
    975       };
     977
     978      };
     979
    976980    };
    977981
     
    981985    /// (NodeMap, ArcMap), that is maps that can be used to
    982986    /// associate data to graph descriptors (nodes or arcs).
    983     template <typename GR, typename K, typename V>
    984     class GraphMap : public ReadWriteMap<K, V> {
    985     public:
    986 
    987       typedef ReadWriteMap<K, V> Parent;
     987    template <typename _Graph, typename _Item, typename _Value>
     988    class GraphMap : public ReadWriteMap<_Item, _Value> {
     989    public:
     990
     991      typedef ReadWriteMap<_Item, _Value> Parent;
    988992
    989993      /// The graph type of the map.
    990       typedef GR Graph;
     994      typedef _Graph Graph;
    991995      /// The key type of the map.
    992       typedef K Key;
     996      typedef _Item Key;
    993997      /// The value type of the map.
    994       typedef V Value;
     998      typedef _Value Value;
    995999
    9961000      /// \brief Construct a new map.
     
    10521056    /// map interface for the digraph structure.
    10531057    /// This concept is part of the Digraph concept.
    1054     template <typename BAS = BaseDigraphComponent>
    1055     class MappableDigraphComponent : public BAS  {
    1056     public:
    1057 
    1058       typedef BAS Base;
     1058    template <typename _Base = BaseDigraphComponent>
     1059    class MappableDigraphComponent : public _Base  {
     1060    public:
     1061
     1062      typedef _Base Base;
    10591063      typedef typename Base::Node Node;
    10601064      typedef typename Base::Arc Arc;
     
    10661070      /// ReadWrite map of the nodes.
    10671071      ///
    1068       template <typename V>
    1069       class NodeMap : public GraphMap<Digraph, Node, V> {
     1072      template <typename _Value>
     1073      class NodeMap : public GraphMap<Digraph, Node, _Value> {
    10701074      public:
    1071         typedef GraphMap<MappableDigraphComponent, Node, V> Parent;
     1075        typedef GraphMap<MappableDigraphComponent, Node, _Value> Parent;
    10721076
    10731077        /// \brief Construct a new map.
     
    10801084        ///
    10811085        /// Construct a new map for the digraph and initalise the values.
    1082         NodeMap(const MappableDigraphComponent& digraph, const V& value)
     1086        NodeMap(const MappableDigraphComponent& digraph, const _Value& value)
    10831087          : Parent(digraph, value) {}
    10841088
     
    10941098        template <typename CMap>
    10951099        NodeMap& operator=(const CMap&) {
    1096           checkConcept<ReadMap<Node, V>, CMap>();
     1100          checkConcept<ReadMap<Node, _Value>, CMap>();
    10971101          return *this;
    10981102        }
     
    11041108      /// ReadWrite map of the arcs.
    11051109      ///
    1106       template <typename V>
    1107       class ArcMap : public GraphMap<Digraph, Arc, V> {
     1110      template <typename _Value>
     1111      class ArcMap : public GraphMap<Digraph, Arc, _Value> {
    11081112      public:
    1109         typedef GraphMap<MappableDigraphComponent, Arc, V> Parent;
     1113        typedef GraphMap<MappableDigraphComponent, Arc, _Value> Parent;
    11101114
    11111115        /// \brief Construct a new map.
     
    11181122        ///
    11191123        /// Construct a new map for the digraph and initalise the values.
    1120         ArcMap(const MappableDigraphComponent& digraph, const V& value)
     1124        ArcMap(const MappableDigraphComponent& digraph, const _Value& value)
    11211125          : Parent(digraph, value) {}
    11221126
     
    11321136        template <typename CMap>
    11331137        ArcMap& operator=(const CMap&) {
    1134           checkConcept<ReadMap<Arc, V>, CMap>();
     1138          checkConcept<ReadMap<Arc, _Value>, CMap>();
    11351139          return *this;
    11361140        }
     
    11881192    /// map interface for the graph structure.
    11891193    /// This concept is part of the Graph concept.
    1190     template <typename BAS = BaseGraphComponent>
    1191     class MappableGraphComponent : public MappableDigraphComponent<BAS>  {
    1192     public:
    1193 
    1194       typedef BAS Base;
     1194    template <typename _Base = BaseGraphComponent>
     1195    class MappableGraphComponent : public MappableDigraphComponent<_Base>  {
     1196    public:
     1197
     1198      typedef _Base Base;
    11951199      typedef typename Base::Edge Edge;
    11961200
     
    12011205      /// ReadWrite map of the edges.
    12021206      ///
    1203       template <typename V>
    1204       class EdgeMap : public GraphMap<Graph, Edge, V> {
     1207      template <typename _Value>
     1208      class EdgeMap : public GraphMap<Graph, Edge, _Value> {
    12051209      public:
    1206         typedef GraphMap<MappableGraphComponent, Edge, V> Parent;
     1210        typedef GraphMap<MappableGraphComponent, Edge, _Value> Parent;
    12071211
    12081212        /// \brief Construct a new map.
     
    12151219        ///
    12161220        /// Construct a new map for the graph and initalise the values.
    1217         EdgeMap(const MappableGraphComponent& graph, const V& value)
     1221        EdgeMap(const MappableGraphComponent& graph, const _Value& value)
    12181222          : Parent(graph, value) {}
    12191223
     
    12291233        template <typename CMap>
    12301234        EdgeMap& operator=(const CMap&) {
    1231           checkConcept<ReadMap<Edge, V>, CMap>();
     1235          checkConcept<ReadMap<Edge, _Value>, CMap>();
    12321236          return *this;
    12331237        }
     
    12731277    /// difference between the base and this interface is that the
    12741278    /// digraph alterations should handled already on this level.
    1275     template <typename BAS = BaseDigraphComponent>
    1276     class ExtendableDigraphComponent : public BAS {
    1277     public:
    1278       typedef BAS Base;
    1279 
    1280       typedef typename Base::Node Node;
    1281       typedef typename Base::Arc Arc;
     1279    template <typename _Base = BaseDigraphComponent>
     1280    class ExtendableDigraphComponent : public _Base {
     1281    public:
     1282      typedef _Base Base;
     1283
     1284      typedef typename _Base::Node Node;
     1285      typedef typename _Base::Arc Arc;
    12821286
    12831287      /// \brief Adds a new node to the digraph.
     
    13181322    /// that the graph alterations should handled already on this
    13191323    /// level.
    1320     template <typename BAS = BaseGraphComponent>
    1321     class ExtendableGraphComponent : public BAS {
    1322     public:
    1323 
    1324       typedef BAS Base;
    1325       typedef typename Base::Node Node;
    1326       typedef typename Base::Edge Edge;
     1324    template <typename _Base = BaseGraphComponent>
     1325    class ExtendableGraphComponent : public _Base {
     1326    public:
     1327
     1328      typedef _Base Base;
     1329      typedef typename _Base::Node Node;
     1330      typedef typename _Base::Edge Edge;
    13271331
    13281332      /// \brief Adds a new node to the graph.
     
    13621366    /// the base and this interface is that the digraph alterations
    13631367    /// should handled already on this level.
    1364     template <typename BAS = BaseDigraphComponent>
    1365     class ErasableDigraphComponent : public BAS {
    1366     public:
    1367 
    1368       typedef BAS Base;
     1368    template <typename _Base = BaseDigraphComponent>
     1369    class ErasableDigraphComponent : public _Base {
     1370    public:
     1371
     1372      typedef _Base Base;
    13691373      typedef typename Base::Node Node;
    13701374      typedef typename Base::Arc Arc;
     
    14021406    /// main difference between the base and this interface is that
    14031407    /// the graph alterations should handled already on this level.
    1404     template <typename BAS = BaseGraphComponent>
    1405     class ErasableGraphComponent : public BAS {
    1406     public:
    1407 
    1408       typedef BAS Base;
     1408    template <typename _Base = BaseGraphComponent>
     1409    class ErasableGraphComponent : public _Base {
     1410    public:
     1411
     1412      typedef _Base Base;
    14091413      typedef typename Base::Node Node;
    14101414      typedef typename Base::Edge Edge;
     
    14421446    /// the base and this interface is that the digraph alterations
    14431447    /// should handled already on this level.
    1444     template <typename BAS = BaseDigraphComponent>
    1445     class ClearableDigraphComponent : public BAS {
    1446     public:
    1447 
    1448       typedef BAS Base;
     1448    template <typename _Base = BaseDigraphComponent>
     1449    class ClearableDigraphComponent : public _Base {
     1450    public:
     1451
     1452      typedef _Base Base;
    14491453
    14501454      /// \brief Erase all nodes and arcs from the digraph.
     
    14711475    /// main difference between the base and this interface is that
    14721476    /// the graph alterations should handled already on this level.
    1473     template <typename BAS = BaseGraphComponent>
    1474     class ClearableGraphComponent : public ClearableDigraphComponent<BAS> {
    1475     public:
    1476 
    1477       typedef BAS Base;
     1477    template <typename _Base = BaseGraphComponent>
     1478    class ClearableGraphComponent : public ClearableDigraphComponent<_Base> {
     1479    public:
     1480
     1481      typedef _Base Base;
    14781482
    14791483      template <typename _Graph>
  • lemon/concepts/heap.h

    r606 r576  
    3636    /// \brief The heap concept.
    3737    ///
    38     /// Concept class describing the main interface of heaps. A \e heap
    39     /// is a data structure for storing items with specified values called
    40     /// \e priorities in such a way that finding the item with minimum
    41     /// priority is efficient. In a heap one can change the priority of an
    42     /// item, add or erase an item, etc.
    43     ///
    44     /// \tparam PR Type of the priority of the items.
    45     /// \tparam IM A read and writable item map with int values, used
    46     /// internally to handle the cross references.
    47     /// \tparam Comp A functor class for the ordering of the priorities.
    48     /// The default is \c std::less<PR>.
    49 #ifdef DOXYGEN
    50     template <typename PR, typename IM, typename Comp = std::less<PR> >
    51 #else
    52     template <typename PR, typename IM>
    53 #endif
     38    /// Concept class describing the main interface of heaps.
     39    template <typename Priority, typename ItemIntMap>
    5440    class Heap {
    5541    public:
    5642
    57       /// Type of the item-int map.
    58       typedef IM ItemIntMap;
    59       /// Type of the priorities.
    60       typedef PR Prio;
    6143      /// Type of the items stored in the heap.
    6244      typedef typename ItemIntMap::Key Item;
     45
     46      /// Type of the priorities.
     47      typedef Priority Prio;
    6348
    6449      /// \brief Type to represent the states of the items.
     
    6954      /// the user.
    7055      ///
    71       /// The item-int map must be initialized in such way that it assigns
    72       /// \c PRE_HEAP (<tt>-1</tt>) to any element to be put in the heap.
     56      /// The \c ItemIntMap must be initialized in such a way, that it
     57      /// assigns \c PRE_HEAP (<tt>-1</tt>) to every item.
    7358      enum State {
    74         IN_HEAP = 0,    ///< The "in heap" state constant.
    75         PRE_HEAP = -1,  ///< The "pre heap" state constant.
    76         POST_HEAP = -2  ///< The "post heap" state constant.
     59        IN_HEAP = 0,
     60        PRE_HEAP = -1,
     61        POST_HEAP = -2
    7762      };
    7863
     
    135120      ///
    136121      /// Returns the priority of the given item.
    137       /// \param i The item.
    138122      /// \pre \c i must be in the heap.
     123      /// \param i The item.
    139124      Prio operator[](const Item &i) const {}
    140125
     
    153138      ///
    154139      /// Decreases the priority of an item to the given value.
     140      /// \pre \c i must be stored in the heap with priority at least \c p.
    155141      /// \param i The item.
    156142      /// \param p The priority.
    157       /// \pre \c i must be stored in the heap with priority at least \c p.
    158143      void decrease(const Item &i, const Prio &p) {}
    159144
     
    161146      ///
    162147      /// Increases the priority of an item to the given value.
     148      /// \pre \c i must be stored in the heap with priority at most \c p.
    163149      /// \param i The item.
    164150      /// \param p The priority.
    165       /// \pre \c i must be stored in the heap with priority at most \c p.
    166151      void increase(const Item &i, const Prio &p) {}
    167152
  • lemon/concepts/path.h

    r606 r576  
    3939    /// A skeleton structure for representing directed paths in a
    4040    /// digraph.
    41     /// \tparam GR The digraph type in which the path is.
     41    /// \tparam _Digraph The digraph type in which the path is.
    4242    ///
    4343    /// In a sense, the path can be treated as a list of arcs. The
     
    4646    /// paths cannot store the source.
    4747    ///
    48     template <typename GR>
     48    template <typename _Digraph>
    4949    class Path {
    5050    public:
    5151
    5252      /// Type of the underlying digraph.
    53       typedef GR Digraph;
     53      typedef _Digraph Digraph;
    5454      /// Arc type of the underlying digraph.
    5555      typedef typename Digraph::Arc Arc;
     
    206206    /// assigned to a real path and the dumpers can be implemented as
    207207    /// an adaptor class to the predecessor map.
    208     ///
    209     /// \tparam GR The digraph type in which the path is.
     208
     209    /// \tparam _Digraph The digraph type in which the path is.
    210210    ///
    211211    /// The paths can be constructed from any path type by a
    212212    /// template constructor or a template assignment operator.
    213     template <typename GR>
     213    ///
     214    template <typename _Digraph>
    214215    class PathDumper {
    215216    public:
    216217
    217218      /// Type of the underlying digraph.
    218       typedef GR Digraph;
     219      typedef _Digraph Digraph;
    219220      /// Arc type of the underlying digraph.
    220221      typedef typename Digraph::Arc Arc;
  • lemon/connectivity.h

    r606 r463  
    4747  /// Check whether the given undirected graph is connected.
    4848  /// \param graph The undirected graph.
    49   /// \return \c true when there is path between any two nodes in the graph.
     49  /// \return %True when there is path between any two nodes in the graph.
    5050  /// \note By definition, the empty graph is connected.
    5151  template <typename Graph>
     
    235235  /// graph is strongly connected when any two nodes of the graph are
    236236  /// connected with directed paths in both direction.
    237   /// \return \c false when the graph is not strongly connected.
     237  /// \return %False when the graph is not strongly connected.
    238238  /// \see connected
    239239  ///
     
    710710  ///
    711711  /// \param graph The graph.
    712   /// \return \c true when the graph bi-node-connected.
     712  /// \return %True when the graph bi-node-connected.
    713713  template <typename Graph>
    714714  bool biNodeConnected(const Graph& graph) {
     
    12311231  /// of the map will be set exactly once, the values will be set descending
    12321232  /// order.
    1233   /// \return \c false when the graph is not DAG.
     1233  /// \return %False when the graph is not DAG.
    12341234  ///
    12351235  /// \see topologicalSort
     
    12801280  /// Check that the given directed graph is a DAG. The DAG is
    12811281  /// an Directed Acyclic Digraph.
    1282   /// \return \c false when the graph is not DAG.
     1282  /// \return %False when the graph is not DAG.
    12831283  /// \see acyclic
    12841284  template <typename Digraph>
     
    13221322  /// Check that the given undirected graph acyclic.
    13231323  /// \param graph The undirected graph.
    1324   /// \return \c true when there is no circle in the graph.
     1324  /// \return %True when there is no circle in the graph.
    13251325  /// \see dag
    13261326  template <typename Graph>
     
    13561356  /// Check that the given undirected graph is tree.
    13571357  /// \param graph The undirected graph.
    1358   /// \return \c true when the graph is acyclic and connected.
     1358  /// \return %True when the graph is acyclic and connected.
    13591359  template <typename Graph>
    13601360  bool tree(const Graph& graph) {
     
    14491449  /// or not. The \ref Bfs algorithm is used to calculate the result.
    14501450  /// \param graph The undirected graph.
    1451   /// \return \c true if \c graph is bipartite, \c false otherwise.
     1451  /// \return %True if \c graph is bipartite, %false otherwise.
    14521452  /// \sa bipartitePartitions
    14531453  template<typename Graph>
     
    14901490  /// \retval partMap A writable bool map of nodes. It will be set as the
    14911491  /// two partitions of the graph.
    1492   /// \return \c true if \c graph is bipartite, \c false otherwise.
     1492  /// \return %True if \c graph is bipartite, %false otherwise.
    14931493  template<typename Graph, typename NodeMap>
    14941494  inline bool bipartitePartitions(const Graph &graph, NodeMap &partMap){
  • lemon/core.h

    r606 r582  
    10351035  ///\sa findArc()
    10361036  ///\sa ArcLookUp, AllArcLookUp, DynArcLookUp
    1037   template <typename GR>
    1038   class ConArcIt : public GR::Arc {
     1037  template <typename _Graph>
     1038  class ConArcIt : public _Graph::Arc {
    10391039  public:
    10401040
    1041     typedef GR Graph;
     1041    typedef _Graph Graph;
    10421042    typedef typename Graph::Arc Parent;
    10431043
     
    11581158  ///
    11591159  ///\sa findEdge()
    1160   template <typename GR>
    1161   class ConEdgeIt : public GR::Edge {
     1160  template <typename _Graph>
     1161  class ConEdgeIt : public _Graph::Edge {
    11621162  public:
    11631163
    1164     typedef GR Graph;
     1164    typedef _Graph Graph;
    11651165    typedef typename Graph::Edge Parent;
    11661166
     
    12121212  ///queries.
    12131213  ///
    1214   ///\tparam GR The type of the underlying digraph.
     1214  ///\tparam G The type of the underlying digraph.
    12151215  ///
    12161216  ///\sa ArcLookUp
    12171217  ///\sa AllArcLookUp
    1218   template <typename GR>
     1218  template<class G>
    12191219  class DynArcLookUp
    1220     : protected ItemSetTraits<GR, typename GR::Arc>::ItemNotifier::ObserverBase
     1220    : protected ItemSetTraits<G, typename G::Arc>::ItemNotifier::ObserverBase
    12211221  {
    12221222  public:
    1223     typedef typename ItemSetTraits<GR, typename GR::Arc>
     1223    typedef typename ItemSetTraits<G, typename G::Arc>
    12241224    ::ItemNotifier::ObserverBase Parent;
    12251225
    1226     TEMPLATE_DIGRAPH_TYPEDEFS(GR);
    1227     typedef GR Digraph;
     1226    TEMPLATE_DIGRAPH_TYPEDEFS(G);
     1227    typedef G Digraph;
    12281228
    12291229  protected:
    12301230
    1231     class AutoNodeMap : public ItemSetTraits<GR, Node>::template Map<Arc>::Type {
     1231    class AutoNodeMap : public ItemSetTraits<G, Node>::template Map<Arc>::Type {
    12321232    public:
    12331233
    1234       typedef typename ItemSetTraits<GR, Node>::template Map<Arc>::Type Parent;
    1235 
    1236       AutoNodeMap(const GR& digraph) : Parent(digraph, INVALID) {}
     1234      typedef typename ItemSetTraits<G, Node>::template Map<Arc>::Type Parent;
     1235
     1236      AutoNodeMap(const G& digraph) : Parent(digraph, INVALID) {}
    12371237
    12381238      virtual void add(const Node& node) {
     
    16241624  ///(<em>O</em>(<em>m</em> log<em>m</em>)) to the number of arcs).
    16251625  ///
    1626   ///\tparam GR The type of the underlying digraph.
     1626  ///\tparam G The type of the underlying digraph.
    16271627  ///
    16281628  ///\sa DynArcLookUp
    16291629  ///\sa AllArcLookUp
    1630   template<class GR>
     1630  template<class G>
    16311631  class ArcLookUp
    16321632  {
    16331633  public:
    1634     TEMPLATE_DIGRAPH_TYPEDEFS(GR);
    1635     typedef GR Digraph;
     1634    TEMPLATE_DIGRAPH_TYPEDEFS(G);
     1635    typedef G Digraph;
    16361636
    16371637  protected:
     
    17341734  ///(<em>O</em>(<em>m</em> log<em>m</em>)) to the number of arcs).
    17351735  ///
    1736   ///\tparam GR The type of the underlying digraph.
     1736  ///\tparam G The type of the underlying digraph.
    17371737  ///
    17381738  ///\sa DynArcLookUp
    17391739  ///\sa ArcLookUp
    1740   template<class GR>
    1741   class AllArcLookUp : public ArcLookUp<GR>
     1740  template<class G>
     1741  class AllArcLookUp : public ArcLookUp<G>
    17421742  {
    1743     using ArcLookUp<GR>::_g;
    1744     using ArcLookUp<GR>::_right;
    1745     using ArcLookUp<GR>::_left;
    1746     using ArcLookUp<GR>::_head;
    1747 
    1748     TEMPLATE_DIGRAPH_TYPEDEFS(GR);
    1749     typedef GR Digraph;
     1743    using ArcLookUp<G>::_g;
     1744    using ArcLookUp<G>::_right;
     1745    using ArcLookUp<G>::_left;
     1746    using ArcLookUp<G>::_head;
     1747
     1748    TEMPLATE_DIGRAPH_TYPEDEFS(G);
     1749    typedef G Digraph;
    17501750
    17511751    typename Digraph::template ArcMap<Arc> _next;
     
    17741774    ///It builds up the search database, which remains valid until the digraph
    17751775    ///changes.
    1776     AllArcLookUp(const Digraph &g) : ArcLookUp<GR>(g), _next(g) {refreshNext();}
     1776    AllArcLookUp(const Digraph &g) : ArcLookUp<G>(g), _next(g) {refreshNext();}
    17771777
    17781778    ///Refresh the data structure at a node.
     
    17841784    void refresh(Node n)
    17851785    {
    1786       ArcLookUp<GR>::refresh(n);
     1786      ArcLookUp<G>::refresh(n);
    17871787      refreshNext(_head[n]);
    17881788    }
     
    18311831    Arc operator()(Node s, Node t, Arc prev=INVALID) const {}
    18321832#else
    1833     using ArcLookUp<GR>::operator() ;
     1833    using ArcLookUp<G>::operator() ;
    18341834    Arc operator()(Node s, Node t, Arc prev) const
    18351835    {
  • lemon/dijkstra.h

    r606 r525  
    3939  /// This operation traits class defines all computational operations and
    4040  /// constants which are used in the Dijkstra algorithm.
    41   template <typename V>
     41  template <typename Value>
    4242  struct DijkstraDefaultOperationTraits {
    43     /// \e
    44     typedef V Value;
    4543    /// \brief Gives back the zero value of the type.
    4644    static Value zero() {
     
    6159  ///Default traits class of Dijkstra class.
    6260  ///\tparam GR The type of the digraph.
    63   ///\tparam LEN The type of the length map.
    64   template<typename GR, typename LEN>
     61  ///\tparam LM The type of the length map.
     62  template<class GR, class LM>
    6563  struct DijkstraDefaultTraits
    6664  {
     
    7270    ///The type of the map that stores the arc lengths.
    7371    ///It must meet the \ref concepts::ReadMap "ReadMap" concept.
    74     typedef LEN LengthMap;
     72    typedef LM LengthMap;
    7573    ///The type of the length of the arcs.
    76     typedef typename LEN::Value Value;
     74    typedef typename LM::Value Value;
    7775
    7876    /// Operation traits for %Dijkstra algorithm.
     
    103101    ///\sa BinHeap
    104102    ///\sa Dijkstra
    105     typedef BinHeap<typename LEN::Value, HeapCrossRef, std::less<Value> > Heap;
     103    typedef BinHeap<typename LM::Value, HeapCrossRef, std::less<Value> > Heap;
    106104    ///Instantiates a \c Heap.
    107105
     
    153151    ///The type of the map that stores the distances of the nodes.
    154152    ///It must meet the \ref concepts::WriteMap "WriteMap" concept.
    155     typedef typename Digraph::template NodeMap<typename LEN::Value> DistMap;
     153    typedef typename Digraph::template NodeMap<typename LM::Value> DistMap;
    156154    ///Instantiates a \c DistMap.
    157155
     
    183181  ///\tparam GR The type of the digraph the algorithm runs on.
    184182  ///The default type is \ref ListDigraph.
    185   ///\tparam LEN A \ref concepts::ReadMap "readable" arc map that specifies
     183  ///\tparam LM A \ref concepts::ReadMap "readable" arc map that specifies
    186184  ///the lengths of the arcs.
    187185  ///It is read once for each arc, so the map may involve in
     
    190188  ///concepts::Digraph::ArcMap "GR::ArcMap<int>".
    191189#ifdef DOXYGEN
    192   template <typename GR, typename LEN, typename TR>
     190  template <typename GR, typename LM, typename TR>
    193191#else
    194192  template <typename GR=ListDigraph,
    195             typename LEN=typename GR::template ArcMap<int>,
    196             typename TR=DijkstraDefaultTraits<GR,LEN> >
     193            typename LM=typename GR::template ArcMap<int>,
     194            typename TR=DijkstraDefaultTraits<GR,LM> >
    197195#endif
    198196  class Dijkstra {
     
    916914  ///Default traits class of dijkstra() function.
    917915  ///\tparam GR The type of the digraph.
    918   ///\tparam LEN The type of the length map.
    919   template<class GR, class LEN>
     916  ///\tparam LM The type of the length map.
     917  template<class GR, class LM>
    920918  struct DijkstraWizardDefaultTraits
    921919  {
     
    926924    ///The type of the map that stores the arc lengths.
    927925    ///It must meet the \ref concepts::ReadMap "ReadMap" concept.
    928     typedef LEN LengthMap;
     926    typedef LM LengthMap;
    929927    ///The type of the length of the arcs.
    930     typedef typename LEN::Value Value;
     928    typedef typename LM::Value Value;
    931929
    932930    /// Operation traits for Dijkstra algorithm.
     
    10101008    ///The type of the map that stores the distances of the nodes.
    10111009    ///It must meet the \ref concepts::WriteMap "WriteMap" concept.
    1012     typedef typename Digraph::template NodeMap<typename LEN::Value> DistMap;
     1010    typedef typename Digraph::template NodeMap<typename LM::Value> DistMap;
    10131011    ///Instantiates a DistMap.
    10141012
     
    10361034  /// The \ref DijkstraWizardBase is a class to be the default traits of the
    10371035  /// \ref DijkstraWizard class.
    1038   template<typename GR, typename LEN>
    1039   class DijkstraWizardBase : public DijkstraWizardDefaultTraits<GR,LEN>
     1036  template<class GR,class LM>
     1037  class DijkstraWizardBase : public DijkstraWizardDefaultTraits<GR,LM>
    10401038  {
    1041     typedef DijkstraWizardDefaultTraits<GR,LEN> Base;
     1039    typedef DijkstraWizardDefaultTraits<GR,LM> Base;
    10421040  protected:
    10431041    //The type of the nodes in the digraph.
     
    10731071    /// \param g The digraph the algorithm runs on.
    10741072    /// \param l The length map.
    1075     DijkstraWizardBase(const GR &g,const LEN &l) :
     1073    DijkstraWizardBase(const GR &g,const LM &l) :
    10761074      _g(reinterpret_cast<void*>(const_cast<GR*>(&g))),
    1077       _length(reinterpret_cast<void*>(const_cast<LEN*>(&l))),
     1075      _length(reinterpret_cast<void*>(const_cast<LM*>(&l))),
    10781076      _processed(0), _pred(0), _dist(0), _path(0), _di(0) {}
    10791077
     
    12841282  ///\sa DijkstraWizard
    12851283  ///\sa Dijkstra
    1286   template<typename GR, typename LEN>
    1287   DijkstraWizard<DijkstraWizardBase<GR,LEN> >
    1288   dijkstra(const GR &digraph, const LEN &length)
     1284  template<class GR, class LM>
     1285  DijkstraWizard<DijkstraWizardBase<GR,LM> >
     1286  dijkstra(const GR &digraph, const LM &length)
    12891287  {
    1290     return DijkstraWizard<DijkstraWizardBase<GR,LEN> >(digraph,length);
     1288    return DijkstraWizard<DijkstraWizardBase<GR,LM> >(digraph,length);
    12911289  }
    12921290
  • lemon/edge_set.h

    r606 r559  
    256256  /// concept.
    257257  ///
    258   /// This class fully conforms to the \ref concepts::Digraph
     258  /// This class is fully conform to the \ref concepts::Digraph
    259259  /// "Digraph" concept.
    260260  template <typename GR>
     
    337337    /// Add a new arc to the digraph with source node \c s
    338338    /// and target node \c t.
    339     /// \return The new arc.
     339    /// \return the new arc.
    340340    Arc addArc(const Node& s, const Node& t) {
    341341      return Parent::addArc(s, t);
     
    685685  /// concept.
    686686  ///
    687   /// This class fully conforms to the \ref concepts::Graph "Graph"
     687  /// This class is fully conform to the \ref concepts::Graph "Graph"
    688688  /// concept.
    689689  template <typename GR>
     
    762762    /// Add a new edge to the graph with node \c u
    763763    /// and node \c v endpoints.
    764     /// \return The new edge.
     764    /// \return the new edge.
    765765    Edge addEdge(const Node& u, const Node& v) {
    766766      return Parent::addEdge(u, v);
     
    953953  /// validity can be checked with the \c valid() member function.
    954954  ///
    955   /// This class fully conforms to the \ref concepts::Digraph
     955  /// This class is fully conform to the \ref concepts::Digraph
    956956  /// "Digraph" concept.
    957957  template <typename GR>
     
    10421042    /// Add a new arc to the digraph with source node \c s
    10431043    /// and target node \c t.
    1044     /// \return The new arc.
     1044    /// \return the new arc.
    10451045    Arc addArc(const Node& s, const Node& t) {
    10461046      return Parent::addArc(s, t);
     
    13011301  /// be checked with the \c valid() member function.
    13021302  ///
    1303   /// This class fully conforms to the \ref concepts::Graph
     1303  /// This class is fully conform to the \ref concepts::Graph
    13041304  /// "Graph" concept.
    13051305  template <typename GR>
     
    13901390    /// Add a new edge to the graph with node \c u
    13911391    /// and node \c v endpoints.
    1392     /// \return The new edge.
     1392    /// \return the new edge.
    13931393    Edge addEdge(const Node& u, const Node& v) {
    13941394      return Parent::addEdge(u, v);
  • lemon/elevator.h

    r606 r566  
    4747  ///\sa LinkedElevator
    4848  ///
    49   ///\param GR Type of the underlying graph.
    50   ///\param Item Type of the items the data is assigned to (\c GR::Node,
    51   ///\c GR::Arc or \c GR::Edge).
    52   template<class GR, class Item>
     49  ///\param Graph Type of the underlying graph.
     50  ///\param Item Type of the items the data is assigned to (Graph::Node,
     51  ///Graph::Arc, Graph::Edge).
     52  template<class Graph, class Item>
    5353  class Elevator
    5454  {
     
    6161
    6262    typedef Item *Vit;
    63     typedef typename ItemSetTraits<GR,Item>::template Map<Vit>::Type VitMap;
    64     typedef typename ItemSetTraits<GR,Item>::template Map<int>::Type IntMap;
    65 
    66     const GR &_g;
     63    typedef typename ItemSetTraits<Graph,Item>::template Map<Vit>::Type VitMap;
     64    typedef typename ItemSetTraits<Graph,Item>::template Map<int>::Type IntMap;
     65
     66    const Graph &_g;
    6767    int _max_level;
    6868    int _item_num;
     
    106106    ///\param max_level The maximum allowed level.
    107107    ///Set the range of the possible labels to <tt>[0..max_level]</tt>.
    108     Elevator(const GR &graph,int max_level) :
     108    Elevator(const Graph &graph,int max_level) :
    109109      _g(graph),
    110110      _max_level(max_level),
     
    123123    ///Set the range of the possible labels to <tt>[0..max_level]</tt>,
    124124    ///where \c max_level is equal to the number of labeled items in the graph.
    125     Elevator(const GR &graph) :
     125    Elevator(const Graph &graph) :
    126126      _g(graph),
    127       _max_level(countItems<GR, Item>(graph)),
     127      _max_level(countItems<Graph, Item>(graph)),
    128128      _item_num(_max_level),
    129129      _where(graph),
     
    431431      _last_active[0]=&_items[0]-1;
    432432      Vit n=&_items[0];
    433       for(typename ItemSetTraits<GR,Item>::ItemIt i(_g);i!=INVALID;++i)
     433      for(typename ItemSetTraits<Graph,Item>::ItemIt i(_g);i!=INVALID;++i)
    434434        {
    435435          *n=i;
     
    490490  ///\sa Elevator
    491491  ///
    492   ///\param GR Type of the underlying graph.
    493   ///\param Item Type of the items the data is assigned to (\c GR::Node,
    494   ///\c GR::Arc or \c GR::Edge).
    495   template <class GR, class Item>
     492  ///\param Graph Type of the underlying graph.
     493  ///\param Item Type of the items the data is assigned to (Graph::Node,
     494  ///Graph::Arc, Graph::Edge).
     495  template <class Graph, class Item>
    496496  class LinkedElevator {
    497497  public:
     
    502502  private:
    503503
    504     typedef typename ItemSetTraits<GR,Item>::
     504    typedef typename ItemSetTraits<Graph,Item>::
    505505    template Map<Item>::Type ItemMap;
    506     typedef typename ItemSetTraits<GR,Item>::
     506    typedef typename ItemSetTraits<Graph,Item>::
    507507    template Map<int>::Type IntMap;
    508     typedef typename ItemSetTraits<GR,Item>::
     508    typedef typename ItemSetTraits<Graph,Item>::
    509509    template Map<bool>::Type BoolMap;
    510510
    511     const GR &_graph;
     511    const Graph &_graph;
    512512    int _max_level;
    513513    int _item_num;
     
    526526    ///\param max_level The maximum allowed level.
    527527    ///Set the range of the possible labels to <tt>[0..max_level]</tt>.
    528     LinkedElevator(const GR& graph, int max_level)
     528    LinkedElevator(const Graph& graph, int max_level)
    529529      : _graph(graph), _max_level(max_level), _item_num(_max_level),
    530530        _first(_max_level + 1), _last(_max_level + 1),
     
    539539    ///Set the range of the possible labels to <tt>[0..max_level]</tt>,
    540540    ///where \c max_level is equal to the number of labeled items in the graph.
    541     LinkedElevator(const GR& graph)
    542       : _graph(graph), _max_level(countItems<GR, Item>(graph)),
     541    LinkedElevator(const Graph& graph)
     542      : _graph(graph), _max_level(countItems<Graph, Item>(graph)),
    543543        _item_num(_max_level),
    544544        _first(_max_level + 1), _last(_max_level + 1),
     
    936936      }
    937937      _init_level = 0;
    938       for(typename ItemSetTraits<GR,Item>::ItemIt i(_graph);
     938      for(typename ItemSetTraits<Graph,Item>::ItemIt i(_graph);
    939939          i != INVALID; ++i) {
    940940        _level.set(i, _max_level);
  • lemon/euler.h

    r606 r569  
    5555  ///If \c g is not Euler then the resulted tour will not be full or closed.
    5656  ///\sa EulerIt
    57   template<typename GR>
     57  template<class Digraph>
    5858  class DiEulerIt
    5959  {
    60     typedef typename GR::Node Node;
    61     typedef typename GR::NodeIt NodeIt;
    62     typedef typename GR::Arc Arc;
    63     typedef typename GR::ArcIt ArcIt;
    64     typedef typename GR::OutArcIt OutArcIt;
    65     typedef typename GR::InArcIt InArcIt;
    66 
    67     const GR &g;
    68     typename GR::template NodeMap<OutArcIt> nedge;
     60    typedef typename Digraph::Node Node;
     61    typedef typename Digraph::NodeIt NodeIt;
     62    typedef typename Digraph::Arc Arc;
     63    typedef typename Digraph::ArcIt ArcIt;
     64    typedef typename Digraph::OutArcIt OutArcIt;
     65    typedef typename Digraph::InArcIt InArcIt;
     66
     67    const Digraph &g;
     68    typename Digraph::template NodeMap<OutArcIt> nedge;
    6969    std::list<Arc> euler;
    7070
     
    7373    ///Constructor
    7474
    75     ///\param gr A digraph.
     75    ///\param _g A digraph.
    7676    ///\param start The starting point of the tour. If it is not given
    7777    ///       the tour will start from the first node.
    78     DiEulerIt(const GR &gr, typename GR::Node start = INVALID)
    79       : g(gr), nedge(g)
     78    DiEulerIt(const Digraph &_g,typename Digraph::Node start=INVALID)
     79      : g(_g), nedge(g)
    8080    {
    8181      if(start==INVALID) start=NodeIt(g);
     
    146146  ///If \c g is not Euler then the resulted tour will not be full or closed.
    147147  ///\sa EulerIt
    148   template<typename GR>
     148  template<class Digraph>
    149149  class EulerIt
    150150  {
    151     typedef typename GR::Node Node;
    152     typedef typename GR::NodeIt NodeIt;
    153     typedef typename GR::Arc Arc;
    154     typedef typename GR::Edge Edge;
    155     typedef typename GR::ArcIt ArcIt;
    156     typedef typename GR::OutArcIt OutArcIt;
    157     typedef typename GR::InArcIt InArcIt;
    158 
    159     const GR &g;
    160     typename GR::template NodeMap<OutArcIt> nedge;
    161     typename GR::template EdgeMap<bool> visited;
     151    typedef typename Digraph::Node Node;
     152    typedef typename Digraph::NodeIt NodeIt;
     153    typedef typename Digraph::Arc Arc;
     154    typedef typename Digraph::Edge Edge;
     155    typedef typename Digraph::ArcIt ArcIt;
     156    typedef typename Digraph::OutArcIt OutArcIt;
     157    typedef typename Digraph::InArcIt InArcIt;
     158
     159    const Digraph &g;
     160    typename Digraph::template NodeMap<OutArcIt> nedge;
     161    typename Digraph::template EdgeMap<bool> visited;
    162162    std::list<Arc> euler;
    163163
     
    166166    ///Constructor
    167167
    168     ///\param gr An graph.
     168    ///\param _g An graph.
    169169    ///\param start The starting point of the tour. If it is not given
    170170    ///       the tour will start from the first node.
    171     EulerIt(const GR &gr, typename GR::Node start = INVALID)
    172       : g(gr), nedge(g), visited(g, false)
     171    EulerIt(const Digraph &_g,typename Digraph::Node start=INVALID)
     172      : g(_g), nedge(g), visited(g,false)
    173173    {
    174174      if(start==INVALID) start=NodeIt(g);
     
    239239  ///for each node. <em>Therefore, there are digraphs which are not Eulerian,
    240240  ///but still have an Euler tour</em>.
    241   template<typename GR>
     241  template<class Digraph>
    242242#ifdef DOXYGEN
    243243  bool
    244244#else
    245   typename enable_if<UndirectedTagIndicator<GR>,bool>::type
    246   eulerian(const GR &g)
    247   {
    248     for(typename GR::NodeIt n(g);n!=INVALID;++n)
     245  typename enable_if<UndirectedTagIndicator<Digraph>,bool>::type
     246  eulerian(const Digraph &g)
     247  {
     248    for(typename Digraph::NodeIt n(g);n!=INVALID;++n)
    249249      if(countIncEdges(g,n)%2) return false;
    250250    return connected(g);
    251251  }
    252   template<class GR>
    253   typename disable_if<UndirectedTagIndicator<GR>,bool>::type
     252  template<class Digraph>
     253  typename disable_if<UndirectedTagIndicator<Digraph>,bool>::type
    254254#endif
    255   eulerian(const GR &g)
    256   {
    257     for(typename GR::NodeIt n(g);n!=INVALID;++n)
     255  eulerian(const Digraph &g)
     256  {
     257    for(typename Digraph::NodeIt n(g);n!=INVALID;++n)
    258258      if(countInArcs(g,n)!=countOutArcs(g,n)) return false;
    259     return connected(Undirector<const GR>(g));
     259    return connected(Undirector<const Digraph>(g));
    260260  }
    261261
  • lemon/graph_to_eps.h

    r606 r562  
    6565///Default traits class of \ref GraphToEps.
    6666///
    67 ///\param GR is the type of the underlying graph.
    68 template<class GR>
     67///\c G is the type of the underlying graph.
     68template<class G>
    6969struct DefaultGraphToEpsTraits
    7070{
    71   typedef GR Graph;
     71  typedef G Graph;
    7272  typedef typename Graph::Node Node;
    7373  typedef typename Graph::NodeIt NodeIt;
     
    140140
    141141  ///Constructor
    142   ///\param gr  Reference to the graph to be printed.
    143   ///\param ost Reference to the output stream.
     142  ///\param _g  Reference to the graph to be printed.
     143  ///\param _os Reference to the output stream.
     144  ///\param _os Reference to the output stream.
    144145  ///By default it is <tt>std::cout</tt>.
    145   ///\param pros If it is \c true, then the \c ostream referenced by \c os
     146  ///\param _pros If it is \c true, then the \c ostream referenced by \c _os
    146147  ///will be explicitly deallocated by the destructor.
    147   DefaultGraphToEpsTraits(const GR &gr, std::ostream& ost = std::cout,
    148                           bool pros = false) :
    149     g(gr), os(ost),
     148  DefaultGraphToEpsTraits(const G &_g,std::ostream& _os=std::cout,
     149                          bool _pros=false) :
     150    g(_g), os(_os),
    150151    _coords(dim2::Point<double>(1,1)), _nodeSizes(1), _nodeShapes(0),
    151152    _nodeColors(WHITE), _arcColors(BLACK),
     
    158159    _showNodeText(false), _nodeTexts(false), _nodeTextSize(1),
    159160    _showNodePsText(false), _nodePsTexts(false), _nodePsTextsPreamble(0),
    160     _undirected(lemon::UndirectedTagIndicator<GR>::value),
    161     _pleaseRemoveOsStream(pros), _scaleToA4(false),
     161    _undirected(lemon::UndirectedTagIndicator<G>::value),
     162    _pleaseRemoveOsStream(_pros), _scaleToA4(false),
    162163    _nodeTextColorType(SAME_COL), _nodeTextColors(BLACK),
    163164    _autoNodeScale(false),
     
    11341135///to the end of the parameter list.
    11351136///\sa GraphToEps
    1136 ///\sa graphToEps(GR &g, const char *file_name)
    1137 template<class GR>
    1138 GraphToEps<DefaultGraphToEpsTraits<GR> >
    1139 graphToEps(GR &g, std::ostream& os=std::cout)
     1137///\sa graphToEps(G &g, const char *file_name)
     1138template<class G>
     1139GraphToEps<DefaultGraphToEpsTraits<G> >
     1140graphToEps(G &g, std::ostream& os=std::cout)
    11401141{
    11411142  return
    1142     GraphToEps<DefaultGraphToEpsTraits<GR> >(DefaultGraphToEpsTraits<GR>(g,os));
     1143    GraphToEps<DefaultGraphToEpsTraits<G> >(DefaultGraphToEpsTraits<G>(g,os));
    11431144}
    11441145
     
    11471148///\ingroup eps_io
    11481149///This function does the same as
    1149 ///\ref graphToEps(GR &g,std::ostream& os)
     1150///\ref graphToEps(G &g,std::ostream& os)
    11501151///but it writes its output into the file \c file_name
    11511152///instead of a stream.
    1152 ///\sa graphToEps(GR &g, std::ostream& os)
    1153 template<class GR>
    1154 GraphToEps<DefaultGraphToEpsTraits<GR> >
    1155 graphToEps(GR &g,const char *file_name)
     1153///\sa graphToEps(G &g, std::ostream& os)
     1154template<class G>
     1155GraphToEps<DefaultGraphToEpsTraits<G> >
     1156graphToEps(G &g,const char *file_name)
    11561157{
    11571158  std::ostream* os = new std::ofstream(file_name);
     
    11601161    throw IoError("Cannot write file", file_name);
    11611162  }
    1162   return GraphToEps<DefaultGraphToEpsTraits<GR> >
    1163     (DefaultGraphToEpsTraits<GR>(g,*os,true));
     1163  return GraphToEps<DefaultGraphToEpsTraits<G> >
     1164    (DefaultGraphToEpsTraits<G>(g,*os,true));
    11641165}
    11651166
     
    11681169///\ingroup eps_io
    11691170///This function does the same as
    1170 ///\ref graphToEps(GR &g,std::ostream& os)
     1171///\ref graphToEps(G &g,std::ostream& os)
    11711172///but it writes its output into the file \c file_name
    11721173///instead of a stream.
    1173 ///\sa graphToEps(GR &g, std::ostream& os)
    1174 template<class GR>
    1175 GraphToEps<DefaultGraphToEpsTraits<GR> >
    1176 graphToEps(GR &g,const std::string& file_name)
     1174///\sa graphToEps(G &g, std::ostream& os)
     1175template<class G>
     1176GraphToEps<DefaultGraphToEpsTraits<G> >
     1177graphToEps(G &g,const std::string& file_name)
    11771178{
    11781179  std::ostream* os = new std::ofstream(file_name.c_str());
     
    11811182    throw IoError("Cannot write file", file_name);
    11821183  }
    1183   return GraphToEps<DefaultGraphToEpsTraits<GR> >
    1184     (DefaultGraphToEpsTraits<GR>(g,*os,true));
     1184  return GraphToEps<DefaultGraphToEpsTraits<G> >
     1185    (DefaultGraphToEpsTraits<G>(g,*os,true));
    11851186}
    11861187
  • lemon/grid_graph.h

    r606 r463  
    497497  ///\endcode
    498498  ///
    499   /// This graph type fully conforms to the \ref concepts::Graph
     499  /// This graph type is fully conform to the \ref concepts::Graph
    500500  /// "Graph" concept, and it also has an important extra feature
    501501  /// that its maps are real \ref concepts::ReferenceMap
  • lemon/hao_orlin.h

    r606 r463  
    5858  /// algorithm or you can use the algorithm of Nagamochi and Ibaraki
    5959  /// which solves the undirected problem in
    60   /// \f$ O(nm + n^2 \log n) \f$ time: it is implemented in the
     60  /// \f$ O(nm + n^2 \log(n)) \f$ time: it is implemented in the
    6161  /// NagamochiIbaraki algorithm class.
    6262  ///
    63   /// \param GR The digraph class the algorithm runs on.
    64   /// \param CAP An arc map of capacities which can be any numreric type.
    65   /// The default type is \ref concepts::Digraph::ArcMap "GR::ArcMap<int>".
    66   /// \param TOL Tolerance class for handling inexact computations. The
    67   /// default tolerance type is \ref Tolerance "Tolerance<CAP::Value>".
     63  /// \param _Digraph is the graph type of the algorithm.
     64  /// \param _CapacityMap is an edge map of capacities which should
     65  /// be any numreric type. The default type is _Digraph::ArcMap<int>.
     66  /// \param _Tolerance is the handler of the inexact computation. The
     67  /// default type for this is Tolerance<CapacityMap::Value>.
    6868#ifdef DOXYGEN
    69   template <typename GR, typename CAP, typename TOL>
     69  template <typename _Digraph, typename _CapacityMap, typename _Tolerance>
    7070#else
    71   template <typename GR,
    72             typename CAP = typename GR::template ArcMap<int>,
    73             typename TOL = Tolerance<typename CAP::Value> >
     71  template <typename _Digraph,
     72            typename _CapacityMap = typename _Digraph::template ArcMap<int>,
     73            typename _Tolerance = Tolerance<typename _CapacityMap::Value> >
    7474#endif
    7575  class HaoOrlin {
    7676  private:
    7777
    78     typedef GR Digraph;
    79     typedef CAP CapacityMap;
    80     typedef TOL Tolerance;
     78    typedef _Digraph Digraph;
     79    typedef _CapacityMap CapacityMap;
     80    typedef _Tolerance Tolerance;
    8181
    8282    typedef typename CapacityMap::Value Value;
     
    818818    /// \name Execution control
    819819    /// The simplest way to execute the algorithm is to use
    820     /// one of the member functions called \ref run().
     820    /// one of the member functions called \c run(...).
    821821    /// \n
    822822    /// If you need more control on the execution,
  • lemon/hypercube_graph.h

    r606 r463  
    292292  /// (assuming that the size of \c int is 32 bit).
    293293  ///
    294   /// This graph type fully conforms to the \ref concepts::Graph
     294  /// This graph type is fully conform to the \ref concepts::Graph
    295295  /// "Graph" concept, and it also has an important extra feature
    296296  /// that its maps are real \ref concepts::ReferenceMap
  • lemon/lgf_reader.h

    r606 r564  
    449449  /// a single pass, because the arcs are not constructed when the node
    450450  /// maps are read.
    451   template <typename GR>
     451  template <typename _Digraph>
    452452  class DigraphReader {
    453453  public:
    454454
    455     typedef GR Digraph;
     455    typedef _Digraph Digraph;
     456    TEMPLATE_DIGRAPH_TYPEDEFS(Digraph);
    456457
    457458  private:
    458459
    459     TEMPLATE_DIGRAPH_TYPEDEFS(Digraph);
    460460
    461461    std::istream* _is;
     
    12471247  /// arc map.  Similarly, an attribute can be read into an arc, if
    12481248  /// it's value is an edge label prefixed with \c '+' or \c '-'.
    1249   template <typename GR>
     1249  template <typename _Graph>
    12501250  class GraphReader {
    12511251  public:
    12521252
    1253     typedef GR Graph;
     1253    typedef _Graph Graph;
     1254    TEMPLATE_GRAPH_TYPEDEFS(Graph);
    12541255
    12551256  private:
    1256 
    1257     TEMPLATE_GRAPH_TYPEDEFS(Graph);
    12581257
    12591258    std::istream* _is;
     
    13581357
    13591358  private:
    1360     template <typename Graph>
    1361     friend GraphReader<Graph> graphReader(Graph& graph, std::istream& is);
    1362     template <typename Graph>
    1363     friend GraphReader<Graph> graphReader(Graph& graph, const std::string& fn);
    1364     template <typename Graph>
    1365     friend GraphReader<Graph> graphReader(Graph& graph, const char *fn);
     1359    template <typename GR>
     1360    friend GraphReader<GR> graphReader(GR& graph, std::istream& is);
     1361    template <typename GR>
     1362    friend GraphReader<GR> graphReader(GR& graph, const std::string& fn);
     1363    template <typename GR>
     1364    friend GraphReader<GR> graphReader(GR& graph, const char *fn);
    13661365
    13671366    GraphReader(GraphReader& other)
  • lemon/lgf_writer.h

    r606 r564  
    407407  /// the \c ostream() function, hence the second pass can append its
    408408  /// output to the output of the first pass.
    409   template <typename GR>
     409  template <typename _Digraph>
    410410  class DigraphWriter {
    411411  public:
    412412
    413     typedef GR Digraph;
     413    typedef _Digraph Digraph;
    414414    TEMPLATE_DIGRAPH_TYPEDEFS(Digraph);
    415415
     
    975975  /// section as a \c '+' or a \c '-' prefix (depends on the direction
    976976  /// of the arc) and the label of corresponding edge.
    977   template <typename GR>
     977  template <typename _Graph>
    978978  class GraphWriter {
    979979  public:
    980980
    981     typedef GR Graph;
     981    typedef _Graph Graph;
    982982    TEMPLATE_GRAPH_TYPEDEFS(Graph);
    983983
     
    10741074  private:
    10751075
    1076     template <typename Graph>
    1077     friend GraphWriter<Graph> graphWriter(const Graph& graph,
    1078                                           std::ostream& os);
    1079     template <typename Graph>
    1080     friend GraphWriter<Graph> graphWriter(const Graph& graph,
    1081                                           const std::string& fn);
    1082     template <typename Graph>
    1083     friend GraphWriter<Graph> graphWriter(const Graph& graph,
    1084                                           const char *fn);
     1076    template <typename GR>
     1077    friend GraphWriter<GR> graphWriter(const GR& graph,
     1078                                       std::ostream& os);
     1079    template <typename GR>
     1080    friend GraphWriter<GR> graphWriter(const GR& graph,
     1081                                       const std::string& fn);
     1082    template <typename GR>
     1083    friend GraphWriter<GR> graphWriter(const GR& graph,
     1084                                       const char *fn);
    10851085   
    10861086    GraphWriter(GraphWriter& other)
  • lemon/list_graph.h

    r606 r463  
    352352
    353353    ///Add a new node to the digraph.
    354     ///\return The new node.
     354    ///\return the new node.
    355355    Node addNode() { return Parent::addNode(); }
    356356
     
    359359    ///Add a new arc to the digraph with source node \c s
    360360    ///and target node \c t.
    361     ///\return The new arc.
     361    ///\return the new arc.
    362362    Arc addArc(const Node& s, const Node& t) {
    363363      return Parent::addArc(s, t);
     
    12091209    ///
    12101210    /// Add a new node to the graph.
    1211     /// \return The new node.
     1211    /// \return the new node.
    12121212    Node addNode() { return Parent::addNode(); }
    12131213
     
    12161216    /// Add a new edge to the graph with source node \c s
    12171217    /// and target node \c t.
    1218     /// \return The new edge.
     1218    /// \return the new edge.
    12191219    Edge addEdge(const Node& s, const Node& t) {
    12201220      return Parent::addEdge(s, t);
  • lemon/maps.h

    r606 r463  
    6464  class NullMap : public MapBase<K, V> {
    6565  public:
    66     ///\e
    67     typedef K Key;
    68     ///\e
    69     typedef V Value;
     66    typedef MapBase<K, V> Parent;
     67    typedef typename Parent::Key Key;
     68    typedef typename Parent::Value Value;
    7069
    7170    /// Gives back a default constructed element.
     
    104103    V _value;
    105104  public:
    106     ///\e
    107     typedef K Key;
    108     ///\e
    109     typedef V Value;
     105    typedef MapBase<K, V> Parent;
     106    typedef typename Parent::Key Key;
     107    typedef typename Parent::Value Value;
    110108
    111109    /// Default constructor
     
    171169  class ConstMap<K, Const<V, v> > : public MapBase<K, V> {
    172170  public:
    173     ///\e
    174     typedef K Key;
    175     ///\e
    176     typedef V Value;
     171    typedef MapBase<K, V> Parent;
     172    typedef typename Parent::Key Key;
     173    typedef typename Parent::Value Value;
    177174
    178175    /// Constructor.
     
    206203  class IdentityMap : public MapBase<T, T> {
    207204  public:
    208     ///\e
    209     typedef T Key;
    210     ///\e
    211     typedef T Value;
     205    typedef MapBase<T, T> Parent;
     206    typedef typename Parent::Key Key;
     207    typedef typename Parent::Value Value;
    212208
    213209    /// Gives back the given value without any modification.
     
    250246  public:
    251247
     248    typedef MapBase<int, V> Parent;
    252249    /// Key type
    253     typedef int Key;
     250    typedef typename Parent::Key Key;
    254251    /// Value type
    255     typedef V Value;
     252    typedef typename Parent::Value Value;
    256253    /// Reference type
    257254    typedef typename Vector::reference Reference;
     
    357354  /// The simplest way of using this map is through the sparseMap()
    358355  /// function.
    359   template <typename K, typename V, typename Comp = std::less<K> >
     356  template <typename K, typename V, typename Compare = std::less<K> >
    360357  class SparseMap : public MapBase<K, V> {
    361358    template <typename K1, typename V1, typename C1>
     
    363360  public:
    364361
     362    typedef MapBase<K, V> Parent;
    365363    /// Key type
    366     typedef K Key;
     364    typedef typename Parent::Key Key;
    367365    /// Value type
    368     typedef V Value;
     366    typedef typename Parent::Value Value;
    369367    /// Reference type
    370368    typedef Value& Reference;
     
    376374  private:
    377375
    378     typedef std::map<K, V, Comp> Map;
     376    typedef std::map<K, V, Compare> Map;
    379377    Map _map;
    380378    Value _value;
     
    492490    const M2 &_m2;
    493491  public:
    494     ///\e
    495     typedef typename M2::Key Key;
    496     ///\e
    497     typedef typename M1::Value Value;
     492    typedef MapBase<typename M2::Key, typename M1::Value> Parent;
     493    typedef typename Parent::Key Key;
     494    typedef typename Parent::Value Value;
    498495
    499496    /// Constructor
    500497    ComposeMap(const M1 &m1, const M2 &m2) : _m1(m1), _m2(m2) {}
    501498
    502     ///\e
     499    /// \e
    503500    typename MapTraits<M1>::ConstReturnValue
    504501    operator[](const Key &k) const { return _m1[_m2[k]]; }
     
    549546    F _f;
    550547  public:
    551     ///\e
    552     typedef typename M1::Key Key;
    553     ///\e
    554     typedef V Value;
     548    typedef MapBase<typename M1::Key, V> Parent;
     549    typedef typename Parent::Key Key;
     550    typedef typename Parent::Value Value;
    555551
    556552    /// Constructor
    557553    CombineMap(const M1 &m1, const M2 &m2, const F &f = F())
    558554      : _m1(m1), _m2(m2), _f(f) {}
    559     ///\e
     555    /// \e
    560556    Value operator[](const Key &k) const { return _f(_m1[k],_m2[k]); }
    561557  };
     
    620616    F _f;
    621617  public:
    622     ///\e
    623     typedef K Key;
    624     ///\e
    625     typedef V Value;
     618    typedef MapBase<K, V> Parent;
     619    typedef typename Parent::Key Key;
     620    typedef typename Parent::Value Value;
    626621
    627622    /// Constructor
    628623    FunctorToMap(const F &f = F()) : _f(f) {}
    629     ///\e
     624    /// \e
    630625    Value operator[](const Key &k) const { return _f(k); }
    631626  };
     
    675670    const M &_m;
    676671  public:
    677     ///\e
    678     typedef typename M::Key Key;
    679     ///\e
    680     typedef typename M::Value Value;
    681 
    682     typedef typename M::Key argument_type;
    683     typedef typename M::Value result_type;
     672    typedef MapBase<typename M::Key, typename M::Value> Parent;
     673    typedef typename Parent::Key Key;
     674    typedef typename Parent::Value Value;
     675
     676    typedef typename Parent::Key argument_type;
     677    typedef typename Parent::Value result_type;
    684678
    685679    /// Constructor
    686680    MapToFunctor(const M &m) : _m(m) {}
    687     ///\e
     681    /// \e
    688682    Value operator()(const Key &k) const { return _m[k]; }
    689     ///\e
     683    /// \e
    690684    Value operator[](const Key &k) const { return _m[k]; }
    691685  };
     
    716710    const M &_m;
    717711  public:
    718     ///\e
    719     typedef typename M::Key Key;
    720     ///\e
    721     typedef V Value;
     712    typedef MapBase<typename M::Key, V> Parent;
     713    typedef typename Parent::Key Key;
     714    typedef typename Parent::Value Value;
    722715
    723716    /// Constructor
     
    727720    ConvertMap(const M &m) : _m(m) {}
    728721
    729     ///\e
     722    /// \e
    730723    Value operator[](const Key &k) const { return _m[k]; }
    731724  };
     
    759752    M2 &_m2;
    760753  public:
    761     ///\e
    762     typedef typename M1::Key Key;
    763     ///\e
    764     typedef typename M1::Value Value;
     754    typedef MapBase<typename M1::Key, typename M1::Value> Parent;
     755    typedef typename Parent::Key Key;
     756    typedef typename Parent::Value Value;
    765757
    766758    /// Constructor
     
    806798    const M2 &_m2;
    807799  public:
    808     ///\e
    809     typedef typename M1::Key Key;
    810     ///\e
    811     typedef typename M1::Value Value;
     800    typedef MapBase<typename M1::Key, typename M1::Value> Parent;
     801    typedef typename Parent::Key Key;
     802    typedef typename Parent::Value Value;
    812803
    813804    /// Constructor
    814805    AddMap(const M1 &m1, const M2 &m2) : _m1(m1), _m2(m2) {}
    815     ///\e
     806    /// \e
    816807    Value operator[](const Key &k) const { return _m1[k]+_m2[k]; }
    817808  };
     
    855846    const M2 &_m2;
    856847  public:
    857     ///\e
    858     typedef typename M1::Key Key;
    859     ///\e
    860     typedef typename M1::Value Value;
     848    typedef MapBase<typename M1::Key, typename M1::Value> Parent;
     849    typedef typename Parent::Key Key;
     850    typedef typename Parent::Value Value;
    861851
    862852    /// Constructor
    863853    SubMap(const M1 &m1, const M2 &m2) : _m1(m1), _m2(m2) {}
    864     ///\e
     854    /// \e
    865855    Value operator[](const Key &k) const { return _m1[k]-_m2[k]; }
    866856  };
     
    905895    const M2 &_m2;
    906896  public:
    907     ///\e
    908     typedef typename M1::Key Key;
    909     ///\e
    910     typedef typename M1::Value Value;
     897    typedef MapBase<typename M1::Key, typename M1::Value> Parent;
     898    typedef typename Parent::Key Key;
     899    typedef typename Parent::Value Value;
    911900
    912901    /// Constructor
    913902    MulMap(const M1 &m1,const M2 &m2) : _m1(m1), _m2(m2) {}
    914     ///\e
     903    /// \e
    915904    Value operator[](const Key &k) const { return _m1[k]*_m2[k]; }
    916905  };
     
    954943    const M2 &_m2;
    955944  public:
    956     ///\e
    957     typedef typename M1::Key Key;
    958     ///\e
    959     typedef typename M1::Value Value;
     945    typedef MapBase<typename M1::Key, typename M1::Value> Parent;
     946    typedef typename Parent::Key Key;
     947    typedef typename Parent::Value Value;
    960948
    961949    /// Constructor
    962950    DivMap(const M1 &m1,const M2 &m2) : _m1(m1), _m2(m2) {}
    963     ///\e
     951    /// \e
    964952    Value operator[](const Key &k) const { return _m1[k]/_m2[k]; }
    965953  };
     
    1005993    C _v;
    1006994  public:
    1007     ///\e
    1008     typedef typename M::Key Key;
    1009     ///\e
    1010     typedef typename M::Value Value;
     995    typedef MapBase<typename M::Key, typename M::Value> Parent;
     996    typedef typename Parent::Key Key;
     997    typedef typename Parent::Value Value;
    1011998
    1012999    /// Constructor
     
    10161003    /// \param v The constant value.
    10171004    ShiftMap(const M &m, const C &v) : _m(m), _v(v) {}
    1018     ///\e
     1005    /// \e
    10191006    Value operator[](const Key &k) const { return _m[k]+_v; }
    10201007  };
     
    10361023    C _v;
    10371024  public:
    1038     ///\e
    1039     typedef typename M::Key Key;
    1040     ///\e
    1041     typedef typename M::Value Value;
     1025    typedef MapBase<typename M::Key, typename M::Value> Parent;
     1026    typedef typename Parent::Key Key;
     1027    typedef typename Parent::Value Value;
    10421028
    10431029    /// Constructor
     
    10471033    /// \param v The constant value.
    10481034    ShiftWriteMap(M &m, const C &v) : _m(m), _v(v) {}
    1049     ///\e
     1035    /// \e
    10501036    Value operator[](const Key &k) const { return _m[k]+_v; }
    1051     ///\e
     1037    /// \e
    10521038    void set(const Key &k, const Value &v) { _m.set(k, v-_v); }
    10531039  };
     
    11081094    C _v;
    11091095  public:
    1110     ///\e
    1111     typedef typename M::Key Key;
    1112     ///\e
    1113     typedef typename M::Value Value;
     1096    typedef MapBase<typename M::Key, typename M::Value> Parent;
     1097    typedef typename Parent::Key Key;
     1098    typedef typename Parent::Value Value;
    11141099
    11151100    /// Constructor
     
    11191104    /// \param v The constant value.
    11201105    ScaleMap(const M &m, const C &v) : _m(m), _v(v) {}
    1121     ///\e
     1106    /// \e
    11221107    Value operator[](const Key &k) const { return _v*_m[k]; }
    11231108  };
     
    11401125    C _v;
    11411126  public:
    1142     ///\e
    1143     typedef typename M::Key Key;
    1144     ///\e
    1145     typedef typename M::Value Value;
     1127    typedef MapBase<typename M::Key, typename M::Value> Parent;
     1128    typedef typename Parent::Key Key;
     1129    typedef typename Parent::Value Value;
    11461130
    11471131    /// Constructor
     
    11511135    /// \param v The constant value.
    11521136    ScaleWriteMap(M &m, const C &v) : _m(m), _v(v) {}
    1153     ///\e
     1137    /// \e
    11541138    Value operator[](const Key &k) const { return _v*_m[k]; }
    1155     ///\e
     1139    /// \e
    11561140    void set(const Key &k, const Value &v) { _m.set(k, v/_v); }
    11571141  };
     
    12101194    const M& _m;
    12111195  public:
    1212     ///\e
    1213     typedef typename M::Key Key;
    1214     ///\e
    1215     typedef typename M::Value Value;
     1196    typedef MapBase<typename M::Key, typename M::Value> Parent;
     1197    typedef typename Parent::Key Key;
     1198    typedef typename Parent::Value Value;
    12161199
    12171200    /// Constructor
    12181201    NegMap(const M &m) : _m(m) {}
    1219     ///\e
     1202    /// \e
    12201203    Value operator[](const Key &k) const { return -_m[k]; }
    12211204  };
     
    12461229    M &_m;
    12471230  public:
    1248     ///\e
    1249     typedef typename M::Key Key;
    1250     ///\e
    1251     typedef typename M::Value Value;
     1231    typedef MapBase<typename M::Key, typename M::Value> Parent;
     1232    typedef typename Parent::Key Key;
     1233    typedef typename Parent::Value Value;
    12521234
    12531235    /// Constructor
    12541236    NegWriteMap(M &m) : _m(m) {}
    1255     ///\e
     1237    /// \e
    12561238    Value operator[](const Key &k) const { return -_m[k]; }
    1257     ///\e
     1239    /// \e
    12581240    void set(const Key &k, const Value &v) { _m.set(k, -v); }
    12591241  };
     
    13011283    const M &_m;
    13021284  public:
    1303     ///\e
    1304     typedef typename M::Key Key;
    1305     ///\e
    1306     typedef typename M::Value Value;
     1285    typedef MapBase<typename M::Key, typename M::Value> Parent;
     1286    typedef typename Parent::Key Key;
     1287    typedef typename Parent::Value Value;
    13071288
    13081289    /// Constructor
    13091290    AbsMap(const M &m) : _m(m) {}
    1310     ///\e
     1291    /// \e
    13111292    Value operator[](const Key &k) const {
    13121293      Value tmp = _m[k];
     
    13571338  class TrueMap : public MapBase<K, bool> {
    13581339  public:
    1359     ///\e
    1360     typedef K Key;
    1361     ///\e
    1362     typedef bool Value;
     1340    typedef MapBase<K, bool> Parent;
     1341    typedef typename Parent::Key Key;
     1342    typedef typename Parent::Value Value;
    13631343
    13641344    /// Gives back \c true.
     
    13951375  class FalseMap : public MapBase<K, bool> {
    13961376  public:
    1397     ///\e
    1398     typedef K Key;
    1399     ///\e
    1400     typedef bool Value;
     1377    typedef MapBase<K, bool> Parent;
     1378    typedef typename Parent::Key Key;
     1379    typedef typename Parent::Value Value;
    14011380
    14021381    /// Gives back \c false.
     
    14411420    const M2 &_m2;
    14421421  public:
    1443     ///\e
    1444     typedef typename M1::Key Key;
    1445     ///\e
    1446     typedef bool Value;
     1422    typedef MapBase<typename M1::Key, bool> Parent;
     1423    typedef typename Parent::Key Key;
     1424    typedef typename Parent::Value Value;
    14471425
    14481426    /// Constructor
    14491427    AndMap(const M1 &m1, const M2 &m2) : _m1(m1), _m2(m2) {}
    1450     ///\e
     1428    /// \e
    14511429    Value operator[](const Key &k) const { return _m1[k]&&_m2[k]; }
    14521430  };
     
    14901468    const M2 &_m2;
    14911469  public:
    1492     ///\e
    1493     typedef typename M1::Key Key;
    1494     ///\e
    1495     typedef bool Value;
     1470    typedef MapBase<typename M1::Key, bool> Parent;
     1471    typedef typename Parent::Key Key;
     1472    typedef typename Parent::Value Value;
    14961473
    14971474    /// Constructor
    14981475    OrMap(const M1 &m1, const M2 &m2) : _m1(m1), _m2(m2) {}
    1499     ///\e
     1476    /// \e
    15001477    Value operator[](const Key &k) const { return _m1[k]||_m2[k]; }
    15011478  };
     
    15301507    const M &_m;
    15311508  public:
    1532     ///\e
    1533     typedef typename M::Key Key;
    1534     ///\e
    1535     typedef bool Value;
     1509    typedef MapBase<typename M::Key, bool> Parent;
     1510    typedef typename Parent::Key Key;
     1511    typedef typename Parent::Value Value;
    15361512
    15371513    /// Constructor
    15381514    NotMap(const M &m) : _m(m) {}
    1539     ///\e
     1515    /// \e
    15401516    Value operator[](const Key &k) const { return !_m[k]; }
    15411517  };
     
    15571533    M &_m;
    15581534  public:
    1559     ///\e
    1560     typedef typename M::Key Key;
    1561     ///\e
    1562     typedef bool Value;
     1535    typedef MapBase<typename M::Key, bool> Parent;
     1536    typedef typename Parent::Key Key;
     1537    typedef typename Parent::Value Value;
    15631538
    15641539    /// Constructor
    15651540    NotWriteMap(M &m) : _m(m) {}
    1566     ///\e
     1541    /// \e
    15671542    Value operator[](const Key &k) const { return !_m[k]; }
    1568     ///\e
     1543    /// \e
    15691544    void set(const Key &k, bool v) { _m.set(k, !v); }
    15701545  };
     
    16211596    const M2 &_m2;
    16221597  public:
    1623     ///\e
    1624     typedef typename M1::Key Key;
    1625     ///\e
    1626     typedef bool Value;
     1598    typedef MapBase<typename M1::Key, bool> Parent;
     1599    typedef typename Parent::Key Key;
     1600    typedef typename Parent::Value Value;
    16271601
    16281602    /// Constructor
    16291603    EqualMap(const M1 &m1, const M2 &m2) : _m1(m1), _m2(m2) {}
    1630     ///\e
     1604    /// \e
    16311605    Value operator[](const Key &k) const { return _m1[k]==_m2[k]; }
    16321606  };
     
    16701644    const M2 &_m2;
    16711645  public:
    1672     ///\e
    1673     typedef typename M1::Key Key;
    1674     ///\e
    1675     typedef bool Value;
     1646    typedef MapBase<typename M1::Key, bool> Parent;
     1647    typedef typename Parent::Key Key;
     1648    typedef typename Parent::Value Value;
    16761649
    16771650    /// Constructor
    16781651    LessMap(const M1 &m1, const M2 &m2) : _m1(m1), _m2(m2) {}
    1679     ///\e
     1652    /// \e
    16801653    Value operator[](const Key &k) const { return _m1[k]<_m2[k]; }
    16811654  };
     
    17331706  /// function.
    17341707  ///
    1735   /// \tparam IT The type of the iterator.
    1736   /// \tparam KEY The key type of the map. The default value set
     1708  /// \tparam It The type of the iterator.
     1709  /// \tparam Ke The key type of the map. The default value set
    17371710  /// according to the iterator type should work in most cases.
    17381711  ///
     
    17401713  /// for the elements or the iterator should be an inserter iterator.
    17411714#ifdef DOXYGEN
    1742   template <typename IT, typename KEY>
     1715  template <typename It, typename Ke>
    17431716#else
    1744   template <typename IT,
    1745             typename KEY = typename _maps_bits::IteratorTraits<IT>::Value>
     1717  template <typename It,
     1718            typename Ke=typename _maps_bits::IteratorTraits<It>::Value>
    17461719#endif
    1747   class LoggerBoolMap : public MapBase<KEY, bool> {
    1748   public:
    1749 
    1750     ///\e
    1751     typedef KEY Key;
    1752     ///\e
     1720  class LoggerBoolMap {
     1721  public:
     1722    typedef It Iterator;
     1723
     1724    typedef Ke Key;
    17531725    typedef bool Value;
    1754     ///\e
    1755     typedef IT Iterator;
    17561726
    17571727    /// Constructor
     
    18161786  /// @{
    18171787
    1818   /// \brief Provides an immutable and unique id for each item in a graph.
    1819   ///
    1820   /// IdMap provides a unique and immutable id for each item of the
    1821   /// same type (\c Node, \c Arc or \c Edge) in a graph. This id is
    1822   ///  - \b unique: different items get different ids,
    1823   ///  - \b immutable: the id of an item does not change (even if you
    1824   ///    delete other nodes).
    1825   ///
    1826   /// Using this map you get access (i.e. can read) the inner id values of
    1827   /// the items stored in the graph, which is returned by the \c id()
    1828   /// function of the graph. This map can be inverted with its member
     1788  /// Provides an immutable and unique id for each item in the graph.
     1789
     1790  /// The IdMap class provides a unique and immutable id for each item of the
     1791  /// same type (e.g. node) in the graph. This id is <ul><li>\b unique:
     1792  /// different items (nodes) get different ids <li>\b immutable: the id of an
     1793  /// item (node) does not change (even if you delete other nodes).  </ul>
     1794  /// Through this map you get access (i.e. can read) the inner id values of
     1795  /// the items stored in the graph. This map can be inverted with its member
    18291796  /// class \c InverseMap or with the \c operator() member.
    18301797  ///
    1831   /// \tparam GR The graph type.
    1832   /// \tparam K The key type of the map (\c GR::Node, \c GR::Arc or
    1833   /// \c GR::Edge).
    1834   ///
    1835   /// \see DescriptorMap
    1836   template <typename GR, typename K>
    1837   class IdMap : public MapBase<K, int> {
    1838   public:
    1839     /// The graph type of IdMap.
    1840     typedef GR Graph;
    1841     /// The key type of IdMap (\c Node, \c Arc or \c Edge).
    1842     typedef K Item;
    1843     /// The key type of IdMap (\c Node, \c Arc or \c Edge).
    1844     typedef K Key;
    1845     /// The value type of IdMap.
     1798  template <typename _Graph, typename _Item>
     1799  class IdMap {
     1800  public:
     1801    typedef _Graph Graph;
    18461802    typedef int Value;
     1803    typedef _Item Item;
     1804    typedef _Item Key;
    18471805
    18481806    /// \brief Constructor.
     
    18561814    int operator[](const Item& item) const { return _graph->id(item);}
    18571815
    1858     /// \brief Gives back the \e item by its id.
    1859     ///
    1860     /// Gives back the \e item by its id.
     1816    /// \brief Gives back the item by its id.
     1817    ///
     1818    /// Gives back the item by its id.
    18611819    Item operator()(int id) { return _graph->fromId(id, Item()); }
    18621820
     
    18661824  public:
    18671825
    1868     /// \brief This class represents the inverse of its owner (IdMap).
    1869     ///
    1870     /// This class represents the inverse of its owner (IdMap).
     1826    /// \brief The class represents the inverse of its owner (IdMap).
     1827    ///
     1828    /// The class represents the inverse of its owner (IdMap).
    18711829    /// \see inverse()
    18721830    class InverseMap {
     
    18861844      ///
    18871845      /// Gives back the given item from its id.
     1846      ///
    18881847      Item operator[](int id) const { return _graph->fromId(id, Item());}
    18891848
     
    18961855    /// Gives back the inverse of the IdMap.
    18971856    InverseMap inverse() const { return InverseMap(*_graph);}
    1898   };
    1899 
    1900 
    1901   /// \brief General invertable graph map type.
    1902 
    1903   /// This class provides simple invertable graph maps.
    1904   /// It wraps an arbitrary \ref concepts::ReadWriteMap "ReadWriteMap"
     1857
     1858  };
     1859
     1860
     1861  /// \brief General invertable graph-map type.
     1862
     1863  /// This type provides simple invertable graph-maps.
     1864  /// The InvertableMap wraps an arbitrary ReadWriteMap
    19051865  /// and if a key is set to a new value then store it
    19061866  /// in the inverse map.
     
    19091869  /// with stl compatible forward iterator.
    19101870  ///
    1911   /// \tparam GR The graph type.
    1912   /// \tparam K The key type of the map (\c GR::Node, \c GR::Arc or
    1913   /// \c GR::Edge).
    1914   /// \tparam V The value type of the map.
     1871  /// \tparam _Graph The graph type.
     1872  /// \tparam _Item The item type of the graph.
     1873  /// \tparam _Value The value type of the map.
    19151874  ///
    19161875  /// \see IterableValueMap
    1917   template <typename GR, typename K, typename V>
     1876  template <typename _Graph, typename _Item, typename _Value>
    19181877  class InvertableMap
    1919     : protected ItemSetTraits<GR, K>::template Map<V>::Type {
     1878    : protected ItemSetTraits<_Graph, _Item>::template Map<_Value>::Type {
    19201879  private:
    19211880
    1922     typedef typename ItemSetTraits<GR, K>::
    1923       template Map<V>::Type Map;
    1924 
    1925     typedef std::map<V, K> Container;
     1881    typedef typename ItemSetTraits<_Graph, _Item>::
     1882    template Map<_Value>::Type Map;
     1883    typedef _Graph Graph;
     1884
     1885    typedef std::map<_Value, _Item> Container;
    19261886    Container _inv_map;
    19271887
    19281888  public:
    19291889
    1930     /// The graph type of InvertableMap.
    1931     typedef GR Graph;
    1932     /// The key type of InvertableMap (\c Node, \c Arc or \c Edge).
    1933     typedef K Item;
    1934     /// The key type of InvertableMap (\c Node, \c Arc or \c Edge).
    1935     typedef K Key;
    1936     /// The value type of InvertableMap.
    1937     typedef V Value;
     1890    /// The key type of InvertableMap (Node, Arc, Edge).
     1891    typedef typename Map::Key Key;
     1892    /// The value type of the InvertableMap.
     1893    typedef typename Map::Value Value;
    19381894
    19391895    /// \brief Constructor.
    19401896    ///
    1941     /// Construct a new InvertableMap for the given graph.
     1897    /// Construct a new InvertableMap for the graph.
     1898    ///
    19421899    explicit InvertableMap(const Graph& graph) : Map(graph) {}
    19431900
     
    19461903    /// This iterator is an stl compatible forward
    19471904    /// iterator on the values of the map. The values can
    1948     /// be accessed in the <tt>[beginValue, endValue)</tt> range.
     1905    /// be accessed in the [beginValue, endValue) range.
     1906    ///
    19491907    class ValueIterator
    19501908      : public std::iterator<std::forward_iterator_tag, Value> {
     
    19781936    /// Returns an stl compatible iterator to the
    19791937    /// first value of the map. The values of the
    1980     /// map can be accessed in the <tt>[beginValue, endValue)</tt>
     1938    /// map can be accessed in the [beginValue, endValue)
    19811939    /// range.
    19821940    ValueIterator beginValue() const {
     
    19881946    /// Returns an stl compatible iterator after the
    19891947    /// last value of the map. The values of the
    1990     /// map can be accessed in the <tt>[beginValue, endValue)</tt>
     1948    /// map can be accessed in the [beginValue, endValue)
    19911949    /// range.
    19921950    ValueIterator endValue() const {
     
    19941952    }
    19951953
    1996     /// \brief Sets the value associated with the given key.
    1997     ///
    1998     /// Sets the value associated with the given key.
     1954    /// \brief The setter function of the map.
     1955    ///
     1956    /// Sets the mapped value.
    19991957    void set(const Key& key, const Value& val) {
    20001958      Value oldval = Map::operator[](key);
     
    20071965    }
    20081966
    2009     /// \brief Returns the value associated with the given key.
    2010     ///
    2011     /// Returns the value associated with the given key.
     1967    /// \brief The getter function of the map.
     1968    ///
     1969    /// It gives back the value associated with the key.
    20121970    typename MapTraits<Map>::ConstReturnValue
    20131971    operator[](const Key& key) const {
     
    20251983  protected:
    20261984
    2027     /// \brief Erase the key from the map and the inverse map.
    2028     ///
    2029     /// Erase the key from the map and the inverse map. It is called by the
     1985    /// \brief Erase the key from the map.
     1986    ///
     1987    /// Erase the key to the map. It is called by the
    20301988    /// \c AlterationNotifier.
    20311989    virtual void erase(const Key& key) {
     
    20381996    }
    20391997
    2040     /// \brief Erase more keys from the map and the inverse map.
    2041     ///
    2042     /// Erase more keys from the map and the inverse map. It is called by the
     1998    /// \brief Erase more keys from the map.
     1999    ///
     2000    /// Erase more keys from the map. It is called by the
    20432001    /// \c AlterationNotifier.
    20442002    virtual void erase(const std::vector<Key>& keys) {
     
    20532011    }
    20542012
    2055     /// \brief Clear the keys from the map and the inverse map.
    2056     ///
    2057     /// Clear the keys from the map and the inverse map. It is called by the
     2013    /// \brief Clear the keys from the map and inverse map.
     2014    ///
     2015    /// Clear the keys from the map and inverse map. It is called by the
    20582016    /// \c AlterationNotifier.
    20592017    virtual void clear() {
     
    20672025    ///
    20682026    /// The inverse of this map. The subscript operator of the map
    2069     /// gives back the item that was last assigned to the value.
     2027    /// gives back always the item what was last assigned to the value.
    20702028    class InverseMap {
    20712029    public:
    2072       /// \brief Constructor
     2030      /// \brief Constructor of the InverseMap.
    20732031      ///
    20742032      /// Constructor of the InverseMap.
     
    20832041      /// \brief Subscript operator.
    20842042      ///
    2085       /// Subscript operator. It gives back the item
    2086       /// that was last assigned to the given value.
     2043      /// Subscript operator. It gives back always the item
     2044      /// what was last assigned to the value.
    20872045      Value operator[](const Key& key) const {
    20882046        return _inverted(key);
     
    20932051    };
    20942052
    2095     /// \brief It gives back the read-only inverse map.
    2096     ///
    2097     /// It gives back the read-only inverse map.
     2053    /// \brief It gives back the just readable inverse map.
     2054    ///
     2055    /// It gives back the just readable inverse map.
    20982056    InverseMap inverse() const {
    20992057      return InverseMap(*this);
     
    21032061
    21042062  /// \brief Provides a mutable, continuous and unique descriptor for each
    2105   /// item in a graph.
    2106   ///
    2107   /// DescriptorMap provides a unique and continuous (but mutable)
    2108   /// descriptor (id) for each item of the same type (\c Node, \c Arc or
    2109   /// \c Edge) in a graph. This id is
    2110   ///  - \b unique: different items get different ids,
    2111   ///  - \b continuous: the range of the ids is the set of integers
    2112   ///    between 0 and \c n-1, where \c n is the number of the items of
    2113   ///    this type (\c Node, \c Arc or \c Edge). So the id of an item can
    2114   ///    change if you delete an other item of the same type, i.e. this
    2115   ///    id is mutable.
    2116   ///
    2117   /// Thus this id is not (necessarily) the same as what can get using
    2118   /// the \c id() function of the graph or \ref IdMap.
    2119   /// This map can be inverted with its member class \c InverseMap,
    2120   /// or with the \c operator() member.
    2121   ///
    2122   /// \tparam GR The graph type.
    2123   /// \tparam K The key type of the map (\c GR::Node, \c GR::Arc or
    2124   /// \c GR::Edge).
    2125   ///
    2126   /// \see IdMap
    2127   template <typename GR, typename K>
     2063  /// item in the graph.
     2064  ///
     2065  /// The DescriptorMap class provides a unique and continuous (but mutable)
     2066  /// descriptor (id) for each item of the same type (e.g. node) in the
     2067  /// graph. This id is <ul><li>\b unique: different items (nodes) get
     2068  /// different ids <li>\b continuous: the range of the ids is the set of
     2069  /// integers between 0 and \c n-1, where \c n is the number of the items of
     2070  /// this type (e.g. nodes) (so the id of a node can change if you delete an
     2071  /// other node, i.e. this id is mutable).  </ul> This map can be inverted
     2072  /// with its member class \c InverseMap, or with the \c operator() member.
     2073  ///
     2074  /// \tparam _Graph The graph class the \c DescriptorMap belongs to.
     2075  /// \tparam _Item The Item is the Key of the Map. It may be Node, Arc or
     2076  /// Edge.
     2077  template <typename _Graph, typename _Item>
    21282078  class DescriptorMap
    2129     : protected ItemSetTraits<GR, K>::template Map<int>::Type {
    2130 
    2131     typedef typename ItemSetTraits<GR, K>::template Map<int>::Type Map;
    2132 
    2133   public:
    2134     /// The graph type of DescriptorMap.
    2135     typedef GR Graph;
    2136     /// The key type of DescriptorMap (\c Node, \c Arc or \c Edge).
    2137     typedef K Item;
    2138     /// The key type of DescriptorMap (\c Node, \c Arc or \c Edge).
    2139     typedef K Key;
     2079    : protected ItemSetTraits<_Graph, _Item>::template Map<int>::Type {
     2080
     2081    typedef _Item Item;
     2082    typedef typename ItemSetTraits<_Graph, _Item>::template Map<int>::Type Map;
     2083
     2084  public:
     2085    /// The graph class of DescriptorMap.
     2086    typedef _Graph Graph;
     2087
     2088    /// The key type of DescriptorMap (Node, Arc, Edge).
     2089    typedef typename Map::Key Key;
    21402090    /// The value type of DescriptorMap.
    2141     typedef int Value;
     2091    typedef typename Map::Value Value;
    21422092
    21432093    /// \brief Constructor.
    21442094    ///
    21452095    /// Constructor for descriptor map.
    2146     explicit DescriptorMap(const Graph& gr) : Map(gr) {
     2096    explicit DescriptorMap(const Graph& _graph) : Map(_graph) {
    21472097      Item it;
    21482098      const typename Map::Notifier* nf = Map::notifier();
     
    21552105  protected:
    21562106
    2157     /// \brief Adds a new key to the map.
     2107    /// \brief Add a new key to the map.
    21582108    ///
    21592109    /// Add a new key to the map. It is called by the
     
    22652215
    22662216  public:
    2267 
    22682217    /// \brief The inverse map type of DescriptorMap.
    22692218    ///
     
    22712220    class InverseMap {
    22722221    public:
    2273       /// \brief Constructor
     2222      /// \brief Constructor of the InverseMap.
    22742223      ///
    22752224      /// Constructor of the InverseMap.
     
    22862235      ///
    22872236      /// Subscript operator. It gives back the item
    2288       /// that the descriptor currently belongs to.
     2237      /// that the descriptor belongs to currently.
    22892238      Value operator[](const Key& key) const {
    22902239        return _inverted(key);
     
    23102259  };
    23112260
    2312   /// \brief Map of the source nodes of arcs in a digraph.
    2313   ///
    2314   /// SourceMap provides access for the source node of each arc in a digraph,
    2315   /// which is returned by the \c source() function of the digraph.
    2316   /// \tparam GR The digraph type.
     2261  /// \brief Returns the source of the given arc.
     2262  ///
     2263  /// The SourceMap gives back the source Node of the given arc.
    23172264  /// \see TargetMap
    2318   template <typename GR>
     2265  template <typename Digraph>
    23192266  class SourceMap {
    23202267  public:
    23212268
    2322     ///\e
    2323     typedef typename GR::Arc Key;
    2324     ///\e
    2325     typedef typename GR::Node Value;
     2269    typedef typename Digraph::Node Value;
     2270    typedef typename Digraph::Arc Key;
    23262271
    23272272    /// \brief Constructor
    23282273    ///
    2329     /// Constructor.
     2274    /// Constructor
    23302275    /// \param digraph The digraph that the map belongs to.
    2331     explicit SourceMap(const GR& digraph) : _graph(digraph) {}
    2332 
    2333     /// \brief Returns the source node of the given arc.
    2334     ///
    2335     /// Returns the source node of the given arc.
     2276    explicit SourceMap(const Digraph& digraph) : _digraph(digraph) {}
     2277
     2278    /// \brief The subscript operator.
     2279    ///
     2280    /// The subscript operator.
     2281    /// \param arc The arc
     2282    /// \return The source of the arc
    23362283    Value operator[](const Key& arc) const {
    2337       return _graph.source(arc);
     2284      return _digraph.source(arc);
    23382285    }
    23392286
    23402287  private:
    2341     const GR& _graph;
     2288    const Digraph& _digraph;
    23422289  };
    23432290
     
    23462293  /// This function just returns an \c SourceMap class.
    23472294  /// \relates SourceMap
    2348   template <typename GR>
    2349   inline SourceMap<GR> sourceMap(const GR& graph) {
    2350     return SourceMap<GR>(graph);
    2351   }
    2352 
    2353   /// \brief Map of the target nodes of arcs in a digraph.
    2354   ///
    2355   /// TargetMap provides access for the target node of each arc in a digraph,
    2356   /// which is returned by the \c target() function of the digraph.
    2357   /// \tparam GR The digraph type.
     2295  template <typename Digraph>
     2296  inline SourceMap<Digraph> sourceMap(const Digraph& digraph) {
     2297    return SourceMap<Digraph>(digraph);
     2298  }
     2299
     2300  /// \brief Returns the target of the given arc.
     2301  ///
     2302  /// The TargetMap gives back the target Node of the given arc.
    23582303  /// \see SourceMap
    2359   template <typename GR>
     2304  template <typename Digraph>
    23602305  class TargetMap {
    23612306  public:
    23622307
    2363     ///\e
    2364     typedef typename GR::Arc Key;
    2365     ///\e
    2366     typedef typename GR::Node Value;
     2308    typedef typename Digraph::Node Value;
     2309    typedef typename Digraph::Arc Key;
    23672310
    23682311    /// \brief Constructor
    23692312    ///
    2370     /// Constructor.
     2313    /// Constructor
    23712314    /// \param digraph The digraph that the map belongs to.
    2372     explicit TargetMap(const GR& digraph) : _graph(digraph) {}
    2373 
    2374     /// \brief Returns the target node of the given arc.
    2375     ///
    2376     /// Returns the target node of the given arc.
     2315    explicit TargetMap(const Digraph& digraph) : _digraph(digraph) {}
     2316
     2317    /// \brief The subscript operator.
     2318    ///
     2319    /// The subscript operator.
     2320    /// \param e The arc
     2321    /// \return The target of the arc
    23772322    Value operator[](const Key& e) const {
    2378       return _graph.target(e);
     2323      return _digraph.target(e);
    23792324    }
    23802325
    23812326  private:
    2382     const GR& _graph;
     2327    const Digraph& _digraph;
    23832328  };
    23842329
     
    23872332  /// This function just returns a \c TargetMap class.
    23882333  /// \relates TargetMap
    2389   template <typename GR>
    2390   inline TargetMap<GR> targetMap(const GR& graph) {
    2391     return TargetMap<GR>(graph);
    2392   }
    2393 
    2394   /// \brief Map of the "forward" directed arc view of edges in a graph.
    2395   ///
    2396   /// ForwardMap provides access for the "forward" directed arc view of
    2397   /// each edge in a graph, which is returned by the \c direct() function
    2398   /// of the graph with \c true parameter.
    2399   /// \tparam GR The graph type.
     2334  template <typename Digraph>
     2335  inline TargetMap<Digraph> targetMap(const Digraph& digraph) {
     2336    return TargetMap<Digraph>(digraph);
     2337  }
     2338
     2339  /// \brief Returns the "forward" directed arc view of an edge.
     2340  ///
     2341  /// Returns the "forward" directed arc view of an edge.
    24002342  /// \see BackwardMap
    2401   template <typename GR>
     2343  template <typename Graph>
    24022344  class ForwardMap {
    24032345  public:
    24042346
    2405     typedef typename GR::Arc Value;
    2406     typedef typename GR::Edge Key;
     2347    typedef typename Graph::Arc Value;
     2348    typedef typename Graph::Edge Key;
    24072349
    24082350    /// \brief Constructor
    24092351    ///
    2410     /// Constructor.
     2352    /// Constructor
    24112353    /// \param graph The graph that the map belongs to.
    2412     explicit ForwardMap(const GR& graph) : _graph(graph) {}
    2413 
    2414     /// \brief Returns the "forward" directed arc view of the given edge.
    2415     ///
    2416     /// Returns the "forward" directed arc view of the given edge.
     2354    explicit ForwardMap(const Graph& graph) : _graph(graph) {}
     2355
     2356    /// \brief The subscript operator.
     2357    ///
     2358    /// The subscript operator.
     2359    /// \param key An edge
     2360    /// \return The "forward" directed arc view of edge
    24172361    Value operator[](const Key& key) const {
    24182362      return _graph.direct(key, true);
     
    24202364
    24212365  private:
    2422     const GR& _graph;
     2366    const Graph& _graph;
    24232367  };
    24242368
     
    24272371  /// This function just returns an \c ForwardMap class.
    24282372  /// \relates ForwardMap
    2429   template <typename GR>
    2430   inline ForwardMap<GR> forwardMap(const GR& graph) {
    2431     return ForwardMap<GR>(graph);
    2432   }
    2433 
    2434   /// \brief Map of the "backward" directed arc view of edges in a graph.
    2435   ///
    2436   /// BackwardMap provides access for the "backward" directed arc view of
    2437   /// each edge in a graph, which is returned by the \c direct() function
    2438   /// of the graph with \c false parameter.
    2439   /// \tparam GR The graph type.
     2373  template <typename Graph>
     2374  inline ForwardMap<Graph> forwardMap(const Graph& graph) {
     2375    return ForwardMap<Graph>(graph);
     2376  }
     2377
     2378  /// \brief Returns the "backward" directed arc view of an edge.
     2379  ///
     2380  /// Returns the "backward" directed arc view of an edge.
    24402381  /// \see ForwardMap
    2441   template <typename GR>
     2382  template <typename Graph>
    24422383  class BackwardMap {
    24432384  public:
    24442385
    2445     typedef typename GR::Arc Value;
    2446     typedef typename GR::Edge Key;
     2386    typedef typename Graph::Arc Value;
     2387    typedef typename Graph::Edge Key;
    24472388
    24482389    /// \brief Constructor
    24492390    ///
    2450     /// Constructor.
     2391    /// Constructor
    24512392    /// \param graph The graph that the map belongs to.
    2452     explicit BackwardMap(const GR& graph) : _graph(graph) {}
    2453 
    2454     /// \brief Returns the "backward" directed arc view of the given edge.
    2455     ///
    2456     /// Returns the "backward" directed arc view of the given edge.
     2393    explicit BackwardMap(const Graph& graph) : _graph(graph) {}
     2394
     2395    /// \brief The subscript operator.
     2396    ///
     2397    /// The subscript operator.
     2398    /// \param key An edge
     2399    /// \return The "backward" directed arc view of edge
    24572400    Value operator[](const Key& key) const {
    24582401      return _graph.direct(key, false);
     
    24602403
    24612404  private:
    2462     const GR& _graph;
     2405    const Graph& _graph;
    24632406  };
    24642407
     
    24672410  /// This function just returns a \c BackwardMap class.
    24682411  /// \relates BackwardMap
    2469   template <typename GR>
    2470   inline BackwardMap<GR> backwardMap(const GR& graph) {
    2471     return BackwardMap<GR>(graph);
    2472   }
    2473 
    2474   /// \brief Map of the in-degrees of nodes in a digraph.
     2412  template <typename Graph>
     2413  inline BackwardMap<Graph> backwardMap(const Graph& graph) {
     2414    return BackwardMap<Graph>(graph);
     2415  }
     2416
     2417  /// \brief Potential difference map
     2418  ///
     2419  /// If there is an potential map on the nodes then we
     2420  /// can get an arc map as we get the substraction of the
     2421  /// values of the target and source.
     2422  template <typename Digraph, typename NodeMap>
     2423  class PotentialDifferenceMap {
     2424  public:
     2425    typedef typename Digraph::Arc Key;
     2426    typedef typename NodeMap::Value Value;
     2427
     2428    /// \brief Constructor
     2429    ///
     2430    /// Contructor of the map
     2431    explicit PotentialDifferenceMap(const Digraph& digraph,
     2432                                    const NodeMap& potential)
     2433      : _digraph(digraph), _potential(potential) {}
     2434
     2435    /// \brief Const subscription operator
     2436    ///
     2437    /// Const subscription operator
     2438    Value operator[](const Key& arc) const {
     2439      return _potential[_digraph.target(arc)] -
     2440        _potential[_digraph.source(arc)];
     2441    }
     2442
     2443  private:
     2444    const Digraph& _digraph;
     2445    const NodeMap& _potential;
     2446  };
     2447
     2448  /// \brief Returns a PotentialDifferenceMap.
     2449  ///
     2450  /// This function just returns a PotentialDifferenceMap.
     2451  /// \relates PotentialDifferenceMap
     2452  template <typename Digraph, typename NodeMap>
     2453  PotentialDifferenceMap<Digraph, NodeMap>
     2454  potentialDifferenceMap(const Digraph& digraph, const NodeMap& potential) {
     2455    return PotentialDifferenceMap<Digraph, NodeMap>(digraph, potential);
     2456  }
     2457
     2458  /// \brief Map of the node in-degrees.
    24752459  ///
    24762460  /// This map returns the in-degree of a node. Once it is constructed,
    2477   /// the degrees are stored in a standard \c NodeMap, so each query is done
     2461  /// the degrees are stored in a standard NodeMap, so each query is done
    24782462  /// in constant time. On the other hand, the values are updated automatically
    24792463  /// whenever the digraph changes.
    24802464  ///
    2481   /// \warning Besides \c addNode() and \c addArc(), a digraph structure
    2482   /// may provide alternative ways to modify the digraph.
    2483   /// The correct behavior of InDegMap is not guarantied if these additional
    2484   /// features are used. For example the functions
    2485   /// \ref ListDigraph::changeSource() "changeSource()",
     2465  /// \warning Besides addNode() and addArc(), a digraph structure may provide
     2466  /// alternative ways to modify the digraph. The correct behavior of InDegMap
     2467  /// is not guarantied if these additional features are used. For example
     2468  /// the functions \ref ListDigraph::changeSource() "changeSource()",
    24862469  /// \ref ListDigraph::changeTarget() "changeTarget()" and
    24872470  /// \ref ListDigraph::reverseArc() "reverseArc()"
     
    24892472  ///
    24902473  /// \sa OutDegMap
    2491   template <typename GR>
     2474
     2475  template <typename _Digraph>
    24922476  class InDegMap
    2493     : protected ItemSetTraits<GR, typename GR::Arc>
     2477    : protected ItemSetTraits<_Digraph, typename _Digraph::Arc>
    24942478      ::ItemNotifier::ObserverBase {
    24952479
    24962480  public:
    2497    
    2498     /// The digraph type
    2499     typedef GR Digraph;
    2500     /// The key type
     2481
     2482    typedef _Digraph Digraph;
     2483    typedef int Value;
    25012484    typedef typename Digraph::Node Key;
    2502     /// The value type
    2503     typedef int Value;
    25042485
    25052486    typedef typename ItemSetTraits<Digraph, typename Digraph::Arc>
     
    25432524    /// \brief Constructor.
    25442525    ///
    2545     /// Constructor for creating an in-degree map.
    2546     explicit InDegMap(const Digraph& graph)
    2547       : _digraph(graph), _deg(graph) {
     2526    /// Constructor for creating in-degree map.
     2527    explicit InDegMap(const Digraph& digraph)
     2528      : _digraph(digraph), _deg(digraph) {
    25482529      Parent::attach(_digraph.notifier(typename Digraph::Arc()));
    25492530
     
    25532534    }
    25542535
    2555     /// \brief Gives back the in-degree of a Node.
    2556     ///
    25572536    /// Gives back the in-degree of a Node.
    25582537    int operator[](const Key& key) const {
     
    26012580  };
    26022581
    2603   /// \brief Map of the out-degrees of nodes in a digraph.
     2582  /// \brief Map of the node out-degrees.
    26042583  ///
    26052584  /// This map returns the out-degree of a node. Once it is constructed,
    2606   /// the degrees are stored in a standard \c NodeMap, so each query is done
     2585  /// the degrees are stored in a standard NodeMap, so each query is done
    26072586  /// in constant time. On the other hand, the values are updated automatically
    26082587  /// whenever the digraph changes.
    26092588  ///
    2610   /// \warning Besides \c addNode() and \c addArc(), a digraph structure
    2611   /// may provide alternative ways to modify the digraph.
    2612   /// The correct behavior of OutDegMap is not guarantied if these additional
    2613   /// features are used. For example the functions
    2614   /// \ref ListDigraph::changeSource() "changeSource()",
     2589  /// \warning Besides addNode() and addArc(), a digraph structure may provide
     2590  /// alternative ways to modify the digraph. The correct behavior of OutDegMap
     2591  /// is not guarantied if these additional features are used. For example
     2592  /// the functions \ref ListDigraph::changeSource() "changeSource()",
    26152593  /// \ref ListDigraph::changeTarget() "changeTarget()" and
    26162594  /// \ref ListDigraph::reverseArc() "reverseArc()"
     
    26182596  ///
    26192597  /// \sa InDegMap
    2620   template <typename GR>
     2598
     2599  template <typename _Digraph>
    26212600  class OutDegMap
    2622     : protected ItemSetTraits<GR, typename GR::Arc>
     2601    : protected ItemSetTraits<_Digraph, typename _Digraph::Arc>
    26232602      ::ItemNotifier::ObserverBase {
    26242603
    26252604  public:
    26262605
    2627     /// The digraph type
    2628     typedef GR Digraph;
    2629     /// The key type
     2606    typedef _Digraph Digraph;
     2607    typedef int Value;
    26302608    typedef typename Digraph::Node Key;
    2631     /// The value type
    2632     typedef int Value;
    26332609
    26342610    typedef typename ItemSetTraits<Digraph, typename Digraph::Arc>
     
    26702646    /// \brief Constructor.
    26712647    ///
    2672     /// Constructor for creating an out-degree map.
    2673     explicit OutDegMap(const Digraph& graph)
    2674       : _digraph(graph), _deg(graph) {
     2648    /// Constructor for creating out-degree map.
     2649    explicit OutDegMap(const Digraph& digraph)
     2650      : _digraph(digraph), _deg(digraph) {
    26752651      Parent::attach(_digraph.notifier(typename Digraph::Arc()));
    26762652
     
    26802656    }
    26812657
    2682     /// \brief Gives back the out-degree of a Node.
    2683     ///
    26842658    /// Gives back the out-degree of a Node.
    26852659    int operator[](const Key& key) const {
     
    27282702  };
    27292703
    2730   /// \brief Potential difference map
    2731   ///
    2732   /// PotentialMap returns the difference between the potentials of the
    2733   /// source and target nodes of each arc in a digraph, i.e. it returns
    2734   /// \code
    2735   ///   potential[gr.target(arc)] - potential[gr.source(arc)].
    2736   /// \endcode
    2737   /// \tparam GR The digraph type.
    2738   /// \tparam POT A node map storing the potentials.
    2739   template <typename GR, typename POT>
    2740   class PotentialDifferenceMap {
    2741   public:
    2742     /// Key type
    2743     typedef typename GR::Arc Key;
    2744     /// Value type
    2745     typedef typename POT::Value Value;
    2746 
    2747     /// \brief Constructor
    2748     ///
    2749     /// Contructor of the map.
    2750     explicit PotentialDifferenceMap(const GR& gr,
    2751                                     const POT& potential)
    2752       : _digraph(gr), _potential(potential) {}
    2753 
    2754     /// \brief Returns the potential difference for the given arc.
    2755     ///
    2756     /// Returns the potential difference for the given arc, i.e.
    2757     /// \code
    2758     ///   potential[gr.target(arc)] - potential[gr.source(arc)].
    2759     /// \endcode
    2760     Value operator[](const Key& arc) const {
    2761       return _potential[_digraph.target(arc)] -
    2762         _potential[_digraph.source(arc)];
    2763     }
    2764 
    2765   private:
    2766     const GR& _digraph;
    2767     const POT& _potential;
    2768   };
    2769 
    2770   /// \brief Returns a PotentialDifferenceMap.
    2771   ///
    2772   /// This function just returns a PotentialDifferenceMap.
    2773   /// \relates PotentialDifferenceMap
    2774   template <typename GR, typename POT>
    2775   PotentialDifferenceMap<GR, POT>
    2776   potentialDifferenceMap(const GR& gr, const POT& potential) {
    2777     return PotentialDifferenceMap<GR, POT>(gr, potential);
    2778   }
    2779 
    27802704  /// @}
    27812705}
  • lemon/max_matching.h

    r606 r463  
    5656  /// decomposition() after running the algorithm.
    5757  ///
    58   /// \param GR The graph type the algorithm runs on.
    59   template <typename GR>
     58  /// \param _Graph The graph type the algorithm runs on.
     59  template <typename _Graph>
    6060  class MaxMatching {
    6161  public:
    6262
    63     typedef GR Graph;
     63    typedef _Graph Graph;
    6464    typedef typename Graph::template NodeMap<typename Graph::Arc>
    6565    MatchingMap;
     
    464464    /// map must have the property that there are no two incident edges
    465465    /// with true value, ie. it contains a matching.
    466     /// \return \c true if the map contains a matching.
     466    /// \return %True if the map contains a matching.
    467467    template <typename MatchingMap>
    468468    bool matchingInit(const MatchingMap& matching) {
     
    614614  /// maximum weighted matching algorithm. The implementation is based
    615615  /// on extensive use of priority queues and provides
    616   /// \f$O(nm\log n)\f$ time complexity.
     616  /// \f$O(nm\log(n))\f$ time complexity.
    617617  ///
    618618  /// The maximum weighted matching problem is to find undirected
     
    648648  /// of a blossom. If the value type is integral then the dual
    649649  /// solution is multiplied by \ref MaxWeightedMatching::dualScale "4".
    650   template <typename GR,
    651             typename WM = typename GR::template EdgeMap<int> >
     650  template <typename _Graph,
     651            typename _WeightMap = typename _Graph::template EdgeMap<int> >
    652652  class MaxWeightedMatching {
    653653  public:
    654654
    655     ///\e
    656     typedef GR Graph;
    657     ///\e
    658     typedef WM WeightMap;
    659     ///\e
     655    typedef _Graph Graph;
     656    typedef _WeightMap WeightMap;
    660657    typedef typename WeightMap::Value Value;
    661658
     
    19611958  /// maximum weighted perfect matching algorithm. The implementation
    19621959  /// is based on extensive use of priority queues and provides
    1963   /// \f$O(nm\log n)\f$ time complexity.
     1960  /// \f$O(nm\log(n))\f$ time complexity.
    19641961  ///
    19651962  /// The maximum weighted matching problem is to find undirected
     
    19941991  /// of a blossom. If the value type is integral then the dual
    19951992  /// solution is multiplied by \ref MaxWeightedMatching::dualScale "4".
    1996   template <typename GR,
    1997             typename WM = typename GR::template EdgeMap<int> >
     1993  template <typename _Graph,
     1994            typename _WeightMap = typename _Graph::template EdgeMap<int> >
    19981995  class MaxWeightedPerfectMatching {
    19991996  public:
    20001997
    2001     typedef GR Graph;
    2002     typedef WM WeightMap;
     1998    typedef _Graph Graph;
     1999    typedef _WeightMap WeightMap;
    20032000    typedef typename WeightMap::Value Value;
    20042001
  • lemon/min_cost_arborescence.h

    r606 r522  
    3636  ///
    3737  /// Default traits class for MinCostArborescence class.
    38   /// \param GR Digraph type.
    39   /// \param CM Type of cost map.
    40   template <class GR, class CM>
     38  /// \param _Digraph Digraph type.
     39  /// \param _CostMap Type of cost map.
     40  template <class _Digraph, class _CostMap>
    4141  struct MinCostArborescenceDefaultTraits{
    4242
    4343    /// \brief The digraph type the algorithm runs on.
    44     typedef GR Digraph;
     44    typedef _Digraph Digraph;
    4545
    4646    /// \brief The type of the map that stores the arc costs.
     
    4848    /// The type of the map that stores the arc costs.
    4949    /// It must meet the \ref concepts::ReadMap "ReadMap" concept.
    50     typedef CM CostMap;
     50    typedef _CostMap CostMap;
    5151
    5252    /// \brief The value type of the costs.
     
    6464    typedef typename Digraph::template ArcMap<bool> ArborescenceMap;
    6565
    66     /// \brief Instantiates a \c ArborescenceMap.
    67     ///
    68     /// This function instantiates a \c ArborescenceMap.
     66    /// \brief Instantiates a ArborescenceMap.
     67    ///
     68    /// This function instantiates a \ref ArborescenceMap.
    6969    /// \param digraph is the graph, to which we would like to
    70     /// calculate the \c ArborescenceMap.
     70    /// calculate the ArborescenceMap.
    7171    static ArborescenceMap *createArborescenceMap(const Digraph &digraph){
    7272      return new ArborescenceMap(digraph);
    7373    }
    7474
    75     /// \brief The type of the \c PredMap
    76     ///
    77     /// The type of the \c PredMap. It is a node map with an arc value type.
     75    /// \brief The type of the PredMap
     76    ///
     77    /// The type of the PredMap. It is a node map with an arc value type.
    7878    typedef typename Digraph::template NodeMap<typename Digraph::Arc> PredMap;
    7979
    80     /// \brief Instantiates a \c PredMap.
    81     ///
    82     /// This function instantiates a \c PredMap.
    83     /// \param digraph The digraph to which we would like to define the
    84     /// \c PredMap.
     80    /// \brief Instantiates a PredMap.
     81    ///
     82    /// This function instantiates a \ref PredMap.
     83    /// \param _digraph is the digraph, to which we would like to define the
     84    /// PredMap.
    8585    static PredMap *createPredMap(const Digraph &digraph){
    8686      return new PredMap(digraph);
     
    9999  /// the minimum cost subgraph which are union of arborescences with the
    100100  /// given sources and spans all the nodes which are reachable from the
    101   /// sources. The time complexity of the algorithm is O(n<sup>2</sup>+e).
     101  /// sources. The time complexity of the algorithm is \f$ O(n^2+e) \f$.
    102102  ///
    103103  /// The algorithm provides also an optimal dual solution, therefore
    104104  /// the optimality of the solution can be checked.
    105105  ///
    106   /// \param GR The digraph type the algorithm runs on. The default value
     106  /// \param _Digraph The digraph type the algorithm runs on. The default value
    107107  /// is \ref ListDigraph.
    108   /// \param CM This read-only ArcMap determines the costs of the
     108  /// \param _CostMap This read-only ArcMap determines the costs of the
    109109  /// arcs. It is read once for each arc, so the map may involve in
    110110  /// relatively time consuming process to compute the arc cost if
    111111  /// it is necessary. The default map type is \ref
    112112  /// concepts::Digraph::ArcMap "Digraph::ArcMap<int>".
    113   /// \param TR Traits class to set various data types used
     113  /// \param _Traits Traits class to set various data types used
    114114  /// by the algorithm. The default traits class is
    115115  /// \ref MinCostArborescenceDefaultTraits
    116   /// "MinCostArborescenceDefaultTraits<GR, CM>".  See \ref
     116  /// "MinCostArborescenceDefaultTraits<_Digraph, _CostMap>".  See \ref
    117117  /// MinCostArborescenceDefaultTraits for the documentation of a
    118118  /// MinCostArborescence traits class.
     119  ///
     120  /// \author Balazs Dezso
    119121#ifndef DOXYGEN
    120   template <typename GR = ListDigraph,
    121             typename CM = typename GR::template ArcMap<int>,
    122             typename TR =
    123               MinCostArborescenceDefaultTraits<GR, CM> >
     122  template <typename _Digraph = ListDigraph,
     123            typename _CostMap = typename _Digraph::template ArcMap<int>,
     124            typename _Traits =
     125            MinCostArborescenceDefaultTraits<_Digraph, _CostMap> >
    124126#else
    125   template <typename GR, typename CM, typedef TR>
     127  template <typename _Digraph, typename _CostMap, typedef _Traits>
    126128#endif
    127129  class MinCostArborescence {
     
    129131
    130132    /// The traits.
    131     typedef TR Traits;
     133    typedef _Traits Traits;
    132134    /// The type of the underlying digraph.
    133135    typedef typename Traits::Digraph Digraph;
     
    439441    /// \brief Constructor.
    440442    ///
    441     /// \param digraph The digraph the algorithm will run on.
    442     /// \param cost The cost map used by the algorithm.
     443    /// \param _digraph The digraph the algorithm will run on.
     444    /// \param _cost The cost map used by the algorithm.
    443445    MinCostArborescence(const Digraph& digraph, const CostMap& cost)
    444446      : _digraph(&digraph), _cost(&cost), _pred(0), local_pred(false),
     
    455457    ///
    456458    /// Sets the arborescence map.
    457     /// \return <tt>(*this)</tt>
     459    /// \return \c (*this)
    458460    MinCostArborescence& arborescenceMap(ArborescenceMap& m) {
    459461      if (local_arborescence) {
     
    468470    ///
    469471    /// Sets the arborescence map.
    470     /// \return <tt>(*this)</tt>
     472    /// \return \c (*this)
    471473    MinCostArborescence& predMap(PredMap& m) {
    472474      if (local_pred) {
  • lemon/path.h

    r606 r564  
    4141  ///
    4242  /// A structure for representing directed path in a digraph.
    43   /// \tparam GR The digraph type in which the path is.
     43  /// \tparam _Digraph The digraph type in which the path is.
    4444  ///
    4545  /// In a sense, the path can be treated as a list of arcs. The
     
    5353  /// implementation uses two vectors for storing the front and back
    5454  /// insertions.
    55   template <typename GR>
     55  template <typename _Digraph>
    5656  class Path {
    5757  public:
    5858
    59     typedef GR Digraph;
     59    typedef _Digraph Digraph;
    6060    typedef typename Digraph::Arc Arc;
    6161
     
    138138    /// \brief The nth arc.
    139139    ///
    140     /// \pre \c n is in the <tt>[0..length() - 1]</tt> range.
     140    /// \pre n is in the [0..length() - 1] range
    141141    const Arc& nth(int n) const {
    142142      return n < int(head.size()) ? *(head.rbegin() + n) :
     
    146146    /// \brief Initialize arc iterator to point to the nth arc
    147147    ///
    148     /// \pre \c n is in the <tt>[0..length() - 1]</tt> range.
     148    /// \pre n is in the [0..length() - 1] range
    149149    ArcIt nthIt(int n) const {
    150150      return ArcIt(*this, n);
     
    229229  ///
    230230  /// A structure for representing directed path in a digraph.
    231   /// \tparam GR The digraph type in which the path is.
     231  /// \tparam _Digraph The digraph type in which the path is.
    232232  ///
    233233  /// In a sense, the path can be treated as a list of arcs. The
     
    241241  /// then the \c Path type because it use just one vector for the
    242242  /// arcs.
    243   template <typename GR>
     243  template <typename _Digraph>
    244244  class SimplePath {
    245245  public:
    246246
    247     typedef GR Digraph;
     247    typedef _Digraph Digraph;
    248248    typedef typename Digraph::Arc Arc;
    249249
     
    330330    /// \brief The nth arc.
    331331    ///
    332     /// \pre \c n is in the <tt>[0..length() - 1]</tt> range.
     332    /// \pre n is in the [0..length() - 1] range
    333333    const Arc& nth(int n) const {
    334334      return data[n];
     
    393393  ///
    394394  /// A structure for representing directed path in a digraph.
    395   /// \tparam GR The digraph type in which the path is.
     395  /// \tparam _Digraph The digraph type in which the path is.
    396396  ///
    397397  /// In a sense, the path can be treated as a list of arcs. The
     
    405405  /// time. The front and back insertion and erasure is O(1) time
    406406  /// and it can be splited and spliced in O(1) time.
    407   template <typename GR>
     407  template <typename _Digraph>
    408408  class ListPath {
    409409  public:
    410410
    411     typedef GR Digraph;
     411    typedef _Digraph Digraph;
    412412    typedef typename Digraph::Arc Arc;
    413413
     
    508508    ///
    509509    /// This function looks for the nth arc in O(n) time.
    510     /// \pre \c n is in the <tt>[0..length() - 1]</tt> range.
     510    /// \pre n is in the [0..length() - 1] range
    511511    const Arc& nth(int n) const {
    512512      Node *node = first;
     
    733733  ///
    734734  /// A structure for representing directed path in a digraph.
    735   /// \tparam GR The digraph type in which the path is.
     735  /// \tparam _Digraph The digraph type in which the path is.
    736736  ///
    737737  /// In a sense, the path can be treated as a list of arcs. The
     
    747747  /// it is intented to be
    748748  /// used when you want to store a large number of paths.
    749   template <typename GR>
     749  template <typename _Digraph>
    750750  class StaticPath {
    751751  public:
    752752
    753     typedef GR Digraph;
     753    typedef _Digraph Digraph;
    754754    typedef typename Digraph::Arc Arc;
    755755
     
    834834    /// \brief The nth arc.
    835835    ///
    836     /// \pre \c n is in the <tt>[0..length() - 1]</tt> range.
     836    /// \pre n is in the [0..length() - 1] range
    837837    const Arc& nth(int n) const {
    838838      return arcs[n];
  • lemon/preflow.h

    r606 r525  
    3333  /// Default traits class of Preflow class.
    3434  /// \tparam GR Digraph type.
    35   /// \tparam CAP Capacity map type.
    36   template <typename GR, typename CAP>
     35  /// \tparam CM Capacity map type.
     36  template <typename GR, typename CM>
    3737  struct PreflowDefaultTraits {
    3838
     
    4444    /// The type of the map that stores the arc capacities.
    4545    /// It must meet the \ref concepts::ReadMap "ReadMap" concept.
    46     typedef CAP CapacityMap;
     46    typedef CM CapacityMap;
    4747
    4848    /// \brief The type of the flow values.
     
    9595  ///
    9696  /// This class provides an implementation of Goldberg-Tarjan's \e preflow
    97   /// \e push-relabel algorithm producing a \ref max_flow
    98   /// "flow of maximum value" in a digraph.
    99   /// The preflow algorithms are the fastest known maximum
     97  /// \e push-relabel algorithm producing a flow of maximum value in a
     98  /// digraph. The preflow algorithms are the fastest known maximum
    10099  /// flow algorithms. The current implementation use a mixture of the
    101100  /// \e "highest label" and the \e "bound decrease" heuristics.
     
    107106  ///
    108107  /// \tparam GR The type of the digraph the algorithm runs on.
    109   /// \tparam CAP The type of the capacity map. The default map
     108  /// \tparam CM The type of the capacity map. The default map
    110109  /// type is \ref concepts::Digraph::ArcMap "GR::ArcMap<int>".
    111110#ifdef DOXYGEN
    112   template <typename GR, typename CAP, typename TR>
     111  template <typename GR, typename CM, typename TR>
    113112#else
    114113  template <typename GR,
    115             typename CAP = typename GR::template ArcMap<int>,
    116             typename TR = PreflowDefaultTraits<GR, CAP> >
     114            typename CM = typename GR::template ArcMap<int>,
     115            typename TR = PreflowDefaultTraits<GR, CM> >
    117116#endif
    118117  class Preflow {
     
    196195    ///@{
    197196
    198     template <typename T>
     197    template <typename _FlowMap>
    199198    struct SetFlowMapTraits : public Traits {
    200       typedef T FlowMap;
     199      typedef _FlowMap FlowMap;
    201200      static FlowMap *createFlowMap(const Digraph&) {
    202201        LEMON_ASSERT(false, "FlowMap is not initialized");
     
    210209    /// \ref named-templ-param "Named parameter" for setting FlowMap
    211210    /// type.
    212     template <typename T>
     211    template <typename _FlowMap>
    213212    struct SetFlowMap
    214       : public Preflow<Digraph, CapacityMap, SetFlowMapTraits<T> > {
     213      : public Preflow<Digraph, CapacityMap, SetFlowMapTraits<_FlowMap> > {
    215214      typedef Preflow<Digraph, CapacityMap,
    216                       SetFlowMapTraits<T> > Create;
     215                      SetFlowMapTraits<_FlowMap> > Create;
    217216    };
    218217
    219     template <typename T>
     218    template <typename _Elevator>
    220219    struct SetElevatorTraits : public Traits {
    221       typedef T Elevator;
     220      typedef _Elevator Elevator;
    222221      static Elevator *createElevator(const Digraph&, int) {
    223222        LEMON_ASSERT(false, "Elevator is not initialized");
     
    235234    /// \ref run() or \ref init().
    236235    /// \sa SetStandardElevator
    237     template <typename T>
     236    template <typename _Elevator>
    238237    struct SetElevator
    239       : public Preflow<Digraph, CapacityMap, SetElevatorTraits<T> > {
     238      : public Preflow<Digraph, CapacityMap, SetElevatorTraits<_Elevator> > {
    240239      typedef Preflow<Digraph, CapacityMap,
    241                       SetElevatorTraits<T> > Create;
     240                      SetElevatorTraits<_Elevator> > Create;
    242241    };
    243242
    244     template <typename T>
     243    template <typename _Elevator>
    245244    struct SetStandardElevatorTraits : public Traits {
    246       typedef T Elevator;
     245      typedef _Elevator Elevator;
    247246      static Elevator *createElevator(const Digraph& digraph, int max_level) {
    248247        return new Elevator(digraph, max_level);
     
    262261    /// before calling \ref run() or \ref init().
    263262    /// \sa SetElevator
    264     template <typename T>
     263    template <typename _Elevator>
    265264    struct SetStandardElevator
    266265      : public Preflow<Digraph, CapacityMap,
    267                        SetStandardElevatorTraits<T> > {
     266                       SetStandardElevatorTraits<_Elevator> > {
    268267      typedef Preflow<Digraph, CapacityMap,
    269                       SetStandardElevatorTraits<T> > Create;
     268                      SetStandardElevatorTraits<_Elevator> > Create;
    270269    };
    271270
     
    948947    ///
    949948    /// \note This function calls \ref minCut() for each node, so it runs in
    950     /// O(n) time.
     949    /// \f$O(n)\f$ time.
    951950    ///
    952951    /// \pre Either \ref run() or \ref init() must be called before
  • lemon/radix_sort.h

    r606 r467  
    206206  ///
    207207  /// This is a special quick sort algorithm where the pivot
    208   /// values to split the items are choosen to be 2<sup>k</sup>
    209   /// for each \c k.
    210   /// Therefore, the time complexity of the algorithm is O(log(c)*n) and
    211   /// it uses O(log(c)) additional space, where \c c is the maximal value
    212   /// and \c n is the number of the items in the container.
     208  /// values to split the items are choosen to be \f$ 2^k \f$ for each \c k.
     209  /// Therefore, the time complexity of the
     210  /// algorithm is \f$ O(\log(c)n) \f$ and it uses \f$ O(\log(c)) \f$,
     211  /// additional space, where \c c is the maximal value and \c n is the
     212  /// number of the items in the container.
    213213  ///
    214214  /// \param first The begin of the given range.
     
    431431  /// byte-by-byte. First, it counts how many times a byte value occurs
    432432  /// in the container, then it copies the corresponding items to
    433   /// another container in asceding order in O(n) time.
    434   ///
    435   /// The time complexity of the algorithm is O(log(c)*n) and
    436   /// it uses O(n) additional space, where \c c is the
     433  /// another container in asceding order in \c O(n) time.
     434  ///
     435  /// The time complexity of the algorithm is \f$ O(\log(c)n) \f$ and
     436  /// it uses \f$ O(n) \f$, additional space, where \c c is the
    437437  /// maximal value and \c n is the number of the items in the
    438438  /// container.
  • lemon/random.h

    r606 r564  
    604604    /// function with the <tt>/dev/urandom</tt> file. If it does not success,
    605605    /// it uses the \c seedFromTime().
    606     /// \return Currently always \c true.
     606    /// \return Currently always true.
    607607    bool seed() {
    608608#ifndef WIN32
     
    625625    /// \param file The source file
    626626    /// \param offset The offset, from the file read.
    627     /// \return \c true when the seeding successes.
     627    /// \return True when the seeding successes.
    628628#ifndef WIN32
    629629    bool seedFromFile(const std::string& file = "/dev/urandom", int offset = 0)
     
    646646    /// current process id and the current time for initialize the
    647647    /// random sequence.
    648     /// \return Currently always \c true.
     648    /// \return Currently always true.
    649649    bool seedFromTime() {
    650650#ifndef WIN32
  • lemon/smart_graph.h

    r606 r463  
    226226    ///Add a new node to the digraph.
    227227
    228     /// Add a new node to the digraph.
    229     /// \return The new node.
     228    /// \return the new node.
     229    ///
    230230    Node addNode() { return Parent::addNode(); }
    231231
     
    234234    ///Add a new arc to the digraph with source node \c s
    235235    ///and target node \c t.
    236     ///\return The new arc.
     236    ///\return the new arc.
    237237    Arc addArc(const Node& s, const Node& t) {
    238238      return Parent::addArc(s, t);
     
    667667    ///Add a new node to the graph.
    668668
    669     /// Add a new node to the graph.
    670     /// \return The new node.
     669    /// \return the new node.
     670    ///
    671671    Node addNode() { return Parent::addNode(); }
    672672
     
    675675    ///Add a new edge to the graph with node \c s
    676676    ///and \c t.
    677     ///\return The new edge.
     677    ///\return the new edge.
    678678    Edge addEdge(const Node& s, const Node& t) {
    679679      return Parent::addEdge(s, t);
  • lemon/suurballe.h

    r606 r566  
    4646  /// \ref CapacityScaling "successive shortest path" algorithm.
    4747  ///
    48   /// \tparam GR The digraph type the algorithm runs on.
     48  /// \tparam Digraph The digraph type the algorithm runs on.
    4949  /// The default value is \c ListDigraph.
    50   /// \tparam LEN The type of the length (cost) map.
     50  /// \tparam LengthMap The type of the length (cost) map.
    5151  /// The default value is <tt>Digraph::ArcMap<int></tt>.
    5252  ///
     
    5656  /// with \ref SplitNodes.
    5757#ifdef DOXYGEN
    58   template <typename GR, typename LEN>
     58  template <typename Digraph, typename LengthMap>
    5959#else
    60   template < typename GR = ListDigraph,
    61              typename LEN = typename GR::template ArcMap<int> >
     60  template < typename Digraph = ListDigraph,
     61             typename LengthMap = typename Digraph::template ArcMap<int> >
    6262#endif
    6363  class Suurballe
    6464  {
    65     TEMPLATE_DIGRAPH_TYPEDEFS(GR);
    66 
     65    TEMPLATE_DIGRAPH_TYPEDEFS(Digraph);
     66
     67    typedef typename LengthMap::Value Length;
    6768    typedef ConstMap<Arc, int> ConstArcMap;
    68     typedef typename GR::template NodeMap<Arc> PredMap;
     69    typedef typename Digraph::template NodeMap<Arc> PredMap;
    6970
    7071  public:
    7172
    72     /// The type of the digraph the algorithm runs on.
    73     typedef GR Digraph;
    74     /// The type of the length map.
    75     typedef LEN LengthMap;
    76     /// The type of the lengths.
    77     typedef typename LengthMap::Value Length;
    7873    /// The type of the flow map.
    7974    typedef typename Digraph::template ArcMap<int> FlowMap;
     
    262257    /// the found arc-disjoint paths.
    263258    ///
    264     /// \return <tt>(*this)</tt>
     259    /// \return \c (*this)
    265260    Suurballe& flowMap(FlowMap &map) {
    266261      if (_local_flow) {
     
    279274    /// minimum cost flow problem.
    280275    ///
    281     /// \return <tt>(*this)</tt>
     276    /// \return \c (*this)
    282277    Suurballe& potentialMap(PotentialMap &map) {
    283278      if (_local_potential) {
     
    464459    ///
    465460    /// This function returns the total length (cost) of the found paths
    466     /// (flow). The complexity of the function is O(e).
     461    /// (flow). The complexity of the function is \f$ O(e) \f$.
    467462    ///
    468463    /// \pre \ref run() or \ref findFlow() must be called before using
  • lemon/unionfind.h

    r606 r463  
    5252  /// \pre You need to add all the elements by the \ref insert()
    5353  /// method.
    54   template <typename IM>
     54  template <typename _ItemIntMap>
    5555  class UnionFind {
    5656  public:
    5757
    58     ///\e
    59     typedef IM ItemIntMap;
    60     ///\e
     58    typedef _ItemIntMap ItemIntMap;
    6159    typedef typename ItemIntMap::Key Item;
    6260
     
    173171  /// method.
    174172  ///
    175   template <typename IM>
     173  template <typename _ItemIntMap>
    176174  class UnionFindEnum {
    177175  public:
    178176
    179     ///\e
    180     typedef IM ItemIntMap;
    181     ///\e
     177    typedef _ItemIntMap ItemIntMap;
    182178    typedef typename ItemIntMap::Key Item;
    183179
     
    632628  /// \pre You need to add all the elements by the \ref insert()
    633629  /// method.
    634   template <typename IM>
     630  template <typename _ItemIntMap>
    635631  class ExtendFindEnum {
    636632  public:
    637633
    638     ///\e
    639     typedef IM ItemIntMap;
    640     ///\e
     634    typedef _ItemIntMap ItemIntMap;
    641635    typedef typename ItemIntMap::Key Item;
    642636
     
    955949  /// \pre You need to add all the elements by the \ref insert()
    956950  /// method.
    957   template <typename V, typename IM, typename Comp = std::less<V> >
     951  ///
     952  template <typename _Value, typename _ItemIntMap,
     953            typename _Comp = std::less<_Value> >
    958954  class HeapUnionFind {
    959955  public:
    960956
    961     ///\e
    962     typedef V Value;
    963     ///\e
    964     typedef typename IM::Key Item;
    965     ///\e
    966     typedef IM ItemIntMap;
    967     ///\e
    968     typedef Comp Compare;
     957    typedef _Value Value;
     958    typedef typename _ItemIntMap::Key Item;
     959
     960    typedef _ItemIntMap ItemIntMap;
     961
     962    typedef _Comp Comp;
    969963
    970964  private:
     
    16081602    /// \brief Gives back the priority of the current item.
    16091603    ///
    1610     /// Gives back the priority of the current item.
     1604    /// \return Gives back the priority of the current item.
    16111605    const Value& operator[](const Item& item) const {
    16121606      return nodes[index[item]].prio;
     
    16531647    /// \brief Gives back the minimum priority of the class.
    16541648    ///
    1655     /// Gives back the minimum priority of the class.
     1649    /// \return Gives back the minimum priority of the class.
    16561650    const Value& classPrio(int cls) const {
    16571651      return nodes[~(classes[cls].parent)].prio;
     
    16671661    /// \brief Gives back a representant item of the class.
    16681662    ///
    1669     /// Gives back a representant item of the class.
    16701663    /// The representant is indpendent from the priorities of the
    16711664    /// items.
     1665    /// \return Gives back a representant item of the class.
    16721666    const Item& classRep(int id) const {
    16731667      int parent = classes[id].parent;
Note: See TracChangeset for help on using the changeset viewer.