/
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/local_subgraph.hpp
(6057B)
// Copyright (C) 2004-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: Douglas Gregor // Andrew Lumsdaine #ifndef BOOST_GRAPH_LOCAL_SUBGRAPH_HPP #define BOOST_GRAPH_LOCAL_SUBGRAPH_HPP #ifndef BOOST_GRAPH_USE_MPI #error "Parallel BGL files should not be included unless <boost/graph/use_mpi.hpp> has been included" #endif #include <boost/graph/graph_traits.hpp> #include <boost/graph/filtered_graph.hpp> #include <boost/type_traits/is_same.hpp> #include <boost/type_traits/is_base_and_derived.hpp> #include <boost/graph/parallel/container_traits.hpp> namespace boost { namespace graph { namespace detail { // Optionally, virtually derive from a base class template<bool Derive, typename Base> struct derive_from_if; template<typename Base> struct derive_from_if<true, Base> : virtual Base {}; template<typename Base> struct derive_from_if<false, Base> {}; template<typename NewBase, typename Tag, typename OldBase = NewBase> struct derive_from_if_tag_is : derive_from_if<(is_base_and_derived<OldBase, Tag>::value || is_same<OldBase, Tag>::value), NewBase> { }; } } // end namespace graph::detail template<typename DistributedGraph> class is_local_edge { public: typedef bool result_type; typedef typename graph_traits<DistributedGraph>::edge_descriptor argument_type; is_local_edge() : g(0) {} is_local_edge(DistributedGraph& g) : g(&g), owner(get(vertex_owner, g)) {} // Since either the source or target vertex must be local, the // equivalence of their owners indicates a local edge. result_type operator()(const argument_type& e) const { return get(owner, source(e, *g)) == get(owner, target(e, *g)); } private: DistributedGraph* g; typename property_map<DistributedGraph, vertex_owner_t>::const_type owner; }; template<typename DistributedGraph> class is_local_vertex { public: typedef bool result_type; typedef typename graph_traits<DistributedGraph>::vertex_descriptor argument_type; is_local_vertex() : g(0) {} is_local_vertex(DistributedGraph& g) : g(&g), owner(get(vertex_owner, g)) { } // Since either the source or target vertex must be local, the // equivalence of their owners indicates a local edge. result_type operator()(const argument_type& v) const { return get(owner, v) == process_id(process_group(*g)); } private: DistributedGraph* g; typename property_map<DistributedGraph, vertex_owner_t>::const_type owner; }; template<typename DistributedGraph> class local_subgraph : public filtered_graph<DistributedGraph, is_local_edge<DistributedGraph>, is_local_vertex<DistributedGraph> > { typedef filtered_graph<DistributedGraph, is_local_edge<DistributedGraph>, is_local_vertex<DistributedGraph> > inherited; typedef typename graph_traits<DistributedGraph>::traversal_category inherited_category; public: struct traversal_category : graph::detail::derive_from_if_tag_is<incidence_graph_tag, inherited_category>, graph::detail::derive_from_if_tag_is<adjacency_graph_tag, inherited_category>, graph::detail::derive_from_if_tag_is<vertex_list_graph_tag, inherited_category>, graph::detail::derive_from_if_tag_is<edge_list_graph_tag, inherited_category>, graph::detail::derive_from_if_tag_is<vertex_list_graph_tag, inherited_category, distributed_vertex_list_graph_tag>, graph::detail::derive_from_if_tag_is<edge_list_graph_tag, inherited_category, distributed_edge_list_graph_tag> { }; local_subgraph(DistributedGraph& g) : inherited(g, is_local_edge<DistributedGraph>(g), is_local_vertex<DistributedGraph>(g)), g(g) { } // Distributed Container typedef typename boost::graph::parallel::process_group_type<DistributedGraph>::type process_group_type; process_group_type& process_group() { using boost::graph::parallel::process_group; return process_group(g); } const process_group_type& process_group() const { using boost::graph::parallel::process_group; return boost::graph::parallel::process_group(g); } DistributedGraph& base() { return g; } const DistributedGraph& base() const { return g; } private: DistributedGraph& g; }; template<typename DistributedGraph, typename PropertyTag> class property_map<local_subgraph<DistributedGraph>, PropertyTag> : public property_map<DistributedGraph, PropertyTag> { }; template<typename DistributedGraph, typename PropertyTag> class property_map<local_subgraph<const DistributedGraph>, PropertyTag> { public: typedef typename property_map<DistributedGraph, PropertyTag>::const_type type; typedef type const_type; }; template<typename PropertyTag, typename DistributedGraph> inline typename property_map<local_subgraph<DistributedGraph>, PropertyTag>::type get(PropertyTag p, local_subgraph<DistributedGraph>& g) { return get(p, g.base()); } template<typename PropertyTag, typename DistributedGraph> inline typename property_map<local_subgraph<DistributedGraph>, PropertyTag> ::const_type get(PropertyTag p, const local_subgraph<DistributedGraph>& g) { return get(p, g.base()); } template<typename DistributedGraph> inline local_subgraph<DistributedGraph> make_local_subgraph(DistributedGraph& g) { return local_subgraph<DistributedGraph>(g); } } // end namespace boost #endif // BOOST_GRAPH_LOCAL_SUBGRAPH_HPP
Save
cmd:
run