$include_dir="/home/hyper-archives/boost-commit/include"; include("$include_dir/msg-header.inc") ?>
From: asutton_at_[hidden]
Date: 2007-08-22 08:40:03
Author: asutton
Date: 2007-08-22 08:39:37 EDT (Wed, 22 Aug 2007)
New Revision: 38836
URL: http://svn.boost.org/trac/boost/changeset/38836
Log:
Added concept check for clustering coefficient
Added:
   sandbox/SOC/2007/graphs/libs/graph/test/concept/clustering_coefficient.cpp   (contents, props changed)
Text files modified: 
   sandbox/SOC/2007/graphs/libs/graph/test/concept/Jamfile.v2 |     1 +                                       
   1 files changed, 1 insertions(+), 0 deletions(-)
Modified: sandbox/SOC/2007/graphs/libs/graph/test/concept/Jamfile.v2
==============================================================================
--- sandbox/SOC/2007/graphs/libs/graph/test/concept/Jamfile.v2	(original)
+++ sandbox/SOC/2007/graphs/libs/graph/test/concept/Jamfile.v2	2007-08-22 08:39:37 EDT (Wed, 22 Aug 2007)
@@ -13,6 +13,7 @@
     [ compile closeness_centrality_check.cpp ]
     [ compile mean_geodesic_check.cpp ]
     [ compile eccentricity_check.cpp ]
+    [ compile clustering_coefficient.cpp ]
     [ compile tiernan_all_cycles.cpp ]
     [ compile bron_kerbosch_all_cliques.cpp ]
     ;
\ No newline at end of file
Added: sandbox/SOC/2007/graphs/libs/graph/test/concept/clustering_coefficient.cpp
==============================================================================
--- (empty file)
+++ sandbox/SOC/2007/graphs/libs/graph/test/concept/clustering_coefficient.cpp	2007-08-22 08:39:37 EDT (Wed, 22 Aug 2007)
@@ -0,0 +1,65 @@
+// (C) Copyright Andrew Sutton 2007
+//
+// Use, modification and distribution are subject to the
+// Boost Software License, Version 1.0 (See accompanying file
+// LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt)
+
+#include "archetypes.hpp"
+#include <boost/graph/clustering_coefficient.hpp>
+
+#include <iostream>
+
+using namespace std;
+using namespace boost;
+
+int
+main(int argc, char *argv[])
+{
+    {
+        typedef vertex_list_graph_archetype<
+                undirected_tag,
+                allow_parallel_edge_tag
+            > VertexListGraph;
+        typedef incidence_graph_archetype<
+                undirected_tag,
+                allow_parallel_edge_tag,
+                VertexListGraph
+            > IncidenceGraph;
+        typedef adjacency_graph_archetype<
+                undirected_tag,
+                allow_parallel_edge_tag,
+                IncidenceGraph
+            > AdjacencyGraph;
+        typedef adjacency_matrix_archetype<
+                undirected_tag,
+                allow_parallel_edge_tag,
+                AdjacencyGraph
+            > AdjacencyMatrix;
+        typedef graph_traits<AdjacencyMatrix>::vertex_descriptor Vertex;
+        typedef writable_property_map_archetype<Vertex, float> ClusteringMap;
+
+        AdjacencyMatrix& g = static_object<AdjacencyMatrix>::get();
+        Vertex v = static_object<Vertex>::get();
+        ClusteringMap cm;
+
+        num_paths_through_vertex(g, v);
+        num_triangles_on_vertex(g, v);
+        clustering_coefficient(g, v);
+        all_clustering_coefficients(g, cm);
+    }
+
+    {
+        typedef vertex_list_graph_archetype<
+                undirected_tag,
+                allow_parallel_edge_tag
+            > VertexListGraph;
+        typedef graph_traits<VertexListGraph>::vertex_descriptor Vertex;
+        typedef readable_property_map_archetype<Vertex, float> ClusteringMap;
+
+        VertexListGraph& g = static_object<VertexListGraph>::get();
+        ClusteringMap cm;
+        mean_clustering_coefficient(g, cm);
+    }
+
+    return 0;
+}