]> Creatis software - FrontAlgorithms.git/blobdiff - lib/fpa/Base/Graph.hxx
...
[FrontAlgorithms.git] / lib / fpa / Base / Graph.hxx
index 89fec7bd6d3e12473e6f92c3cb0cdaf7e800f41f..03f85a802d3622e3128aa7230711af4429e3d4bf 100644 (file)
@@ -20,8 +20,8 @@ template< class _TVertex, class _TCost, class _TIndex, class _TIndexCompare >
 bool fpa::Base::Graph< _TVertex, _TCost, _TIndex, _TIndexCompare >::
 RenameVertex( const TIndex& old_index, const TIndex& new_index )
 {
-  auto old_v = this->m_Vertices.find( old_index );
-  auto new_v = this->m_Vertices.find( new_index );
+  typename TVertices::iterator old_v = this->m_Vertices.find( old_index );
+  typename TVertices::iterator new_v = this->m_Vertices.find( new_index );
   if( old_v != this->m_Vertices.end( ) && new_v == this->m_Vertices.end( ) )
   {
     // Replace vertex
@@ -29,14 +29,14 @@ RenameVertex( const TIndex& old_index, const TIndex& new_index )
     this->m_Vertices.erase( old_index );
 
     // Duplicate edges
-    auto mIt = this->m_Matrix.begin( );
-    auto found_row = this->m_Matrix.end( );
+    typename TMatrix::iterator mIt = this->m_Matrix.begin( );
+    typename TMatrix::iterator found_row = this->m_Matrix.end( );
     for( ; mIt != this->m_Matrix.end( ); ++mIt )
     {
       if( mIt->first == old_index )
         found_row = mIt;
 
-      auto rIt = mIt->second.begin( );
+      typename TMatrixRow::iterator rIt = mIt->second.begin( );
       for( ; rIt != mIt->second.end( ); ++rIt )
       {
         if( mIt->first == old_index )
@@ -55,7 +55,7 @@ RenameVertex( const TIndex& old_index, const TIndex& new_index )
     mIt = this->m_Matrix.begin( );
     for( ; mIt != this->m_Matrix.end( ); ++mIt )
     {
-      auto rIt = mIt->second.begin( );
+      typename TMatrixRow::iterator rIt = mIt->second.begin( );
       while( rIt != mIt->second.end( ) )
       {
         if( rIt->first == old_index )
@@ -80,14 +80,14 @@ template< class _TVertex, class _TCost, class _TIndex, class _TIndexCompare >
 void fpa::Base::Graph< _TVertex, _TCost, _TIndex, _TIndexCompare >::
 RemoveVertex( const TIndex& index )
 {
-  auto i = this->m_Vertices.find( index );
+  typename TVertices::iterator i = this->m_Vertices.find( index );
   if( i != this->m_Vertices.end( ) )
   {
     // Delete vertex
     this->m_Vertices.erase( i );
 
     // Delete edges starting from given vertex
-    auto mIt = this->m_Matrix.find( index );
+    typename TMatrix::iterator mIt = this->m_Matrix.find( index );
     if( mIt != this->m_Matrix.end( ) )
       this->m_Matrix.erase( mIt );
 
@@ -95,7 +95,7 @@ RemoveVertex( const TIndex& index )
     mIt = this->m_Matrix.begin( );
     for( ; mIt != this->m_Matrix.end( ); ++mIt )
     {
-      auto rIt = mIt->second.begin( );
+      typename TMatrixRow::iterator rIt = mIt->second.begin( );
       while( rIt != mIt->second.end( ) )
       {
         if( rIt->first == index )
@@ -122,10 +122,10 @@ fpa::Base::Graph< _TVertex, _TCost, _TIndex, _TIndexCompare >::
 GetEdges( const TIndex& orig, const TIndex& dest )
 {
   static TEdges null_edges;
-  auto o = this->m_Matrix.find( orig );
+  typename TMatrix::iterator o = this->m_Matrix.find( orig );
   if( o != this->m_Matrix.find( orig ) )
   {
-    auto d = o->second.find( dest );
+    typename TMatrixRow::iterator d = o->second.find( dest );
     if( d == o->second.end( ) )
     {
       null_edges.clear( );
@@ -151,10 +151,10 @@ fpa::Base::Graph< _TVertex, _TCost, _TIndex, _TIndexCompare >::
 GetEdges( const TIndex& orig, const TIndex& dest ) const
 {
   static const TEdges null_edges;
-  auto o = this->m_Matrix.find( orig );
+  typename TMatrix::iterator o = this->m_Matrix.find( orig );
   if( o != this->m_Matrix.find( orig ) )
   {
-    auto d = o->second.find( dest );
+    typename TMatrixRow::iterator d = o->second.find( dest );
     if( d == o->second.end( ) )
       return( null_edges );
     else
@@ -169,7 +169,7 @@ template< class _TVertex, class _TCost, class _TIndex, class _TIndexCompare >
 bool fpa::Base::Graph< _TVertex, _TCost, _TIndex, _TIndexCompare >::
 HasEdge( const TIndex& orig, const TIndex& dest ) const
 {
-  auto mIt = this->m_Matrix.find( orig );
+  typename TMatrix::const_iterator mIt = this->m_Matrix.find( orig );
   if( mIt != this->m_Matrix.end( ) )
     return( mIt->second.find( dest ) != mIt->second.end( ) );
   else
@@ -181,15 +181,15 @@ template< class _TVertex, class _TCost, class _TIndex, class _TIndexCompare >
 void fpa::Base::Graph< _TVertex, _TCost, _TIndex, _TIndexCompare >::
 RemoveEdge( const TIndex& orig, const TIndex& dest, const TCost& cost )
 {
-  auto m = this->m_Matrix.find( orig );
+  typename TMatrix::iterator m = this->m_Matrix.find( orig );
   if( m != this->m_Matrix.end( ) )
   {
-    auto r = m->second.find( dest );
+    typename TMatrixRow::iterator r = m->second.find( dest );
     if( r != m->second.end( ) )
     {
-      auto e = r->second.end( );
+      typename TEdges::iterator e = r->second.end( );
       for(
-        auto i = r->second.begin( );
+        typename TEdges::iterator i = r->second.begin( );
         i != r->second.end( ) && e == r->second.end( );
         ++i
         )
@@ -218,10 +218,10 @@ template< class _TVertex, class _TCost, class _TIndex, class _TIndexCompare >
 void fpa::Base::Graph< _TVertex, _TCost, _TIndex, _TIndexCompare >::
 RemoveEdges( const TIndex& orig, const TIndex& dest )
 {
-  auto m = this->m_Matrix.find( orig );
+  typename TMatrix::iterator m = this->m_Matrix.find( orig );
   if( m != this->m_Matrix.end( ) )
   {
-    auto r = m->second.find( dest );
+    typename TMatrixRow::iterator r = m->second.find( dest );
     if( r != m->second.end( ) )
     {
       m->second.erase( r );
@@ -242,10 +242,10 @@ GetSinks( ) const
 {
   std::set< _TIndex, _TIndexCompare > sinks;
 
-  auto vIt = this->m_Vertices.begin( );
+  typename TVertices::iterator vIt = this->m_Vertices.begin( );
   for( ; vIt != this->m_Vertices.end( ); ++vIt )
     sinks.insert( vIt->first );
-  auto mIt = this->m_Matrix.begin( );
+  typename TMatrix::iterator mIt = this->m_Matrix.begin( );
   for( ; mIt != this->m_Matrix.end( ); ++mIt )
     sinks.erase( mIt->first );