# HG changeset patch # User alpar # Date 1078242327 0 # Node ID 07c32a103bbb8e9aa9519533637d96570f7dd2b7 # Parent a1323efc5753829d5ed5bbf9a2b44872e2091562 next() -> getNext() goNext() -> next() diff -r a1323efc5753 -r 07c32a103bbb src/work/alpar/emptygraph.h --- a/src/work/alpar/emptygraph.h Tue Mar 02 14:51:13 2004 +0000 +++ b/src/work/alpar/emptygraph.h Tue Mar 02 15:45:27 2004 +0000 @@ -1,8 +1,9 @@ // -*-mode: c++; -*- -class Graph +class EmptyGraph { public: + class EdgeIt {}; class InEdgeIt : public EdgeIt {}; @@ -18,17 +19,17 @@ SymEdgeIt &getFirst(SymEdgeIt &, NodeIt) const {} EachEdgeIt &getFirst(EachEdgeIt &) const {} - NodeIt next(NodeIt) const {} - InEdgeIt next(InEdgeIt) const {} - OutEdgeIt next(OutEdgeIt) const {} - SymEdgeIt next(SymEdgeIt) const {} - EachEdgeIt next(EachEdgeIt) const {} + NodeIt getNext(NodeIt) const {} + InEdgeIt getNext(InEdgeIt) const {} + OutEdgeIt getNext(OutEdgeIt) const {} + SymEdgeIt getNext(SymEdgeIt) const {} + EachEdgeIt getNext(EachEdgeIt) const {} - NodeIt &goNext(NodeIt &) const {} - InEdgeIt &goNext(InEdgeIt &) const {} - OutEdgeIt &goNext(OutEdgeIt &) const {} - SymEdgeIt &goNext(SymEdgeIt &) const {} - EachEdgeIt &goNext(EachEdgeIt &) const {} + NodeIt &next(NodeIt &) const {} + InEdgeIt &next(InEdgeIt &) const {} + OutEdgeIt &next(OutEdgeIt &) const {} + SymEdgeIt &next(SymEdgeIt &) const {} + EachEdgeIt &next(EachEdgeIt &) const {} NodeIt head(EdgeIt) const {} NodeIt tail(EdgeIt) const {} @@ -81,3 +82,19 @@ EdgeMap(const Graph &G, T t) {} }; }; + +class EmptyBipGraph : public EmptyGraph +{ + class ANodeIt {}; + class BNodeIt {}; + + ANodeIt &next(ANodeIt &) {} + BNodeIt &next(BNodeIt &) {} + + ANodeIt &getFirst(ANodeIt &) const {} + BNodeIt &getFirst(BNodeIt &) const {} + + enum NodeClass { A = 0, B = 1 }; + NodeClass getClass(NodeIt n) {} + +} diff -r a1323efc5753 -r 07c32a103bbb src/work/alpar/gwrapper.h --- a/src/work/alpar/gwrapper.h Tue Mar 02 14:51:13 2004 +0000 +++ b/src/work/alpar/gwrapper.h Tue Mar 02 15:45:27 2004 +0000 @@ -117,6 +117,61 @@ }; template +class RevGraphExt : public G +{ +public: + // typedef G BaseGraph; + + typedef typename G::EdgeIt EdgeIt; + + typedef typename G::InEdgeIt OutEdgeIt; + typedef typename G::OutEdgeIt InEdgeIt; + typedef typename G::SymEdgeIt SymEdgeIt; + typedef typename G::EachEdgeIt EachEdgeIt; + + typedef typename G::NodeIt NodeIt; + +// template I &getFirst(I &i); { return graph->getFirst(i); } +// template I &getFirst(I &i,const P &p); +// { return graph->getFirst(i,p); } +// template I next(const I i); { return graph->goNext(i); } +// template I &goNext(I &i); { return graph->goNext(i); } + + NodeIt head(const EdgeIt &e); + { return G::tail(e); } + NodeIt tail(const EdgeIt &e); + { return G::head(e); } + +// template NodeIt aNode(const I e); +// { return graph->aNode(e); } +// template NodeIt bNode(const I e); +// { return graph->bNode(e); } + +// template bool valid(const I i); +// { return graph->valid(i); } + +// template void setInvalid(const I &i); +// { return graph->setInvalid(i); } + +// NodeIt addNode(); { return graph->addNode(); } + + EdgeIt addEdge(const NodeIt from,const NodeIt to); + { return G::addEdge(to,from); } + +// template void delete(I i); { graph->delete(i); } + +// void clean(); { graph->clean(); } + +// template class NodeMap : public typename G::NodeMap; +// template class EdgeMap : public typename G::EdgeMap; + +// void SetG(G &g) {graph = &g;} + +// RevGraphWrapper() {graph = NULL;} +// RevGraphWrapper(G &g) {graph = &g;} +}; + +template class SymGraphWrapper { G *graph; @@ -173,6 +228,23 @@ }; + + + + + + + + + + + + + + + + + // FIXME: comparison should be made better!!! template class ResGraphWrapper