Boost logo

Boost-Commit :

From: asutton_at_[hidden]
Date: 2008-05-29 17:16:28


Author: asutton
Date: 2008-05-29 17:16:28 EDT (Thu, 29 May 2008)
New Revision: 45923
URL: http://svn.boost.org/trac/boost/changeset/45923

Log:
Added a generic add vertices "algorithm" for tests.

Added:
   sandbox/SOC/2008/graphs/libs/graphs/add_vertices.hpp (contents, props changed)

Added: sandbox/SOC/2008/graphs/libs/graphs/add_vertices.hpp
==============================================================================
--- (empty file)
+++ sandbox/SOC/2008/graphs/libs/graphs/add_vertices.hpp 2008-05-29 17:16:28 EDT (Thu, 29 May 2008)
@@ -0,0 +1,20 @@
+
+#ifndef ADD_VERTICES_HPP
+#define ADD_VERTICES_HPP
+
+/**
+ * Add numbered vertices to the graph.
+ *
+ * @requires ExtendableGraph<Graph>
+ * @requires PropertyGraph<Graph>
+ * @requires Convertible<Graph::vertex_properties, int>
+ */
+template <typename Graph>
+void add_vertices(Graph& g, int n)
+{
+ for(int i = 0; i < n; ++i) {
+ g.add_vertex(i);
+ }
+}
+
+#endif


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