Boost logo

Boost-Commit :

From: asutton_at_[hidden]
Date: 2007-08-01 13:54:21


Author: asutton
Date: 2007-08-01 13:54:20 EDT (Wed, 01 Aug 2007)
New Revision: 38343
URL: http://svn.boost.org/trac/boost/changeset/38343

Log:
Renaming some functions
Added the radius and diameter headers

Added:
   sandbox/SOC/2007/graphs/boost/graph/diameter.hpp (contents, props changed)
   sandbox/SOC/2007/graphs/boost/graph/radius.hpp (contents, props changed)
Text files modified:
   sandbox/SOC/2007/graphs/boost/graph/tiernan_all_cycles.hpp | 4 ++--
   1 files changed, 2 insertions(+), 2 deletions(-)

Added: sandbox/SOC/2007/graphs/boost/graph/diameter.hpp
==============================================================================
--- (empty file)
+++ sandbox/SOC/2007/graphs/boost/graph/diameter.hpp 2007-08-01 13:54:20 EDT (Wed, 01 Aug 2007)
@@ -0,0 +1,26 @@
+// (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)
+
+#ifndef BOOST_GRAPH_DIAMETER_HPP
+#define BOOST_GRAPH_DIAMETER_HPP
+
+namespace boost
+{
+ template <typename Graph, typename EccentricityMap>
+ inline typename property_traits<EccentricityMap>::value_type
+ graph_diameter(const Graph& g, EccentricityMap ecc)
+ {
+ typedef typename property_traits<EccentricityMap>::value_type T;
+ typename graph_traits<Graph>::vertex_iterator i, end;
+ T ret = ecc[*vertices(g).first];
+ for(tie(i, end) = vertices(g); i != end; ++i) {
+ ret = std::max(ret, ecc[*i]);
+ }
+ return ret;
+ }
+}
+
+#endif

Added: sandbox/SOC/2007/graphs/boost/graph/radius.hpp
==============================================================================
--- (empty file)
+++ sandbox/SOC/2007/graphs/boost/graph/radius.hpp 2007-08-01 13:54:20 EDT (Wed, 01 Aug 2007)
@@ -0,0 +1,26 @@
+// (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)
+
+#ifndef BOOST_GRAPH_RADIUS_HPP
+#define BOOST_GRAPH_RADIUS_HPP
+
+namespace boost
+{
+ template <typename Graph, typename EccentricityMap>
+ inline typename property_traits<EccentricityMap>::value_type
+ graph_radius(const Graph& g, EccentricityMap ecc)
+ {
+ typedef typename property_traits<EccentricityMap>::value_type T;
+ typename graph_traits<Graph>::vertex_iterator i, end;
+ T ret = ecc[*vertices(g).first];
+ for(tie(i, end) = vertices(g); i != end; ++i) {
+ ret = std::min(ret, ecc[*i]);
+ }
+ return ret;
+ }
+}
+
+#endif

Modified: sandbox/SOC/2007/graphs/boost/graph/tiernan_all_cycles.hpp
==============================================================================
--- sandbox/SOC/2007/graphs/boost/graph/tiernan_all_cycles.hpp (original)
+++ sandbox/SOC/2007/graphs/boost/graph/tiernan_all_cycles.hpp 2007-08-01 13:54:20 EDT (Wed, 01 Aug 2007)
@@ -295,8 +295,8 @@
     template <typename Graph, typename Visitor>
     inline void
     tiernan_all_cycles(const Graph& g, Visitor vis,
- std::size_t maxlen,
- std::size_t minlen)
+ std::size_t minlen,
+ std::size_t maxlen)
     {
         typedef typename graph_traits<Graph>::vertex_iterator VertexIterator;
 


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