Changeset 986:e997802b855c in lemon0.x for src/lemon/smart_graph.h
 Timestamp:
 11/13/04 13:53:28 (16 years ago)
 Branch:
 default
 Phase:
 public
 Convert:
 svn:c9d7d8f590d60310b91f818b3a526b0e/lemon/trunk@1376
 File:

 1 edited
Legend:
 Unmodified
 Added
 Removed

src/lemon/smart_graph.h
r980 r986 56 56 struct EdgeT 57 57 { 58 int head, tail, next_in, next_out;58 int target, source, next_in, next_out; 59 59 //FIXME: is this necessary? 60 60 EdgeT() : next_in(1), next_out(1) {} … … 98 98 int maxId(Edge = INVALID) const { return edges.size()1; } 99 99 100 Node tail(Edge e) const { return edges[e.n].tail; }101 Node head(Edge e) const { return edges[e.n].head; }100 Node source(Edge e) const { return edges[e.n].source; } 101 Node target(Edge e) const { return edges[e.n].target; } 102 102 103 103 /// Node ID. … … 128 128 Edge addEdge(Node u, Node v) { 129 129 Edge e; e.n=edges.size(); edges.push_back(EdgeT()); //FIXME: Hmmm... 130 edges[e.n]. tail=u.n; edges[e.n].head=v.n;130 edges[e.n].source=u.n; edges[e.n].target=v.n; 131 131 edges[e.n].next_out=nodes[u.n].first_out; 132 132 edges[e.n].next_in=nodes[v.n].first_in; … … 212 212 { 213 213 int e = (prev.n==1)? nodes[u.n].first_out : edges[prev.n].next_out; 214 while(e!=1 && edges[e]. tail!=v.n) e = edges[e].next_out;214 while(e!=1 && edges[e].source!=v.n) e = edges[e].next_out; 215 215 prev.n=e; 216 216 return prev; … … 308 308 while(s.edge_num>edges.size()) { 309 309 edge_observers.erase(Edge(edges.size()1)); 310 nodes[edges.back(). head].first_in=edges.back().next_in;311 nodes[edges.back(). tail].first_out=edges.back().next_out;310 nodes[edges.back().target].first_in=edges.back().next_in; 311 nodes[edges.back().source].first_out=edges.back().next_out; 312 312 edges.pop_back(); 313 313 }
Note: See TracChangeset
for help on using the changeset viewer.