]> git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/graph_parallel/doc/html/rmat_generator.html
bump version to 12.2.2-pve1
[ceph.git] / ceph / src / boost / libs / graph_parallel / doc / html / rmat_generator.html
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 R-MAT generator</title>
8 <link rel="stylesheet" href="../../../../rst.css" type="text/css" />
9 </head>
10 <body>
11 <div class="document" id="logo-r-mat-generator">
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> R-MAT generator</h1>
13
14 <!-- Copyright (C) 2004-2009 The Trustees of Indiana University.
15 Use, modification and distribution is subject to the Boost Software
16 License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
17 http://www.boost.org/LICENSE_1_0.txt) -->
18 <pre class="literal-block">
19 template&lt;typename RandomGenerator, typename Graph&gt;
20 class rmat_iterator
21 {
22 public:
23 typedef std::input_iterator_tag iterator_category;
24 typedef std::pair&lt;vertices_size_type, vertices_size_type&gt; value_type;
25 typedef const value_type&amp; reference;
26 typedef const value_type* pointer;
27 typedef void difference_type;
28
29 rmat_iterator();
30 rmat_iterator(RandomGenerator&amp; gen, vertices_size_type n,
31 edges_size_type m, double a, double b, double c,
32 double d, bool permute_vertices = true);
33 // Iterator operations
34 reference operator*() const;
35 pointer operator-&gt;() const;
36 rmat_iterator&amp; operator++();
37 rmat_iterator operator++(int);
38 bool operator==(const rmat_iterator&amp; other) const;
39 bool operator!=(const rmat_iterator&amp; other) const;
40 };
41 </pre>
42 <p>This class template implements a generator for R-MAT graphs <a class="citation-reference" href="#czf04" id="id1">[CZF04]</a>,
43 suitable for initializing an adjacency_list or other graph structure
44 with iterator-based initialization. An R-MAT graph has a scale-free
45 distribution w.r.t. vertex degree and is implemented using
46 Recursive-MATrix partitioning.</p>
47 <div class="section" id="where-defined">
48 <h1>Where Defined</h1>
49 <p>&lt;<tt class="docutils literal"><span class="pre">boost/graph/rmat_graph_generator.hpp</span></tt>&gt;</p>
50 </div>
51 <div class="section" id="constructors">
52 <h1>Constructors</h1>
53 <pre class="literal-block">
54 rmat_iterator();
55 </pre>
56 <p>Constructs a past-the-end iterator.</p>
57 <pre class="literal-block">
58 rmat_iterator(RandomGenerator&amp; gen, vertices_size_type n,
59 edges_size_type m, double a, double b, double c,
60 double d, bool permute_vertices = true);
61 </pre>
62 <p>Constructs an R-MAT generator iterator that creates a graph with <tt class="docutils literal"><span class="pre">n</span></tt>
63 vertices and <tt class="docutils literal"><span class="pre">m</span></tt> edges. <tt class="docutils literal"><span class="pre">a</span></tt>, <tt class="docutils literal"><span class="pre">b</span></tt>, <tt class="docutils literal"><span class="pre">c</span></tt>, and <tt class="docutils literal"><span class="pre">d</span></tt> represent
64 the probability that a generated edge is placed of each of the 4
65 quadrants of the partitioned adjacency matrix. Probabilities are
66 drawn from the random number generator gen. Vertex indices are
67 permuted to eliminate locality when <tt class="docutils literal"><span class="pre">permute_vertices</span></tt> is true.</p>
68 </div>
69 <div class="section" id="example">
70 <h1>Example</h1>
71 <pre class="literal-block">
72 #include &lt;boost/graph/adjacency_list.hpp&gt;
73 #include &lt;boost/graph/rmat_graph_generator.hpp&gt;
74 #include &lt;boost/random/linear_congruential.hpp&gt;
75
76 typedef boost::adjacency_list&lt;&gt; Graph;
77 typedef boost::rmat_iterator&lt;boost::minstd_rand, Graph&gt; RMATGen;
78
79 int main()
80 {
81 boost::minstd_rand gen;
82 // Create graph with 100 nodes and 400 edges
83 Graph g(RMATGen(gen, 100, 400, 0.57, 0.19, 0.19, 0.05), RMATGen(), 100);
84 return 0;
85 }
86 </pre>
87 </div>
88 <div class="section" id="bibliography">
89 <h1>Bibliography</h1>
90 <table class="docutils citation" frame="void" id="czf04" rules="none">
91 <colgroup><col class="label" /><col /></colgroup>
92 <tbody valign="top">
93 <tr><td class="label"><a class="fn-backref" href="#id1">[CZF04]</a></td><td>D Chakrabarti, Y Zhan, and C Faloutsos. R-MAT: A Recursive
94 Model for Graph Mining. In Proceedings of 4th International Conference
95 on Data Mining, pages 442--446, 2004.</td></tr>
96 </tbody>
97 </table>
98 <hr class="docutils" />
99 <p>Copyright (C) 2009 The Trustees of Indiana University.</p>
100 <p>Authors: Nick Edmonds and Andrew Lumsdaine</p>
101 </div>
102 </div>
103 <div class="footer">
104 <hr class="footer" />
105 Generated on: 2009-05-31 00:21 UTC.
106 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.
107
108 </div>
109 </body>
110 </html>