Erasing unionfind Item template parameter
authordeba
Fri, 24 Nov 2006 14:24:43 +0000
changeset 2308cddae1c4fee6
parent 2307 558cc308a4bd
child 2309 468a525d5b45
Erasing unionfind Item template parameter
lemon/kruskal.h
lemon/max_matching.h
lemon/unionfind.h
test/unionfind_test.cc
     1.1 --- a/lemon/kruskal.h	Tue Nov 21 18:29:31 2006 +0000
     1.2 +++ b/lemon/kruskal.h	Fri Nov 24 14:24:43 2006 +0000
     1.3 @@ -118,7 +118,7 @@
     1.4      typedef typename GR::Node Node;
     1.5  
     1.6      NodeIntMap comp(g);
     1.7 -    UnionFind<Node,NodeIntMap> uf(comp);
     1.8 +    UnionFind<NodeIntMap> uf(comp);
     1.9      for (typename GR::NodeIt it(g); it != INVALID; ++it) {
    1.10        uf.insert(it);
    1.11      }
     2.1 --- a/lemon/max_matching.h	Tue Nov 21 18:29:31 2006 +0000
     2.2 +++ b/lemon/max_matching.h	Fri Nov 24 14:24:43 2006 +0000
     2.3 @@ -66,7 +66,7 @@
     2.4      typedef typename Graph::IncEdgeIt IncEdgeIt;
     2.5  
     2.6      typedef typename Graph::template NodeMap<int> UFECrossRef;
     2.7 -    typedef UnionFindEnum<Node, UFECrossRef> UFE;
     2.8 +    typedef UnionFindEnum<UFECrossRef> UFE;
     2.9  
    2.10    public:
    2.11      
     3.1 --- a/lemon/unionfind.h	Tue Nov 21 18:29:31 2006 +0000
     3.2 +++ b/lemon/unionfind.h	Fri Nov 24 14:24:43 2006 +0000
     3.3 @@ -33,9 +33,8 @@
     3.4  
     3.5  namespace lemon {
     3.6  
     3.7 -  //! \addtogroup auxdat
     3.8 -  //! @{
     3.9 -
    3.10 +  /// \ingroup auxdat
    3.11 +  ///
    3.12    /// \brief A \e Union-Find data structure implementation
    3.13    ///
    3.14    /// The class implements the \e Union-Find data structure. 
    3.15 @@ -51,11 +50,12 @@
    3.16    ///
    3.17    /// \pre You need to add all the elements by the \ref insert()
    3.18    /// method.  
    3.19 -  template <typename Item, typename ItemIntMap>
    3.20 +  template <typename _ItemIntMap>
    3.21    class UnionFind {
    3.22 -    
    3.23    public:
    3.24 -    typedef Item ElementType;
    3.25 +
    3.26 +    typedef _ItemIntMap ItemIntMap;
    3.27 +    typedef typename ItemIntMap::Key Item;
    3.28  
    3.29    private:
    3.30      // If the items vector stores negative value for an item then
    3.31 @@ -146,7 +146,8 @@
    3.32  
    3.33    };
    3.34  
    3.35 -
    3.36 +  /// \ingroup auxdat
    3.37 +  ///
    3.38    /// \brief A \e Union-Find data structure implementation which
    3.39    /// is able to enumerate the components.
    3.40    ///
    3.41 @@ -161,13 +162,13 @@
    3.42    /// \pre You need to add all the elements by the \ref insert()
    3.43    /// method.
    3.44    ///
    3.45 -  template <typename _Item, typename _ItemIntMap>
    3.46 +  template <typename _ItemIntMap>
    3.47    class UnionFindEnum {
    3.48    public:
    3.49      
    3.50 -    typedef _Item Item;
    3.51      typedef _ItemIntMap ItemIntMap;
    3.52 -    
    3.53 +    typedef typename ItemIntMap::Key Item;
    3.54 +
    3.55    private:
    3.56      
    3.57      // If the parent stores negative value for an item then that item
     4.1 --- a/test/unionfind_test.cc	Tue Nov 21 18:29:31 2006 +0000
     4.2 +++ b/test/unionfind_test.cc	Fri Nov 24 14:24:43 2006 +0000
     4.3 @@ -25,7 +25,7 @@
     4.4  using namespace lemon;
     4.5  using namespace std;
     4.6  
     4.7 -typedef UnionFindEnum<int, StdMap<int, int> > UFE;
     4.8 +typedef UnionFindEnum<StdMap<int, int> > UFE;
     4.9  
    4.10  void print(UFE const &ufe) {
    4.11    cout << "Print the classes of the structure:" << endl;