# HG changeset patch # User marci # Date 1080049651 0 # Node ID 3f76d1aa9d370a843193374fa540316be0d5949f # Parent ad3bdd78f4f69548b915a73cc08cf39328f6351b . diff -r ad3bdd78f4f6 -r 3f76d1aa9d37 src/work/marci/graph_wrapper.h --- a/src/work/marci/graph_wrapper.h Tue Mar 23 13:31:02 2004 +0000 +++ b/src/work/marci/graph_wrapper.h Tue Mar 23 13:47:31 2004 +0000 @@ -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& _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 I& next(I &i) const { return gw.next(i); } - - template I getNext(const I& i) const { - return gw.getNext(i); } + template I getNext(const I& i) const { return gw.getNext(i); } template< typename It > It first() const { It e; first(e); return e; }