From c370699e769d8db284c58534c7a45f11dc9fb8b3 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Leonardo=20Fl=C3=B3rez-Valencia?= Date: Sun, 28 May 2017 22:05:13 -0500 Subject: [PATCH] ... --- lib/fpa/Base/Dijkstra.hxx | 10 ++++++++-- lib/fpa/Base/RegionGrow.hxx | 10 ++++++++-- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/lib/fpa/Base/Dijkstra.hxx b/lib/fpa/Base/Dijkstra.hxx index 3584b1a..b7c10f4 100644 --- a/lib/fpa/Base/Dijkstra.hxx +++ b/lib/fpa/Base/Dijkstra.hxx @@ -137,7 +137,8 @@ GenerateData( ) // Add neighborhood TVertices neighbors = this->_GetNeighbors( node.Vertex ); typename TVertices::const_iterator neighIt = neighbors.begin( ); - for( ; neighIt != neighbors.end( ); ++neighIt ) + bool coll = false; + while( neighIt != neighbors.end( ) && !coll ) { TVertex neigh = *neighIt; if( this->_IsMarked( neigh ) ) @@ -149,7 +150,11 @@ GenerateData( ) this->GetNumberOfSeeds( ) > 1 && nColl == 1 ) + { q.clear( ); + coll = true; + + } // fi } else { @@ -171,8 +176,9 @@ GenerateData( ) } // fi } // fi + ++neighIt; - } // rof + } // elihw } // elihw this->_FreeMarks( ); diff --git a/lib/fpa/Base/RegionGrow.hxx b/lib/fpa/Base/RegionGrow.hxx index b942dfd..09fe59a 100644 --- a/lib/fpa/Base/RegionGrow.hxx +++ b/lib/fpa/Base/RegionGrow.hxx @@ -121,7 +121,8 @@ GenerateData( ) // Add neighborhood TVertices neighbors = this->_GetNeighbors( node.first ); typename TVertices::const_iterator neighIt = neighbors.begin( ); - for( ; neighIt != neighbors.end( ); ++neighIt ) + bool coll = false; + while( neighIt != neighbors.end( ) && !coll ) { TVertex neigh = *neighIt; if( this->_IsMarked( neigh ) ) @@ -133,13 +134,18 @@ GenerateData( ) this->GetNumberOfSeeds( ) > 1 && nColl == 1 ) + { while( q.size( ) > 0 ) q.pop( ); + coll = true; + + } // fi } else q.push( _TNode( neigh, node.second ) ); + ++neighIt; - } // rof + } // elihw } // elihw this->_FreeMarks( ); -- 2.47.1