From 467b7b9263aa7f4cfde616d9652f20bcfcfb6121 Mon Sep 17 00:00:00 2001 From: Gael Guennebaud Date: Sun, 28 Aug 2011 22:17:11 +0200 Subject: [PATCH] fix bug #337: mess with min/max in eigen2 support --- Eigen/src/Eigen2Support/Geometry/AlignedBox.h | 24 +++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/Eigen/src/Eigen2Support/Geometry/AlignedBox.h b/Eigen/src/Eigen2Support/Geometry/AlignedBox.h index 6ad846d35..78df29d40 100644 --- a/Eigen/src/Eigen2Support/Geometry/AlignedBox.h +++ b/Eigen/src/Eigen2Support/Geometry/AlignedBox.h @@ -51,19 +51,19 @@ EIGEN_MAKE_ALIGNED_OPERATOR_NEW_IF_VECTORIZABLE_FIXED_SIZE(_Scalar,_AmbientDim== { if (AmbientDimAtCompileTime!=Dynamic) setNull(); } /** Constructs a null box with \a _dim the dimension of the ambient space. */ - inline explicit AlignedBox(int _dim) : m_(min)(_dim), m_(max)(_dim) + inline explicit AlignedBox(int _dim) : m_min(_dim), m_max(_dim) { setNull(); } /** Constructs a box with extremities \a _min and \a _max. */ - inline AlignedBox(const VectorType& _min, const VectorType& _max) : m_(min)(_min), m_(max)(_max) {} + inline AlignedBox(const VectorType& _min, const VectorType& _max) : m_min(_min), m_max(_max) {} /** Constructs a box containing a single point \a p. */ - inline explicit AlignedBox(const VectorType& p) : m_(min)(p), m_(max)(p) {} + inline explicit AlignedBox(const VectorType& p) : m_min(p), m_max(p) {} ~AlignedBox() {} /** \returns the dimension in which the box holds */ - inline int dim() const { return AmbientDimAtCompileTime==Dynamic ? m_min.size()-1 : AmbientDimAtCompileTime; } + inline int dim() const { return AmbientDimAtCompileTime==Dynamic ? m_min.size()-1 : int(AmbientDimAtCompileTime); } /** \returns true if the box is null, i.e, empty. */ inline bool isNull() const { return (m_min.cwise() > m_max).any(); } @@ -71,8 +71,8 @@ EIGEN_MAKE_ALIGNED_OPERATOR_NEW_IF_VECTORIZABLE_FIXED_SIZE(_Scalar,_AmbientDim== /** Makes \c *this a null/empty box. */ inline void setNull() { - m_min.setConstant( std::numeric_limits::(max)()); - m_max.setConstant(-std::numeric_limits::(max)()); + m_min.setConstant( (std::numeric_limits::max)()); + m_max.setConstant(-(std::numeric_limits::max)()); } /** \returns the minimal corner */ @@ -90,19 +90,19 @@ EIGEN_MAKE_ALIGNED_OPERATOR_NEW_IF_VECTORIZABLE_FIXED_SIZE(_Scalar,_AmbientDim== /** \returns true if the box \a b is entirely inside the box \c *this. */ inline bool contains(const AlignedBox& b) const - { return (m_min.cwise()<=b.(min)()).all() && (b.(max)().cwise()<=m_max).all(); } + { return (m_min.cwise()<=(b.min)()).all() && ((b.max)().cwise()<=m_max).all(); } /** Extends \c *this such that it contains the point \a p and returns a reference to \c *this. */ inline AlignedBox& extend(const VectorType& p) - { m_min = m_min.cwise().(min)(p); m_max = m_max.cwise().(max)(p); return *this; } + { m_min = (m_min.cwise().min)(p); m_max = (m_max.cwise().max)(p); return *this; } /** Extends \c *this such that it contains the box \a b and returns a reference to \c *this. */ inline AlignedBox& extend(const AlignedBox& b) - { m_min = m_min.cwise().(min)(b.m_min); m_max = m_max.cwise().(max)(b.m_max); return *this; } + { m_min = (m_min.cwise().min)(b.m_min); m_max = (m_max.cwise().max)(b.m_max); return *this; } /** Clamps \c *this by the box \a b and returns a reference to \c *this. */ inline AlignedBox& clamp(const AlignedBox& b) - { m_min = m_min.cwise().(max)(b.m_min); m_max = m_max.cwise().(min)(b.m_max); return *this; } + { m_min = (m_min.cwise().max)(b.m_min); m_max = (m_max.cwise().min)(b.m_max); return *this; } /** Translate \c *this by the vector \a t and returns a reference to \c *this. */ inline AlignedBox& translate(const VectorType& t) @@ -138,8 +138,8 @@ EIGEN_MAKE_ALIGNED_OPERATOR_NEW_IF_VECTORIZABLE_FIXED_SIZE(_Scalar,_AmbientDim== template inline explicit AlignedBox(const AlignedBox& other) { - m_min = other.(min)().template cast(); - m_max = other.(max)().template cast(); + m_min = (other.min)().template cast(); + m_max = (other.max)().template cast(); } /** \returns \c true if \c *this is approximately equal to \a other, within the precision