Index: lemon/core.h
===================================================================
--- lemon/core.h	(revision 609)
+++ lemon/core.h	(revision 634)
@@ -3,5 +3,5 @@
  * This file is a part of LEMON, a generic C++ optimization library.
  *
- * Copyright (C) 2003-2009
+ * Copyright (C) 2003-2008
  * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
  * (Egervary Research Group on Combinatorial Optimization, EGRES).
@@ -23,5 +23,5 @@
 #include <algorithm>
 
-#include <lemon/core.h>
+#include <lemon/config.h>
 #include <lemon/bits/enable_if.h>
 #include <lemon/bits/traits.h>
@@ -1035,12 +1035,13 @@
   ///\sa findArc()
   ///\sa ArcLookUp, AllArcLookUp, DynArcLookUp
-  template <typename GR>
-  class ConArcIt : public GR::Arc {
-    typedef typename GR::Arc Parent;
-
+  template <typename _Graph>
+  class ConArcIt : public _Graph::Arc {
   public:
 
-    typedef typename GR::Arc Arc;
-    typedef typename GR::Node Node;
+    typedef _Graph Graph;
+    typedef typename Graph::Arc Parent;
+
+    typedef typename Graph::Arc Arc;
+    typedef typename Graph::Node Node;
 
     /// \brief Constructor.
@@ -1048,5 +1049,5 @@
     /// Construct a new ConArcIt iterating on the arcs that
     /// connects nodes \c u and \c v.
-    ConArcIt(const GR& g, Node u, Node v) : _graph(g) {
+    ConArcIt(const Graph& g, Node u, Node v) : _graph(g) {
       Parent::operator=(findArc(_graph, u, v));
     }
@@ -1055,5 +1056,5 @@
     ///
     /// Construct a new ConArcIt that continues the iterating from arc \c a.
-    ConArcIt(const GR& g, Arc a) : Parent(a), _graph(g) {}
+    ConArcIt(const Graph& g, Arc a) : Parent(a), _graph(g) {}
 
     /// \brief Increment operator.
@@ -1066,5 +1067,5 @@
     }
   private:
-    const GR& _graph;
+    const Graph& _graph;
   };
 
@@ -1157,12 +1158,13 @@
   ///
   ///\sa findEdge()
-  template <typename GR>
-  class ConEdgeIt : public GR::Edge {
-    typedef typename GR::Edge Parent;
-
+  template <typename _Graph>
+  class ConEdgeIt : public _Graph::Edge {
   public:
 
-    typedef typename GR::Edge Edge;
-    typedef typename GR::Node Node;
+    typedef _Graph Graph;
+    typedef typename Graph::Edge Parent;
+
+    typedef typename Graph::Edge Edge;
+    typedef typename Graph::Node Node;
 
     /// \brief Constructor.
@@ -1170,5 +1172,5 @@
     /// Construct a new ConEdgeIt iterating on the edges that
     /// connects nodes \c u and \c v.
-    ConEdgeIt(const GR& g, Node u, Node v) : _graph(g), _u(u), _v(v) {
+    ConEdgeIt(const Graph& g, Node u, Node v) : _graph(g), _u(u), _v(v) {
       Parent::operator=(findEdge(_graph, _u, _v));
     }
@@ -1177,5 +1179,5 @@
     ///
     /// Construct a new ConEdgeIt that continues iterating from edge \c e.
-    ConEdgeIt(const GR& g, Edge e) : Parent(e), _graph(g) {}
+    ConEdgeIt(const Graph& g, Edge e) : Parent(e), _graph(g) {}
 
     /// \brief Increment operator.
@@ -1187,5 +1189,5 @@
     }
   private:
-    const GR& _graph;
+    const Graph& _graph;
     Node _u, _v;
   };
@@ -1210,30 +1212,27 @@
   ///queries.
   ///
-  ///\tparam GR The type of the underlying digraph.
+  ///\tparam G The type of the underlying digraph.
   ///
   ///\sa ArcLookUp
   ///\sa AllArcLookUp
-  template <typename GR>
+  template<class G>
   class DynArcLookUp
-    : protected ItemSetTraits<GR, typename GR::Arc>::ItemNotifier::ObserverBase
+    : protected ItemSetTraits<G, typename G::Arc>::ItemNotifier::ObserverBase
   {
-    typedef typename ItemSetTraits<GR, typename GR::Arc>
+  public:
+    typedef typename ItemSetTraits<G, typename G::Arc>
     ::ItemNotifier::ObserverBase Parent;
 
-    TEMPLATE_DIGRAPH_TYPEDEFS(GR);
-
-  public:
-
-    /// The Digraph type
-    typedef GR Digraph;
+    TEMPLATE_DIGRAPH_TYPEDEFS(G);
+    typedef G Digraph;
 
   protected:
 
-    class AutoNodeMap : public ItemSetTraits<GR, Node>::template Map<Arc>::Type {
-      typedef typename ItemSetTraits<GR, Node>::template Map<Arc>::Type Parent;
-
+    class AutoNodeMap : public ItemSetTraits<G, Node>::template Map<Arc>::Type {
     public:
 
-      AutoNodeMap(const GR& digraph) : Parent(digraph, INVALID) {}
+      typedef typename ItemSetTraits<G, Node>::template Map<Arc>::Type Parent;
+
+      AutoNodeMap(const G& digraph) : Parent(digraph, INVALID) {}
 
       virtual void add(const Node& node) {
@@ -1258,4 +1257,10 @@
       }
     };
+
+    const Digraph &_g;
+    AutoNodeMap _head;
+    typename Digraph::template ArcMap<Arc> _parent;
+    typename Digraph::template ArcMap<Arc> _left;
+    typename Digraph::template ArcMap<Arc> _right;
 
     class ArcLess {
@@ -1269,12 +1274,4 @@
     };
 
-  protected: 
-
-    const Digraph &_g;
-    AutoNodeMap _head;
-    typename Digraph::template ArcMap<Arc> _parent;
-    typename Digraph::template ArcMap<Arc> _left;
-    typename Digraph::template ArcMap<Arc> _right;
-
   public:
 
@@ -1319,5 +1316,5 @@
     virtual void clear() {
       for(NodeIt n(_g);n!=INVALID;++n) {
-        _head[n] = INVALID;
+        _head.set(n, INVALID);
       }
     }
@@ -1326,11 +1323,11 @@
       Node s = _g.source(arc);
       Node t = _g.target(arc);
-      _left[arc] = INVALID;
-      _right[arc] = INVALID;
+      _left.set(arc, INVALID);
+      _right.set(arc, INVALID);
 
       Arc e = _head[s];
       if (e == INVALID) {
-        _head[s] = arc;
-        _parent[arc] = INVALID;
+        _head.set(s, arc);
+        _parent.set(arc, INVALID);
         return;
       }
@@ -1338,6 +1335,6 @@
         if (t < _g.target(e)) {
           if (_left[e] == INVALID) {
-            _left[e] = arc;
-            _parent[arc] = e;
+            _left.set(e, arc);
+            _parent.set(arc, e);
             splay(arc);
             return;
@@ -1347,6 +1344,6 @@
         } else {
           if (_right[e] == INVALID) {
-            _right[e] = arc;
-            _parent[arc] = e;
+            _right.set(e, arc);
+            _parent.set(arc, e);
             splay(arc);
             return;
@@ -1361,25 +1358,25 @@
       if (_left[arc] == INVALID) {
         if (_right[arc] != INVALID) {
-          _parent[_right[arc]] = _parent[arc];
+          _parent.set(_right[arc], _parent[arc]);
         }
         if (_parent[arc] != INVALID) {
           if (_left[_parent[arc]] == arc) {
-            _left[_parent[arc]] = _right[arc];
+            _left.set(_parent[arc], _right[arc]);
           } else {
-            _right[_parent[arc]] = _right[arc];
+            _right.set(_parent[arc], _right[arc]);
           }
         } else {
-          _head[_g.source(arc)] = _right[arc];
+          _head.set(_g.source(arc), _right[arc]);
         }
       } else if (_right[arc] == INVALID) {
-        _parent[_left[arc]] = _parent[arc];
+        _parent.set(_left[arc], _parent[arc]);
         if (_parent[arc] != INVALID) {
           if (_left[_parent[arc]] == arc) {
-            _left[_parent[arc]] = _left[arc];
+            _left.set(_parent[arc], _left[arc]);
           } else {
-            _right[_parent[arc]] = _left[arc];
+            _right.set(_parent[arc], _left[arc]);
           }
         } else {
-          _head[_g.source(arc)] = _left[arc];
+          _head.set(_g.source(arc), _left[arc]);
         }
       } else {
@@ -1391,36 +1388,36 @@
           }
           Arc s = _parent[e];
-          _right[_parent[e]] = _left[e];
+          _right.set(_parent[e], _left[e]);
           if (_left[e] != INVALID) {
-            _parent[_left[e]] = _parent[e];
+            _parent.set(_left[e], _parent[e]);
           }
 
-          _left[e] = _left[arc];
-          _parent[_left[arc]] = e;
-          _right[e] = _right[arc];
-          _parent[_right[arc]] = e;
-
-          _parent[e] = _parent[arc];
+          _left.set(e, _left[arc]);
+          _parent.set(_left[arc], e);
+          _right.set(e, _right[arc]);
+          _parent.set(_right[arc], e);
+
+          _parent.set(e, _parent[arc]);
           if (_parent[arc] != INVALID) {
             if (_left[_parent[arc]] == arc) {
-              _left[_parent[arc]] = e;
+              _left.set(_parent[arc], e);
             } else {
-              _right[_parent[arc]] = e;
+              _right.set(_parent[arc], e);
             }
           }
           splay(s);
         } else {
-          _right[e] = _right[arc];
-          _parent[_right[arc]] = e;
-          _parent[e] = _parent[arc];
+          _right.set(e, _right[arc]);
+          _parent.set(_right[arc], e);
+          _parent.set(e, _parent[arc]);
 
           if (_parent[arc] != INVALID) {
             if (_left[_parent[arc]] == arc) {
-              _left[_parent[arc]] = e;
+              _left.set(_parent[arc], e);
             } else {
-              _right[_parent[arc]] = e;
+              _right.set(_parent[arc], e);
             }
           } else {
-            _head[_g.source(arc)] = e;
+            _head.set(_g.source(arc), e);
           }
         }
@@ -1434,15 +1431,15 @@
       if (a < m) {
         Arc left = refreshRec(v,a,m-1);
-        _left[me] = left;
-        _parent[left] = me;
+        _left.set(me, left);
+        _parent.set(left, me);
       } else {
-        _left[me] = INVALID;
+        _left.set(me, INVALID);
       }
       if (m < b) {
         Arc right = refreshRec(v,m+1,b);
-        _right[me] = right;
-        _parent[right] = me;
+        _right.set(me, right);
+        _parent.set(right, me);
       } else {
-        _right[me] = INVALID;
+        _right.set(me, INVALID);
       }
       return me;
@@ -1456,8 +1453,8 @@
           std::sort(v.begin(),v.end(),ArcLess(_g));
           Arc head = refreshRec(v,0,v.size()-1);
-          _head[n] = head;
-          _parent[head] = INVALID;
-        }
-        else _head[n] = INVALID;
+          _head.set(n, head);
+          _parent.set(head, INVALID);
+        }
+        else _head.set(n, INVALID);
       }
     }
@@ -1465,17 +1462,17 @@
     void zig(Arc v) {
       Arc w = _parent[v];
-      _parent[v] = _parent[w];
-      _parent[w] = v;
-      _left[w] = _right[v];
-      _right[v] = w;
+      _parent.set(v, _parent[w]);
+      _parent.set(w, v);
+      _left.set(w, _right[v]);
+      _right.set(v, w);
       if (_parent[v] != INVALID) {
         if (_right[_parent[v]] == w) {
-          _right[_parent[v]] = v;
+          _right.set(_parent[v], v);
         } else {
-          _left[_parent[v]] = v;
+          _left.set(_parent[v], v);
         }
       }
       if (_left[w] != INVALID){
-        _parent[_left[w]] = w;
+        _parent.set(_left[w], w);
       }
     }
@@ -1483,17 +1480,17 @@
     void zag(Arc v) {
       Arc w = _parent[v];
-      _parent[v] = _parent[w];
-      _parent[w] = v;
-      _right[w] = _left[v];
-      _left[v] = w;
+      _parent.set(v, _parent[w]);
+      _parent.set(w, v);
+      _right.set(w, _left[v]);
+      _left.set(v, w);
       if (_parent[v] != INVALID){
         if (_left[_parent[v]] == w) {
-          _left[_parent[v]] = v;
+          _left.set(_parent[v], v);
         } else {
-          _right[_parent[v]] = v;
+          _right.set(_parent[v], v);
         }
       }
       if (_right[w] != INVALID){
-        _parent[_right[w]] = w;
+        _parent.set(_right[w], w);
       }
     }
@@ -1627,17 +1624,14 @@
   ///(<em>O</em>(<em>m</em> log<em>m</em>)) to the number of arcs).
   ///
-  ///\tparam GR The type of the underlying digraph.
+  ///\tparam G The type of the underlying digraph.
   ///
   ///\sa DynArcLookUp
   ///\sa AllArcLookUp
-  template<class GR>
+  template<class G>
   class ArcLookUp
   {
-    TEMPLATE_DIGRAPH_TYPEDEFS(GR);
-
   public:
-
-    /// The Digraph type
-    typedef GR Digraph;
+    TEMPLATE_DIGRAPH_TYPEDEFS(G);
+    typedef G Digraph;
 
   protected:
@@ -1740,19 +1734,20 @@
   ///(<em>O</em>(<em>m</em> log<em>m</em>)) to the number of arcs).
   ///
-  ///\tparam GR The type of the underlying digraph.
+  ///\tparam G The type of the underlying digraph.
   ///
   ///\sa DynArcLookUp
   ///\sa ArcLookUp
-  template<class GR>
-  class AllArcLookUp : public ArcLookUp<GR>
+  template<class G>
+  class AllArcLookUp : public ArcLookUp<G>
   {
-    using ArcLookUp<GR>::_g;
-    using ArcLookUp<GR>::_right;
-    using ArcLookUp<GR>::_left;
-    using ArcLookUp<GR>::_head;
-
-    TEMPLATE_DIGRAPH_TYPEDEFS(GR);
-
-    typename GR::template ArcMap<Arc> _next;
+    using ArcLookUp<G>::_g;
+    using ArcLookUp<G>::_right;
+    using ArcLookUp<G>::_left;
+    using ArcLookUp<G>::_head;
+
+    TEMPLATE_DIGRAPH_TYPEDEFS(G);
+    typedef G Digraph;
+
+    typename Digraph::template ArcMap<Arc> _next;
 
     Arc refreshNext(Arc head,Arc next=INVALID)
@@ -1773,8 +1768,4 @@
 
   public:
-
-    /// The Digraph type
-    typedef GR Digraph;
-
     ///Constructor
 
@@ -1783,5 +1774,5 @@
     ///It builds up the search database, which remains valid until the digraph
     ///changes.
-    AllArcLookUp(const Digraph &g) : ArcLookUp<GR>(g), _next(g) {refreshNext();}
+    AllArcLookUp(const Digraph &g) : ArcLookUp<G>(g), _next(g) {refreshNext();}
 
     ///Refresh the data structure at a node.
@@ -1793,5 +1784,5 @@
     void refresh(Node n)
     {
-      ArcLookUp<GR>::refresh(n);
+      ArcLookUp<G>::refresh(n);
       refreshNext(_head[n]);
     }
@@ -1840,5 +1831,5 @@
     Arc operator()(Node s, Node t, Arc prev=INVALID) const {}
 #else
-    using ArcLookUp<GR>::operator() ;
+    using ArcLookUp<G>::operator() ;
     Arc operator()(Node s, Node t, Arc prev) const
     {
