From fa68342ef80d72f52b340851a5ab18003259b2ed Mon Sep 17 00:00:00 2001 From: Rasmus Munk Larsen Date: Fri, 3 Aug 2018 17:31:23 -0700 Subject: Move sigmoid functor to core. --- Eigen/src/plugins/ArrayCwiseUnaryOps.h | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'Eigen/src/plugins') diff --git a/Eigen/src/plugins/ArrayCwiseUnaryOps.h b/Eigen/src/plugins/ArrayCwiseUnaryOps.h index 43615bd56..c9c7e7e4f 100644 --- a/Eigen/src/plugins/ArrayCwiseUnaryOps.h +++ b/Eigen/src/plugins/ArrayCwiseUnaryOps.h @@ -21,6 +21,7 @@ typedef CwiseUnaryOp, const Derived> AcosReturn typedef CwiseUnaryOp, const Derived> AsinReturnType; typedef CwiseUnaryOp, const Derived> AtanReturnType; typedef CwiseUnaryOp, const Derived> TanhReturnType; +typedef CwiseUnaryOp, const Derived> SigmoidReturnType; typedef CwiseUnaryOp, const Derived> SinhReturnType; typedef CwiseUnaryOp, const Derived> CoshReturnType; typedef CwiseUnaryOp, const Derived> SquareReturnType; @@ -335,6 +336,15 @@ cosh() const return CoshReturnType(derived()); } +/** \returns an expression of the coefficient-wise sigmoid of *this. + */ +EIGEN_DEVICE_FUNC +inline const SigmoidReturnType +sigmoid() const +{ + return SigmoidReturnType(derived()); +} + /** \returns an expression of the coefficient-wise inverse of *this. * * Example: \include Cwise_inverse.cpp -- cgit v1.2.3