From e4f58816d930894b1f5ec0cac177fdbd37f2c6a2 Mon Sep 17 00:00:00 2001 From: Rasmus Munk Larsen Date: Tue, 7 Feb 2023 21:36:44 -0800 Subject: [PATCH] Get rid of custom implementation of equal_to and not_equal_no. No longer needed with c+14. --- Eigen/src/Core/functors/StlFunctors.h | 31 ------------------------ Eigen/src/plugins/MatrixCwiseBinaryOps.h | 8 +++--- 2 files changed, 4 insertions(+), 35 deletions(-) diff --git a/Eigen/src/Core/functors/StlFunctors.h b/Eigen/src/Core/functors/StlFunctors.h index 5971075dd..b8b842bcc 100644 --- a/Eigen/src/Core/functors/StlFunctors.h +++ b/Eigen/src/Core/functors/StlFunctors.h @@ -13,29 +13,6 @@ #include "../InternalHeaderCheck.h" namespace Eigen { - -// Portable replacements for certain functors. -namespace numext { - -template -struct equal_to { - typedef bool result_type; - EIGEN_DEVICE_FUNC bool operator()(const T& lhs, const T& rhs) const { - return lhs == rhs; - } -}; - -template -struct not_equal_to { - typedef bool result_type; - EIGEN_DEVICE_FUNC bool operator()(const T& lhs, const T& rhs) const { - return lhs != rhs; - } -}; - -} - - namespace internal { // default functor traits for STL functors: @@ -92,18 +69,10 @@ template struct functor_traits > { enum { Cost = 1, PacketAccess = false }; }; -template -struct functor_traits > - : functor_traits > {}; - template struct functor_traits > { enum { Cost = 1, PacketAccess = false }; }; -template -struct functor_traits > - : functor_traits > {}; - #if (EIGEN_COMP_CXXVER < 17) // std::unary_negate is deprecated since c++17 and will be removed in c++20 template diff --git a/Eigen/src/plugins/MatrixCwiseBinaryOps.h b/Eigen/src/plugins/MatrixCwiseBinaryOps.h index 46fe08ce8..5aed0f8d0 100644 --- a/Eigen/src/plugins/MatrixCwiseBinaryOps.h +++ b/Eigen/src/plugins/MatrixCwiseBinaryOps.h @@ -39,10 +39,10 @@ cwiseProduct(const EIGEN_CURRENT_STORAGE_BASE_CLASS &other) const */ template EIGEN_DEVICE_FUNC -inline const CwiseBinaryOp, const Derived, const OtherDerived> +inline const CwiseBinaryOp, const Derived, const OtherDerived> cwiseEqual(const EIGEN_CURRENT_STORAGE_BASE_CLASS &other) const { - return CwiseBinaryOp, const Derived, const OtherDerived>(derived(), other.derived()); + return CwiseBinaryOp, const Derived, const OtherDerived>(derived(), other.derived()); } /** \returns an expression of the coefficient-wise != operator of *this and \a other @@ -59,10 +59,10 @@ cwiseEqual(const EIGEN_CURRENT_STORAGE_BASE_CLASS &other) const */ template EIGEN_DEVICE_FUNC -inline const CwiseBinaryOp, const Derived, const OtherDerived> +inline const CwiseBinaryOp, const Derived, const OtherDerived> cwiseNotEqual(const EIGEN_CURRENT_STORAGE_BASE_CLASS &other) const { - return CwiseBinaryOp, const Derived, const OtherDerived>(derived(), other.derived()); + return CwiseBinaryOp, const Derived, const OtherDerived>(derived(), other.derived()); } /** \returns an expression of the coefficient-wise min of *this and \a other