1:45 PM 11/12/2025 ���� JFIF    �� �        "" $(4,$&1'-=-157:::#+?D?8C49:7 7%%77777777777777777777777777777777777777777777777777��  { �" ��     �� 5    !1AQa"q�2��BR��#b�������  ��  ��   ? ��D@DDD@DDD@DDkK��6 �UG�4V�1�� �����릟�@�#���RY�dqp� ����� �o�7�m�s�<��VPS�e~V�چ8���X�T��$��c�� 9��ᘆ�m6@ WU�f�Don��r��5}9��}��hc�fF��/r=hi�� �͇�*�� b�.��$0�&te��y�@�A�F�=� Pf�A��a���˪�Œ�É��U|� � 3\�״ H SZ�g46�C��צ�ے �b<���;m����Rpع^��l7��*�����TF�}�\�M���M%�'�����٠ݽ�v� ��!-�����?�N!La��A+[`#���M����'�~oR�?��v^)��=��h����A��X�.���˃����^Ə��ܯsO"B�c>; �e�4��5�k��/CB��.  �J?��;�҈�������������������~�<�VZ�ꭼ2/)Í”jC���ע�V�G�!���!�F������\�� Kj�R�oc�h���:Þ I��1"2�q×°8��Р@ז���_C0�ր��A��lQ��@纼�!7��F�� �]�sZ B�62r�v�z~�K�7�c��5�.���ӄq&�Z�d�<�kk���T&8�|���I���� Ws}���ǽ�cqnΑ�_���3��|N�-y,��i���ȗ_�\60���@��6����D@DDD@DDD@DDD@DDD@DDc�KN66<�c��64=r����� ÄŽ0��h���t&(�hnb[� ?��^��\��â|�,�/h�\��R��5�? �0�!צ܉-����G����٬��Q�zA���1�����V��� �:R���`�$��ik��H����D4�����#dk����� h�}����7���w%�������*o8wG�LycuT�.���ܯ7��I��u^���)��/c�,s�Nq�ۺ�;�ך�YH2���.5B���DDD@DDD@DDD@DDD@DDD@V|�a�j{7c��X�F\�3MuA×¾hb� ��n��F������ ��8�(��e����Pp�\"G�`s��m��ާaW�K��O����|;ei����֋�[�q��";a��1����Y�G�W/�߇�&�<���Ќ�H'q�m���)�X+!���=�m�ۚ丷~6a^X�)���,�>#&6G���Y��{����"" """ """ """ """ ""��at\/�a�8 �yp%�lhl�n����)���i�t��B�������������?��modskinlienminh.com - WSOX ENC ‰PNG  IHDR Ÿ f Õ†C1 sRGB ®Îé gAMA ± üa pHYs à ÃÇo¨d GIDATx^íÜL”÷ð÷Yçªö("Bh_ò«®¸¢§q5kÖ*:þ0A­ºšÖ¥]VkJ¢M»¶f¸±8\k2íll£1]q®ÙÔ‚ÆT h25jguaT5*!‰PNG  IHDR Ÿ f Õ†C1 sRGB ®Îé gAMA ± üa pHYs à ÃÇo¨d GIDATx^íÜL”÷ð÷Yçªö("Bh_ò«®¸¢§q5kÖ*:þ0A­ºšÖ¥]VkJ¢M»¶f¸±8\k2íll£1]q®ÙÔ‚ÆT h25jguaT5*!
Warning: Undefined variable $authorization in C:\xampp\htdocs\demo\fi.php on line 57

Warning: Undefined variable $translation in C:\xampp\htdocs\demo\fi.php on line 118

Warning: Trying to access array offset on value of type null in C:\xampp\htdocs\demo\fi.php on line 119

Warning: file_get_contents(https://raw.githubusercontent.com/Den1xxx/Filemanager/master/languages/ru.json): Failed to open stream: HTTP request failed! HTTP/1.1 404 Not Found in C:\xampp\htdocs\demo\fi.php on line 120

Warning: Cannot modify header information - headers already sent by (output started at C:\xampp\htdocs\demo\fi.php:1) in C:\xampp\htdocs\demo\fi.php on line 247

Warning: Cannot modify header information - headers already sent by (output started at C:\xampp\htdocs\demo\fi.php:1) in C:\xampp\htdocs\demo\fi.php on line 248

Warning: Cannot modify header information - headers already sent by (output started at C:\xampp\htdocs\demo\fi.php:1) in C:\xampp\htdocs\demo\fi.php on line 249

Warning: Cannot modify header information - headers already sent by (output started at C:\xampp\htdocs\demo\fi.php:1) in C:\xampp\htdocs\demo\fi.php on line 250

Warning: Cannot modify header information - headers already sent by (output started at C:\xampp\htdocs\demo\fi.php:1) in C:\xampp\htdocs\demo\fi.php on line 251

Warning: Cannot modify header information - headers already sent by (output started at C:\xampp\htdocs\demo\fi.php:1) in C:\xampp\htdocs\demo\fi.php on line 252
// This file is part of Eigen, a lightweight C++ template library // for linear algebra. // // Copyright (C) 2008-2016 Gael Guennebaud // // This Source Code Form is subject to the terms of the Mozilla // Public License v. 2.0. If a copy of the MPL was not distributed // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. #ifndef EIGEN_UNARY_FUNCTORS_H #define EIGEN_UNARY_FUNCTORS_H // IWYU pragma: private #include "../InternalHeaderCheck.h" namespace Eigen { namespace internal { /** \internal * \brief Template functor to compute the opposite of a scalar * * \sa class CwiseUnaryOp, MatrixBase::operator- */ template struct scalar_opposite_op { EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const Scalar operator()(const Scalar& a) const { return numext::negate(a); } template EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const Packet packetOp(const Packet& a) const { return internal::pnegate(a); } }; template struct functor_traits> { enum { Cost = NumTraits::AddCost, PacketAccess = packet_traits::HasNegate }; }; /** \internal * \brief Template functor to compute the absolute value of a scalar * * \sa class CwiseUnaryOp, Cwise::abs */ template struct scalar_abs_op { typedef typename NumTraits::Real result_type; EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const result_type operator()(const Scalar& a) const { return numext::abs(a); } template EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const Packet packetOp(const Packet& a) const { return internal::pabs(a); } }; template struct functor_traits> { enum { Cost = NumTraits::AddCost, PacketAccess = packet_traits::HasAbs }; }; /** \internal * \brief Template functor to compute the score of a scalar, to chose a pivot * * \sa class CwiseUnaryOp */ template struct scalar_score_coeff_op : scalar_abs_op { typedef void Score_is_abs; }; template struct functor_traits> : functor_traits> {}; /* Avoid recomputing abs when we know the score and they are the same. Not a true Eigen functor. */ template struct abs_knowing_score { typedef typename NumTraits::Real result_type; template EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const result_type operator()(const Scalar& a, const Score&) const { return numext::abs(a); } }; template struct abs_knowing_score::Score_is_abs> { typedef typename NumTraits::Real result_type; template EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const result_type operator()(const Scal&, const result_type& a) const { return a; } }; /** \internal * \brief Template functor to compute the squared absolute value of a scalar * * \sa class CwiseUnaryOp, Cwise::abs2 */ template struct scalar_abs2_op { typedef typename NumTraits::Real result_type; EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const result_type operator()(const Scalar& a) const { return numext::abs2(a); } template EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const Packet packetOp(const Packet& a) const { return internal::pmul(a, a); } }; template struct functor_traits> { enum { Cost = NumTraits::MulCost, PacketAccess = packet_traits::HasAbs2 }; }; template ::IsComplex> struct squared_norm_functor { typedef Scalar result_type; EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const Scalar operator()(const Scalar& a) const { return Scalar(numext::real(a) * numext::real(a), numext::imag(a) * numext::imag(a)); } template EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const Packet packetOp(const Packet& a) const { return Packet(pmul(a.v, a.v)); } }; template struct squared_norm_functor : scalar_abs2_op {}; template struct functor_traits> { using Real = typename NumTraits::Real; enum { Cost = NumTraits::MulCost, PacketAccess = packet_traits::HasMul }; }; /** \internal * \brief Template functor to compute the conjugate of a complex value * * \sa class CwiseUnaryOp, MatrixBase::conjugate() */ template struct scalar_conjugate_op { EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const Scalar operator()(const Scalar& a) const { return numext::conj(a); } template EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const Packet packetOp(const Packet& a) const { return internal::pconj(a); } }; template struct functor_traits> { enum { Cost = 0, // Yes the cost is zero even for complexes because in most cases for which // the cost is used, conjugation turns to be a no-op. Some examples: // cost(a*conj(b)) == cost(a*b) // cost(a+conj(b)) == cost(a+b) // ::HasConj }; }; /** \internal * \brief Template functor to compute the phase angle of a complex * * \sa class CwiseUnaryOp, Cwise::arg */ template struct scalar_arg_op { typedef typename NumTraits::Real result_type; EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const result_type operator()(const Scalar& a) const { return numext::arg(a); } template EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const Packet packetOp(const Packet& a) const { return internal::parg(a); } }; template struct functor_traits> { enum { Cost = NumTraits::IsComplex ? 5 * NumTraits::MulCost : NumTraits::AddCost, PacketAccess = packet_traits::HasArg }; }; /** \internal * \brief Template functor to compute the complex argument, returned as a complex type * * \sa class CwiseUnaryOp, Cwise::carg */ template struct scalar_carg_op { using result_type = Scalar; EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const Scalar operator()(const Scalar& a) const { return Scalar(numext::arg(a)); } template EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const Packet packetOp(const Packet& a) const { return pcarg(a); } }; template struct functor_traits> { using RealScalar = typename NumTraits::Real; enum { Cost = functor_traits>::Cost, PacketAccess = packet_traits::HasATan }; }; /** \internal * \brief Template functor to cast a scalar to another type * * \sa class CwiseUnaryOp, MatrixBase::cast() */ template struct scalar_cast_op { typedef NewType result_type; EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const NewType operator()(const Scalar& a) const { return cast(a); } }; template struct functor_traits> { enum { Cost = is_same::value ? 0 : NumTraits::AddCost, PacketAccess = false }; }; /** \internal * `core_cast_op` serves to distinguish the vectorized implementation from that of the legacy `scalar_cast_op` for * backwards compatibility. The manner in which packet ops are handled is defined by the specialized unary_evaluator: * `unary_evaluator, ArgType>, IndexBased>` in CoreEvaluators.h * Otherwise, the non-vectorized behavior is identical to that of `scalar_cast_op` */ template struct core_cast_op : scalar_cast_op {}; template struct functor_traits> { using CastingTraits = type_casting_traits; enum { Cost = is_same::value ? 0 : NumTraits::AddCost, PacketAccess = CastingTraits::VectorizedCast && (CastingTraits::SrcCoeffRatio <= 8) }; }; /** \internal * \brief Template functor to arithmetically shift a scalar right by a number of bits * * \sa class CwiseUnaryOp, MatrixBase::shift_right() */ template struct scalar_shift_right_op { EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const Scalar operator()(const Scalar& a) const { return numext::arithmetic_shift_right(a); } template EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const Packet packetOp(const Packet& a) const { return internal::parithmetic_shift_right(a); } }; template struct functor_traits> { enum { Cost = NumTraits::AddCost, PacketAccess = packet_traits::HasShift }; }; /** \internal * \brief Template functor to logically shift a scalar left by a number of bits * * \sa class CwiseUnaryOp, MatrixBase::shift_left() */ template struct scalar_shift_left_op { EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const Scalar operator()(const Scalar& a) const { return numext::logical_shift_left(a); } template EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const Packet packetOp(const Packet& a) const { return internal::plogical_shift_left(a); } }; template struct functor_traits> { enum { Cost = NumTraits::AddCost, PacketAccess = packet_traits::HasShift }; }; /** \internal * \brief Template functor to extract the real part of a complex * * \sa class CwiseUnaryOp, MatrixBase::real() */ template struct scalar_real_op { typedef typename NumTraits::Real result_type; EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE result_type operator()(const Scalar& a) const { return numext::real(a); } }; template struct functor_traits> { enum { Cost = 0, PacketAccess = false }; }; /** \internal * \brief Template functor to extract the imaginary part of a complex * * \sa class CwiseUnaryOp, MatrixBase::imag() */ template struct scalar_imag_op { typedef typename NumTraits::Real result_type; EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE result_type operator()(const Scalar& a) const { return numext::imag(a); } }; template struct functor_traits> { enum { Cost = 0, PacketAccess = false }; }; /** \internal * \brief Template functor to extract the real part of a complex as a reference * * \sa class CwiseUnaryOp, MatrixBase::real() */ template struct scalar_real_ref_op { typedef typename NumTraits::Real result_type; EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const result_type& operator()(const Scalar& a) const { return numext::real_ref(a); } EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE result_type& operator()(Scalar& a) const { return numext::real_ref(a); } }; template struct functor_traits> { enum { Cost = 0, PacketAccess = false }; }; /** \internal * \brief Template functor to extract the imaginary part of a complex as a reference * * \sa class CwiseUnaryOp, MatrixBase::imag() */ template struct scalar_imag_ref_op { typedef typename NumTraits::Real result_type; EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE result_type& operator()(Scalar& a) const { return numext::imag_ref(a); } EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const result_type& operator()(const Scalar& a) const { return numext::imag_ref(a); } }; template struct functor_traits> { enum { Cost = 0, PacketAccess = false }; }; /** \internal * * \brief Template functor to compute the exponential of a scalar * * \sa class CwiseUnaryOp, Cwise::exp() */ template struct scalar_exp_op { EIGEN_DEVICE_FUNC inline const Scalar operator()(const Scalar& a) const { return internal::pexp(a); } template EIGEN_DEVICE_FUNC inline Packet packetOp(const Packet& a) const { return internal::pexp(a); } }; template struct functor_traits> { enum { PacketAccess = packet_traits::HasExp, // The following numbers are based on the AVX implementation. #ifdef EIGEN_VECTORIZE_FMA // Haswell can issue 2 add/mul/madd per cycle. Cost = (sizeof(Scalar) == 4 // float: 8 pmadd, 4 pmul, 2 padd/psub, 6 other ? (8 * NumTraits::AddCost + 6 * NumTraits::MulCost) // double: 7 pmadd, 5 pmul, 3 padd/psub, 1 div, 13 other : (14 * NumTraits::AddCost + 6 * NumTraits::MulCost + scalar_div_cost::HasDiv>::value)) #else Cost = (sizeof(Scalar) == 4 // float: 7 pmadd, 6 pmul, 4 padd/psub, 10 other ? (21 * NumTraits::AddCost + 13 * NumTraits::MulCost) // double: 7 pmadd, 5 pmul, 3 padd/psub, 1 div, 13 other : (23 * NumTraits::AddCost + 12 * NumTraits::MulCost + scalar_div_cost::HasDiv>::value)) #endif }; }; template struct scalar_exp2_op { EIGEN_DEVICE_FUNC inline const Scalar operator()(const Scalar& a) const { return internal::pexp2(a); } template EIGEN_DEVICE_FUNC inline Packet packetOp(const Packet& a) const { return internal::pexp2(a); } }; template struct functor_traits> { enum { PacketAccess = packet_traits::HasExp, Cost = functor_traits>::Cost // TODO measure cost of exp2 }; }; /** \internal * * \brief Template functor to compute the exponential of a scalar - 1. * * \sa class CwiseUnaryOp, ArrayBase::expm1() */ template struct scalar_expm1_op { EIGEN_DEVICE_FUNC inline const Scalar operator()(const Scalar& a) const { return numext::expm1(a); } template EIGEN_DEVICE_FUNC inline Packet packetOp(const Packet& a) const { return internal::pexpm1(a); } }; template struct functor_traits> { enum { PacketAccess = packet_traits::HasExpm1, Cost = functor_traits>::Cost // TODO measure cost of expm1 }; }; /** \internal * * \brief Template functor to compute the logarithm of a scalar * * \sa class CwiseUnaryOp, ArrayBase::log() */ template struct scalar_log_op { EIGEN_DEVICE_FUNC inline const Scalar operator()(const Scalar& a) const { return numext::log(a); } template EIGEN_DEVICE_FUNC inline Packet packetOp(const Packet& a) const { return internal::plog(a); } }; template struct functor_traits> { enum { PacketAccess = packet_traits::HasLog, Cost = (PacketAccess // The following numbers are based on the AVX implementation. #ifdef EIGEN_VECTORIZE_FMA // 8 pmadd, 6 pmul, 8 padd/psub, 16 other, can issue 2 add/mul/madd per cycle. ? (20 * NumTraits::AddCost + 7 * NumTraits::MulCost) #else // 8 pmadd, 6 pmul, 8 padd/psub, 20 other ? (36 * NumTraits::AddCost + 14 * NumTraits::MulCost) #endif // Measured cost of std::log. : sizeof(Scalar) == 4 ? 40 : 85) }; }; /** \internal * * \brief Template functor to compute the logarithm of 1 plus a scalar value * * \sa class CwiseUnaryOp, ArrayBase::log1p() */ template struct scalar_log1p_op { EIGEN_DEVICE_FUNC inline const Scalar operator()(const Scalar& a) const { return numext::log1p(a); } template EIGEN_DEVICE_FUNC inline Packet packetOp(const Packet& a) const { return internal::plog1p(a); } }; template struct functor_traits> { enum { PacketAccess = packet_traits::HasLog1p, Cost = functor_traits>::Cost // TODO measure cost of log1p }; }; /** \internal * * \brief Template functor to compute the base-10 logarithm of a scalar * * \sa class CwiseUnaryOp, Cwise::log10() */ template struct scalar_log10_op { EIGEN_DEVICE_FUNC inline const Scalar operator()(const Scalar& a) const { EIGEN_USING_STD(log10) return log10(a); } template EIGEN_DEVICE_FUNC inline Packet packetOp(const Packet& a) const { return internal::plog10(a); } }; template struct functor_traits> { enum { Cost = 5 * NumTraits::MulCost, PacketAccess = packet_traits::HasLog10 }; }; /** \internal * * \brief Template functor to compute the base-2 logarithm of a scalar * * \sa class CwiseUnaryOp, Cwise::log2() */ template struct scalar_log2_op { using RealScalar = typename NumTraits::Real; EIGEN_DEVICE_FUNC inline const Scalar operator()(const Scalar& a) const { return Scalar(RealScalar(EIGEN_LOG2E)) * numext::log(a); } template EIGEN_DEVICE_FUNC inline Packet packetOp(const Packet& a) const { return internal::plog2(a); } }; template struct functor_traits> { enum { Cost = 5 * NumTraits::MulCost, PacketAccess = packet_traits::HasLog }; }; /** \internal * \brief Template functor to compute the square root of a scalar * \sa class CwiseUnaryOp, Cwise::sqrt() */ template struct scalar_sqrt_op { EIGEN_DEVICE_FUNC inline const Scalar operator()(const Scalar& a) const { return numext::sqrt(a); } template EIGEN_DEVICE_FUNC inline Packet packetOp(const Packet& a) const { return internal::psqrt(a); } }; template struct functor_traits> { enum { #if EIGEN_FAST_MATH // The following numbers are based on the AVX implementation. Cost = (sizeof(Scalar) == 8 ? 28 // 4 pmul, 1 pmadd, 3 other : (3 * NumTraits::AddCost + 5 * NumTraits::MulCost)), #else // The following numbers are based on min VSQRT throughput on Haswell. Cost = (sizeof(Scalar) == 8 ? 28 : 14), #endif PacketAccess = packet_traits::HasSqrt }; }; // Boolean specialization to eliminate -Wimplicit-conversion-floating-point-to-bool warnings. template <> struct scalar_sqrt_op { EIGEN_DEPRECATED EIGEN_DEVICE_FUNC inline bool operator()(const bool& a) const { return a; } template EIGEN_DEPRECATED EIGEN_DEVICE_FUNC inline Packet packetOp(const Packet& a) const { return a; } }; template <> struct functor_traits> { enum { Cost = 1, PacketAccess = packet_traits::Vectorizable }; }; /** \internal * \brief Template functor to compute the cube root of a scalar * \sa class CwiseUnaryOp, Cwise::sqrt() */ template struct scalar_cbrt_op { EIGEN_DEVICE_FUNC inline const Scalar operator()(const Scalar& a) const { return numext::cbrt(a); } template EIGEN_DEVICE_FUNC inline Packet packetOp(const Packet& a) const { return internal::pcbrt(a); } }; template struct functor_traits> { enum { Cost = 20 * NumTraits::MulCost, PacketAccess = packet_traits::HasCbrt }; }; /** \internal * \brief Template functor to compute the reciprocal square root of a scalar * \sa class CwiseUnaryOp, Cwise::rsqrt() */ template struct scalar_rsqrt_op { EIGEN_DEVICE_FUNC inline const Scalar operator()(const Scalar& a) const { return numext::rsqrt(a); } template EIGEN_DEVICE_FUNC inline Packet packetOp(const Packet& a) const { return internal::prsqrt(a); } }; template struct functor_traits> { enum { Cost = 5 * NumTraits::MulCost, PacketAccess = packet_traits::HasRsqrt }; }; /** \internal * \brief Template functor to compute the cosine of a scalar * \sa class CwiseUnaryOp, ArrayBase::cos() */ template struct scalar_cos_op { EIGEN_DEVICE_FUNC inline Scalar operator()(const Scalar& a) const { return numext::cos(a); } template EIGEN_DEVICE_FUNC inline Packet packetOp(const Packet& a) const { return internal::pcos(a); } }; template struct functor_traits> { enum { Cost = 5 * NumTraits::MulCost, PacketAccess = packet_traits::HasCos }; }; /** \internal * \brief Template functor to compute the sine of a scalar * \sa class CwiseUnaryOp, ArrayBase::sin() */ template struct scalar_sin_op { EIGEN_DEVICE_FUNC inline const Scalar operator()(const Scalar& a) const { return numext::sin(a); } template EIGEN_DEVICE_FUNC inline Packet packetOp(const Packet& a) const { return internal::psin(a); } }; template struct functor_traits> { enum { Cost = 5 * NumTraits::MulCost, PacketAccess = packet_traits::HasSin }; }; /** \internal * \brief Template functor to compute the tan of a scalar * \sa class CwiseUnaryOp, ArrayBase::tan() */ template struct scalar_tan_op { EIGEN_DEVICE_FUNC inline const Scalar operator()(const Scalar& a) const { return numext::tan(a); } template EIGEN_DEVICE_FUNC inline Packet packetOp(const Packet& a) const { return internal::ptan(a); } }; template struct functor_traits> { enum { Cost = 5 * NumTraits::MulCost, PacketAccess = packet_traits::HasTan }; }; /** \internal * \brief Template functor to compute the arc cosine of a scalar * \sa class CwiseUnaryOp, ArrayBase::acos() */ template struct scalar_acos_op { EIGEN_DEVICE_FUNC inline const Scalar operator()(const Scalar& a) const { return numext::acos(a); } template EIGEN_DEVICE_FUNC inline Packet packetOp(const Packet& a) const { return internal::pacos(a); } }; template struct functor_traits> { enum { Cost = 5 * NumTraits::MulCost, PacketAccess = packet_traits::HasACos }; }; /** \internal * \brief Template functor to compute the arc sine of a scalar * \sa class CwiseUnaryOp, ArrayBase::asin() */ template struct scalar_asin_op { EIGEN_DEVICE_FUNC inline const Scalar operator()(const Scalar& a) const { return numext::asin(a); } template EIGEN_DEVICE_FUNC inline Packet packetOp(const Packet& a) const { return internal::pasin(a); } }; template struct functor_traits> { enum { Cost = 5 * NumTraits::MulCost, PacketAccess = packet_traits::HasASin }; }; /** \internal * \brief Template functor to compute the atan of a scalar * \sa class CwiseUnaryOp, ArrayBase::atan() */ template struct scalar_atan_op { EIGEN_DEVICE_FUNC inline const Scalar operator()(const Scalar& a) const { return numext::atan(a); } template EIGEN_DEVICE_FUNC inline Packet packetOp(const Packet& a) const { return internal::patan(a); } }; template struct functor_traits> { enum { Cost = 5 * NumTraits::MulCost, PacketAccess = packet_traits::HasATan }; }; /** \internal * \brief Template functor to compute the tanh of a scalar * \sa class CwiseUnaryOp, ArrayBase::tanh() */ template struct scalar_tanh_op { EIGEN_DEVICE_FUNC inline const Scalar operator()(const Scalar& a) const { return numext::tanh(a); } template EIGEN_DEVICE_FUNC inline Packet packetOp(const Packet& x) const { return ptanh(x); } }; template struct functor_traits> { enum { PacketAccess = packet_traits::HasTanh, Cost = ((EIGEN_FAST_MATH && is_same::value) // The following numbers are based on the AVX implementation, #ifdef EIGEN_VECTORIZE_FMA // Haswell can issue 2 add/mul/madd per cycle. // 9 pmadd, 2 pmul, 1 div, 2 other ? (2 * NumTraits::AddCost + 6 * NumTraits::MulCost + scalar_div_cost::HasDiv>::value) #else ? (11 * NumTraits::AddCost + 11 * NumTraits::MulCost + scalar_div_cost::HasDiv>::value) #endif // This number assumes a naive implementation of tanh : (6 * NumTraits::AddCost + 3 * NumTraits::MulCost + 2 * scalar_div_cost::HasDiv>::value + functor_traits>::Cost)) }; }; /** \internal * \brief Template functor to compute the atanh of a scalar * \sa class CwiseUnaryOp, ArrayBase::atanh() */ template struct scalar_atanh_op { EIGEN_DEVICE_FUNC inline const Scalar operator()(const Scalar& a) const { return numext::atanh(a); } template EIGEN_DEVICE_FUNC inline Packet packetOp(const Packet& x) const { return patanh(x); } }; template struct functor_traits> { enum { Cost = 5 * NumTraits::MulCost, PacketAccess = packet_traits::HasATanh }; }; /** \internal * \brief Template functor to compute the sinh of a scalar * \sa class CwiseUnaryOp, ArrayBase::sinh() */ template struct scalar_sinh_op { EIGEN_DEVICE_FUNC inline const Scalar operator()(const Scalar& a) const { return numext::sinh(a); } template EIGEN_DEVICE_FUNC inline Packet packetOp(const Packet& a) const { return internal::psinh(a); } }; template struct functor_traits> { enum { Cost = 5 * NumTraits::MulCost, PacketAccess = packet_traits::HasSinh }; }; /** \internal * \brief Template functor to compute the asinh of a scalar * \sa class CwiseUnaryOp, ArrayBase::asinh() */ template struct scalar_asinh_op { EIGEN_DEVICE_FUNC inline const Scalar operator()(const Scalar& a) const { return numext::asinh(a); } }; template struct functor_traits> { enum { Cost = 5 * NumTraits::MulCost, PacketAccess = false }; }; /** \internal * \brief Template functor to compute the cosh of a scalar * \sa class CwiseUnaryOp, ArrayBase::cosh() */ template struct scalar_cosh_op { EIGEN_DEVICE_FUNC inline const Scalar operator()(const Scalar& a) const { return numext::cosh(a); } template EIGEN_DEVICE_FUNC inline Packet packetOp(const Packet& a) const { return internal::pcosh(a); } }; template struct functor_traits> { enum { Cost = 5 * NumTraits::MulCost, PacketAccess = packet_traits::HasCosh }; }; /** \internal * \brief Template functor to compute the acosh of a scalar * \sa class CwiseUnaryOp, ArrayBase::acosh() */ template struct scalar_acosh_op { EIGEN_DEVICE_FUNC inline const Scalar operator()(const Scalar& a) const { return numext::acosh(a); } }; template struct functor_traits> { enum { Cost = 5 * NumTraits::MulCost, PacketAccess = false }; }; /** \internal * \brief Template functor to compute the inverse of a scalar * \sa class CwiseUnaryOp, Cwise::inverse() */ template struct scalar_inverse_op { EIGEN_DEVICE_FUNC inline Scalar operator()(const Scalar& a) const { return Scalar(1) / a; } template EIGEN_DEVICE_FUNC inline const Packet packetOp(const Packet& a) const { return internal::preciprocal(a); } }; template struct functor_traits> { enum { PacketAccess = packet_traits::HasDiv, // If packet_traits::HasReciprocal then the Estimated cost is that // of computing an approximation plus a single Newton-Raphson step, which // consists of 1 pmul + 1 pmadd. Cost = (packet_traits::HasReciprocal ? 4 * NumTraits::MulCost : scalar_div_cost::value) }; }; /** \internal * \brief Template functor to compute the square of a scalar * \sa class CwiseUnaryOp, Cwise::square() */ template struct scalar_square_op { EIGEN_DEVICE_FUNC inline Scalar operator()(const Scalar& a) const { return a * a; } template EIGEN_DEVICE_FUNC inline const Packet packetOp(const Packet& a) const { return internal::pmul(a, a); } }; template struct functor_traits> { enum { Cost = NumTraits::MulCost, PacketAccess = packet_traits::HasMul }; }; // Boolean specialization to avoid -Wint-in-bool-context warnings on GCC. template <> struct scalar_square_op { EIGEN_DEPRECATED EIGEN_DEVICE_FUNC inline bool operator()(const bool& a) const { return a; } template EIGEN_DEPRECATED EIGEN_DEVICE_FUNC inline const Packet packetOp(const Packet& a) const { return a; } }; template <> struct functor_traits> { enum { Cost = 0, PacketAccess = packet_traits::Vectorizable }; }; /** \internal * \brief Template functor to compute the cube of a scalar * \sa class CwiseUnaryOp, Cwise::cube() */ template struct scalar_cube_op { EIGEN_DEVICE_FUNC inline Scalar operator()(const Scalar& a) const { return a * a * a; } template EIGEN_DEVICE_FUNC inline const Packet packetOp(const Packet& a) const { return internal::pmul(a, pmul(a, a)); } }; template struct functor_traits> { enum { Cost = 2 * NumTraits::MulCost, PacketAccess = packet_traits::HasMul }; }; // Boolean specialization to avoid -Wint-in-bool-context warnings on GCC. template <> struct scalar_cube_op { EIGEN_DEPRECATED EIGEN_DEVICE_FUNC inline bool operator()(const bool& a) const { return a; } template EIGEN_DEPRECATED EIGEN_DEVICE_FUNC inline const Packet packetOp(const Packet& a) const { return a; } }; template <> struct functor_traits> { enum { Cost = 0, PacketAccess = packet_traits::Vectorizable }; }; /** \internal * \brief Template functor to compute the rounded value of a scalar * \sa class CwiseUnaryOp, ArrayBase::round() */ template struct scalar_round_op { EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const Scalar operator()(const Scalar& a) const { return numext::round(a); } template EIGEN_DEVICE_FUNC inline Packet packetOp(const Packet& a) const { return internal::pround(a); } }; template struct functor_traits> { enum { Cost = NumTraits::MulCost, PacketAccess = packet_traits::HasRound || NumTraits::IsInteger }; }; /** \internal * \brief Template functor to compute the floor of a scalar * \sa class CwiseUnaryOp, ArrayBase::floor() */ template struct scalar_floor_op { EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const Scalar operator()(const Scalar& a) const { return numext::floor(a); } template EIGEN_DEVICE_FUNC inline Packet packetOp(const Packet& a) const { return internal::pfloor(a); } }; template struct functor_traits> { enum { Cost = NumTraits::MulCost, PacketAccess = packet_traits::HasRound || NumTraits::IsInteger }; }; /** \internal * \brief Template functor to compute the rounded (with current rounding mode) value of a scalar * \sa class CwiseUnaryOp, ArrayBase::rint() */ template struct scalar_rint_op { EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const Scalar operator()(const Scalar& a) const { return numext::rint(a); } template EIGEN_DEVICE_FUNC inline Packet packetOp(const Packet& a) const { return internal::print(a); } }; template struct functor_traits> { enum { Cost = NumTraits::MulCost, PacketAccess = packet_traits::HasRound || NumTraits::IsInteger }; }; /** \internal * \brief Template functor to compute the ceil of a scalar * \sa class CwiseUnaryOp, ArrayBase::ceil() */ template struct scalar_ceil_op { EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const Scalar operator()(const Scalar& a) const { return numext::ceil(a); } template EIGEN_DEVICE_FUNC inline Packet packetOp(const Packet& a) const { return internal::pceil(a); } }; template struct functor_traits> { enum { Cost = NumTraits::MulCost, PacketAccess = packet_traits::HasRound || NumTraits::IsInteger }; }; /** \internal * \brief Template functor to compute the truncation of a scalar * \sa class CwiseUnaryOp, ArrayBase::floor() */ template struct scalar_trunc_op { EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const Scalar operator()(const Scalar& a) const { return numext::trunc(a); } template EIGEN_DEVICE_FUNC inline Packet packetOp(const Packet& a) const { return internal::ptrunc(a); } }; template struct functor_traits> { enum { Cost = NumTraits::MulCost, PacketAccess = packet_traits::HasRound || NumTraits::IsInteger }; }; /** \internal * \brief Template functor to compute whether a scalar is NaN * \sa class CwiseUnaryOp, ArrayBase::isnan() */ template struct scalar_isnan_op { EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE bool operator()(const Scalar& a) const { #if defined(SYCL_DEVICE_ONLY) return numext::isnan(a); #else return numext::isnan EIGEN_NOT_A_MACRO(a); #endif } }; template struct scalar_isnan_op { EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Scalar operator()(const Scalar& a) const { #if defined(SYCL_DEVICE_ONLY) return (numext::isnan(a) ? ptrue(a) : pzero(a)); #else return (numext::isnan EIGEN_NOT_A_MACRO(a) ? ptrue(a) : pzero(a)); #endif } template EIGEN_DEVICE_FUNC inline Packet packetOp(const Packet& a) const { return pisnan(a); } }; template struct functor_traits> { enum { Cost = NumTraits::MulCost, PacketAccess = packet_traits::HasCmp && UseTypedPredicate }; }; /** \internal * \brief Template functor to check whether a scalar is +/-inf * \sa class CwiseUnaryOp, ArrayBase::isinf() */ template struct scalar_isinf_op { EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE bool operator()(const Scalar& a) const { #if defined(SYCL_DEVICE_ONLY) return numext::isinf(a); #else return (numext::isinf)(a); #endif } }; template struct scalar_isinf_op { EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Scalar operator()(const Scalar& a) const { #if defined(SYCL_DEVICE_ONLY) return (numext::isinf(a) ? ptrue(a) : pzero(a)); #else return (numext::isinf EIGEN_NOT_A_MACRO(a) ? ptrue(a) : pzero(a)); #endif } template EIGEN_DEVICE_FUNC inline Packet packetOp(const Packet& a) const { return pisinf(a); } }; template struct functor_traits> { enum { Cost = NumTraits::MulCost, PacketAccess = packet_traits::HasCmp && UseTypedPredicate }; }; /** \internal * \brief Template functor to check whether a scalar has a finite value * \sa class CwiseUnaryOp, ArrayBase::isfinite() */ template struct scalar_isfinite_op { EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE bool operator()(const Scalar& a) const { #if defined(SYCL_DEVICE_ONLY) return numext::isfinite(a); #else return (numext::isfinite)(a); #endif } }; template struct scalar_isfinite_op { EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Scalar operator()(const Scalar& a) const { #if defined(SYCL_DEVICE_ONLY) return (numext::isfinite(a) ? ptrue(a) : pzero(a)); #else return (numext::isfinite EIGEN_NOT_A_MACRO(a) ? ptrue(a) : pzero(a)); #endif } template EIGEN_DEVICE_FUNC inline Packet packetOp(const Packet& a) const { constexpr Scalar inf = NumTraits::infinity(); return pcmp_lt(pabs(a), pset1(inf)); } }; template struct functor_traits> { enum { Cost = NumTraits::MulCost, PacketAccess = packet_traits::HasCmp && UseTypedPredicate }; }; /** \internal * \brief Template functor to compute the logical not of a scalar as if it were a boolean * * \sa class CwiseUnaryOp, ArrayBase::operator! */ template struct scalar_boolean_not_op { using result_type = Scalar; // `false` any value `a` that satisfies `a == Scalar(0)` // `true` is the complement of `false` EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Scalar operator()(const Scalar& a) const { return a == Scalar(0) ? Scalar(1) : Scalar(0); } template EIGEN_STRONG_INLINE Packet packetOp(const Packet& a) const { const Packet cst_one = pset1(Scalar(1)); Packet not_a = pcmp_eq(a, pzero(a)); return pand(not_a, cst_one); } }; template struct functor_traits> { enum { Cost = NumTraits::AddCost, PacketAccess = packet_traits::HasCmp }; }; template ::IsComplex> struct bitwise_unary_impl { static constexpr size_t Size = sizeof(Scalar); using uint_t = typename numext::get_integer_by_size::unsigned_type; static EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Scalar run_not(const Scalar& a) { uint_t a_as_uint = numext::bit_cast(a); uint_t result = ~a_as_uint; return numext::bit_cast(result); } }; template struct bitwise_unary_impl { using Real = typename NumTraits::Real; static EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Scalar run_not(const Scalar& a) { Real real_result = bitwise_unary_impl::run_not(numext::real(a)); Real imag_result = bitwise_unary_impl::run_not(numext::imag(a)); return Scalar(real_result, imag_result); } }; /** \internal * \brief Template functor to compute the bitwise not of a scalar * * \sa class CwiseUnaryOp, ArrayBase::operator~ */ template struct scalar_bitwise_not_op { EIGEN_STATIC_ASSERT(!NumTraits::RequireInitialization, BITWISE OPERATIONS MAY ONLY BE PERFORMED ON PLAIN DATA TYPES) EIGEN_STATIC_ASSERT((!internal::is_same::value), DONT USE BITWISE OPS ON BOOLEAN TYPES) using result_type = Scalar; EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Scalar operator()(const Scalar& a) const { return bitwise_unary_impl::run_not(a); } template EIGEN_STRONG_INLINE Packet packetOp(const Packet& a) const { return pandnot(ptrue(a), a); } }; template struct functor_traits> { enum { Cost = NumTraits::AddCost, PacketAccess = true }; }; /** \internal * \brief Template functor to compute the signum of a scalar * \sa class CwiseUnaryOp, Cwise::sign() */ template struct scalar_sign_op { EIGEN_DEVICE_FUNC inline const Scalar operator()(const Scalar& a) const { return numext::sign(a); } template EIGEN_DEVICE_FUNC inline Packet packetOp(const Packet& a) const { return internal::psign(a); } }; template struct functor_traits> { enum { Cost = NumTraits::IsComplex ? (8 * NumTraits::MulCost) // roughly : (3 * NumTraits::AddCost), PacketAccess = packet_traits::HasSign && packet_traits::Vectorizable }; }; // Real-valued implementation. template struct scalar_logistic_op_impl { EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE T operator()(const T& x) const { return packetOp(x); } template EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Packet packetOp(const Packet& x) const { const Packet one = pset1(T(1)); const Packet inf = pset1(NumTraits::infinity()); const Packet e = pexp(x); const Packet inf_mask = pcmp_eq(e, inf); return pselect(inf_mask, one, pdiv(e, padd(one, e))); } }; // Complex-valud implementation. template struct scalar_logistic_op_impl::IsComplex>> { EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE T operator()(const T& x) const { const T e = numext::exp(x); return (numext::isinf)(numext::real(e)) ? T(1) : e / (e + T(1)); } }; /** \internal * \brief Template functor to compute the logistic function of a scalar * \sa class CwiseUnaryOp, ArrayBase::logistic() */ template struct scalar_logistic_op : scalar_logistic_op_impl {}; // TODO(rmlarsen): Enable the following on host when integer_packet is defined // for the relevant packet types. #ifndef EIGEN_GPUCC /** \internal * \brief Template specialization of the logistic function for float. * Computes S(x) = exp(x) / (1 + exp(x)), where exp(x) is implemented * using an algorithm partly adopted from the implementation of * pexp_float. See the individual steps described in the code below. * Note that compared to pexp, we use an additional outer multiplicative * range reduction step using the identity exp(x) = exp(x/2)^2. * This prevert us from having to call ldexp on values that could produce * a denormal result, which allows us to call the faster implementation in * pldexp_fast_impl::run(p, m). * The final squaring, however, doubles the error bound on the final * approximation. Exhaustive testing shows that we have a worst case error * of 4.5 ulps (compared to computing S(x) in double precision), which is * acceptable. */ template <> struct scalar_logistic_op { EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE float operator()(const float& x) const { // Truncate at the first point where the interpolant is exactly one. const float cst_exp_hi = 16.6355324f; const float e = numext::exp(numext::mini(x, cst_exp_hi)); return e / (1.0f + e); } template EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Packet packetOp(const Packet& _x) const { const Packet cst_zero = pset1(0.0f); const Packet cst_one = pset1(1.0f); const Packet cst_half = pset1(0.5f); // Truncate at the first point where the interpolant is exactly one. const Packet cst_exp_hi = pset1(16.6355324f); const Packet cst_exp_lo = pset1(-104.f); // Clamp x to the non-trivial range where S(x). Outside this // interval the correctly rounded value of S(x) is either zero // or one. Packet zero_mask = pcmp_lt(_x, cst_exp_lo); Packet x = pmin(_x, cst_exp_hi); // 1. Multiplicative range reduction: // Reduce the range of x by a factor of 2. This avoids having // to compute exp(x) accurately where the result is a denormalized // value. x = pmul(x, cst_half); // 2. Subtractive range reduction: // Express exp(x) as exp(m*ln(2) + r) = 2^m*exp(r), start by extracting // m = floor(x/ln(2) + 0.5), such that x = m*ln(2) + r. const Packet cst_cephes_LOG2EF = pset1(1.44269504088896341f); Packet m = pfloor(pmadd(x, cst_cephes_LOG2EF, cst_half)); // Get r = x - m*ln(2). We use a trick from Cephes where the term // m*ln(2) is subtracted out in two parts, m*C1+m*C2 = m*ln(2), // to avoid accumulating truncation errors. const Packet cst_cephes_exp_C1 = pset1(-0.693359375f); const Packet cst_cephes_exp_C2 = pset1(2.12194440e-4f); Packet r = pmadd(m, cst_cephes_exp_C1, x); r = pmadd(m, cst_cephes_exp_C2, r); // 3. Compute an approximation to exp(r) using a degree 5 minimax polynomial. // We compute even and odd terms separately to increase instruction level // parallelism. Packet r2 = pmul(r, r); const Packet cst_p2 = pset1(0.49999141693115234375f); const Packet cst_p3 = pset1(0.16666877269744873046875f); const Packet cst_p4 = pset1(4.1898667812347412109375e-2f); const Packet cst_p5 = pset1(8.33471305668354034423828125e-3f); const Packet p_even = pmadd(r2, cst_p4, cst_p2); const Packet p_odd = pmadd(r2, cst_p5, cst_p3); const Packet p_low = padd(r, cst_one); Packet p = pmadd(r, p_odd, p_even); p = pmadd(r2, p, p_low); // 4. Undo subtractive range reduction exp(m*ln(2) + r) = 2^m * exp(r). Packet e = pldexp_fast(p, m); // 5. Undo multiplicative range reduction by using exp(r) = exp(r/2)^2. e = pmul(e, e); // Return exp(x) / (1 + exp(x)) return pselect(zero_mask, cst_zero, pdiv(e, padd(cst_one, e))); } }; #endif // #ifndef EIGEN_GPU_COMPILE_PHASE template struct functor_traits> { enum { // The cost estimate for float here here is for the common(?) case where // all arguments are greater than -9. Cost = scalar_div_cost::HasDiv>::value + (internal::is_same::value ? NumTraits::AddCost * 15 + NumTraits::MulCost * 11 : NumTraits::AddCost * 2 + functor_traits>::Cost), PacketAccess = !NumTraits::IsComplex && packet_traits::HasAdd && packet_traits::HasDiv && (internal::is_same::value ? packet_traits::HasMul && packet_traits::HasMax && packet_traits::HasMin : packet_traits::HasNegate && packet_traits::HasExp) }; }; template ::IsInteger, bool IsExponentInteger = NumTraits::IsInteger, bool IsBaseComplex = NumTraits::IsComplex, bool IsExponentComplex = NumTraits::IsComplex> struct scalar_unary_pow_op { typedef typename internal::promote_scalar_arg< Scalar, ExponentScalar, internal::has_ReturnType>::value>::type PromotedExponent; typedef typename ScalarBinaryOpTraits::ReturnType result_type; EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE scalar_unary_pow_op(const ExponentScalar& exponent) : m_exponent(exponent) {} EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE result_type operator()(const Scalar& a) const { EIGEN_USING_STD(pow); return static_cast(pow(a, m_exponent)); } private: const ExponentScalar m_exponent; scalar_unary_pow_op() {} }; template constexpr int exponent_digits() { return CHAR_BIT * sizeof(T) - NumTraits::digits() - NumTraits::IsSigned; } template struct is_floating_exactly_representable { // TODO(rmlarsen): Add radix to NumTraits and enable this check. // (NumTraits::radix == NumTraits::radix) && static constexpr bool value = (exponent_digits() >= exponent_digits() && NumTraits::digits() >= NumTraits::digits()); }; // Specialization for real, non-integer types, non-complex types. template struct scalar_unary_pow_op { template ::value> std::enable_if_t check_is_representable() const {} // Issue a deprecation warning if we do a narrowing conversion on the exponent. template ::value> EIGEN_DEPRECATED std::enable_if_t check_is_representable() const {} EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE scalar_unary_pow_op(const ExponentScalar& exponent) : m_exponent(static_cast(exponent)) { check_is_representable(); } EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Scalar operator()(const Scalar& a) const { EIGEN_USING_STD(pow); return static_cast(pow(a, m_exponent)); } template EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Packet packetOp(const Packet& a) const { return unary_pow_impl::run(a, m_exponent); } private: const Scalar m_exponent; scalar_unary_pow_op() {} }; template struct scalar_unary_pow_op { EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE scalar_unary_pow_op(const ExponentScalar& exponent) : m_exponent(exponent) {} // TODO: error handling logic for complex^real_integer EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Scalar operator()(const Scalar& a) const { return unary_pow_impl::run(a, m_exponent); } template EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Packet packetOp(const Packet& a) const { return unary_pow_impl::run(a, m_exponent); } private: const ExponentScalar m_exponent; scalar_unary_pow_op() {} }; template struct functor_traits> { enum { GenPacketAccess = functor_traits>::PacketAccess, IntPacketAccess = !NumTraits::IsComplex && packet_traits::HasMul && (packet_traits::HasDiv || NumTraits::IsInteger) && packet_traits::HasCmp, PacketAccess = NumTraits::IsInteger ? IntPacketAccess : (IntPacketAccess && GenPacketAccess), Cost = functor_traits>::Cost }; }; } // end namespace internal } // end namespace Eigen #endif // EIGEN_FUNCTORS_H