From f216854453887f31ac02ffefb7a7a569dc3fa54d Mon Sep 17 00:00:00 2001 From: Michael Figurnov Date: Thu, 31 May 2018 15:34:53 +0100 Subject: Exponentially scaled modified Bessel functions of order zero and one. The functions are conventionally called i0e and i1e. The exponentially scaled version is more numerically stable. The standard Bessel functions can be obtained as i0(x) = exp(|x|) i0e(x) The code is ported from Cephes and tested against SciPy. --- unsupported/Eigen/CXX11/src/Tensor/TensorBase.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'unsupported/Eigen/CXX11/src/Tensor/TensorBase.h') diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorBase.h b/unsupported/Eigen/CXX11/src/Tensor/TensorBase.h index 745b16d2c..a942c98dd 100644 --- a/unsupported/Eigen/CXX11/src/Tensor/TensorBase.h +++ b/unsupported/Eigen/CXX11/src/Tensor/TensorBase.h @@ -133,6 +133,18 @@ class TensorBase return unaryExpr(internal::scalar_digamma_op()); } + EIGEN_DEVICE_FUNC + EIGEN_STRONG_INLINE const TensorCwiseUnaryOp, const Derived> + i0e() const { + return unaryExpr(internal::scalar_i0e_op()); + } + + EIGEN_DEVICE_FUNC + EIGEN_STRONG_INLINE const TensorCwiseUnaryOp, const Derived> + i1e() const { + return unaryExpr(internal::scalar_i1e_op()); + } + // igamma(a = this, x = other) template EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const TensorCwiseBinaryOp, const Derived, const OtherDerived> -- cgit v1.2.3