From b8d36774faafa89ffc016c2c35f7e906035b2fa5 Mon Sep 17 00:00:00 2001 From: Rasmus Munk Larsen Date: Wed, 16 May 2018 14:04:48 -0700 Subject: Rename clip2 to clamp. --- unsupported/Eigen/CXX11/src/Tensor/TensorBase.h | 4 ++-- unsupported/Eigen/CXX11/src/Tensor/TensorFunctors.h | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) (limited to 'unsupported/Eigen/CXX11') diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorBase.h b/unsupported/Eigen/CXX11/src/Tensor/TensorBase.h index 497e2a797..745b16d2c 100644 --- a/unsupported/Eigen/CXX11/src/Tensor/TensorBase.h +++ b/unsupported/Eigen/CXX11/src/Tensor/TensorBase.h @@ -210,9 +210,9 @@ class TensorBase } EIGEN_DEVICE_FUNC - EIGEN_STRONG_INLINE const TensorCwiseUnaryOp, const Derived> + EIGEN_STRONG_INLINE const TensorCwiseUnaryOp, const Derived> clip(Scalar min, Scalar max) const { - return unaryExpr(internal::scalar_clip2_op(min, max)); + return unaryExpr(internal::scalar_clamp_op(min, max)); } EIGEN_DEVICE_FUNC diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorFunctors.h b/unsupported/Eigen/CXX11/src/Tensor/TensorFunctors.h index adadb5afc..0efcd6253 100644 --- a/unsupported/Eigen/CXX11/src/Tensor/TensorFunctors.h +++ b/unsupported/Eigen/CXX11/src/Tensor/TensorFunctors.h @@ -488,8 +488,8 @@ struct functor_traits > { }; template -struct scalar_clip2_op { - EIGEN_DEVICE_FUNC inline scalar_clip2_op(const Scalar& _min, const Scalar& _max) : m_min(_min), m_max(_max) {} +struct scalar_clamp_op { + EIGEN_DEVICE_FUNC inline scalar_clamp_op(const Scalar& _min, const Scalar& _max) : m_min(_min), m_max(_max) {} EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const Scalar operator()(const Scalar& x) const { return numext::mini(numext::maxi(x, m_min), m_max); @@ -503,7 +503,7 @@ struct scalar_clip2_op { const Scalar m_max; }; template -struct functor_traits > +struct functor_traits > { enum { Cost = 2 * NumTraits::AddCost, PacketAccess = (packet_traits::HasMin && packet_traits::HasMax)}; }; } // end namespace internal -- cgit v1.2.3