1 // Copyright (C) 2004-2008 The Trustees of Indiana University. 2 3 // Use, modification and distribution is subject to the Boost Software 4 // License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at 5 // http://www.boost.org/LICENSE_1_0.txt) 6 7 // Authors: Nick Edmonds 8 // Douglas Gregor 9 // Andrew Lumsdaine 10 #ifndef BOOST_DISTRIBUTED_FILTERED_GRAPH_HPP 11 #define BOOST_DISTRIBUTED_FILTERED_GRAPH_HPP 12 13 #ifndef BOOST_GRAPH_USE_MPI 14 #error "Parallel BGL files should not be included unless <boost/graph/use_mpi.hpp> has been included" 15 #endif 16 17 #include <boost/graph/parallel/process_group.hpp> 18 #include <boost/graph/filtered_graph.hpp> 19 20 namespace boost { 21 namespace graph { 22 namespace parallel { 23 /// Retrieve the process group from a filtered graph 24 template<typename Graph, typename EdgePredicate, typename VertexPredicate> 25 struct process_group_type<filtered_graph<Graph, EdgePredicate, VertexPredicate> > 26 : process_group_type<Graph> { }; 27 28 template<typename Graph, typename EdgePredicate, typename VertexPredicate> 29 struct process_group_type<const filtered_graph<Graph, EdgePredicate, VertexPredicate> > 30 : process_group_type<Graph> { }; 31 } 32 33 } 34 35 /// Retrieve the process group from a filtered graph 36 template<typename Graph, typename EdgePredicate, typename VertexPredicate> 37 inline typename graph::parallel::process_group_type<Graph>::type process_group(filtered_graph<Graph,EdgePredicate,VertexPredicate> const & g)38 process_group(filtered_graph<Graph, EdgePredicate, VertexPredicate> const& g) { 39 return process_group(g.m_g); 40 } 41 42 /// Forward vertex() to vertex() of the base graph 43 template <typename Graph, typename EdgePredicate, typename VertexPredicate> 44 typename graph_traits<Graph>::vertex_descriptor vertex(typename graph_traits<Graph>::vertices_size_type i,filtered_graph<Graph,EdgePredicate,VertexPredicate> const & g)45 vertex(typename graph_traits<Graph>::vertices_size_type i, 46 filtered_graph<Graph, EdgePredicate, VertexPredicate> const& g) 47 { return vertex(i, g.m_g); } 48 49 } 50 51 #endif // BOOST_DISTRIBUTED_FILTERED_GRAPH_HPP 52