]> git.proxmox.com Git - ceph.git/blobdiff - ceph/src/boost/libs/graph/example/bron_kerbosch_print_cliques.cpp
update source to Ceph Pacific 16.2.2
[ceph.git] / ceph / src / boost / libs / graph / example / bron_kerbosch_print_cliques.cpp
index 93030edd1522fa3350c848377b28975007a5bc95..21c83b690da683814562ebdb4fd4f40b7ecf2707 100644 (file)
@@ -17,19 +17,17 @@ using namespace boost;
 
 // The clique_printer is a visitor that will print the vertices that comprise
 // a clique. Note that the vertices are not given in any specific order.
-template <typename OutputStream>
-struct clique_printer
+template < typename OutputStream > struct clique_printer
 {
-    clique_printer(OutputStream& stream)
-        : os(stream)
-    { }
+    clique_printer(OutputStream& stream) : os(stream) {}
 
-    template <typename Clique, typename Graph>
+    template < typename Clique, typename Graph >
     void clique(const Clique& c, const Graph& g)
     {
         // Iterate over the clique and print each vertex within it.
         typename Clique::const_iterator i, end = c.end();
-        for(i = c.begin(); i != end; ++i) {
+        for (i = c.begin(); i != end; ++i)
+        {
             os << g[*i].name << " ";
         }
         os << endl;
@@ -44,16 +42,15 @@ struct Actor
 };
 
 // Declare the graph type and its vertex and edge types.
-typedef undirected_graph<Actor> Graph;
-typedef graph_traits<Graph>::vertex_descriptor Vertex;
-typedef graph_traits<Graph>::edge_descriptor Edge;
+typedef undirected_graph< Actor > Graph;
+typedef graph_traits< Graph >::vertex_descriptor Vertex;
+typedef graph_traits< Graph >::edge_descriptor Edge;
 
 // The name map provides an abstract accessor for the names of
 // each vertex. This is used during graph creation.
-typedef property_map<Graph, string Actor::*>::type NameMap;
+typedef property_map< Graph, string Actor::* >::type NameMap;
 
-int
-main(int argc, char *argv[])
+int main(int argc, char* argv[])
 {
     // Create the graph and and its name map accessor.
     Graph g;
@@ -63,7 +60,7 @@ main(int argc, char *argv[])
     read_graph(g, nm, cin);
 
     // Instantiate the visitor for printing cliques
-    clique_printer<ostream> vis(cout);
+    clique_printer< ostream > vis(cout);
 
     // Use the Bron-Kerbosch algorithm to find all cliques, printing them
     // as they are found.