src/work/marci/bfs_mm.h
changeset 986 e997802b855c
parent 944 4f064aff855e
child 987 87f7c54892df
     1.1 --- a/src/work/marci/bfs_mm.h	Sat Nov 13 12:24:01 2004 +0000
     1.2 +++ b/src/work/marci/bfs_mm.h	Sat Nov 13 12:53:28 2004 +0000
     1.3 @@ -71,7 +71,7 @@
     1.4  	actual_edge=OutEdgeIt(*graph, s);
     1.5  	//graph->first(actual_edge, s);
     1.6  	if (actual_edge!=INVALID) { 
     1.7 -	  Node w=graph->head(actual_edge);
     1.8 +	  Node w=graph->target(actual_edge);
     1.9  	  if (!(*reached_map)[w]) {
    1.10  	    bfs_queue.push(w);
    1.11  	    reached_map->set(w, true);
    1.12 @@ -93,7 +93,7 @@
    1.13  	actual_edge=++OutEdgeIt(*graph, actual_edge);
    1.14  	//++actual_edge;
    1.15  	if (actual_edge!=INVALID) {
    1.16 -	  Node w=graph->head(actual_edge);
    1.17 +	  Node w=graph->target(actual_edge);
    1.18  	  if (!(*reached_map)[w]) {
    1.19  	    bfs_queue.push(w);
    1.20  	    reached_map->set(w, true);
    1.21 @@ -108,7 +108,7 @@
    1.22  	  actual_edge=OutEdgeIt(*graph, bfs_queue.front());
    1.23  	  //graph->first(actual_edge, bfs_queue.front());
    1.24  	  if (actual_edge!=INVALID) {
    1.25 -	    Node w=graph->head(actual_edge);
    1.26 +	    Node w=graph->target(actual_edge);
    1.27  	    if (!(*reached_map)[w]) {
    1.28  	      bfs_queue.push(w);
    1.29  	      reached_map->set(w, true);
    1.30 @@ -132,9 +132,9 @@
    1.31      /// Returns if a-node is examined.
    1.32      bool isANodeExamined() const { return actual_edge==INVALID; }
    1.33      /// Returns a-node of the actual edge, so does if the edge is invalid.
    1.34 -    Node tail() const { return bfs_queue.front(); }
    1.35 +    Node source() const { return bfs_queue.front(); }
    1.36      /// \pre The actual edge have to be valid.
    1.37 -    Node head() const { return graph->head(actual_edge); }
    1.38 +    Node target() const { return graph->target(actual_edge); }
    1.39      /// Guess what?
    1.40      /// \deprecated 
    1.41      const ReachedMap& reachedMap() const { return *reached_map; }
    1.42 @@ -231,9 +231,9 @@
    1.43        Parent::operator++();
    1.44        if ((this->actual_edge)!=INVALID && this->b_node_newly_reached) 
    1.45        {
    1.46 -	pred_map->set(this->head(), this->actual_edge);
    1.47 -	pred_node_map->set(this->head(), this->tail());
    1.48 -	dist_map->set(this->head(), (*dist_map)[this->tail()]);
    1.49 +	pred_map->set(this->target(), this->actual_edge);
    1.50 +	pred_node_map->set(this->target(), this->source());
    1.51 +	dist_map->set(this->target(), (*dist_map)[this->source()]);
    1.52        }
    1.53        return *this;
    1.54      }
    1.55 @@ -457,7 +457,7 @@
    1.56      operator++() { 
    1.57        actual_edge=dfs_stack.top();
    1.58        if (actual_edge!=INVALID/*.valid()*/) { 
    1.59 -	Node w=graph->head(actual_edge);
    1.60 +	Node w=graph->target(actual_edge);
    1.61  	actual_node=w;
    1.62  	if (!reached[w]) {
    1.63  	  OutEdgeIt e(*graph, w);
    1.64 @@ -466,7 +466,7 @@
    1.65  	  reached.set(w, true);
    1.66  	  b_node_newly_reached=true;
    1.67  	} else {
    1.68 -	  actual_node=graph->tail(actual_edge);
    1.69 +	  actual_node=graph->source(actual_edge);
    1.70  	  ++dfs_stack.top();
    1.71  	  b_node_newly_reached=false;
    1.72  	}
    1.73 @@ -487,10 +487,10 @@
    1.74      /// Returns if a-node is examined.
    1.75      bool isANodeExamined() const { return actual_edge==INVALID; }
    1.76      /// Returns a-node of the actual edge, so does if the edge is invalid.
    1.77 -    Node tail() const { return actual_node; /*FIXME*/}
    1.78 +    Node source() const { return actual_node; /*FIXME*/}
    1.79      /// Returns b-node of the actual edge. 
    1.80      /// \pre The actual edge have to be valid.
    1.81 -    Node head() const { return graph->head(actual_edge); }
    1.82 +    Node target() const { return graph->target(actual_edge); }
    1.83      /// Guess what?
    1.84      /// \deprecated
    1.85      const ReachedMap& getReachedMap() const { return reached; }
    1.86 @@ -544,7 +544,7 @@
    1.87        Parent::operator++();
    1.88        if (this->graph->valid(this->actual_edge) && this->b_node_newly_reached) 
    1.89        {
    1.90 -	pred.set(this->head(), this->actual_edge);
    1.91 +	pred.set(this->target(), this->actual_edge);
    1.92        }
    1.93        return *this;
    1.94      }