11 #ifndef EIGEN_SPECIALFUNCTIONS_FUNCTORS_H
12 #define EIGEN_SPECIALFUNCTIONS_FUNCTORS_H
26 template<
typename Scalar>
struct scalar_igamma_op :
binary_op_base<Scalar,Scalar>
28 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
const Scalar operator() (
const Scalar& a,
const Scalar&
x)
const {
31 template<
typename Packet>
32 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
const Packet packetOp(
const Packet& a,
const Packet&
x)
const {
36 template<
typename Scalar>
37 struct functor_traits<scalar_igamma_op<Scalar> > {
41 PacketAccess = packet_traits<Scalar>::HasIGamma
51 template <
typename Scalar>
52 struct scalar_igamma_der_a_op {
57 template <
typename Packet>
58 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
const Packet packetOp(
const Packet& a,
const Packet&
x)
const {
62 template <
typename Scalar>
63 struct functor_traits<scalar_igamma_der_a_op<Scalar> > {
67 PacketAccess = packet_traits<Scalar>::HasIGammaDerA
78 template <
typename Scalar>
79 struct scalar_gamma_sample_der_alpha_op {
84 template <
typename Packet>
85 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
const Packet packetOp(
const Packet& alpha,
const Packet& sample)
const {
89 template <
typename Scalar>
90 struct functor_traits<scalar_gamma_sample_der_alpha_op<Scalar> > {
94 PacketAccess = packet_traits<Scalar>::HasGammaSampleDerAlpha
103 template<
typename Scalar>
struct scalar_igammac_op :
binary_op_base<Scalar,Scalar>
105 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
const Scalar operator() (
const Scalar& a,
const Scalar&
x)
const {
108 template<
typename Packet>
109 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
const Packet packetOp(
const Packet& a,
const Packet&
x)
const
114 template<
typename Scalar>
115 struct functor_traits<scalar_igammac_op<Scalar> > {
119 PacketAccess = packet_traits<Scalar>::HasIGammac
128 template<
typename Scalar>
struct scalar_betainc_op {
129 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
const Scalar operator() (
const Scalar&
x,
const Scalar& a,
const Scalar&
b)
const {
132 template<
typename Packet>
133 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
const Packet packetOp(
const Packet&
x,
const Packet& a,
const Packet&
b)
const
138 template<
typename Scalar>
139 struct functor_traits<scalar_betainc_op<Scalar> > {
143 PacketAccess = packet_traits<Scalar>::HasBetaInc
153 template<
typename Scalar>
struct scalar_lgamma_op {
154 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
const Scalar operator() (
const Scalar& a)
const {
155 using numext::lgamma;
return lgamma(a);
157 typedef typename packet_traits<Scalar>::type Packet;
160 template<
typename Scalar>
161 struct functor_traits<scalar_lgamma_op<Scalar> >
166 PacketAccess = packet_traits<Scalar>::HasLGamma
174 template<
typename Scalar>
struct scalar_digamma_op {
175 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
const Scalar operator() (
const Scalar& a)
const {
176 using numext::digamma;
return digamma(a);
178 typedef typename packet_traits<Scalar>::type Packet;
181 template<
typename Scalar>
182 struct functor_traits<scalar_digamma_op<Scalar> >
187 PacketAccess = packet_traits<Scalar>::HasDiGamma
195 template<
typename Scalar>
struct scalar_zeta_op {
196 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
const Scalar operator() (
const Scalar&
x,
const Scalar&
q)
const {
197 using numext::zeta;
return zeta(
x,
q);
199 typedef typename packet_traits<Scalar>::type Packet;
202 template<
typename Scalar>
203 struct functor_traits<scalar_zeta_op<Scalar> >
208 PacketAccess = packet_traits<Scalar>::HasZeta
216 template<
typename Scalar>
struct scalar_polygamma_op {
217 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
const Scalar operator() (
const Scalar& n,
const Scalar&
x)
const {
220 typedef typename packet_traits<Scalar>::type Packet;
223 template<
typename Scalar>
224 struct functor_traits<scalar_polygamma_op<Scalar> >
229 PacketAccess = packet_traits<Scalar>::HasPolygamma
237 template<
typename Scalar>
struct scalar_erf_op {
240 return numext::erf(a);
242 template <
typename Packet>
247 template <
typename Scalar>
248 struct functor_traits<scalar_erf_op<Scalar> > {
250 PacketAccess = packet_traits<Scalar>::HasErf,
253 #ifdef EIGEN_VECTORIZE_FMA
259 scalar_div_cost<Scalar, packet_traits<Scalar>::HasDiv>::value)
263 scalar_div_cost<Scalar, packet_traits<Scalar>::HasDiv>::value)
266 : (functor_traits<scalar_exp_op<Scalar> >::Cost))
275 template<
typename Scalar>
struct scalar_erfc_op {
276 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
const Scalar operator() (
const Scalar& a)
const {
277 using numext::erfc;
return erfc(a);
279 typedef typename packet_traits<Scalar>::type Packet;
282 template<
typename Scalar>
283 struct functor_traits<scalar_erfc_op<Scalar> >
288 PacketAccess = packet_traits<Scalar>::HasErfc
297 template<
typename Scalar>
struct scalar_ndtri_op {
298 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
const Scalar operator() (
const Scalar& a)
const {
299 using numext::ndtri;
return ndtri(a);
301 typedef typename packet_traits<Scalar>::type Packet;
304 template<
typename Scalar>
305 struct functor_traits<scalar_ndtri_op<Scalar> >
312 PacketAccess = packet_traits<Scalar>::HasNdtri
IndexedView_or_VectorBlock operator()(const Indices &indices)
#define EIGEN_DEVICE_FUNC
Packet pigamma_der_a(const Packet &a, const Packet &x)
EIGEN_DECLARE_FUNCTION_ALLOWING_MULTIPLE_DEFINITIONS Packet pdigamma(const Packet &a)
EIGEN_DECLARE_FUNCTION_ALLOWING_MULTIPLE_DEFINITIONS Packet pndtri(const Packet &a)
EIGEN_DECLARE_FUNCTION_ALLOWING_MULTIPLE_DEFINITIONS Packet perf(const Packet &a)
EIGEN_DECLARE_FUNCTION_ALLOWING_MULTIPLE_DEFINITIONS Packet ppolygamma(const Packet &n, const Packet &x)
EIGEN_DECLARE_FUNCTION_ALLOWING_MULTIPLE_DEFINITIONS Packet perfc(const Packet &a)
Packet pigamma(const Packet &a, const Packet &x)
EIGEN_DECLARE_FUNCTION_ALLOWING_MULTIPLE_DEFINITIONS Packet plgamma(const Packet &a)
Packet pigammac(const Packet &a, const Packet &x)
Packet pgamma_sample_der_alpha(const Packet &alpha, const Packet &sample)
Packet pbetainc(const Packet &a, const Packet &b, const Packet &x)
EIGEN_DECLARE_FUNCTION_ALLOWING_MULTIPLE_DEFINITIONS Packet pzeta(const Packet &x, const Packet &q)
: TensorContractionSycl.h, provides various tensor contraction kernel for SYCL backend
const Eigen::CwiseUnaryOp< Eigen::internal::scalar_erfc_op< typename Derived::Scalar >, const Derived > erfc(const Eigen::ArrayBase< Derived > &x)
const Eigen::CwiseBinaryOp< Eigen::internal::scalar_igammac_op< typename Derived::Scalar >, const Derived, const ExponentDerived > igammac(const Eigen::ArrayBase< Derived > &a, const Eigen::ArrayBase< ExponentDerived > &x)
const TensorCwiseTernaryOp< internal::scalar_betainc_op< typename XDerived::Scalar >, const ADerived, const BDerived, const XDerived > betainc(const ADerived &a, const BDerived &b, const XDerived &x)
const Eigen::CwiseBinaryOp< Eigen::internal::scalar_igamma_op< typename Derived::Scalar >, const Derived, const ExponentDerived > igamma(const Eigen::ArrayBase< Derived > &a, const Eigen::ArrayBase< ExponentDerived > &x)
const Eigen::CwiseBinaryOp< Eigen::internal::scalar_polygamma_op< typename DerivedX::Scalar >, const DerivedN, const DerivedX > polygamma(const Eigen::ArrayBase< DerivedN > &n, const Eigen::ArrayBase< DerivedX > &x)
const Eigen::CwiseUnaryOp< Eigen::internal::scalar_ndtri_op< typename Derived::Scalar >, const Derived > ndtri(const Eigen::ArrayBase< Derived > &x)
const Eigen::CwiseUnaryOp< Eigen::internal::scalar_lgamma_op< typename Derived::Scalar >, const Derived > lgamma(const Eigen::ArrayBase< Derived > &x)
const Eigen::CwiseBinaryOp< Eigen::internal::scalar_igamma_der_a_op< typename Derived::Scalar >, const Derived, const ExponentDerived > igamma_der_a(const Eigen::ArrayBase< Derived > &a, const Eigen::ArrayBase< ExponentDerived > &x)
const Eigen::CwiseBinaryOp< Eigen::internal::scalar_zeta_op< typename DerivedX::Scalar >, const DerivedX, const DerivedQ > zeta(const Eigen::ArrayBase< DerivedX > &x, const Eigen::ArrayBase< DerivedQ > &q)
const Eigen::CwiseUnaryOp< Eigen::internal::scalar_digamma_op< typename Derived::Scalar >, const Derived > digamma(const Eigen::ArrayBase< Derived > &x)
const Eigen::CwiseBinaryOp< Eigen::internal::scalar_gamma_sample_der_alpha_op< typename AlphaDerived::Scalar >, const AlphaDerived, const SampleDerived > gamma_sample_der_alpha(const Eigen::ArrayBase< AlphaDerived > &alpha, const Eigen::ArrayBase< SampleDerived > &sample)