|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r51098 - trunk/libs/graph/test
From: asutton_at_[hidden]
Date: 2009-02-08 10:28:55
Author: asutton
Date: 2009-02-08 10:28:54 EST (Sun, 08 Feb 2009)
New Revision: 51098
URL: http://svn.boost.org/trac/boost/changeset/51098
Log:
Integrating exterior property maps and closeness centraility.
Added:
trunk/libs/graph/test/closeness_centrality.cpp (contents, props changed)
- copied, changed from r51086, /sandbox/SOC/2007/graphs/libs/graph/test/runtime/closeness_centrality.cpp
trunk/libs/graph/test/index_graph.cpp (contents, props changed)
- copied, changed from r51086, /sandbox/SOC/2007/graphs/libs/graph/test/runtime/index.cpp
Text files modified:
trunk/libs/graph/test/Jamfile.v2 | 2 ++
trunk/libs/graph/test/closeness_centrality.cpp | 4 ++--
trunk/libs/graph/test/index_graph.cpp | 22 ++++++++++------------
3 files changed, 14 insertions(+), 14 deletions(-)
Modified: trunk/libs/graph/test/Jamfile.v2
==============================================================================
--- trunk/libs/graph/test/Jamfile.v2 (original)
+++ trunk/libs/graph/test/Jamfile.v2 2009-02-08 10:28:54 EST (Sun, 08 Feb 2009)
@@ -24,6 +24,7 @@
# test_graphs will eventually defined a framework for testing the structure
# and implementation of graph data structures and adaptors.
[ run test_graphs.cpp ]
+ [ run index_graph.cpp ] # TODO: Make this part of the test_graphs framework
[ run transitive_closure_test.cpp ]
[ compile adj_list_cc.cpp ]
@@ -99,6 +100,7 @@
[ compile dimacs.cpp ]
[ run bron_kerbosch_all_cliques.cpp ]
[ run tiernan_all_cycles.cpp ]
+ [ run closeness_centrality.cpp ]
$(optional_tests)
;
Copied: trunk/libs/graph/test/closeness_centrality.cpp (from r51086, /sandbox/SOC/2007/graphs/libs/graph/test/runtime/closeness_centrality.cpp)
==============================================================================
--- /sandbox/SOC/2007/graphs/libs/graph/test/runtime/closeness_centrality.cpp (original)
+++ trunk/libs/graph/test/closeness_centrality.cpp 2009-02-08 10:28:54 EST (Sun, 08 Feb 2009)
@@ -9,10 +9,10 @@
#include <boost/graph/undirected_graph.hpp>
#include <boost/graph/directed_graph.hpp>
-#include <boost/graph/exterior_property.hpp>
-#include <boost/graph/constant_property_map.hpp>
#include <boost/graph/floyd_warshall_shortest.hpp>
#include <boost/graph/closeness_centrality.hpp>
+#include <boost/graph/exterior_property.hpp>
+#include <boost/graph/property_maps/constant_property_map.hpp>
using namespace std;
using namespace boost;
Copied: trunk/libs/graph/test/index_graph.cpp (from r51086, /sandbox/SOC/2007/graphs/libs/graph/test/runtime/index.cpp)
==============================================================================
--- /sandbox/SOC/2007/graphs/libs/graph/test/runtime/index.cpp (original)
+++ trunk/libs/graph/test/index_graph.cpp 2009-02-08 10:28:54 EST (Sun, 08 Feb 2009)
@@ -1,12 +1,10 @@
-
-// (C) Copyright Andrew Sutton 2007
+// (C) Copyright 2007-2009 Andrew Sutton
//
// 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 <iostream>
-#include <boost/test/minimal.hpp>
#include <boost/graph/undirected_graph.hpp>
using namespace std;
@@ -16,7 +14,7 @@
typedef Graph::vertex_descriptor Vertex;
typedef property_map<Graph, vertex_index_t>::type IndexMap;
-int test_main(int, char*[])
+int main(int, char*[])
{
static const size_t N = 5;
Graph g;
@@ -30,33 +28,33 @@
}
// after the first build, we should have these conditions
- BOOST_CHECK(max_vertex_index(g) == N);
+ BOOST_ASSERT(max_vertex_index(g) == N);
for(size_t i = 0; i < N; ++i) {
- BOOST_CHECK(get_vertex_index(v[i], g) == i);
+ BOOST_ASSERT(get_vertex_index(v[i], g) == i);
}
// remove some vertices and re-add them...
for(size_t i = 0; i < N; ++i) remove_vertex(v[i], g);
- BOOST_CHECK(num_vertices(g) == 0);
+ BOOST_ASSERT(num_vertices(g) == 0);
for(size_t i = 0; i < N; ++i) {
- v[i] = add_vertex(g);
+ v[i] = add_vertex(g);
}
// before renumbering, our vertices should be off by
// about N...
- BOOST_CHECK(max_vertex_index(g) == 10);
+ BOOST_ASSERT(max_vertex_index(g) == 10);
for(size_t i = 0; i < N; ++i) {
- BOOST_CHECK(get_vertex_index(v[i], g) == N + i);
+ BOOST_ASSERT(get_vertex_index(v[i], g) == N + i);
}
// renumber vertices
renumber_vertex_indices(g);
// and we should be back to the initial condition
- BOOST_CHECK(max_vertex_index(g) == N);
+ BOOST_ASSERT(max_vertex_index(g) == N);
for(size_t i = 0; i < N; ++i) {
- BOOST_CHECK(get_vertex_index(v[i], g) == i);
+ BOOST_ASSERT(get_vertex_index(v[i], g) == i);
}
return 0;
Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk