1.1 --- a/src/work/marci/experiment/graph_wrapper_st_ostream_op.h Sat Nov 13 12:24:01 2004 +0000
1.2 +++ b/src/work/marci/experiment/graph_wrapper_st_ostream_op.h Sat Nov 13 12:53:28 2004 +0000
1.3 @@ -166,10 +166,10 @@
1.4 InEdgeIt& next(InEdgeIt& i) const { graph->next(i.e); return i; }
1.5 EdgeIt& next(EdgeIt& i) const { graph->next(i.e); return i; }
1.6
1.7 - Node tail(const Edge& e) const {
1.8 - return Node(graph->tail(static_cast<typename Graph::Edge>(e))); }
1.9 - Node head(const Edge& e) const {
1.10 - return Node(graph->head(static_cast<typename Graph::Edge>(e))); }
1.11 + Node source(const Edge& e) const {
1.12 + return Node(graph->source(static_cast<typename Graph::Edge>(e))); }
1.13 + Node target(const Edge& e) const {
1.14 + return Node(graph->target(static_cast<typename Graph::Edge>(e))); }
1.15
1.16 bool valid(const Node& n) const {
1.17 return graph->valid(static_cast<typename Graph::Node>(n)); }
1.18 @@ -185,8 +185,8 @@
1.19 Node bNode(const InEdgeIt& e) const { return Node(graph->bNode(e.e)); }
1.20
1.21 Node addNode() const { return Node(graph->addNode()); }
1.22 - Edge addEdge(const Node& tail, const Node& head) const {
1.23 - return Edge(graph->addEdge(tail, head)); }
1.24 + Edge addEdge(const Node& source, const Node& target) const {
1.25 + return Edge(graph->addEdge(source, target)); }
1.26
1.27 void erase(const Node& i) const { graph->erase(i); }
1.28 void erase(const Edge& i) const { graph->erase(i); }
1.29 @@ -272,10 +272,10 @@
1.30 Node bNode(const InEdgeIt& e) const {
1.31 return Node(this->graph->bNode(e.e)); }
1.32
1.33 - Node tail(const Edge& e) const {
1.34 - return GraphWrapper<Graph>::head(e); }
1.35 - Node head(const Edge& e) const {
1.36 - return GraphWrapper<Graph>::tail(e); }
1.37 + Node source(const Edge& e) const {
1.38 + return GraphWrapper<Graph>::target(e); }
1.39 + Node target(const Edge& e) const {
1.40 + return GraphWrapper<Graph>::source(e); }
1.41
1.42 };
1.43
1.44 @@ -489,7 +489,7 @@
1.45 // }
1.46 OutEdgeIt& next(OutEdgeIt& e) const {
1.47 if (e.out_or_in) {
1.48 - typename Graph::Node n=this->graph->tail(e.out);
1.49 + typename Graph::Node n=this->graph->source(e.out);
1.50 this->graph->next(e.out);
1.51 if (!this->graph->valid(e.out)) {
1.52 e.out_or_in=false; this->graph->first(e.in, n); }
1.53 @@ -506,11 +506,11 @@
1.54 // }
1.55
1.56 Node aNode(const OutEdgeIt& e) const {
1.57 - if (e.out_or_in) return this->graph->tail(e); else
1.58 - return this->graph->head(e); }
1.59 + if (e.out_or_in) return this->graph->source(e); else
1.60 + return this->graph->target(e); }
1.61 Node bNode(const OutEdgeIt& e) const {
1.62 - if (e.out_or_in) return this->graph->head(e); else
1.63 - return this->graph->tail(e); }
1.64 + if (e.out_or_in) return this->graph->target(e); else
1.65 + return this->graph->source(e); }
1.66 };
1.67
1.68 /// A wrapper for composing the residual graph for directed flow and circulation problems.
1.69 @@ -724,10 +724,10 @@
1.70 return e;
1.71 }
1.72
1.73 - Node tail(Edge e) const {
1.74 - return ((e.forward) ? this->graph->tail(e) : this->graph->head(e)); }
1.75 - Node head(Edge e) const {
1.76 - return ((e.forward) ? this->graph->head(e) : this->graph->tail(e)); }
1.77 + Node source(Edge e) const {
1.78 + return ((e.forward) ? this->graph->source(e) : this->graph->target(e)); }
1.79 + Node target(Edge e) const {
1.80 + return ((e.forward) ? this->graph->target(e) : this->graph->source(e)); }
1.81
1.82 Node aNode(OutEdgeIt e) const {
1.83 return ((e.forward) ? this->graph->aNode(e.out) :
1.84 @@ -913,7 +913,7 @@
1.85 void erase(const OutEdgeIt& e) const {
1.86 OutEdgeIt f=e;
1.87 this->next(f);
1.88 - first_out_edges->set(this->tail(e), f.e);
1.89 + first_out_edges->set(this->source(e), f.e);
1.90 }
1.91 };
1.92
1.93 @@ -1041,17 +1041,17 @@
1.94 OutEdgeIt& next(OutEdgeIt& i) const { this->graph->next(i.e); return i; }
1.95 InEdgeIt& next(InEdgeIt& i) const { this->graph->next(i.e); return i; }
1.96
1.97 - Node tail(const Edge& e) {
1.98 - if (!(*(this->s_false_t_true_map))[this->graph->tail(e)])
1.99 - return Node(this->graph->tail(e));
1.100 + Node source(const Edge& e) {
1.101 + if (!(*(this->s_false_t_true_map))[this->graph->source(e)])
1.102 + return Node(this->graph->source(e));
1.103 else
1.104 - return Node(this->graph->head(e));
1.105 + return Node(this->graph->target(e));
1.106 }
1.107 - Node head(const Edge& e) {
1.108 - if (!(*(this->s_false_t_true_map))[this->graph->tail(e)])
1.109 - return Node(this->graph->head(e));
1.110 + Node target(const Edge& e) {
1.111 + if (!(*(this->s_false_t_true_map))[this->graph->source(e)])
1.112 + return Node(this->graph->target(e));
1.113 else
1.114 - return Node(this->graph->tail(e));
1.115 + return Node(this->graph->source(e));
1.116 }
1.117
1.118 Node aNode(const OutEdgeIt& e) const {
1.119 @@ -1469,10 +1469,10 @@
1.120 return i;
1.121 }
1.122
1.123 - Node tail(const Edge& e) const {
1.124 + Node source(const Edge& e) const {
1.125 switch (e.spec) {
1.126 case 0:
1.127 - return Node(this->graph->tail(e));
1.128 + return Node(this->graph->source(e));
1.129 break;
1.130 case 1:
1.131 return S_NODE;
1.132 @@ -1483,10 +1483,10 @@
1.133 break;
1.134 }
1.135 }
1.136 - Node head(const Edge& e) const {
1.137 + Node target(const Edge& e) const {
1.138 switch (e.spec) {
1.139 case 0:
1.140 - return Node(this->graph->head(e));
1.141 + return Node(this->graph->target(e));
1.142 break;
1.143 case 1:
1.144 return Node(e.n);
1.145 @@ -1506,17 +1506,17 @@
1.146 return this->graph->edgeNum()+this->graph->nodeNum();
1.147 }
1.148
1.149 - Node aNode(const OutEdgeIt& e) const { return tail(e); }
1.150 - Node aNode(const InEdgeIt& e) const { return head(e); }
1.151 - Node bNode(const OutEdgeIt& e) const { return head(e); }
1.152 - Node bNode(const InEdgeIt& e) const { return tail(e); }
1.153 + Node aNode(const OutEdgeIt& e) const { return source(e); }
1.154 + Node aNode(const InEdgeIt& e) const { return target(e); }
1.155 + Node bNode(const OutEdgeIt& e) const { return target(e); }
1.156 + Node bNode(const InEdgeIt& e) const { return source(e); }
1.157
1.158 void addNode() const { }
1.159 void addEdge() const { }
1.160
1.161 // Node addNode() const { return Node(this->graph->addNode()); }
1.162 -// Edge addEdge(const Node& tail, const Node& head) const {
1.163 -// return Edge(this->graph->addEdge(tail, head)); }
1.164 +// Edge addEdge(const Node& source, const Node& target) const {
1.165 +// return Edge(this->graph->addEdge(source, target)); }
1.166
1.167 // void erase(const Node& i) const { this->graph->erase(i); }
1.168 // void erase(const Edge& i) const { this->graph->erase(i); }