1.1 --- a/lemon/edge_set.h Fri Mar 02 17:56:22 2007 +0000
1.2 +++ b/lemon/edge_set.h Fri Mar 02 18:04:28 2007 +0000
1.3 @@ -86,7 +86,7 @@
1.4
1.5 ListEdgeSetBase() : first_edge(-1), first_free_edge(-1) {}
1.6
1.7 - Edge addEdge(const Node& source, const Node& target) {
1.8 + Edge addEdge(const Node& u, const Node& v) {
1.9 int n;
1.10 if (first_free_edge == -1) {
1.11 n = edges.size();
1.12 @@ -95,18 +95,18 @@
1.13 n = first_free_edge;
1.14 first_free_edge = edges[first_free_edge].next_in;
1.15 }
1.16 - edges[n].next_in = (*nodes)[target].first_in;
1.17 - if ((*nodes)[target].first_in != -1) {
1.18 - edges[(*nodes)[target].first_in].prev_in = n;
1.19 + edges[n].next_in = (*nodes)[v].first_in;
1.20 + if ((*nodes)[v].first_in != -1) {
1.21 + edges[(*nodes)[v].first_in].prev_in = n;
1.22 }
1.23 - (*nodes)[target].first_in = n;
1.24 - edges[n].next_out = (*nodes)[source].first_out;
1.25 - if ((*nodes)[source].first_out != -1) {
1.26 - edges[(*nodes)[source].first_out].prev_out = n;
1.27 + (*nodes)[v].first_in = n;
1.28 + edges[n].next_out = (*nodes)[u].first_out;
1.29 + if ((*nodes)[u].first_out != -1) {
1.30 + edges[(*nodes)[u].first_out].prev_out = n;
1.31 }
1.32 - (*nodes)[source].first_out = n;
1.33 - edges[n].source = source;
1.34 - edges[n].target = target;
1.35 + (*nodes)[u].first_out = n;
1.36 + edges[n].source = u;
1.37 + edges[n].target = v;
1.38 return Edge(n);
1.39 }
1.40
1.41 @@ -188,8 +188,8 @@
1.42 int id(const Node& node) const { return graph->id(node); }
1.43 int id(const Edge& edge) const { return edge.id; }
1.44
1.45 - Node nodeFromId(int id) const { return graph->nodeFromId(id); }
1.46 - Edge edgeFromId(int id) const { return Edge(id); }
1.47 + Node nodeFromId(int ix) const { return graph->nodeFromId(ix); }
1.48 + Edge edgeFromId(int ix) const { return Edge(ix); }
1.49
1.50 int maxNodeId() const { return graph->maxNodeId(); };
1.51 int maxEdgeId() const { return edges.size() - 1; }
1.52 @@ -293,7 +293,7 @@
1.53 Parent::erase(node);
1.54 }
1.55 virtual void erase(const std::vector<Node>& nodes) {
1.56 - for (int i = 0; i < (int)nodes.size(); ++i) {
1.57 + for (int i = 0; i < int(nodes.size()); ++i) {
1.58 _edgeset.eraseNode(nodes[i]);
1.59 }
1.60 Parent::erase(nodes);
1.61 @@ -382,7 +382,7 @@
1.62 Parent::erase(node);
1.63 }
1.64 virtual void erase(const std::vector<Node>& nodes) {
1.65 - for (int i = 0; i < (int)nodes.size(); ++i) {
1.66 + for (int i = 0; i < int(nodes.size()); ++i) {
1.67 _edgeset.eraseNode(nodes[i]);
1.68 }
1.69 Parent::erase(nodes);
1.70 @@ -460,15 +460,15 @@
1.71
1.72 SmartEdgeSetBase() {}
1.73
1.74 - Edge addEdge(const Node& source, const Node& target) {
1.75 + Edge addEdge(const Node& u, const Node& v) {
1.76 int n = edges.size();
1.77 edges.push_back(EdgeT());
1.78 - edges[n].next_in = (*nodes)[target].first_in;
1.79 - (*nodes)[target].first_in = n;
1.80 - edges[n].next_out = (*nodes)[source].first_out;
1.81 - (*nodes)[source].first_out = n;
1.82 - edges[n].source = source;
1.83 - edges[n].target = target;
1.84 + edges[n].next_in = (*nodes)[v].first_in;
1.85 + (*nodes)[v].first_in = n;
1.86 + edges[n].next_out = (*nodes)[u].first_out;
1.87 + (*nodes)[u].first_out = n;
1.88 + edges[n].source = u;
1.89 + edges[n].target = v;
1.90 return Edge(n);
1.91 }
1.92
1.93 @@ -516,8 +516,8 @@
1.94 int id(const Node& node) const { return graph->id(node); }
1.95 int id(const Edge& edge) const { return edge.id; }
1.96
1.97 - Node nodeFromId(int id) const { return graph->nodeFromId(id); }
1.98 - Edge edgeFromId(int id) const { return Edge(id); }
1.99 + Node nodeFromId(int ix) const { return graph->nodeFromId(ix); }
1.100 + Edge edgeFromId(int ix) const { return Edge(ix); }
1.101
1.102 int maxNodeId() const { return graph->maxNodeId(); };
1.103 int maxEdgeId() const { return edges.size() - 1; }
1.104 @@ -626,7 +626,7 @@
1.105 }
1.106 virtual void erase(const std::vector<Node>& nodes) {
1.107 try {
1.108 - for (int i = 0; i < (int)nodes.size(); ++i) {
1.109 + for (int i = 0; i < int(nodes.size()); ++i) {
1.110 _edgeset.eraseNode(nodes[i]);
1.111 }
1.112 Parent::erase(nodes);
1.113 @@ -731,7 +731,7 @@
1.114 }
1.115 virtual void erase(const std::vector<Node>& nodes) {
1.116 try {
1.117 - for (int i = 0; i < (int)nodes.size(); ++i) {
1.118 + for (int i = 0; i < int(nodes.size()); ++i) {
1.119 _edgeset.eraseNode(nodes[i]);
1.120 }
1.121 Parent::erase(nodes);