COIN-OR::LEMON - Graph Library

Changeset 986:e997802b855c in lemon-0.x for src/work/marci/bfs_dfs.h


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/bfs_dfs.h

    r921 r986  
    6464        //graph->first(actual_edge, s);
    6565        if (actual_edge!=INVALID) {
    66           Node w=graph->head(actual_edge);
     66          Node w=graph->target(actual_edge);
    6767          if (!reached[w]) {
    6868            bfs_queue.push(w);
     
    8686        //++actual_edge;
    8787        if (actual_edge!=INVALID) {
    88           Node w=graph->head(actual_edge);
     88          Node w=graph->target(actual_edge);
    8989          if (!reached[w]) {
    9090            bfs_queue.push(w);
     
    101101          //graph->first(actual_edge, bfs_queue.front());
    102102          if (actual_edge!=INVALID) {
    103             Node w=graph->head(actual_edge);
     103            Node w=graph->target(actual_edge);
    104104            if (!reached[w]) {
    105105              bfs_queue.push(w);
     
    125125    bool isANodeExamined() const { return actual_edge==INVALID; }
    126126    /// Returns a-node of the actual edge, so does if the edge is invalid.
    127     Node tail() const { return bfs_queue.front(); }
     127    Node source() const { return bfs_queue.front(); }
    128128    /// \pre The actual edge have to be valid.
    129     Node head() const { return graph->head(actual_edge); }
     129    Node target() const { return graph->target(actual_edge); }
    130130    /// Guess what?
    131131    /// \deprecated
     
    187187      if (this->graph->valid(this->actual_edge) && this->b_node_newly_reached)
    188188      {
    189         pred.set(this->head(), this->actual_edge);
    190         dist.set(this->head(), dist[this->tail()]);
     189        pred.set(this->target(), this->actual_edge);
     190        dist.set(this->target(), dist[this->source()]);
    191191      }
    192192      return *this;
     
    247247      actual_edge=dfs_stack.top();
    248248      if (actual_edge!=INVALID/*.valid()*/) {
    249         Node w=graph->head(actual_edge);
     249        Node w=graph->target(actual_edge);
    250250        actual_node=w;
    251251        if (!reached[w]) {
     
    256256          b_node_newly_reached=true;
    257257        } else {
    258           actual_node=graph->tail(actual_edge);
     258          actual_node=graph->source(actual_edge);
    259259          ++dfs_stack.top();
    260260          b_node_newly_reached=false;
     
    277277    bool isANodeExamined() const { return actual_edge==INVALID; }
    278278    /// Returns a-node of the actual edge, so does if the edge is invalid.
    279     Node tail() const { return actual_node; /*FIXME*/}
     279    Node source() const { return actual_node; /*FIXME*/}
    280280    /// Returns b-node of the actual edge.
    281281    /// \pre The actual edge have to be valid.
    282     Node head() const { return graph->head(actual_edge); }
     282    Node target() const { return graph->target(actual_edge); }
    283283    /// Guess what?
    284284    /// \deprecated
     
    334334      if (this->graph->valid(this->actual_edge) && this->b_node_newly_reached)
    335335      {
    336         pred.set(this->head(), this->actual_edge);
     336        pred.set(this->target(), this->actual_edge);
    337337      }
    338338      return *this;
Note: See TracChangeset for help on using the changeset viewer.