|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r52140 - in trunk/boost/graph: . detail
From: jewillco_at_[hidden]
Date: 2009-04-02 15:22:40
Author: jewillco
Date: 2009-04-02 15:22:38 EDT (Thu, 02 Apr 2009)
New Revision: 52140
URL: http://svn.boost.org/trac/boost/changeset/52140
Log:
Fixed min/max inspection reports
Text files modified:
trunk/boost/graph/bron_kerbosch_all_cliques.hpp | 4 +++-
trunk/boost/graph/detail/geodesic.hpp | 3 ++-
trunk/boost/graph/eccentricity.hpp | 11 +++++++----
trunk/boost/graph/howard_cycle_ratio.hpp | 3 ++-
trunk/boost/graph/numeric_values.hpp | 2 +-
trunk/boost/graph/ssca_graph_generator.hpp | 4 +++-
trunk/boost/graph/tiernan_all_cycles.hpp | 27 +++++++++++++++------------
7 files changed, 33 insertions(+), 21 deletions(-)
Modified: trunk/boost/graph/bron_kerbosch_all_cliques.hpp
==============================================================================
--- trunk/boost/graph/bron_kerbosch_all_cliques.hpp (original)
+++ trunk/boost/graph/bron_kerbosch_all_cliques.hpp 2009-04-02 15:22:38 EDT (Thu, 02 Apr 2009)
@@ -9,6 +9,7 @@
#include <vector>
#include <deque>
+#include <boost/config.hpp>
#include <boost/graph/graph_concepts.hpp>
@@ -106,7 +107,8 @@
template <typename Clique, typename Graph>
inline void clique(const Clique& p, const Graph& g)
{
- maximum = std::max(maximum, p.size());
+ BOOST_USING_STD_MAX();
+ maximum = max BOOST_PREVENT_MACRO_SUBSTITUTION (maximum, p.size());
}
std::size_t& maximum;
};
Modified: trunk/boost/graph/detail/geodesic.hpp
==============================================================================
--- trunk/boost/graph/detail/geodesic.hpp (original)
+++ trunk/boost/graph/detail/geodesic.hpp 2009-04-02 15:22:38 EDT (Thu, 02 Apr 2009)
@@ -8,6 +8,7 @@
#define BOOST_GRAPH_DETAIL_GEODESIC_HPP
#include <functional>
+#include <boost/config.hpp>
#include <boost/graph/graph_concepts.hpp>
#include <boost/graph/numeric_values.hpp>
@@ -83,7 +84,7 @@
struct maximize : public std::binary_function<T, T, T>
{
T operator ()(T x, T y) const
- { return std::max(x, y); }
+ { BOOST_USING_STD_MAX(); return max BOOST_PREVENT_MACRO_SUBSTITUTION (x, y); }
};
// Another helper, like maximize() to help abstract functional
Modified: trunk/boost/graph/eccentricity.hpp
==============================================================================
--- trunk/boost/graph/eccentricity.hpp (original)
+++ trunk/boost/graph/eccentricity.hpp 2009-04-02 15:22:38 EDT (Thu, 02 Apr 2009)
@@ -8,6 +8,7 @@
#define BOOST_GRAPH_ECCENTRICITY_HPP
#include <boost/utility.hpp>
+#include <boost/config.hpp>
#include <boost/graph/detail/geodesic.hpp>
namespace boost
@@ -50,6 +51,8 @@
typedef typename property_traits<DistanceMatrix>::value_type DistanceMap;
function_requires< WritablePropertyMapConcept<EccentricityMap,Vertex> >();
typedef typename property_traits<EccentricityMap>::value_type Eccentricity;
+ BOOST_USING_STD_MIN();
+ BOOST_USING_STD_MAX();
Eccentricity
r = numeric_values<Eccentricity>::infinity(),
@@ -62,8 +65,8 @@
put(ecc, *i, e);
// track the radius and diameter at the same time
- r = std::min(r, e);
- d = std::max(d, e);
+ r = min BOOST_PREVENT_MACRO_SUBSTITUTION (r, e);
+ d = max BOOST_PREVENT_MACRO_SUBSTITUTION (d, e);
}
return make_pair(r, d);
}
@@ -85,8 +88,8 @@
Eccentricity diameter = get(ecc, *i);
for(i = next(i); i != end; ++i) {
Eccentricity cur = get(ecc, *i);
- radius = std::min(radius, cur);
- diameter = std::max(diameter, cur);
+ radius = min BOOST_PREVENT_MACRO_SUBSTITUTION (radius, cur);
+ diameter = max BOOST_PREVENT_MACRO_SUBSTITUTION (diameter, cur);
}
return std::make_pair(radius, diameter);
}
Modified: trunk/boost/graph/howard_cycle_ratio.hpp
==============================================================================
--- trunk/boost/graph/howard_cycle_ratio.hpp (original)
+++ trunk/boost/graph/howard_cycle_ratio.hpp 2009-04-02 15:22:38 EDT (Thu, 02 Apr 2009)
@@ -19,6 +19,7 @@
#include <exception>
#include <set>
#include <boost/bind.hpp>
+#include <boost/config.hpp>
#include <boost/lexical_cast.hpp>
#include <boost/type_traits/is_convertible.hpp>
#include <boost/type_traits/remove_const.hpp>
@@ -52,7 +53,7 @@
* \param ewm2 - edge weight2 read property map: E -> R+
*
* \return maximum_{for all cycles C}CR(C), or
- * -(std::numeric_limits<double>)::max() if g is not "good".
+ * -(std::numeric_limits<double>::max)() if g is not "good".
*/
template <typename TGraph, typename TVertexIndexMap,
typename TWeight1EdgeMap, typename TWeight2EdgeMap >
Modified: trunk/boost/graph/numeric_values.hpp
==============================================================================
--- trunk/boost/graph/numeric_values.hpp (original)
+++ trunk/boost/graph/numeric_values.hpp 2009-04-02 15:22:38 EDT (Thu, 02 Apr 2009)
@@ -37,7 +37,7 @@
{ return T(); }
static T infinity()
- { return std::numeric_limits<T>::max(); }
+ { return (std::numeric_limits<T>::max)(); }
};
// Specializations for floating point types refer to 0.0 and their infinity
Modified: trunk/boost/graph/ssca_graph_generator.hpp
==============================================================================
--- trunk/boost/graph/ssca_graph_generator.hpp (original)
+++ trunk/boost/graph/ssca_graph_generator.hpp 2009-04-02 15:22:38 EDT (Thu, 02 Apr 2009)
@@ -13,6 +13,7 @@
#include <utility>
#include <vector>
#include <queue>
+#include <boost/config.hpp>
#include <boost/random/uniform_int.hpp>
#include <boost/graph/graph_traits.hpp>
#include <boost/type_traits/is_base_and_derived.hpp>
@@ -58,6 +59,7 @@
ssca_iterator& operator++()
{
+ BOOST_USING_STD_MIN();
while (values.empty() && verticesRemaining > 0) { // If there are no values left, generate a new clique
uniform_int<vertices_size_type> clique_size(1, maxCliqueSize);
uniform_int<vertices_size_type> rand_vertex(0, totVertices-1);
@@ -67,7 +69,7 @@
std::vector<vertices_size_type> cliqueVertices;
cliqueVertices.clear();
- vertices_size_type size = std::min(clique_size(*gen), verticesRemaining);
+ vertices_size_type size = min BOOST_PREVENT_MACRO_SUBSTITUTION (clique_size(*gen), verticesRemaining);
while (cliqueVertices.size() < size) {
vertices_size_type v = rand_vertex(*gen);
if (cliqueNum[v] == -1) {
Modified: trunk/boost/graph/tiernan_all_cycles.hpp
==============================================================================
--- trunk/boost/graph/tiernan_all_cycles.hpp (original)
+++ trunk/boost/graph/tiernan_all_cycles.hpp 2009-04-02 15:22:38 EDT (Thu, 02 Apr 2009)
@@ -9,6 +9,7 @@
#include <vector>
+#include <boost/config.hpp>
#include <boost/graph/graph_concepts.hpp>
#include <boost/graph/graph_traits.hpp>
#include <boost/graph/properties.hpp>
@@ -99,24 +100,26 @@
*/
struct min_max_cycle_visitor
{
- min_max_cycle_visitor(std::size_t& min, std::size_t& max)
- : minimum(min), maximum(max)
+ min_max_cycle_visitor(std::size_t& min_, std::size_t& max_)
+ : minimum(min_), maximum(max_)
{ }
template <typename Path, typename Graph>
inline void cycle(const Path& p, const Graph& g)
{
+ BOOST_USING_STD_MIN();
+ BOOST_USING_STD_MAX();
std::size_t len = p.size();
- minimum = std::min(minimum, len);
- maximum = std::max(maximum, len);
+ minimum = min BOOST_PREVENT_MACRO_SUBSTITUTION (minimum, len);
+ maximum = max BOOST_PREVENT_MACRO_SUBSTITUTION (maximum, len);
}
std::size_t& minimum;
std::size_t& maximum;
};
inline min_max_cycle_visitor
-find_min_max_cycle(std::size_t& min, std::size_t& max)
-{ return min_max_cycle_visitor(min, max); }
+find_min_max_cycle(std::size_t& min_, std::size_t& max_)
+{ return min_max_cycle_visitor(min_, max_); }
namespace detail
{
@@ -340,7 +343,7 @@
{
typedef typename graph_traits<Graph>::directed_category Dir;
tiernan_all_cycles(g, vis, detail::min_cycles<Dir>::value,
- std::numeric_limits<std::size_t>::max());
+ (std::numeric_limits<std::size_t>::max)());
}
template <typename Graph>
@@ -348,14 +351,14 @@
tiernan_girth_and_circumference(const Graph& g)
{
std::size_t
- min = std::numeric_limits<std::size_t>::max(),
- max = 0;
- tiernan_all_cycles(g, find_min_max_cycle(min, max));
+ min_ = (std::numeric_limits<std::size_t>::max)(),
+ max_ = 0;
+ tiernan_all_cycles(g, find_min_max_cycle(min_, max_));
// if this is the case, the graph is acyclic...
- if(max == 0) max = min;
+ if(max_ == 0) max_ = min_;
- return std::make_pair(min, max);
+ return std::make_pair(min_, max_);
}
template <typename Graph>
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