Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r50729 - in trunk/boost/graph: . planar_detail
From: jewillco_at_[hidden]
Date: 2009-01-22 11:06:21


Author: jewillco
Date: 2009-01-22 11:06:21 EST (Thu, 22 Jan 2009)
New Revision: 50729
URL: http://svn.boost.org/trac/boost/changeset/50729

Log:
Changed some enums from local to global to fix regression test problems on Sandia-gcc gcc-4.0.1
Text files modified:
   trunk/boost/graph/planar_canonical_ordering.hpp | 40 +++++++++++++++++++++-------------------
   trunk/boost/graph/planar_detail/boyer_myrvold_impl.hpp | 28 +++++++++++++++-------------
   2 files changed, 36 insertions(+), 32 deletions(-)

Modified: trunk/boost/graph/planar_canonical_ordering.hpp
==============================================================================
--- trunk/boost/graph/planar_canonical_ordering.hpp (original)
+++ trunk/boost/graph/planar_canonical_ordering.hpp 2009-01-22 11:06:21 EST (Thu, 22 Jan 2009)
@@ -21,6 +21,13 @@
 {
 
 
+ namespace detail {
+ enum {PCO_PROCESSED,
+ PCO_UNPROCESSED,
+ PCO_ONE_NEIGHBOR_PROCESSED,
+ PCO_READY_TO_BE_PROCESSED};
+ }
+
   template<typename Graph,
            typename PlanarEmbedding,
            typename OutputIterator,
@@ -47,16 +54,11 @@
       <typename std::vector<std::size_t>::iterator, VertexIndexMap>
       vertex_to_size_t_map_t;
     
- enum {PROCESSED,
- UNPROCESSED,
- ONE_NEIGHBOR_PROCESSED,
- READY_TO_BE_PROCESSED};
-
     std::vector<vertex_t> processed_neighbor_vector(num_vertices(g));
     vertex_to_vertex_map_t processed_neighbor
       (processed_neighbor_vector.begin(), vm);
 
- std::vector<std::size_t> status_vector(num_vertices(g), UNPROCESSED);
+ std::vector<std::size_t> status_vector(num_vertices(g), detail::PCO_UNPROCESSED);
     vertex_to_size_t_map_t status(status_vector.begin(), vm);
 
     std::list<vertex_t> ready_to_be_processed;
@@ -73,16 +75,16 @@
       }
 
     ready_to_be_processed.push_back(first_vertex);
- status[first_vertex] = READY_TO_BE_PROCESSED;
+ status[first_vertex] = detail::PCO_READY_TO_BE_PROCESSED;
     ready_to_be_processed.push_back(second_vertex);
- status[second_vertex] = READY_TO_BE_PROCESSED;
+ status[second_vertex] = detail::PCO_READY_TO_BE_PROCESSED;
 
     while(!ready_to_be_processed.empty())
       {
         vertex_t u = ready_to_be_processed.front();
         ready_to_be_processed.pop_front();
 
- if (status[u] != READY_TO_BE_PROCESSED && u != second_vertex)
+ if (status[u] != detail::PCO_READY_TO_BE_PROCESSED && u != second_vertex)
           continue;
 
         embedding_iterator_t ei, ei_start, ei_end;
@@ -131,12 +133,12 @@
               }
 
 
- if (status[v] == UNPROCESSED)
+ if (status[v] == detail::PCO_UNPROCESSED)
               {
- status[v] = ONE_NEIGHBOR_PROCESSED;
+ status[v] = detail::PCO_ONE_NEIGHBOR_PROCESSED;
                 processed_neighbor[v] = u;
               }
- else if (status[v] == ONE_NEIGHBOR_PROCESSED)
+ else if (status[v] == detail::PCO_ONE_NEIGHBOR_PROCESSED)
               {
                 vertex_t x = processed_neighbor[v];
                 //are edges (v,u) and (v,x) adjacent in the planar
@@ -152,24 +154,24 @@
                      )
                     )
                   {
- status[v] = READY_TO_BE_PROCESSED;
+ status[v] = detail::PCO_READY_TO_BE_PROCESSED;
                   }
                 else
                   {
- status[v] = READY_TO_BE_PROCESSED + 1;
+ status[v] = detail::PCO_READY_TO_BE_PROCESSED + 1;
                   }
               }
- else if (status[v] > ONE_NEIGHBOR_PROCESSED)
+ else if (status[v] > detail::PCO_ONE_NEIGHBOR_PROCESSED)
               {
                 //check the two edges before and after (v,u) in the planar
                 //embedding, and update status[v] accordingly
 
                 bool processed_before = false;
- if (status[prior_vertex] == PROCESSED)
+ if (status[prior_vertex] == detail::PCO_PROCESSED)
                   processed_before = true;
 
                 bool processed_after = false;
- if (status[next_vertex] == PROCESSED)
+ if (status[next_vertex] == detail::PCO_PROCESSED)
                   processed_after = true;
 
                 if (!processed_before && !processed_after)
@@ -180,14 +182,14 @@
 
               }
 
