[Lemon-commits] deba: r3084 - in hugo/trunk: lemon test

Lemon SVN svn at lemon.cs.elte.hu
Fri Nov 24 15:24:44 CET 2006


Author: deba
Date: Fri Nov 24 15:24:43 2006
New Revision: 3084

Modified:
   hugo/trunk/lemon/kruskal.h
   hugo/trunk/lemon/max_matching.h
   hugo/trunk/lemon/unionfind.h
   hugo/trunk/test/unionfind_test.cc

Log:
Erasing unionfind Item template parameter




Modified: hugo/trunk/lemon/kruskal.h
==============================================================================
--- hugo/trunk/lemon/kruskal.h	(original)
+++ hugo/trunk/lemon/kruskal.h	Fri Nov 24 15:24:43 2006
@@ -118,7 +118,7 @@
     typedef typename GR::Node Node;
 
     NodeIntMap comp(g);
-    UnionFind<Node,NodeIntMap> uf(comp);
+    UnionFind<NodeIntMap> uf(comp);
     for (typename GR::NodeIt it(g); it != INVALID; ++it) {
       uf.insert(it);
     }

Modified: hugo/trunk/lemon/max_matching.h
==============================================================================
--- hugo/trunk/lemon/max_matching.h	(original)
+++ hugo/trunk/lemon/max_matching.h	Fri Nov 24 15:24:43 2006
@@ -66,7 +66,7 @@
     typedef typename Graph::IncEdgeIt IncEdgeIt;
 
     typedef typename Graph::template NodeMap<int> UFECrossRef;
-    typedef UnionFindEnum<Node, UFECrossRef> UFE;
+    typedef UnionFindEnum<UFECrossRef> UFE;
 
   public:
     

Modified: hugo/trunk/lemon/unionfind.h
==============================================================================
--- hugo/trunk/lemon/unionfind.h	(original)
+++ hugo/trunk/lemon/unionfind.h	Fri Nov 24 15:24:43 2006
@@ -33,9 +33,8 @@
 
 namespace lemon {
 
-  //! \addtogroup auxdat
-  //! @{
-
+  /// \ingroup auxdat
+  ///
   /// \brief A \e Union-Find data structure implementation
   ///
   /// The class implements the \e Union-Find data structure. 
@@ -51,11 +50,12 @@
   ///
   /// \pre You need to add all the elements by the \ref insert()
   /// method.  
-  template <typename Item, typename ItemIntMap>
+  template <typename _ItemIntMap>
   class UnionFind {
-    
   public:
-    typedef Item ElementType;
+
+    typedef _ItemIntMap ItemIntMap;
+    typedef typename ItemIntMap::Key Item;
 
   private:
     // If the items vector stores negative value for an item then
@@ -146,7 +146,8 @@
 
   };
 
-
+  /// \ingroup auxdat
+  ///
   /// \brief A \e Union-Find data structure implementation which
   /// is able to enumerate the components.
   ///
@@ -161,13 +162,13 @@
   /// \pre You need to add all the elements by the \ref insert()
   /// method.
   ///
-  template <typename _Item, typename _ItemIntMap>
+  template <typename _ItemIntMap>
   class UnionFindEnum {
   public:
     
-    typedef _Item Item;
     typedef _ItemIntMap ItemIntMap;
-    
+    typedef typename ItemIntMap::Key Item;
+
   private:
     
     // If the parent stores negative value for an item then that item

Modified: hugo/trunk/test/unionfind_test.cc
==============================================================================
--- hugo/trunk/test/unionfind_test.cc	(original)
+++ hugo/trunk/test/unionfind_test.cc	Fri Nov 24 15:24:43 2006
@@ -25,7 +25,7 @@
 using namespace lemon;
 using namespace std;
 
-typedef UnionFindEnum<int, StdMap<int, int> > UFE;
+typedef UnionFindEnum<StdMap<int, int> > UFE;
 
 void print(UFE const &ufe) {
   cout << "Print the classes of the structure:" << endl;



More information about the Lemon-commits mailing list