vertex_list_adaptor.html 7.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121
  1. <?xml version="1.0" encoding="utf-8" ?>
  2. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  3. <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
  4. <head>
  5. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  6. <meta name="generator" content="Docutils 0.6: http://docutils.sourceforge.net/" />
  7. <title>Parallel BGL Vertex List Graph Adaptor</title>
  8. <link rel="stylesheet" href="../../../../rst.css" type="text/css" />
  9. </head>
  10. <body>
  11. <div class="document" id="logo-vertex-list-graph-adaptor">
  12. <h1 class="title"><a class="reference external" href="http://www.osl.iu.edu/research/pbgl"><img align="middle" alt="Parallel BGL" class="align-middle" src="pbgl-logo.png" /></a> Vertex List Graph Adaptor</h1>
  13. <!-- Copyright (C) 2004-2008 The Trustees of Indiana University.
  14. Use, modification and distribution is subject to the Boost Software
  15. License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
  16. http://www.boost.org/LICENSE_1_0.txt) -->
  17. <pre class="literal-block">
  18. template&lt;typename Graph, typename GlobalIndexMap&gt;
  19. class vertex_list_adaptor
  20. {
  21. public:
  22. vertex_list_adaptor(const Graph&amp; g,
  23. const GlobalIndexMap&amp; index_map = GlobalIndexMap());
  24. };
  25. template&lt;typename Graph, typename GlobalIndexMap&gt;
  26. vertex_list_adaptor&lt;Graph, GlobalIndexMap&gt;
  27. make_vertex_list_adaptor(const Graph&amp; g, const GlobalIndexMap&amp; index_map);
  28. template&lt;typename Graph&gt;
  29. vertex_list_adaptor&lt;Graph, *unspecified*&gt;
  30. make_vertex_list_adaptor(const Graph&amp; g);
  31. </pre>
  32. <p>The vertex list graph adaptor adapts any model of <a class="reference external" href="DistributedVertexListGraph.html">Distributed Vertex List
  33. Graph</a> in a <a class="reference external" href="http://www.boost.org/libs/graph/doc/VertexListGraph.html">Vertex List Graph</a>. In the former type of graph, the
  34. set of vertices is distributed across the process group, so no
  35. process has access to all vertices. In the latter type of graph,
  36. however, every process has access to every vertex in the graph. This
  37. is required by some distributed algorithms, such as the
  38. implementations of <a class="reference external" href="dehne_gotz_min_spanning_tree.html">Minimum spanning tree</a> algorithms.</p>
  39. <div class="contents topic" id="contents">
  40. <p class="topic-title first">Contents</p>
  41. <ul class="simple">
  42. <li><a class="reference internal" href="#where-defined" id="id1">Where Defined</a></li>
  43. <li><a class="reference internal" href="#class-template-vertex-list-adaptor" id="id2">Class template <tt class="docutils literal"><span class="pre">vertex_list_adaptor</span></tt></a></li>
  44. <li><a class="reference internal" href="#function-templates-make-vertex-list-adaptor" id="id3">Function templates <tt class="docutils literal"><span class="pre">make_vertex_list_adaptor</span></tt></a><ul>
  45. <li><a class="reference internal" href="#parameters" id="id4">Parameters</a></li>
  46. <li><a class="reference internal" href="#complexity" id="id5">Complexity</a></li>
  47. </ul>
  48. </li>
  49. </ul>
  50. </div>
  51. <div class="section" id="where-defined">
  52. <h1><a class="toc-backref" href="#id1">Where Defined</a></h1>
  53. <p>&lt;<tt class="docutils literal"><span class="pre">boost/graph/distributed/vertex_list_adaptor.hpp</span></tt>&gt;</p>
  54. </div>
  55. <div class="section" id="class-template-vertex-list-adaptor">
  56. <h1><a class="toc-backref" href="#id2">Class template <tt class="docutils literal"><span class="pre">vertex_list_adaptor</span></tt></a></h1>
  57. <p>The <tt class="docutils literal"><span class="pre">vertex_list_adaptor</span></tt> class template takes a <a class="reference external" href="DistributedVertexListGraph.html">Distributed
  58. Vertex List Graph</a> and a mapping from vertex descriptors to global
  59. vertex indices, which must be in the range <em>[0, n)</em>, where <em>n</em> is the
  60. number of vertices in the entire graph. The mapping is a <a class="reference external" href="http://www.boost.org/libs/property_map/ReadablePropertyMap.html">Readable
  61. Property Map</a> whose key type is a vertex descriptor.</p>
  62. <p>The vertex list adaptor stores only a reference to the underlying
  63. graph, forwarding all operations not related to the vertex list on to
  64. the underlying graph. For instance, if the underlying graph models
  65. <a class="reference external" href="http://www.boost.org/libs/graph/doc/AdjacencyGraph.html">Adjacency Graph</a>, then the adaptor will also model <a class="reference external" href="http://www.boost.org/libs/graph/doc/AdjacencyGraph.html">Adjacency
  66. Graph</a>. Note, however, that no modifications to the underlying graph
  67. can occur through the vertex list adaptor. Modifications made to the
  68. underlying graph directly will be reflected in the vertex list
  69. adaptor, but modifications that add or remove vertices invalidate the
  70. vertex list adaptor. Additionally, the vertex list adaptor provides
  71. access to the global index map via the <tt class="docutils literal"><span class="pre">vertex_index</span></tt> property.</p>
  72. <p>On construction, the vertex list adaptor performs an all-gather
  73. operation to create a list of all vertices in the graph within each
  74. process. It is this list that is accessed via <em>vertices</em> and the
  75. length of this list that is accessed via <em>num_vertices</em>. Due to the
  76. all-gather operation, the creation of this adaptor is a collective
  77. operation.</p>
  78. </div>
  79. <div class="section" id="function-templates-make-vertex-list-adaptor">
  80. <h1><a class="toc-backref" href="#id3">Function templates <tt class="docutils literal"><span class="pre">make_vertex_list_adaptor</span></tt></a></h1>
  81. <p>These function templates construct a vertex list adaptor from a graph
  82. and, optionally, a property map that maps vertices to global index
  83. numbers.</p>
  84. <div class="section" id="parameters">
  85. <h2><a class="toc-backref" href="#id4">Parameters</a></h2>
  86. <dl class="docutils">
  87. <dt>IN: <tt class="docutils literal"><span class="pre">Graph&amp;</span> <span class="pre">g</span></tt></dt>
  88. <dd>The graph type must be a model of <a class="reference external" href="DistributedVertexListGraph.html">Distributed Vertex List Graph</a>.</dd>
  89. <dt>IN: <tt class="docutils literal"><span class="pre">GlobalIndexMap</span> <span class="pre">index_map</span></tt></dt>
  90. <dd><p class="first">A <a class="reference external" href="distributed_property_map.html">Distributed property map</a> whose type must model <a class="reference external" href="http://www.boost.org/libs/property_map/ReadablePropertyMap.html">Readable
  91. property map</a> that maps from vertices to a global index. If
  92. provided, this map must be initialized prior to be passed to the
  93. vertex list adaptor.</p>
  94. <p class="last"><strong>Default:</strong> A property map of unspecified type constructed from a
  95. distributed <tt class="docutils literal"><span class="pre">iterator_property_map</span></tt> that uses the
  96. <tt class="docutils literal"><span class="pre">vertex_index</span></tt> property map of the underlying graph and a vector
  97. of <tt class="docutils literal"><span class="pre">vertices_size_type</span></tt>.</p>
  98. </dd>
  99. </dl>
  100. </div>
  101. <div class="section" id="complexity">
  102. <h2><a class="toc-backref" href="#id5">Complexity</a></h2>
  103. <p>These operations require <em>O(n)</em> time, where <em>n</em> is the number of
  104. vertices in the graph, and <em>O(n)</em> communication per node in the BSP model.</p>
  105. <hr class="docutils" />
  106. <p>Copyright (C) 2004 The Trustees of Indiana University.</p>
  107. <p>Authors: Douglas Gregor and Andrew Lumsdaine</p>
  108. </div>
  109. </div>
  110. </div>
  111. <div class="footer">
  112. <hr class="footer" />
  113. Generated on: 2009-05-31 00:21 UTC.
  114. Generated by <a class="reference external" href="http://docutils.sourceforge.net/">Docutils</a> from <a class="reference external" href="http://docutils.sourceforge.net/rst.html">reStructuredText</a> source.
  115. </div>
  116. </body>
  117. </html>