lemon/unionfind.h
changeset 783 ef88c0a30f85
parent 440 88ed40ad0d4f
child 786 e20173729589
child 867 5b926cc36a4b
     1.1 --- a/lemon/unionfind.h	Mon Jan 12 23:11:39 2009 +0100
     1.2 +++ b/lemon/unionfind.h	Thu Nov 05 15:48:01 2009 +0100
     1.3 @@ -51,11 +51,13 @@
     1.4    ///
     1.5    /// \pre You need to add all the elements by the \ref insert()
     1.6    /// method.
     1.7 -  template <typename _ItemIntMap>
     1.8 +  template <typename IM>
     1.9    class UnionFind {
    1.10    public:
    1.11  
    1.12 -    typedef _ItemIntMap ItemIntMap;
    1.13 +    ///\e
    1.14 +    typedef IM ItemIntMap;
    1.15 +    ///\e
    1.16      typedef typename ItemIntMap::Key Item;
    1.17  
    1.18    private:
    1.19 @@ -170,11 +172,13 @@
    1.20    /// \pre You need to add all the elements by the \ref insert()
    1.21    /// method.
    1.22    ///
    1.23 -  template <typename _ItemIntMap>
    1.24 +  template <typename IM>
    1.25    class UnionFindEnum {
    1.26    public:
    1.27  
    1.28 -    typedef _ItemIntMap ItemIntMap;
    1.29 +    ///\e
    1.30 +    typedef IM ItemIntMap;
    1.31 +    ///\e
    1.32      typedef typename ItemIntMap::Key Item;
    1.33  
    1.34    private:
    1.35 @@ -627,11 +631,13 @@
    1.36    ///
    1.37    /// \pre You need to add all the elements by the \ref insert()
    1.38    /// method.
    1.39 -  template <typename _ItemIntMap>
    1.40 +  template <typename IM>
    1.41    class ExtendFindEnum {
    1.42    public:
    1.43  
    1.44 -    typedef _ItemIntMap ItemIntMap;
    1.45 +    ///\e
    1.46 +    typedef IM ItemIntMap;
    1.47 +    ///\e
    1.48      typedef typename ItemIntMap::Key Item;
    1.49  
    1.50    private:
    1.51 @@ -948,18 +954,18 @@
    1.52    ///
    1.53    /// \pre You need to add all the elements by the \ref insert()
    1.54    /// method.
    1.55 -  ///
    1.56 -  template <typename _Value, typename _ItemIntMap,
    1.57 -            typename _Comp = std::less<_Value> >
    1.58 +  template <typename V, typename IM, typename Comp = std::less<V> >
    1.59    class HeapUnionFind {
    1.60    public:
    1.61  
    1.62 -    typedef _Value Value;
    1.63 -    typedef typename _ItemIntMap::Key Item;
    1.64 -
    1.65 -    typedef _ItemIntMap ItemIntMap;
    1.66 -
    1.67 -    typedef _Comp Comp;
    1.68 +    ///\e
    1.69 +    typedef V Value;
    1.70 +    ///\e
    1.71 +    typedef typename IM::Key Item;
    1.72 +    ///\e
    1.73 +    typedef IM ItemIntMap;
    1.74 +    ///\e
    1.75 +    typedef Comp Compare;
    1.76  
    1.77    private:
    1.78  
    1.79 @@ -1601,7 +1607,7 @@
    1.80  
    1.81      /// \brief Gives back the priority of the current item.
    1.82      ///
    1.83 -    /// \return Gives back the priority of the current item.
    1.84 +    /// Gives back the priority of the current item.
    1.85      const Value& operator[](const Item& item) const {
    1.86        return nodes[index[item]].prio;
    1.87      }
    1.88 @@ -1646,7 +1652,7 @@
    1.89  
    1.90      /// \brief Gives back the minimum priority of the class.
    1.91      ///
    1.92 -    /// \return Gives back the minimum priority of the class.
    1.93 +    /// Gives back the minimum priority of the class.
    1.94      const Value& classPrio(int cls) const {
    1.95        return nodes[~(classes[cls].parent)].prio;
    1.96      }
    1.97 @@ -1660,9 +1666,9 @@
    1.98  
    1.99      /// \brief Gives back a representant item of the class.
   1.100      ///
   1.101 +    /// Gives back a representant item of the class.
   1.102      /// The representant is indpendent from the priorities of the
   1.103      /// items.
   1.104 -    /// \return Gives back a representant item of the class.
   1.105      const Item& classRep(int id) const {
   1.106        int parent = classes[id].parent;
   1.107        return nodes[parent >= 0 ? classes[id].depth : leftNode(id)].item;