1.1 --- a/src/work/marci/experiment/graph_wrapper.h Sat Nov 13 12:24:01 2004 +0000
1.2 +++ b/src/work/marci/experiment/graph_wrapper.h Sat Nov 13 12:53:28 2004 +0000
1.3 @@ -96,8 +96,8 @@
1.4 template< typename It > It first(const Node& v) const {
1.5 It e; first(e, v); return e; }
1.6
1.7 - Node head(const Edge& e) const { return graph->head(e); }
1.8 - Node tail(const Edge& e) const { return graph->tail(e); }
1.9 + Node target(const Edge& e) const { return graph->target(e); }
1.10 + Node source(const Edge& e) const { return graph->source(e); }
1.11
1.12 template<typename I> bool valid(const I& i) const
1.13 { return graph->valid(i); }
1.14 @@ -114,8 +114,8 @@
1.15 return graph->bNode(e); }
1.16
1.17 Node addNode() const { return graph->addNode(); }
1.18 - Edge addEdge(const Node& tail, const Node& head) const {
1.19 - return graph->addEdge(tail, head); }
1.20 + Edge addEdge(const Node& source, const Node& target) const {
1.21 + return graph->addEdge(source, target); }
1.22
1.23 template<typename I> void erase(const I& i) const { graph->erase(i); }
1.24
1.25 @@ -245,8 +245,8 @@
1.26 template< typename It > It first(const Node& v) const {
1.27 It e; this->first(e, v); return e; }
1.28
1.29 - Node head(const Edge& e) const { return gw.head(e); }
1.30 - Node tail(const Edge& e) const { return gw.tail(e); }
1.31 + Node target(const Edge& e) const { return gw.target(e); }
1.32 + Node source(const Edge& e) const { return gw.source(e); }
1.33
1.34 template<typename I> bool valid(const I& i) const { return gw.valid(i); }
1.35
1.36 @@ -260,8 +260,8 @@
1.37 template<typename I> Node bNode(const I& e) const { return gw.bNode(e); }
1.38
1.39 Node addNode() const { return gw.addNode(); }
1.40 - Edge addEdge(const Node& tail, const Node& head) const {
1.41 - return gw.addEdge(tail, head); }
1.42 + Edge addEdge(const Node& source, const Node& target) const {
1.43 + return gw.addEdge(source, target); }
1.44
1.45 template<typename I> void erase(const I& i) const { gw.erase(i); }
1.46
1.47 @@ -322,8 +322,8 @@
1.48 // template< typename It > It first(const Node& v) const {
1.49 // It e; first(e, v); return e; }
1.50
1.51 -// Node head(const Edge& e) const { return graph->tail(e); }
1.52 -// Node tail(const Edge& e) const { return graph->head(e); }
1.53 +// Node target(const Edge& e) const { return graph->source(e); }
1.54 +// Node source(const Edge& e) const { return graph->target(e); }
1.55
1.56 // template<typename I> bool valid(const I& i) const
1.57 // { return graph->valid(i); }
1.58 @@ -337,8 +337,8 @@
1.59 // return graph->bNode(e); }
1.60
1.61 // Node addNode() const { return graph->addNode(); }
1.62 -// Edge addEdge(const Node& tail, const Node& head) const {
1.63 -// return graph->addEdge(tail, head); }
1.64 +// Edge addEdge(const Node& source, const Node& target) const {
1.65 +// return graph->addEdge(source, target); }
1.66
1.67 // int nodeNum() const { return graph->nodeNum(); }
1.68 // int edgeNum() const { return graph->edgeNum(); }
1.69 @@ -403,8 +403,8 @@
1.70 // //template< typename It > It first(const Node& v) const {
1.71 // // It e; first(e, v); return e; }
1.72
1.73 -// //Node head(const Edge& e) const { return graph->tail(e); }
1.74 -// //Node tail(const Edge& e) const { return graph->head(e); }
1.75 +// //Node target(const Edge& e) const { return graph->source(e); }
1.76 +// //Node source(const Edge& e) const { return graph->target(e); }
1.77
1.78 // //template<typename I> bool valid(const I& i) const
1.79 // // { return graph->valid(i); }
1.80 @@ -418,8 +418,8 @@
1.81 // // return graph->bNode(e); }
1.82
1.83 // //Node addNode() const { return graph->addNode(); }
1.84 -// //Edge addEdge(const Node& tail, const Node& head) const {
1.85 -// // return graph->addEdge(tail, head); }
1.86 +// //Edge addEdge(const Node& source, const Node& target) const {
1.87 +// // return graph->addEdge(source, target); }
1.88
1.89 // //int nodeNum() const { return graph->nodeNum(); }
1.90 // //int edgeNum() const { return graph->edgeNum(); }
1.91 @@ -467,10 +467,10 @@
1.92 RevGraphWrapper(GraphWrapper _gw) :
1.93 GraphWrapper<GraphWrapper>(_gw) { }
1.94
1.95 - Node head(const Edge& e) const
1.96 - { return GraphWrapper<GraphWrapper>::tail(e); }
1.97 - Node tail(const Edge& e) const
1.98 - { return GraphWrapper<GraphWrapper>::head(e); }
1.99 + Node target(const Edge& e) const
1.100 + { return GraphWrapper<GraphWrapper>::source(e); }
1.101 + Node source(const Edge& e) const
1.102 + { return GraphWrapper<GraphWrapper>::target(e); }
1.103 };
1.104
1.105 //Subgraph on the same node-set and partial edge-set
1.106 @@ -599,7 +599,7 @@
1.107
1.108 // OutEdgeIt& next(OutEdgeIt& e) const {
1.109 // if (e.out_or_in) {
1.110 -// Node n=gw.tail(e.out);
1.111 +// Node n=gw.source(e.out);
1.112 // gw.next(e.out);
1.113 // if (!gw.valid(e.out)) {
1.114 // e.out_or_in=false;
1.115 @@ -612,9 +612,9 @@
1.116 // }
1.117
1.118 // Node aNode(const OutEdgeIt& e) const {
1.119 -// if (e.out_or_in) return gw.tail(e); else return gw.head(e); }
1.120 +// if (e.out_or_in) return gw.source(e); else return gw.target(e); }
1.121 // Node bNode(const OutEdgeIt& e) const {
1.122 -// if (e.out_or_in) return gw.head(e); else return gw.tail(e); }
1.123 +// if (e.out_or_in) return gw.target(e); else return gw.source(e); }
1.124
1.125 // typedef OutEdgeIt InEdgeIt;
1.126
1.127 @@ -632,8 +632,8 @@
1.128 // template< typename It > It first(const Node& v) const {
1.129 // It e; first(e, v); return e; }
1.130
1.131 -// Node head(const Edge& e) const { return gw.head(e); }
1.132 -// Node tail(const Edge& e) const { return gw.tail(e); }
1.133 +// Node target(const Edge& e) const { return gw.target(e); }
1.134 +// Node source(const Edge& e) const { return gw.source(e); }
1.135
1.136 // template<typename I> bool valid(const I& i) const
1.137 // { return gw.valid(i); }
1.138 @@ -651,8 +651,8 @@
1.139
1.140 // Node addNode() const { return gw.addNode(); }
1.141 // // FIXME: ez igy nem jo, mert nem
1.142 -// // Edge addEdge(const Node& tail, const Node& head) const {
1.143 -// // return graph->addEdge(tail, head); }
1.144 +// // Edge addEdge(const Node& source, const Node& target) const {
1.145 +// // return graph->addEdge(source, target); }
1.146
1.147 // template<typename I> void erase(const I& i) const { gw.erase(i); }
1.148
1.149 @@ -798,7 +798,7 @@
1.150
1.151 OutEdgeIt& next(OutEdgeIt& e) const {
1.152 if (e.out_or_in) {
1.153 - Node n=gw.tail(e.out);
1.154 + Node n=gw.source(e.out);
1.155 gw.next(e.out);
1.156 if (!gw.valid(e.out)) { e.out_or_in=false; gw.first(e.in, n); }
1.157 } else {
1.158 @@ -808,7 +808,7 @@
1.159 }
1.160
1.161 EdgeIt& next(EdgeIt& e) const {
1.162 - //NodeIt v=tail(e);
1.163 + //NodeIt v=source(e);
1.164 gw.next(e.out);
1.165 while (valid(e.v) && !gw.valid(e.out)) {
1.166 next(e.v);
1.167 @@ -826,8 +826,8 @@
1.168 template< typename It > It first(const Node& v) const {
1.169 It e; first(e, v); return e; }
1.170
1.171 -// Node head(const Edge& e) const { return gw.head(e); }
1.172 -// Node tail(const Edge& e) const { return gw.tail(e); }
1.173 +// Node target(const Edge& e) const { return gw.target(e); }
1.174 +// Node source(const Edge& e) const { return gw.source(e); }
1.175
1.176 // template<typename I> bool valid(const I& i) const
1.177 // { return gw.valid(i); }
1.178 @@ -841,15 +841,15 @@
1.179 // return graph->bNode(e); }
1.180
1.181 Node aNode(const OutEdgeIt& e) const {
1.182 - if (e.out_or_in) return gw.tail(e); else return gw.head(e); }
1.183 + if (e.out_or_in) return gw.source(e); else return gw.target(e); }
1.184 Node bNode(const OutEdgeIt& e) const {
1.185 - if (e.out_or_in) return gw.head(e); else return gw.tail(e); }
1.186 + if (e.out_or_in) return gw.target(e); else return gw.source(e); }
1.187
1.188 // Node addNode() const { return gw.addNode(); }
1.189
1.190 // FIXME: ez igy nem jo, mert nem
1.191 -// Edge addEdge(const Node& tail, const Node& head) const {
1.192 -// return graph->addEdge(tail, head); }
1.193 +// Edge addEdge(const Node& source, const Node& target) const {
1.194 +// return graph->addEdge(source, target); }
1.195
1.196 // template<typename I> void erase(const I& i) const { gw.erase(i); }
1.197
1.198 @@ -913,8 +913,8 @@
1.199 // template< typename It > It first(Node v) const {
1.200 // It e; first(e, v); return e; }
1.201
1.202 -// Node head(const Edge& e) const { return graph->head(e); }
1.203 -// Node tail(const Edge& e) const { return graph->tail(e); }
1.204 +// Node target(const Edge& e) const { return graph->target(e); }
1.205 +// Node source(const Edge& e) const { return graph->source(e); }
1.206
1.207 // template<typename I> Node aNode(const I& e) const {
1.208 // return graph->aNode(e); }
1.209 @@ -928,8 +928,8 @@
1.210 // //{ return graph->setInvalid(i); }
1.211
1.212 // Node addNode() { return graph->addNode(); }
1.213 -// Edge addEdge(const Node& tail, const Node& head) {
1.214 -// return graph->addEdge(tail, head); }
1.215 +// Edge addEdge(const Node& source, const Node& target) {
1.216 +// return graph->addEdge(source, target); }
1.217
1.218 // template<typename I> void erase(const I& i) { graph->erase(i); }
1.219
1.220 @@ -1180,9 +1180,9 @@
1.221 return e;
1.222 }
1.223
1.224 - Node tail(Edge e) const {
1.225 + Node source(Edge e) const {
1.226 return ((e.out_or_in) ? gw.aNode(e.out) : gw.aNode(e.in)); }
1.227 - Node head(Edge e) const {
1.228 + Node target(Edge e) const {
1.229 return ((e.out_or_in) ? gw.bNode(e.out) : gw.bNode(e.in)); }
1.230
1.231 Node aNode(OutEdgeIt e) const {
1.232 @@ -1311,7 +1311,7 @@
1.233 void erase(const OutEdgeIt& e) const {
1.234 OutEdgeIt f=e;
1.235 this->next(f);
1.236 - first_out_edges->set(this->tail(e), f);
1.237 + first_out_edges->set(this->source(e), f);
1.238 }
1.239 };
1.240
1.241 @@ -1381,8 +1381,8 @@
1.242 // template< typename It > It first(const Node& v) const {
1.243 // It e; first(e, v); return e; }
1.244
1.245 -// //Node head(const Edge& e) const { return gw.head(e); }
1.246 -// //Node tail(const Edge& e) const { return gw.tail(e); }
1.247 +// //Node target(const Edge& e) const { return gw.target(e); }
1.248 +// //Node source(const Edge& e) const { return gw.source(e); }
1.249
1.250 // //template<typename I> bool valid(const I& i) const
1.251 // // { return gw.valid(i); }
1.252 @@ -1396,16 +1396,16 @@
1.253 // // return gw.bNode(e); }
1.254
1.255 // //Node addNode() const { return gw.addNode(); }
1.256 -// //Edge addEdge(const Node& tail, const Node& head) const {
1.257 -// // return gw.addEdge(tail, head); }
1.258 +// //Edge addEdge(const Node& source, const Node& target) const {
1.259 +// // return gw.addEdge(source, target); }
1.260
1.261 // //void erase(const OutEdgeIt& e) {
1.262 -// // first_out_edge(this->tail(e))=e;
1.263 +// // first_out_edge(this->source(e))=e;
1.264 // //}
1.265 // void erase(const Edge& e) {
1.266 // OutEdgeIt f(e);
1.267 // next(f);
1.268 -// first_out_edges.set(this->tail(e), f);
1.269 +// first_out_edges.set(this->source(e), f);
1.270 // }
1.271 // //template<typename I> void erase(const I& i) const { gw.erase(i); }
1.272
1.273 @@ -1459,7 +1459,7 @@
1.274
1.275 // OutEdgeIt& first(OutEdgeIt& e, const Node& n) const {
1.276 // ErasingResGraphWrapper<Graph, Number, FlowMap, CapacityMap>::first(e, n);
1.277 -// while (valid(e) && (dist.get(tail(e))/*+1!=*/>=dist.get(head(e))))
1.278 +// while (valid(e) && (dist.get(source(e))/*+1!=*/>=dist.get(target(e))))
1.279 // ErasingResGraphWrapper<Graph, Number, FlowMap, CapacityMap>::next(e);
1.280 // return e;
1.281 // }
1.282 @@ -1470,7 +1470,7 @@
1.283
1.284 // OutEdgeIt& next(OutEdgeIt& e) const {
1.285 // ErasingResGraphWrapper<Graph, Number, FlowMap, CapacityMap>::next(e);
1.286 -// while (valid(e) && (dist.get(tail(e))/*+1!*/>=dist.get(head(e))))
1.287 +// while (valid(e) && (dist.get(source(e))/*+1!*/>=dist.get(target(e))))
1.288 // ErasingResGraphWrapper<Graph, Number, FlowMap, CapacityMap>::next(e);
1.289 // return e;
1.290 // }
1.291 @@ -1482,9 +1482,9 @@
1.292 // void erase(const Edge& e) {
1.293 // OutEdgeIt f(e);
1.294 // ErasingResGraphWrapper<Graph, Number, FlowMap, CapacityMap>::next(f);
1.295 -// while (valid(f) && (dist.get(tail(f))/*+1!=*/>=dist.get(head(f))))
1.296 +// while (valid(f) && (dist.get(source(f))/*+1!=*/>=dist.get(target(f))))
1.297 // ErasingResGraphWrapper<Graph, Number, FlowMap, CapacityMap>::next(f);
1.298 -// first_out_edges.set(this->tail(e), f);
1.299 +// first_out_edges.set(this->source(e), f);
1.300 // }
1.301
1.302 // //TrivGraphWrapper() : graph(0) { }
1.303 @@ -1507,8 +1507,8 @@
1.304 // template< typename It > It first(const Node& v) const {
1.305 // It e; first(e, v); return e; }
1.306
1.307 -// //Node head(const Edge& e) const { return gw.head(e); }
1.308 -// //Node tail(const Edge& e) const { return gw.tail(e); }
1.309 +// //Node target(const Edge& e) const { return gw.target(e); }
1.310 +// //Node source(const Edge& e) const { return gw.source(e); }
1.311
1.312 // //template<typename I> bool valid(const I& i) const
1.313 // // { return gw.valid(i); }
1.314 @@ -1525,8 +1525,8 @@
1.315 // // return gw.bNode(e); }
1.316
1.317 // //Node addNode() const { return gw.addNode(); }
1.318 -// //Edge addEdge(const Node& tail, const Node& head) const {
1.319 -// // return gw.addEdge(tail, head); }
1.320 +// //Edge addEdge(const Node& source, const Node& target) const {
1.321 +// // return gw.addEdge(source, target); }
1.322
1.323 // //template<typename I> void erase(const I& i) const { gw.erase(i); }
1.324
1.325 @@ -1669,8 +1669,8 @@
1.326 // template< typename It > It first(Node v) const {
1.327 // It e; first(e, v); return e; }
1.328
1.329 -// Node head(const Edge& e) const { return gw.head(e); }
1.330 -// Node tail(const Edge& e) const { return gw.tail(e); }
1.331 +// Node target(const Edge& e) const { return gw.target(e); }
1.332 +// Node source(const Edge& e) const { return gw.source(e); }
1.333
1.334 // template<typename I> Node aNode(const I& e) const {
1.335 // return gw.aNode(e); }
1.336 @@ -1684,8 +1684,8 @@
1.337 // //{ return gw.setInvalid(i); }
1.338
1.339 // Node addNode() { return gw.addNode(); }
1.340 -// Edge addEdge(const Node& tail, const Node& head) {
1.341 -// return gw.addEdge(tail, head); }
1.342 +// Edge addEdge(const Node& source, const Node& target) {
1.343 +// return gw.addEdge(source, target); }
1.344
1.345 // template<typename I> void erase(const I& i) { gw.erase(i); }
1.346