]> git.proxmox.com Git - ceph.git/blobdiff - ceph/src/boost/libs/graph/example/mean_geodesic.cpp
update source to Ceph Pacific 16.2.2
[ceph.git] / ceph / src / boost / libs / graph / example / mean_geodesic.cpp
index ca246b0a25d5af1671d69ed4f686fbb7ef437193..d0cfee821ea4ab15a8fbedb1dc5ad63decd86a51 100644 (file)
@@ -24,32 +24,31 @@ 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;
 
 // Declare a matrix type and its corresponding property map that
 // will contain the distances between each pair of vertices.
-typedef exterior_vertex_property<Graph, int> DistanceProperty;
+typedef exterior_vertex_property< Graph, int > DistanceProperty;
 typedef DistanceProperty::matrix_type DistanceMatrix;
 typedef DistanceProperty::matrix_map_type DistanceMatrixMap;
 
 // Declare the weight map so that each edge returns the same value.
-typedef constant_property_map<Edge, int> WeightMap;
+typedef constant_property_map< Edge, int > WeightMap;
 
 // Declare a container and its corresponding property map that
 // will contain the resulting mean geodesic distances of each
 // vertex in the graph.
-typedef exterior_vertex_property<Graph, float> GeodesicProperty;
+typedef exterior_vertex_property< Graph, float > GeodesicProperty;
 typedef GeodesicProperty::container_type GeodesicContainer;
 typedef GeodesicProperty::map_type GeodesicMap;
 
-int
-main(int argc, char *argv[])
+int main(int argc, char* argv[])
 {
     // Create the graph and a property map that provides access
     // to the actor names.
@@ -76,14 +75,14 @@ main(int argc, char *argv[])
 
     // Print the mean geodesic distance of each vertex and finally,
     // the graph itself.
-    graph_traits<Graph>::vertex_iterator i, end;
-    for(boost::tie(i, end) = vertices(g); i != end; ++i) {
-        cout << setw(12) << setiosflags(ios::left)
-             << g[*i].name << get(gm, *i) << endl;
+    graph_traits< Graph >::vertex_iterator i, end;
+    for (boost::tie(i, end) = vertices(g); i != end; ++i)
+    {
+        cout << setw(12) << setiosflags(ios::left) << g[*i].name << get(gm, *i)
+             << endl;
     }
     cout << "small world distance: " << sw << endl;
 
-
     return 0;
 }
 //]