All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
SpecialFunctionsArrayAPI.h
1 // 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 
11 #ifndef EIGEN_SPECIALFUNCTIONS_ARRAYAPI_H
12 #define EIGEN_SPECIALFUNCTIONS_ARRAYAPI_H
13 
14 namespace Eigen {
15 
26 template<typename Derived,typename ExponentDerived>
27 inline const Eigen::CwiseBinaryOp<Eigen::internal::scalar_igamma_op<typename Derived::Scalar>, const Derived, const ExponentDerived>
29 {
31  a.derived(),
32  x.derived()
33  );
34 }
35 
46 template<typename Derived,typename ExponentDerived>
47 inline const Eigen::CwiseBinaryOp<Eigen::internal::scalar_igammac_op<typename Derived::Scalar>, const Derived, const ExponentDerived>
49 {
51  a.derived(),
52  x.derived()
53  );
54 }
55 
66 // * \warning Be careful with the order of the parameters: x.polygamma(n) is equivalent to polygamma(n,x)
67 // * \sa ArrayBase::polygamma()
68 template<typename DerivedN,typename DerivedX>
70 polygamma(const Eigen::ArrayBase<DerivedN>& n, const Eigen::ArrayBase<DerivedX>& x)
71 {
73  n.derived(),
74  x.derived()
75  );
76 }
77 
88 template<typename ArgADerived, typename ArgBDerived, typename ArgXDerived>
89 inline const Eigen::CwiseTernaryOp<Eigen::internal::scalar_betainc_op<typename ArgXDerived::Scalar>, const ArgADerived, const ArgBDerived, const ArgXDerived>
91 {
92  return Eigen::CwiseTernaryOp<Eigen::internal::scalar_betainc_op<typename ArgXDerived::Scalar>, const ArgADerived, const ArgBDerived, const ArgXDerived>(
93  a.derived(),
94  b.derived(),
95  x.derived()
96  );
97 }
98 
99 
112 template<typename DerivedX,typename DerivedQ>
115 {
117  x.derived(),
118  q.derived()
119  );
120 }
121 
122 } // end namespace Eigen
123 
124 #endif // EIGEN_SPECIALFUNCTIONS_ARRAYAPI_H