/usr/include/boost/graph/distributed
NameSizeModeActions
adjlist/-0755rm
detail/-0755rm
adjacency_list.hpp1497770644editdlrm
betweenness_centrality.hpp701320644editdlrm
boman_et_al_graph_coloring.hpp129870644editdlrm
breadth_first_search.hpp52090644editdlrm
compressed_sparse_row_graph.hpp818050644editdlrm
concepts.hpp70280644editdlrm
connected_components.hpp284010644editdlrm
connected_components_parallel_search.hpp150590644editdlrm
crauser_et_al_shortest_paths.hpp253420644editdlrm
dehne_gotz_min_spanning_tree.hpp386870644editdlrm
delta_stepping_shortest_paths.hpp194150644editdlrm
depth_first_search.hpp104370644editdlrm
dijkstra_shortest_paths.hpp87190644editdlrm
distributed_graph_utility.hpp45600644editdlrm
eager_dijkstra_shortest_paths.hpp162940644editdlrm
filtered_graph.hpp19430644editdlrm
fruchterman_reingold.hpp129630644editdlrm
graphviz.hpp86720644editdlrm
hohberg_biconnected_components.hpp380930644editdlrm
local_subgraph.hpp60570644editdlrm
mpi_process_group.hpp265920644editdlrm
named_graph.hpp481620644editdlrm
one_bit_color_map.hpp40460644editdlrm
page_rank.hpp80030644editdlrm
queue.hpp102490644editdlrm
reverse_graph.hpp12230644editdlrm
rmat_graph_generator.hpp59130644editdlrm
selector.hpp13750644editdlrm
shuffled_distribution.hpp28330644editdlrm
strong_components.hpp403960644editdlrm
st_connected.hpp61580644editdlrm
two_bit_color_map.hpp40410644editdlrm
unsafe_serialize.hpp3800644editdlrm
vertex_list_adaptor.hpp162520644editdlrm
Edit: /usr/include/boost/graph/distributed/breadth_first_search.hpp (5209B)
// Copyright 2004 The Trustees of Indiana University. // Use, modification and distribution is subject to the Boost Software // License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) // Authors: Douglas Gregor // Andrew Lumsdaine #ifndef BOOST_GRAPH_PARALLEL_BFS_HPP #define BOOST_GRAPH_PARALLEL_BFS_HPP #ifndef BOOST_GRAPH_USE_MPI #error "Parallel BGL files should not be included unless has been included" #endif #include #include #include #include #include #include #include #include #include namespace boost { namespace detail { /** @brief A unary predicate that decides when to push into a * breadth-first search queue. * * This predicate stores a color map that is used to determine * when to push. If it is provided with a key for which the color * is white, it darkens the color to gray and returns true (so * that the value will be pushed appropriately); if the color is * not white, it returns false so that the vertex will be * ignored. */ template struct darken_and_push { typedef typename property_traits::key_type argument_type; typedef bool result_type; explicit darken_and_push(const ColorMap& color) : color(color) { } bool operator()(const argument_type& value) const { typedef color_traits::value_type> Color; if (get(color, value) == Color::white()) { put(color, value, Color::gray()); return true; } else { return false; } } ColorMap color; }; template struct has_not_been_seen { typedef bool result_type; has_not_been_seen() { } has_not_been_seen(std::size_t n, IndexMap index_map) : seen(n), index_map(index_map) {} template result_type operator()(Key key) { bool result = seen[get(index_map, key)]; seen[get(index_map, key)] = true; return !result; } void swap(has_not_been_seen& other) { using std::swap; swap(seen, other.seen); swap(index_map, other.index_map); } private: dynamic_bitset<> seen; IndexMap index_map; }; template inline void swap(has_not_been_seen& x, has_not_been_seen& y) { x.swap(y); } template inline void parallel_bfs_helper (DistributedGraph& g, typename graph_traits::vertex_descriptor s, ColorMap color, BFSVisitor vis, BufferRef Q, VertexIndexMap) { set_property_map_role(vertex_color, color); color.set_consistency_model(0); breadth_first_search(g, s, Q.ref, vis, color); } template void parallel_bfs_helper (DistributedGraph& g, typename graph_traits::vertex_descriptor s, ColorMap color, BFSVisitor vis, boost::param_not_found, VertexIndexMap vertex_index) { using boost::graph::parallel::process_group; typedef graph_traits Traits; typedef typename Traits::vertex_descriptor Vertex; typedef typename boost::graph::parallel::process_group_type::type process_group_type; set_property_map_role(vertex_color, color); color.set_consistency_model(0); // Buffer default typedef typename property_map ::const_type vertex_owner_map; typedef boost::graph::distributed::distributed_queue< process_group_type, vertex_owner_map, queue, detail::darken_and_push > queue_t; queue_t Q(process_group(g), get(vertex_owner, g), detail::darken_and_push(color)); breadth_first_search(g, s, Q, vis, color); } template void bfs_helper (DistributedGraph& g, typename graph_traits::vertex_descriptor s, ColorMap color, BFSVisitor vis, const bgl_named_params& params, boost::mpl::true_) { parallel_bfs_helper (g, s, color, vis, get_param(params, buffer_param_t()), choose_const_pmap(get_param(params, vertex_index), g, vertex_index)); } } } #endif // BOOST_GRAPH_PARALLEL_BFS_HPP