/
usr
/
include
/
boost
/
graph
/
distributed
/
/usr/include/boost/graph/distributed
mkdir
upload
Name
Size
Mode
Actions
adjlist/
-
0755
rm
detail/
-
0755
rm
adjacency_list.hpp
149777
0644
edit
dl
rm
betweenness_centrality.hpp
70132
0644
edit
dl
rm
boman_et_al_graph_coloring.hpp
12987
0644
edit
dl
rm
breadth_first_search.hpp
5209
0644
edit
dl
rm
compressed_sparse_row_graph.hpp
81805
0644
edit
dl
rm
concepts.hpp
7028
0644
edit
dl
rm
connected_components.hpp
28401
0644
edit
dl
rm
connected_components_parallel_search.hpp
15059
0644
edit
dl
rm
crauser_et_al_shortest_paths.hpp
25342
0644
edit
dl
rm
dehne_gotz_min_spanning_tree.hpp
38687
0644
edit
dl
rm
delta_stepping_shortest_paths.hpp
19415
0644
edit
dl
rm
depth_first_search.hpp
10437
0644
edit
dl
rm
dijkstra_shortest_paths.hpp
8719
0644
edit
dl
rm
distributed_graph_utility.hpp
4560
0644
edit
dl
rm
eager_dijkstra_shortest_paths.hpp
16294
0644
edit
dl
rm
filtered_graph.hpp
1943
0644
edit
dl
rm
fruchterman_reingold.hpp
12963
0644
edit
dl
rm
graphviz.hpp
8672
0644
edit
dl
rm
hohberg_biconnected_components.hpp
38093
0644
edit
dl
rm
local_subgraph.hpp
6057
0644
edit
dl
rm
mpi_process_group.hpp
26592
0644
edit
dl
rm
named_graph.hpp
48162
0644
edit
dl
rm
one_bit_color_map.hpp
4046
0644
edit
dl
rm
page_rank.hpp
8003
0644
edit
dl
rm
queue.hpp
10249
0644
edit
dl
rm
reverse_graph.hpp
1223
0644
edit
dl
rm
rmat_graph_generator.hpp
5913
0644
edit
dl
rm
selector.hpp
1375
0644
edit
dl
rm
shuffled_distribution.hpp
2833
0644
edit
dl
rm
strong_components.hpp
40396
0644
edit
dl
rm
st_connected.hpp
6158
0644
edit
dl
rm
two_bit_color_map.hpp
4041
0644
edit
dl
rm
unsafe_serialize.hpp
380
0644
edit
dl
rm
vertex_list_adaptor.hpp
16252
0644
edit
dl
rm
Edit:
/usr/include/boost/graph/distributed/distributed_graph_utility.hpp
(4560B)
// Copyright (C) 2005-2006 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: Peter Gottschling // Douglas Gregor // Andrew Lumsdaine #include <boost/graph/iteration_macros.hpp> #include <boost/property_map/parallel/global_index_map.hpp> #ifndef BOOST_GRAPH_DISTRIBUTED_GRAPH_UTILITY_INCLUDE #define BOOST_GRAPH_DISTRIBUTED_GRAPH_UTILITY_INCLUDE #ifndef BOOST_GRAPH_USE_MPI #error "Parallel BGL files should not be included unless <boost/graph/use_mpi.hpp> has been included" #endif namespace boost { namespace graph { template <class Property, class Graph> void property_on_inedges(Property p, const Graph& g) { BGL_FORALL_VERTICES_T(u, g, Graph) BGL_FORALL_INEDGES_T(u, e, g, Graph) request(p, e); synchronize(p); } // For reverse graphs template <class Property, class Graph> void property_on_outedges(Property p, const Graph& g) { BGL_FORALL_VERTICES_T(u, g, Graph) BGL_FORALL_OUTEDGES_T(u, e, g, Graph) request(p, e); synchronize(p); } template <class Property, class Graph> void property_on_successors(Property p, const Graph& g) { BGL_FORALL_VERTICES_T(u, g, Graph) BGL_FORALL_OUTEDGES_T(u, e, g, Graph) request(p, target(e, g)); synchronize(p); } template <class Property, class Graph> void property_on_predecessors(Property p, const Graph& g) { BGL_FORALL_VERTICES_T(u, g, Graph) BGL_FORALL_INEDGES_T(u, e, g, Graph) request(p, source(e, g)); synchronize(p); } // Like successors and predecessors but saves one synchronize (and a call) template <class Property, class Graph> void property_on_adjacents(Property p, const Graph& g) { BGL_FORALL_VERTICES_T(u, g, Graph) { BGL_FORALL_OUTEDGES_T(u, e, g, Graph) request(p, target(e, g)); BGL_FORALL_INEDGES_T(u, e, g, Graph) request(p, source(e, g)); } synchronize(p); } template <class PropertyIn, class PropertyOut, class Graph> void copy_vertex_property(PropertyIn p_in, PropertyOut p_out, Graph& g) { BGL_FORALL_VERTICES_T(u, g, Graph) put(p_out, u, get(p_in, g)); } template <class PropertyIn, class PropertyOut, class Graph> void copy_edge_property(PropertyIn p_in, PropertyOut p_out, Graph& g) { BGL_FORALL_EDGES_T(e, g, Graph) put(p_out, e, get(p_in, g)); } namespace distributed { // Define global_index<Graph> global(graph); // Then global(v) returns global index of v template <typename Graph> struct global_index { typedef typename property_map<Graph, vertex_index_t>::const_type VertexIndexMap; typedef typename property_map<Graph, vertex_global_t>::const_type VertexGlobalMap; explicit global_index(Graph const& g) : global_index_map(process_group(g), num_vertices(g), get(vertex_index, g), get(vertex_global, g)) {} int operator() (typename graph_traits<Graph>::vertex_descriptor v) { return get(global_index_map, v); } protected: boost::parallel::global_index_map<VertexIndexMap, VertexGlobalMap> global_index_map; }; template<typename T> struct additive_reducer { BOOST_STATIC_CONSTANT(bool, non_default_resolver = true); template<typename K> T operator()(const K&) const { return T(0); } template<typename K> T operator()(const K&, const T& local, const T& remote) const { return local + remote; } }; template <typename T> struct choose_min_reducer { BOOST_STATIC_CONSTANT(bool, non_default_resolver = true); template<typename K> T operator()(const K&) const { return (std::numeric_limits<T>::max)(); } template<typename K> T operator()(const K&, const T& x, const T& y) const { return x < y ? x : y; } }; // To use a property map syntactically like a function template <typename PropertyMap> struct property_map_reader { explicit property_map_reader(PropertyMap pm) : pm(pm) {} template <typename T> typename PropertyMap::value_type operator() (const T& v) { return get(pm, v); } private: PropertyMap pm; }; } // namespace distributed }} // namespace boost::graph #endif // BOOST_GRAPH_DISTRIBUTED_GRAPH_UTILITY_INCLUDE
Save
cmd:
run