lemon/elevator.h
changeset 559 c5fd2d996909
parent 519 c786cd201266
child 581 aa1804409f29
     1.1 --- a/lemon/elevator.h	Thu Mar 05 10:13:20 2009 +0000
     1.2 +++ b/lemon/elevator.h	Sun Mar 29 23:08:20 2009 +0200
     1.3 @@ -46,10 +46,10 @@
     1.4    ///
     1.5    ///\sa LinkedElevator
     1.6    ///
     1.7 -  ///\param Graph Type of the underlying graph.
     1.8 -  ///\param Item Type of the items the data is assigned to (Graph::Node,
     1.9 -  ///Graph::Arc, Graph::Edge).
    1.10 -  template<class Graph, class Item>
    1.11 +  ///\param GR Type of the underlying graph.
    1.12 +  ///\param Item Type of the items the data is assigned to (\c GR::Node,
    1.13 +  ///\c GR::Arc or \c GR::Edge).
    1.14 +  template<class GR, class Item>
    1.15    class Elevator
    1.16    {
    1.17    public:
    1.18 @@ -60,10 +60,10 @@
    1.19    private:
    1.20  
    1.21      typedef Item *Vit;
    1.22 -    typedef typename ItemSetTraits<Graph,Item>::template Map<Vit>::Type VitMap;
    1.23 -    typedef typename ItemSetTraits<Graph,Item>::template Map<int>::Type IntMap;
    1.24 +    typedef typename ItemSetTraits<GR,Item>::template Map<Vit>::Type VitMap;
    1.25 +    typedef typename ItemSetTraits<GR,Item>::template Map<int>::Type IntMap;
    1.26  
    1.27 -    const Graph &_g;
    1.28 +    const GR &_g;
    1.29      int _max_level;
    1.30      int _item_num;
    1.31      VitMap _where;
    1.32 @@ -105,7 +105,7 @@
    1.33      ///\param graph The underlying graph.
    1.34      ///\param max_level The maximum allowed level.
    1.35      ///Set the range of the possible labels to <tt>[0..max_level]</tt>.
    1.36 -    Elevator(const Graph &graph,int max_level) :
    1.37 +    Elevator(const GR &graph,int max_level) :
    1.38        _g(graph),
    1.39        _max_level(max_level),
    1.40        _item_num(_max_level),
    1.41 @@ -122,9 +122,9 @@
    1.42      ///\param graph The underlying graph.
    1.43      ///Set the range of the possible labels to <tt>[0..max_level]</tt>,
    1.44      ///where \c max_level is equal to the number of labeled items in the graph.
    1.45 -    Elevator(const Graph &graph) :
    1.46 +    Elevator(const GR &graph) :
    1.47        _g(graph),
    1.48 -      _max_level(countItems<Graph, Item>(graph)),
    1.49 +      _max_level(countItems<GR, Item>(graph)),
    1.50        _item_num(_max_level),
    1.51        _where(graph),
    1.52        _level(graph,0),
    1.53 @@ -430,7 +430,7 @@
    1.54        _first[0]=&_items[0];
    1.55        _last_active[0]=&_items[0]-1;
    1.56        Vit n=&_items[0];
    1.57 -      for(typename ItemSetTraits<Graph,Item>::ItemIt i(_g);i!=INVALID;++i)
    1.58 +      for(typename ItemSetTraits<GR,Item>::ItemIt i(_g);i!=INVALID;++i)
    1.59          {
    1.60            *n=i;
    1.61            _where.set(i,n);
    1.62 @@ -489,10 +489,10 @@
    1.63    ///
    1.64    ///\sa Elevator
    1.65    ///
    1.66 -  ///\param Graph Type of the underlying graph.
    1.67 -  ///\param Item Type of the items the data is assigned to (Graph::Node,
    1.68 -  ///Graph::Arc, Graph::Edge).
    1.69 -  template <class Graph, class Item>
    1.70 +  ///\param GR Type of the underlying graph.
    1.71 +  ///\param Item Type of the items the data is assigned to (\c GR::Node,
    1.72 +  ///\c GR::Arc or \c GR::Edge).
    1.73 +  template <class GR, class Item>
    1.74    class LinkedElevator {
    1.75    public:
    1.76  
    1.77 @@ -501,14 +501,14 @@
    1.78  
    1.79    private:
    1.80  
    1.81 -    typedef typename ItemSetTraits<Graph,Item>::
    1.82 +    typedef typename ItemSetTraits<GR,Item>::
    1.83      template Map<Item>::Type ItemMap;
    1.84 -    typedef typename ItemSetTraits<Graph,Item>::
    1.85 +    typedef typename ItemSetTraits<GR,Item>::
    1.86      template Map<int>::Type IntMap;
    1.87 -    typedef typename ItemSetTraits<Graph,Item>::
    1.88 +    typedef typename ItemSetTraits<GR,Item>::
    1.89      template Map<bool>::Type BoolMap;
    1.90  
    1.91 -    const Graph &_graph;
    1.92 +    const GR &_graph;
    1.93      int _max_level;
    1.94      int _item_num;
    1.95      std::vector<Item> _first, _last;
    1.96 @@ -525,7 +525,7 @@
    1.97      ///\param graph The underlying graph.
    1.98      ///\param max_level The maximum allowed level.
    1.99      ///Set the range of the possible labels to <tt>[0..max_level]</tt>.
   1.100 -    LinkedElevator(const Graph& graph, int max_level)
   1.101 +    LinkedElevator(const GR& graph, int max_level)
   1.102        : _graph(graph), _max_level(max_level), _item_num(_max_level),
   1.103          _first(_max_level + 1), _last(_max_level + 1),
   1.104          _prev(graph), _next(graph),
   1.105 @@ -538,8 +538,8 @@
   1.106      ///\param graph The underlying graph.
   1.107      ///Set the range of the possible labels to <tt>[0..max_level]</tt>,
   1.108      ///where \c max_level is equal to the number of labeled items in the graph.
   1.109 -    LinkedElevator(const Graph& graph)
   1.110 -      : _graph(graph), _max_level(countItems<Graph, Item>(graph)),
   1.111 +    LinkedElevator(const GR& graph)
   1.112 +      : _graph(graph), _max_level(countItems<GR, Item>(graph)),
   1.113          _item_num(_max_level),
   1.114          _first(_max_level + 1), _last(_max_level + 1),
   1.115          _prev(graph, INVALID), _next(graph, INVALID),
   1.116 @@ -935,7 +935,7 @@
   1.117          _first[i] = _last[i] = INVALID;
   1.118        }
   1.119        _init_level = 0;
   1.120 -      for(typename ItemSetTraits<Graph,Item>::ItemIt i(_graph);
   1.121 +      for(typename ItemSetTraits<GR,Item>::ItemIt i(_graph);
   1.122            i != INVALID; ++i) {
   1.123          _level.set(i, _max_level);
   1.124          _active.set(i, false);