- if (status[v] == READY_TO_BE_PROCESSED)
+ if (status[v] == detail::PCO_READY_TO_BE_PROCESSED)
               ready_to_be_processed.push_back(v);
 
             prior_edge_itr = ei;
 
           }
 
- status[u] = PROCESSED;
+ status[u] = detail::PCO_PROCESSED;
         *ordering = u;
         ++ordering;
         

Modified: trunk/boost/graph/planar_detail/boyer_myrvold_impl.hpp
==============================================================================
--- trunk/boost/graph/planar_detail/boyer_myrvold_impl.hpp (original)
+++ trunk/boost/graph/planar_detail/boyer_myrvold_impl.hpp 2009-01-22 11:06:21 EST (Thu, 22 Jan 2009)
@@ -25,6 +25,9 @@
 
 namespace boost
 {
+ namespace detail {
+ enum bm_case_t{BM_NO_CASE_CHOSEN, BM_CASE_A, BM_CASE_B, BM_CASE_C, BM_CASE_D, BM_CASE_E};
+ }
 
   template<typename LowPointMap, typename DFSParentMap,
            typename DFSNumberMap, typename LeastAncestorMap,
@@ -1240,8 +1243,7 @@
       vertex_t second_x_y_path_endpoint = graph_traits<Graph>::null_vertex();
       vertex_t w_ancestor = v;
 
- enum case_t{NO_CASE_CHOSEN, CASE_A, CASE_B, CASE_C, CASE_D, CASE_E};
- case_t chosen_case = NO_CASE_CHOSEN;
+ detail::bm_case_t chosen_case = detail::BM_NO_CASE_CHOSEN;
 
       std::vector<edge_t> x_external_path;
       std::vector<edge_t> y_external_path;
@@ -1403,7 +1405,7 @@
       //If v isn't on the same bicomp as x and y, it's a case A
       if (bicomp_root != v)
         {
- chosen_case = CASE_A;
+ chosen_case = detail::BM_CASE_A;
 
           for(tie(vi,vi_end) = vertices(g); vi != vi_end; ++vi)
             if (lower_face_vertex[*vi])
@@ -1420,7 +1422,7 @@
         }
       else if (w != graph_traits<Graph>::null_vertex())
         {
- chosen_case = CASE_B;
+ chosen_case = detail::BM_CASE_B;
 
           for(tie(ei, ei_end) = edges(g); ei != ei_end; ++ei)
             {
@@ -1512,7 +1514,7 @@
           //We need to find a valid z, since the x-y path re-defines the lower
           //face, and the z we found earlier may now be on the upper face.
 
- chosen_case = CASE_E;
+ chosen_case = detail::BM_CASE_E;
 
 
           // The z we've used so far is just an externally active vertex on the
@@ -1631,7 +1633,7 @@
                     }
                   else if (previous_vertex == x || previous_vertex == y)
                     {
- chosen_case = CASE_C;
+ chosen_case = detail::BM_CASE_C;
                     }
               
                 }
@@ -1688,7 +1690,7 @@
 
               if (x_y_path_vertex[current_vertex])
                 {
- chosen_case = CASE_D;
+ chosen_case = detail::BM_CASE_D;
                   break;
                 }
               else
@@ -1704,7 +1706,7 @@
 
 
 
- if (chosen_case != CASE_B && chosen_case != CASE_A)
+ if (chosen_case != detail::BM_CASE_B && chosen_case != detail::BM_CASE_A)
         {
 
           //Finding z and w.
@@ -1724,7 +1726,7 @@
                             z_v_path
                             );
               
- if (chosen_case == CASE_E)
+ if (chosen_case == detail::BM_CASE_E)
             {
 
               for(tie(ei, ei_end) = edges(g); ei != ei_end; ++ei)
@@ -1810,11 +1812,11 @@
       // a deterministic process, and we can simplify the function
       // is_kuratowski_subgraph by cleaning up some edges here.
 
- if (chosen_case == CASE_B)
+ if (chosen_case == detail::BM_CASE_B)
         {
           is_in_subgraph[dfs_parent_edge[v]] = false;
         }
- else if (chosen_case == CASE_C)
+ else if (chosen_case == detail::BM_CASE_C)
         {
           // In a case C subgraph, at least one of the x-y path endpoints
           // (call it alpha) is above either x or y on the outer face. The
@@ -1857,7 +1859,7 @@
             }
           
         }
- else if (chosen_case == CASE_D)
+ else if (chosen_case == detail::BM_CASE_D)
         {
           // Need to remove both of the edges adjacent to v on the outer face.
           // remove the connecting edges from v to bicomp, then
@@ -1868,7 +1870,7 @@
           is_in_subgraph[v_dfchild_handle.second_edge()] = false;
 
         }
- else if (chosen_case == CASE_E)
+ else if (chosen_case == detail::BM_CASE_E)
         {
           // Similarly to case C, if the endpoints of the x-y path are both
           // below x and y, we should remove an edge to allow the subgraph to


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk