]> git.proxmox.com Git - ceph.git/blame - ceph/src/boost/libs/graph_parallel/doc/vertex_list_adaptor.rst
bump version to 12.2.2-pve1
[ceph.git] / ceph / src / boost / libs / graph_parallel / doc / vertex_list_adaptor.rst
CommitLineData
7c673cae
FG
1.. Copyright (C) 2004-2008 The Trustees of Indiana University.
2 Use, modification and distribution is subject to the Boost Software
3 License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
4 http://www.boost.org/LICENSE_1_0.txt)
5
6================================
7|Logo| Vertex List Graph Adaptor
8================================
9
10::
11
12 template<typename Graph, typename GlobalIndexMap>
13 class vertex_list_adaptor
14 {
15 public:
16 vertex_list_adaptor(const Graph& g,
17 const GlobalIndexMap& index_map = GlobalIndexMap());
18 };
19
20 template<typename Graph, typename GlobalIndexMap>
21 vertex_list_adaptor<Graph, GlobalIndexMap>
22 make_vertex_list_adaptor(const Graph& g, const GlobalIndexMap& index_map);
23
24 template<typename Graph>
25 vertex_list_adaptor<Graph, *unspecified*>
26 make_vertex_list_adaptor(const Graph& g);
27
28
29The vertex list graph adaptor adapts any model of `Distributed Vertex List
30Graph`_ in a `Vertex List Graph`_. In the former type of graph, the
31set of vertices is distributed across the process group, so no
32process has access to all vertices. In the latter type of graph,
33however, every process has access to every vertex in the graph. This
34is required by some distributed algorithms, such as the
35implementations of `Minimum spanning tree`_ algorithms.
36
37.. contents::
38
39Where Defined
40-------------
41<``boost/graph/distributed/vertex_list_adaptor.hpp``>
42
43
44Class template ``vertex_list_adaptor``
45--------------------------------------
46
47The ``vertex_list_adaptor`` class template takes a `Distributed
48Vertex List Graph`_ and a mapping from vertex descriptors to global
49vertex indices, which must be in the range *[0, n)*, where *n* is the
50number of vertices in the entire graph. The mapping is a `Readable
51Property Map`_ whose key type is a vertex descriptor.
52
53The vertex list adaptor stores only a reference to the underlying
54graph, forwarding all operations not related to the vertex list on to
55the underlying graph. For instance, if the underlying graph models
56`Adjacency Graph`_, then the adaptor will also model `Adjacency
57Graph`_. Note, however, that no modifications to the underlying graph
58can occur through the vertex list adaptor. Modifications made to the
59underlying graph directly will be reflected in the vertex list
60adaptor, but modifications that add or remove vertices invalidate the
61vertex list adaptor. Additionally, the vertex list adaptor provides
62access to the global index map via the ``vertex_index`` property.
63
64On construction, the vertex list adaptor performs an all-gather
65operation to create a list of all vertices in the graph within each
66process. It is this list that is accessed via *vertices* and the
67length of this list that is accessed via *num_vertices*. Due to the
68all-gather operation, the creation of this adaptor is a collective
69operation.
70
71Function templates ``make_vertex_list_adaptor``
72-----------------------------------------------
73
74These function templates construct a vertex list adaptor from a graph
75and, optionally, a property map that maps vertices to global index
76numbers.
77
78Parameters
79~~~~~~~~~~
80
81IN: ``Graph& g``
82 The graph type must be a model of `Distributed Vertex List Graph`_.
83
84IN: ``GlobalIndexMap index_map``
85 A `Distributed property map`_ whose type must model `Readable
86 property map`_ that maps from vertices to a global index. If
87 provided, this map must be initialized prior to be passed to the
88 vertex list adaptor.
89
90 **Default:** A property map of unspecified type constructed from a
91 distributed ``iterator_property_map`` that uses the
92 ``vertex_index`` property map of the underlying graph and a vector
93 of ``vertices_size_type``.
94
95Complexity
96~~~~~~~~~~
97These operations require *O(n)* time, where *n* is the number of
98vertices in the graph, and *O(n)* communication per node in the BSP model.
99
100-----------------------------------------------------------------------------
101
102Copyright (C) 2004 The Trustees of Indiana University.
103
104Authors: Douglas Gregor and Andrew Lumsdaine
105
106.. |Logo| image:: pbgl-logo.png
107 :align: middle
108 :alt: Parallel BGL
109 :target: http://www.osl.iu.edu/research/pbgl
110
111.. _Kruskal's algorithm: http://www.boost.org/libs/graph/doc/kruskal_min_spanning_tree.html
112.. _Vertex list graph: http://www.boost.org/libs/graph/doc/VertexListGraph.html
113.. _Adjacency graph: http://www.boost.org/libs/graph/doc/AdjacencyGraph.html
114.. _distributed adjacency list: distributed_adjacency_list.html
115.. _Minimum spanning tree: dehne_gotz_min_spanning_tree.html
116.. _Distributed Vertex List Graph: DistributedVertexListGraph.html
117.. _Distributed property map: distributed_property_map.html
118.. _Readable Property Map: http://www.boost.org/libs/property_map/ReadablePropertyMap.html
119.. _Read/Write Property Map: http://www.boost.org/libs/property_map/ReadWritePropertyMap.html
120
121