mirror of
https://gitlab.com/libeigen/eigen.git
synced 2025-05-06 02:34:05 +08:00
Rename clip2 to clamp.
This commit is contained in:
parent
812480baa3
commit
b8d36774fa
@ -210,9 +210,9 @@ class TensorBase<Derived, ReadOnlyAccessors>
|
||||
}
|
||||
|
||||
EIGEN_DEVICE_FUNC
|
||||
EIGEN_STRONG_INLINE const TensorCwiseUnaryOp<internal::scalar_clip2_op<Scalar>, const Derived>
|
||||
EIGEN_STRONG_INLINE const TensorCwiseUnaryOp<internal::scalar_clamp_op<Scalar>, const Derived>
|
||||
clip(Scalar min, Scalar max) const {
|
||||
return unaryExpr(internal::scalar_clip2_op<Scalar>(min, max));
|
||||
return unaryExpr(internal::scalar_clamp_op<Scalar>(min, max));
|
||||
}
|
||||
|
||||
EIGEN_DEVICE_FUNC
|
||||
|
@ -488,8 +488,8 @@ struct functor_traits<GaussianGenerator<T, Index, NumDims> > {
|
||||
};
|
||||
|
||||
template <typename Scalar>
|
||||
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<typename Scalar>
|
||||
struct functor_traits<scalar_clip2_op<Scalar> >
|
||||
struct functor_traits<scalar_clamp_op<Scalar> >
|
||||
{ enum { Cost = 2 * NumTraits<Scalar>::AddCost, PacketAccess = (packet_traits<Scalar>::HasMin && packet_traits<Scalar>::HasMax)}; };
|
||||
|
||||
} // end namespace internal
|
||||
|
Loading…
x
Reference in New Issue
Block a user