COIN-OR::LEMON - Graph Library

Changeset 986:e997802b855c in lemon-0.x for src/lemon/smart_graph.h


Ignore:
Timestamp:
11/13/04 13:53:28 (16 years ago)
Author:
Alpar Juttner
Branch:
default
Phase:
public
Convert:
svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/lemon/trunk@1376
Message:

Naming changes:

  • head -> target
  • tail -> source
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/lemon/smart_graph.h

    r980 r986  
    5656    struct EdgeT
    5757    {
    58       int head, tail, next_in, next_out;     
     58      int target, source, next_in, next_out;     
    5959      //FIXME: is this necessary?
    6060      EdgeT() : next_in(-1), next_out(-1) {} 
     
    9898    int maxId(Edge = INVALID) const { return edges.size()-1; }
    9999
    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; }
    102102
    103103    /// Node ID.
     
    128128    Edge addEdge(Node u, Node v) {
    129129      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;
    131131      edges[e.n].next_out=nodes[u.n].first_out;
    132132      edges[e.n].next_in=nodes[v.n].first_in;
     
    212212    {
    213213      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;
    215215      prev.n=e;
    216216      return prev;
     
    308308      while(s.edge_num>edges.size()) {
    309309        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;
    312312        edges.pop_back();
    313313      }
Note: See TracChangeset for help on using the changeset viewer.