Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r54337 - in trunk: boost/graph libs/graph/test
From: jewillco_at_[hidden]
Date: 2009-06-25 12:24:21


Author: jewillco
Date: 2009-06-25 12:24:20 EDT (Thu, 25 Jun 2009)
New Revision: 54337
URL: http://svn.boost.org/trac/boost/changeset/54337

Log:
Added patches from Michael Hansen; refs #3134
Text files modified:
   trunk/boost/graph/mcgregor_common_subgraphs.hpp | 44 +++++++++++++--------------------------
   trunk/libs/graph/test/mcgregor_subgraphs_test.cpp | 5 +--
   2 files changed, 17 insertions(+), 32 deletions(-)

Modified: trunk/boost/graph/mcgregor_common_subgraphs.hpp
==============================================================================
--- trunk/boost/graph/mcgregor_common_subgraphs.hpp (original)
+++ trunk/boost/graph/mcgregor_common_subgraphs.hpp 2009-06-25 12:24:20 EDT (Thu, 25 Jun 2009)
@@ -47,9 +47,8 @@
 
   // ==========================================================================
 
- // Binary function object that returns true if the values for
- // vertex1 in property_map1 and vertex2 in property_map2 are
- // equivalent.
+ // Binary function object that returns true if the values for item1
+ // in property_map1 and item2 in property_map2 are equivalent.
   template <typename PropertyMapFirst,
             typename PropertyMapSecond>
   struct property_map_equivalent {
@@ -59,10 +58,10 @@
       m_property_map1(property_map1),
       m_property_map2(property_map2) { }
 
- template <typename VertexFirst,
- typename VertexSecond>
- bool operator()(const VertexFirst vertex1, const VertexSecond vertex2) {
- return (get(m_property_map1, vertex1) == get(m_property_map2, vertex2));
+ template <typename ItemFirst,
+ typename ItemSecond>
+ bool operator()(const ItemFirst item1, const ItemSecond item2) {
+ return (get(m_property_map1, item1) == get(m_property_map2, item2));
     }
   
   private:
@@ -1091,37 +1090,24 @@
 
   // ==========================================================================
 
- // Fills two membership maps (vertex -> bool) using the information
- // present in correspondence_map_1_to_2 and
- // correspondence_map_2_to_1. Every vertex in a membership map will
- // have a true value only if it is not associated with a null vertex
- // in its respective correspondence map.
- template <typename GraphFirst,
- typename GraphSecond,
+ // Fills a membership map (vertex -> bool) using the information
+ // present in correspondence_map_1_to_2. Every vertex in a
+ // membership map will have a true value only if it is not
+ // associated with a null vertex in the correspondence map.
+ template <typename GraphSecond,
+ typename GraphFirst,
             typename CorrespondenceMapFirstToSecond,
- typename CorrespondenceMapSecondToFirst,
- typename MembershipMapFirst,
- typename MembershipMapSecond>
- void fill_membership_maps
+ typename MembershipMapFirst>
+ void fill_membership_map
   (const GraphFirst& graph1,
- const GraphSecond& graph2,
    const CorrespondenceMapFirstToSecond correspondence_map_1_to_2,
- const CorrespondenceMapSecondToFirst correspondence_map_2_to_1,
- MembershipMapFirst membership_map1,
- MembershipMapSecond membership_map2) {
-
- typedef typename graph_traits<GraphSecond>::vertex_descriptor
- VertexSecond;
+ MembershipMapFirst membership_map1) {
 
     BGL_FORALL_VERTICES_T(vertex1, graph1, GraphFirst) {
       put(membership_map1, vertex1,
           get(correspondence_map_1_to_2, vertex1) != graph_traits<GraphSecond>::null_vertex());
     }
 
- BGL_FORALL_VERTICES_T(vertex2, graph2, GraphSecond) {
- put(membership_map2, vertex2,
- get(correspondence_map_2_to_1, vertex2) != graph_traits<GraphFirst>::null_vertex());
- }
   }
 
   // Traits associated with a membership map filtered graph. Provided

Modified: trunk/libs/graph/test/mcgregor_subgraphs_test.cpp
==============================================================================
--- trunk/libs/graph/test/mcgregor_subgraphs_test.cpp (original)
+++ trunk/libs/graph/test/mcgregor_subgraphs_test.cpp 2009-06-25 12:24:20 EDT (Thu, 25 Jun 2009)
@@ -69,9 +69,8 @@
     MembershipMap membership_map2(num_vertices(m_graph2),
                                   get(vertex_index, m_graph2));
 
- fill_membership_maps(m_graph1, m_graph2,
- correspondence_map_1_to_2, correspondence_map_2_to_1,
- membership_map1, membership_map2);
+ fill_membership_map<Graph>(m_graph1, correspondence_map_1_to_2, membership_map1);
+ fill_membership_map<Graph>(m_graph2, correspondence_map_2_to_1, membership_map2);
 
     // Generate filtered graphs using membership maps
     typedef typename membership_filtered_graph_traits<Graph, MembershipMap>::graph_type


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