blob: 46d60d323e99f4b49b5c5447958bf696fddad681 [file] [log] [blame]
Austin Schuh189376f2018-12-20 22:11:15 +11001// This file is part of Eigen, a lightweight C++ template library
2// for linear algebra.
3//
4// Copyright (C) 2016 Gael Guennebaud <gael.guennebaud@inria.fr>
5//
6// This Source Code Form is subject to the terms of the Mozilla
7// Public License v. 2.0. If a copy of the MPL was not distributed
8// with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
9
10#ifndef EIGEN_SPECIALFUNCTIONS_PACKETMATH_H
11#define EIGEN_SPECIALFUNCTIONS_PACKETMATH_H
12
13namespace Eigen {
14
15namespace internal {
16
17/** \internal \returns the ln(|gamma(\a a)|) (coeff-wise) */
18template<typename Packet> EIGEN_DECLARE_FUNCTION_ALLOWING_MULTIPLE_DEFINITIONS
19Packet plgamma(const Packet& a) { using numext::lgamma; return lgamma(a); }
20
21/** \internal \returns the derivative of lgamma, psi(\a a) (coeff-wise) */
22template<typename Packet> EIGEN_DECLARE_FUNCTION_ALLOWING_MULTIPLE_DEFINITIONS
23Packet pdigamma(const Packet& a) { using numext::digamma; return digamma(a); }
24
25/** \internal \returns the zeta function of two arguments (coeff-wise) */
26template<typename Packet> EIGEN_DECLARE_FUNCTION_ALLOWING_MULTIPLE_DEFINITIONS
27Packet pzeta(const Packet& x, const Packet& q) { using numext::zeta; return zeta(x, q); }
28
29/** \internal \returns the polygamma function (coeff-wise) */
30template<typename Packet> EIGEN_DECLARE_FUNCTION_ALLOWING_MULTIPLE_DEFINITIONS
31Packet ppolygamma(const Packet& n, const Packet& x) { using numext::polygamma; return polygamma(n, x); }
32
33/** \internal \returns the erf(\a a) (coeff-wise) */
34template<typename Packet> EIGEN_DECLARE_FUNCTION_ALLOWING_MULTIPLE_DEFINITIONS
35Packet perf(const Packet& a) { using numext::erf; return erf(a); }
36
37/** \internal \returns the erfc(\a a) (coeff-wise) */
38template<typename Packet> EIGEN_DECLARE_FUNCTION_ALLOWING_MULTIPLE_DEFINITIONS
39Packet perfc(const Packet& a) { using numext::erfc; return erfc(a); }
40
41/** \internal \returns the incomplete gamma function igamma(\a a, \a x) */
42template<typename Packet> EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
43Packet pigamma(const Packet& a, const Packet& x) { using numext::igamma; return igamma(a, x); }
44
45/** \internal \returns the complementary incomplete gamma function igammac(\a a, \a x) */
46template<typename Packet> EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
47Packet pigammac(const Packet& a, const Packet& x) { using numext::igammac; return igammac(a, x); }
48
49/** \internal \returns the complementary incomplete gamma function betainc(\a a, \a b, \a x) */
50template<typename Packet> EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
51Packet pbetainc(const Packet& a, const Packet& b,const Packet& x) { using numext::betainc; return betainc(a, b, x); }
52
53} // end namespace internal
54
55} // end namespace Eigen
56
57#endif // EIGEN_SPECIALFUNCTIONS_PACKETMATH_H
58