[Lemon-commits] [lemon_svn] marci: r337 - hugo/trunk/src/work/marci

Lemon SVN svn at lemon.cs.elte.hu
Mon Nov 6 20:38:51 CET 2006


Author: marci
Date: Tue Mar 23 14:47:31 2004
New Revision: 337

Modified:
   hugo/trunk/src/work/marci/graph_wrapper.h

Log:
.


Modified: hugo/trunk/src/work/marci/graph_wrapper.h
==============================================================================
--- hugo/trunk/src/work/marci/graph_wrapper.h	(original)
+++ hugo/trunk/src/work/marci/graph_wrapper.h	Tue Mar 23 14:47:31 2004
@@ -540,17 +540,24 @@
       operator GraphEdge() const {
 	if (out_or_in) return(out); else return(in);
       }
+//FIXME
+//2 edges are equal if they "refer" to the same physical edge 
+//is it good?
       friend bool operator==(const Edge& u, const Edge& v) { 
 	if (v.out_or_in) 
-	  return (u.out_or_in && u.out==v.out);
+	  if (u.out_or_in) return (u.out==v.out); else return (u.out==v.in);
+	//return (u.out_or_in && u.out==v.out);
 	else
-	  return (!u.out_or_in && u.in==v.in);
+	  if (u.out_or_in) return (u.out==v.in); else return (u.in==v.in);
+	//return (!u.out_or_in && u.in==v.in);
       } 
       friend bool operator!=(const Edge& u, const Edge& v) { 
 	if (v.out_or_in) 
-	  return (!u.out_or_in || u.out!=v.out);
+	  if (u.out_or_in) return (u.out!=v.out); else return (u.out!=v.in);
+	//return (!u.out_or_in || u.out!=v.out);
 	else
-	  return (u.out_or_in || u.in!=v.in);
+	  if (u.out_or_in) return (u.out!=v.in); else return (u.in!=v.in);
+	//return (u.out_or_in || u.in!=v.in);
       } 
     };
 
@@ -561,12 +568,8 @@
       OutEdgeIt(const Invalid& i) : Edge(i) { }
       OutEdgeIt(const UndirGraphWrapper<GraphWrapper>& _G, const Node& n) 
 	: Edge() { 
-	out_or_in=true;
-	_G.gw.first(out, n);
-	if (!(_G.gw.valid(out))) {
-	  out_or_in=false;
-	  _G.gw.first(in, n);
-	}
+	out_or_in=true; _G.gw.first(out, n);
+	if (!(_G.gw.valid(out))) { out_or_in=false; _G.gw.first(in, n);	}
       }
     };
 
@@ -593,12 +596,8 @@
     };
 
     OutEdgeIt& first(OutEdgeIt& e, const Node& n) const {
-      e.out_or_in=true;
-      gw.first(e.out, n);
-      if (!(gw.valid(e.out))) {
-	e.out_or_in=false;
-	gw.first(e.in, n);
-      }
+      e.out_or_in=true; gw.first(e.out, n);
+      if (!(gw.valid(e.out))) { e.out_or_in=false; gw.first(e.in, n); }
       return e;
     }
 
@@ -622,10 +621,7 @@
       if (e.out_or_in) {
 	Node n=gw.tail(e.out);
 	gw.next(e.out);
-	if (!gw.valid(e.out)) {
-	  e.out_or_in=false;
-	  gw.first(e.in, n);
-	}
+	if (!gw.valid(e.out)) { e.out_or_in=false; gw.first(e.in, n); }
       } else {
 	gw.next(e.in);
       }
@@ -643,9 +639,7 @@
     }
 
     template<typename I> I& next(I &i) const { return gw.next(i); }    
-    
-    template<typename I> I getNext(const I& i) const { 
-      return gw.getNext(i); }
+    template<typename I> I getNext(const I& i) const { return gw.getNext(i); }
 
     template< typename It > It first() const { 
       It e; first(e); return e; }



More information about the Lemon-commits mailing list