diff -r 741f3108a90f -r e997802b855c src/work/marci/experiment/graph_wrapper.h --- a/src/work/marci/experiment/graph_wrapper.h Sat Nov 13 12:24:01 2004 +0000 +++ b/src/work/marci/experiment/graph_wrapper.h Sat Nov 13 12:53:28 2004 +0000 @@ -96,8 +96,8 @@ template< typename It > It first(const Node& v) const { It e; first(e, v); return e; } - Node head(const Edge& e) const { return graph->head(e); } - Node tail(const Edge& e) const { return graph->tail(e); } + Node target(const Edge& e) const { return graph->target(e); } + Node source(const Edge& e) const { return graph->source(e); } template bool valid(const I& i) const { return graph->valid(i); } @@ -114,8 +114,8 @@ return graph->bNode(e); } Node addNode() const { return graph->addNode(); } - Edge addEdge(const Node& tail, const Node& head) const { - return graph->addEdge(tail, head); } + Edge addEdge(const Node& source, const Node& target) const { + return graph->addEdge(source, target); } template void erase(const I& i) const { graph->erase(i); } @@ -245,8 +245,8 @@ template< typename It > It first(const Node& v) const { It e; this->first(e, v); return e; } - Node head(const Edge& e) const { return gw.head(e); } - Node tail(const Edge& e) const { return gw.tail(e); } + Node target(const Edge& e) const { return gw.target(e); } + Node source(const Edge& e) const { return gw.source(e); } template bool valid(const I& i) const { return gw.valid(i); } @@ -260,8 +260,8 @@ template Node bNode(const I& e) const { return gw.bNode(e); } Node addNode() const { return gw.addNode(); } - Edge addEdge(const Node& tail, const Node& head) const { - return gw.addEdge(tail, head); } + Edge addEdge(const Node& source, const Node& target) const { + return gw.addEdge(source, target); } template void erase(const I& i) const { gw.erase(i); } @@ -322,8 +322,8 @@ // template< typename It > It first(const Node& v) const { // It e; first(e, v); return e; } -// Node head(const Edge& e) const { return graph->tail(e); } -// Node tail(const Edge& e) const { return graph->head(e); } +// Node target(const Edge& e) const { return graph->source(e); } +// Node source(const Edge& e) const { return graph->target(e); } // template bool valid(const I& i) const // { return graph->valid(i); } @@ -337,8 +337,8 @@ // return graph->bNode(e); } // Node addNode() const { return graph->addNode(); } -// Edge addEdge(const Node& tail, const Node& head) const { -// return graph->addEdge(tail, head); } +// Edge addEdge(const Node& source, const Node& target) const { +// return graph->addEdge(source, target); } // int nodeNum() const { return graph->nodeNum(); } // int edgeNum() const { return graph->edgeNum(); } @@ -403,8 +403,8 @@ // //template< typename It > It first(const Node& v) const { // // It e; first(e, v); return e; } -// //Node head(const Edge& e) const { return graph->tail(e); } -// //Node tail(const Edge& e) const { return graph->head(e); } +// //Node target(const Edge& e) const { return graph->source(e); } +// //Node source(const Edge& e) const { return graph->target(e); } // //template bool valid(const I& i) const // // { return graph->valid(i); } @@ -418,8 +418,8 @@ // // return graph->bNode(e); } // //Node addNode() const { return graph->addNode(); } -// //Edge addEdge(const Node& tail, const Node& head) const { -// // return graph->addEdge(tail, head); } +// //Edge addEdge(const Node& source, const Node& target) const { +// // return graph->addEdge(source, target); } // //int nodeNum() const { return graph->nodeNum(); } // //int edgeNum() const { return graph->edgeNum(); } @@ -467,10 +467,10 @@ RevGraphWrapper(GraphWrapper _gw) : GraphWrapper(_gw) { } - Node head(const Edge& e) const - { return GraphWrapper::tail(e); } - Node tail(const Edge& e) const - { return GraphWrapper::head(e); } + Node target(const Edge& e) const + { return GraphWrapper::source(e); } + Node source(const Edge& e) const + { return GraphWrapper::target(e); } }; //Subgraph on the same node-set and partial edge-set @@ -599,7 +599,7 @@ // OutEdgeIt& next(OutEdgeIt& e) const { // if (e.out_or_in) { -// Node n=gw.tail(e.out); +// Node n=gw.source(e.out); // gw.next(e.out); // if (!gw.valid(e.out)) { // e.out_or_in=false; @@ -612,9 +612,9 @@ // } // Node aNode(const OutEdgeIt& e) const { -// if (e.out_or_in) return gw.tail(e); else return gw.head(e); } +// if (e.out_or_in) return gw.source(e); else return gw.target(e); } // Node bNode(const OutEdgeIt& e) const { -// if (e.out_or_in) return gw.head(e); else return gw.tail(e); } +// if (e.out_or_in) return gw.target(e); else return gw.source(e); } // typedef OutEdgeIt InEdgeIt; @@ -632,8 +632,8 @@ // template< typename It > It first(const Node& v) const { // It e; first(e, v); return e; } -// Node head(const Edge& e) const { return gw.head(e); } -// Node tail(const Edge& e) const { return gw.tail(e); } +// Node target(const Edge& e) const { return gw.target(e); } +// Node source(const Edge& e) const { return gw.source(e); } // template bool valid(const I& i) const // { return gw.valid(i); } @@ -651,8 +651,8 @@ // Node addNode() const { return gw.addNode(); } // // FIXME: ez igy nem jo, mert nem -// // Edge addEdge(const Node& tail, const Node& head) const { -// // return graph->addEdge(tail, head); } +// // Edge addEdge(const Node& source, const Node& target) const { +// // return graph->addEdge(source, target); } // template void erase(const I& i) const { gw.erase(i); } @@ -798,7 +798,7 @@ OutEdgeIt& next(OutEdgeIt& e) const { if (e.out_or_in) { - Node n=gw.tail(e.out); + Node n=gw.source(e.out); gw.next(e.out); if (!gw.valid(e.out)) { e.out_or_in=false; gw.first(e.in, n); } } else { @@ -808,7 +808,7 @@ } EdgeIt& next(EdgeIt& e) const { - //NodeIt v=tail(e); + //NodeIt v=source(e); gw.next(e.out); while (valid(e.v) && !gw.valid(e.out)) { next(e.v); @@ -826,8 +826,8 @@ template< typename It > It first(const Node& v) const { It e; first(e, v); return e; } -// Node head(const Edge& e) const { return gw.head(e); } -// Node tail(const Edge& e) const { return gw.tail(e); } +// Node target(const Edge& e) const { return gw.target(e); } +// Node source(const Edge& e) const { return gw.source(e); } // template bool valid(const I& i) const // { return gw.valid(i); } @@ -841,15 +841,15 @@ // return graph->bNode(e); } Node aNode(const OutEdgeIt& e) const { - if (e.out_or_in) return gw.tail(e); else return gw.head(e); } + if (e.out_or_in) return gw.source(e); else return gw.target(e); } Node bNode(const OutEdgeIt& e) const { - if (e.out_or_in) return gw.head(e); else return gw.tail(e); } + if (e.out_or_in) return gw.target(e); else return gw.source(e); } // Node addNode() const { return gw.addNode(); } // FIXME: ez igy nem jo, mert nem -// Edge addEdge(const Node& tail, const Node& head) const { -// return graph->addEdge(tail, head); } +// Edge addEdge(const Node& source, const Node& target) const { +// return graph->addEdge(source, target); } // template void erase(const I& i) const { gw.erase(i); } @@ -913,8 +913,8 @@ // template< typename It > It first(Node v) const { // It e; first(e, v); return e; } -// Node head(const Edge& e) const { return graph->head(e); } -// Node tail(const Edge& e) const { return graph->tail(e); } +// Node target(const Edge& e) const { return graph->target(e); } +// Node source(const Edge& e) const { return graph->source(e); } // template Node aNode(const I& e) const { // return graph->aNode(e); } @@ -928,8 +928,8 @@ // //{ return graph->setInvalid(i); } // Node addNode() { return graph->addNode(); } -// Edge addEdge(const Node& tail, const Node& head) { -// return graph->addEdge(tail, head); } +// Edge addEdge(const Node& source, const Node& target) { +// return graph->addEdge(source, target); } // template void erase(const I& i) { graph->erase(i); } @@ -1180,9 +1180,9 @@ return e; } - Node tail(Edge e) const { + Node source(Edge e) const { return ((e.out_or_in) ? gw.aNode(e.out) : gw.aNode(e.in)); } - Node head(Edge e) const { + Node target(Edge e) const { return ((e.out_or_in) ? gw.bNode(e.out) : gw.bNode(e.in)); } Node aNode(OutEdgeIt e) const { @@ -1311,7 +1311,7 @@ void erase(const OutEdgeIt& e) const { OutEdgeIt f=e; this->next(f); - first_out_edges->set(this->tail(e), f); + first_out_edges->set(this->source(e), f); } }; @@ -1381,8 +1381,8 @@ // template< typename It > It first(const Node& v) const { // It e; first(e, v); return e; } -// //Node head(const Edge& e) const { return gw.head(e); } -// //Node tail(const Edge& e) const { return gw.tail(e); } +// //Node target(const Edge& e) const { return gw.target(e); } +// //Node source(const Edge& e) const { return gw.source(e); } // //template bool valid(const I& i) const // // { return gw.valid(i); } @@ -1396,16 +1396,16 @@ // // return gw.bNode(e); } // //Node addNode() const { return gw.addNode(); } -// //Edge addEdge(const Node& tail, const Node& head) const { -// // return gw.addEdge(tail, head); } +// //Edge addEdge(const Node& source, const Node& target) const { +// // return gw.addEdge(source, target); } // //void erase(const OutEdgeIt& e) { -// // first_out_edge(this->tail(e))=e; +// // first_out_edge(this->source(e))=e; // //} // void erase(const Edge& e) { // OutEdgeIt f(e); // next(f); -// first_out_edges.set(this->tail(e), f); +// first_out_edges.set(this->source(e), f); // } // //template void erase(const I& i) const { gw.erase(i); } @@ -1459,7 +1459,7 @@ // OutEdgeIt& first(OutEdgeIt& e, const Node& n) const { // ErasingResGraphWrapper::first(e, n); -// while (valid(e) && (dist.get(tail(e))/*+1!=*/>=dist.get(head(e)))) +// while (valid(e) && (dist.get(source(e))/*+1!=*/>=dist.get(target(e)))) // ErasingResGraphWrapper::next(e); // return e; // } @@ -1470,7 +1470,7 @@ // OutEdgeIt& next(OutEdgeIt& e) const { // ErasingResGraphWrapper::next(e); -// while (valid(e) && (dist.get(tail(e))/*+1!*/>=dist.get(head(e)))) +// while (valid(e) && (dist.get(source(e))/*+1!*/>=dist.get(target(e)))) // ErasingResGraphWrapper::next(e); // return e; // } @@ -1482,9 +1482,9 @@ // void erase(const Edge& e) { // OutEdgeIt f(e); // ErasingResGraphWrapper::next(f); -// while (valid(f) && (dist.get(tail(f))/*+1!=*/>=dist.get(head(f)))) +// while (valid(f) && (dist.get(source(f))/*+1!=*/>=dist.get(target(f)))) // ErasingResGraphWrapper::next(f); -// first_out_edges.set(this->tail(e), f); +// first_out_edges.set(this->source(e), f); // } // //TrivGraphWrapper() : graph(0) { } @@ -1507,8 +1507,8 @@ // template< typename It > It first(const Node& v) const { // It e; first(e, v); return e; } -// //Node head(const Edge& e) const { return gw.head(e); } -// //Node tail(const Edge& e) const { return gw.tail(e); } +// //Node target(const Edge& e) const { return gw.target(e); } +// //Node source(const Edge& e) const { return gw.source(e); } // //template bool valid(const I& i) const // // { return gw.valid(i); } @@ -1525,8 +1525,8 @@ // // return gw.bNode(e); } // //Node addNode() const { return gw.addNode(); } -// //Edge addEdge(const Node& tail, const Node& head) const { -// // return gw.addEdge(tail, head); } +// //Edge addEdge(const Node& source, const Node& target) const { +// // return gw.addEdge(source, target); } // //template void erase(const I& i) const { gw.erase(i); } @@ -1669,8 +1669,8 @@ // template< typename It > It first(Node v) const { // It e; first(e, v); return e; } -// Node head(const Edge& e) const { return gw.head(e); } -// Node tail(const Edge& e) const { return gw.tail(e); } +// Node target(const Edge& e) const { return gw.target(e); } +// Node source(const Edge& e) const { return gw.source(e); } // template Node aNode(const I& e) const { // return gw.aNode(e); } @@ -1684,8 +1684,8 @@ // //{ return gw.setInvalid(i); } // Node addNode() { return gw.addNode(); } -// Edge addEdge(const Node& tail, const Node& head) { -// return gw.addEdge(tail, head); } +// Edge addEdge(const Node& source, const Node& target) { +// return gw.addEdge(source, target); } // template void erase(const I& i) { gw.erase(i); }