COIN-OR::LEMON - Graph Library

Ignore:
Timestamp:
11/13/04 13:53:28 (19 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/work/marci/iterator_bfs_demo.cc

    r921 r986  
    2424  string operator[](typename Graph::Edge e) const {
    2525    return
    26       (node_name_map[graph.tail(e)]+"->"+node_name_map[graph.head(e)]);
     26      (node_name_map[graph.source(e)]+"->"+node_name_map[graph.target(e)]);
    2727  }
    2828};
     
    9696      if (Graph::Edge(bfs)!=INVALID) {
    9797        cout << edge_name[bfs] << /*endl*/", " <<
    98           node_name[G.tail(bfs)] <<
    99           (bfs.isANodeExamined() ? ": is examined, " : ": is not examined, ") <<
    100           node_name[G.head(bfs)] <<
     98          node_name[G.source(bfs)] <<
     99          (bfs.isANodeExamined() ? ": is examined, " : ": is not examined, ") <<
     100          node_name[G.target(bfs)] <<
    101101          (bfs.isBNodeNewlyReached() ? ": is newly reached." :
    102102           ": is not newly reached.");
    103103      } else {
    104104        cout << "invalid" << /*endl*/", " <<
    105           node_name[bfs.tail()] <<
     105          node_name[bfs.source()] <<
    106106          (bfs.isANodeExamined() ? ": is examined, " : ": is not examined, ") <<
    107107         
     
    130130      if (Graph::Edge(dfs)!=INVALID) {
    131131        cout << edge_name[dfs] << /*endl*/", " <<
    132           node_name[G.tail(dfs)] <<
    133           (dfs.isANodeExamined() ? ": is examined, " : ": is not examined, ") <<
    134           node_name[G.head(dfs)] <<
     132          node_name[G.source(dfs)] <<
     133          (dfs.isANodeExamined() ? ": is examined, " : ": is not examined, ") <<
     134          node_name[G.target(dfs)] <<
    135135          (dfs.isBNodeNewlyReached() ? ": is newly reached." :
    136136           ": is not newly reached.");
    137137      } else {
    138138        cout << "invalid" << /*endl*/", " <<
    139           node_name[dfs.tail()] <<
     139          node_name[dfs.source()] <<
    140140          (dfs.isANodeExamined() ? ": is examined, " : ": is not examined, ") <<
    141141         
     
    172172      if (GW::Edge(bfs)!=INVALID) {
    173173        cout << edge_name[GW::Edge(bfs)] << /*endl*/", " <<
    174           node_name[gw.tail(bfs)] <<
    175           (bfs.isANodeExamined() ? ": is examined, " : ": is not examined, ") <<
    176           node_name[gw.head(bfs)] <<
     174          node_name[gw.source(bfs)] <<
     175          (bfs.isANodeExamined() ? ": is examined, " : ": is not examined, ") <<
     176          node_name[gw.target(bfs)] <<
    177177          (bfs.isBNodeNewlyReached() ? ": is newly reached." :
    178178           ": is not newly reached.");
    179179      } else {
    180180        cout << "invalid" << /*endl*/", " <<
    181           node_name[bfs.tail()] <<
     181          node_name[bfs.source()] <<
    182182          (bfs.isANodeExamined() ? ": is examined, " : ": is not examined, ") <<
    183183         
     
    206206      if (GW::Edge(dfs)!=INVALID) {
    207207        cout << edge_name[GW::Edge(dfs)] << /*endl*/", " <<
    208           node_name[gw.tail(dfs)] <<
    209           (dfs.isANodeExamined() ? ": is examined, " : ": is not examined, ") <<
    210           node_name[gw.head(dfs)] <<
     208          node_name[gw.source(dfs)] <<
     209          (dfs.isANodeExamined() ? ": is examined, " : ": is not examined, ") <<
     210          node_name[gw.target(dfs)] <<
    211211          (dfs.isBNodeNewlyReached() ? ": is newly reached." :
    212212           ": is not newly reached.");
    213213      } else {
    214214        cout << "invalid" << /*endl*/", " <<
    215           node_name[dfs.tail()] <<
     215          node_name[dfs.source()] <<
    216216          (dfs.isANodeExamined() ? ": is examined, " : ": is not examined, ") <<
    217217         
     
    311311    cout << "bfs and dfs iterator demo on the bidirected graph" << endl;
    312312//     for(GW::EdgeIt e(gw); e!=INVALID; ++e) {
    313 //       cout << node_name[gw.tail(e)] << "->" << node_name[gw.head(e)] << " ";
     313//       cout << node_name[gw.source(e)] << "->" << node_name[gw.target(e)] << " ";
    314314//     }
    315315    for(GW::NodeIt n(gw); n!=INVALID; ++n) {
     
    335335      if (GW::Edge(bfs)!=INVALID) {
    336336        cout << edge_name[GW::Edge(bfs)] << /*endl*/", " <<
    337           node_name[gw.tail(bfs)] <<
    338           (bfs.isANodeExamined() ? ": is examined, " : ": is not examined, ") <<
    339           node_name[gw.head(bfs)] <<
     337          node_name[gw.source(bfs)] <<
     338          (bfs.isANodeExamined() ? ": is examined, " : ": is not examined, ") <<
     339          node_name[gw.target(bfs)] <<
    340340          (bfs.isBNodeNewlyReached() ? ": is newly reached." :
    341341           ": is not newly reached.");
    342342      } else {
    343343        cout << "invalid" << /*endl*/", " <<
    344           node_name[bfs.tail()] <<
     344          node_name[bfs.source()] <<
    345345          (bfs.isANodeExamined() ? ": is examined, " : ": is not examined, ") <<
    346346         
     
    369369      if (GW::Edge(dfs)!=INVALID) {
    370370        cout << edge_name[GW::Edge(dfs)] << /*endl*/", " <<
    371           node_name[gw.tail(dfs)] <<
    372           (dfs.isANodeExamined() ? ": is examined, " : ": is not examined, ") <<
    373           node_name[gw.head(dfs)] <<
     371          node_name[gw.source(dfs)] <<
     372          (dfs.isANodeExamined() ? ": is examined, " : ": is not examined, ") <<
     373          node_name[gw.target(dfs)] <<
    374374          (dfs.isBNodeNewlyReached() ? ": is newly reached." :
    375375           ": is not newly reached.");
    376376      } else {
    377377        cout << "invalid" << /*endl*/", " <<
    378           node_name[dfs.tail()] <<
     378          node_name[dfs.source()] <<
    379379          (dfs.isANodeExamined() ? ": is examined, " : ": is not examined, ") <<
    380380         
Note: See TracChangeset for help on using the changeset viewer.