ソースを参照

ENH: DependencyGraph: Set the parent even in the case when a vertex
has already been discovered. In the case of a cycle, this allows for
correct paths for diagnosing the problem. Example:

-> 3
/
1 -> 2 -> 4
\ /
<-

Previously, findPathDFS(...) which uses this->Parent[to] found for 4 to 2:
(4,1,2). Now it finds (4,2) because the new parent for 2 is 4.

Sascha Zelzer 15 年 前
コミット
98b7352a52
共有1 個のファイルを変更した1 個の追加1 個の削除を含む
  1. 1 1
      Libs/Core/ctkDependencyGraph.cpp

+ 1 - 1
Libs/Core/ctkDependencyGraph.cpp

@@ -138,9 +138,9 @@ void ctkDependencyGraph::ctkInternal::traverseUsingDFS(int v)
 		y = this->edge(v, i);
 		y = this->edge(v, i);
 		if (this->P->shouldExcludeEdge(this->edge(v, i)) == false)
 		if (this->P->shouldExcludeEdge(this->edge(v, i)) == false)
 		  {
 		  {
+      this->Parent[y] = v;
 			if (this->Discovered[y] == false)
 			if (this->Discovered[y] == false)
 			  {
 			  {
-				this->Parent[y] = v;
 				this->traverseUsingDFS(y);
 				this->traverseUsingDFS(y);
 			  } 
 			  } 
 			else 
 			else