10 #ifndef EIGEN_MATHFUNCTIONS_H 11 #define EIGEN_MATHFUNCTIONS_H 15 #define EIGEN_PI 3.141592653589793238462643383279502884197169399375105820974944592307816406L 22 #if EIGEN_OS_WINCE && EIGEN_COMP_MSVC && EIGEN_COMP_MSVC<=1500 23 long abs(
long x) {
return (labs(x)); }
24 double abs(
double x) {
return (
fabs(x)); }
25 float abs(
float x) {
return (fabsf(x)); }
26 long double abs(
long double x) {
return (fabsl(x)); }
51 template<
typename T,
typename dummy =
void>
52 struct global_math_functions_filtering_base
57 template<
typename T>
struct always_void {
typedef void type; };
60 struct global_math_functions_filtering_base
62 typename always_void<typename T::Eigen_BaseClassForSpecializationOfGlobalMathFuncImpl>::type
65 typedef typename T::Eigen_BaseClassForSpecializationOfGlobalMathFuncImpl type;
68 #define EIGEN_MATHFUNC_IMPL(func, scalar) Eigen::internal::func##_impl<typename Eigen::internal::global_math_functions_filtering_base<scalar>::type> 69 #define EIGEN_MATHFUNC_RETVAL(func, scalar) typename Eigen::internal::func##_retval<typename Eigen::internal::global_math_functions_filtering_base<scalar>::type>::type 75 template<typename Scalar, bool IsComplex = NumTraits<Scalar>::IsComplex>
76 struct real_default_impl
80 static inline RealScalar
run(
const Scalar& x)
86 template<
typename Scalar>
87 struct real_default_impl<Scalar,true>
91 static inline RealScalar
run(
const Scalar& x)
98 template<
typename Scalar>
struct real_impl : real_default_impl<Scalar> {};
102 struct real_impl<std::complex<T> >
104 typedef T RealScalar;
106 static inline T
run(
const std::complex<T>& x)
113 template<
typename Scalar>
123 template<typename Scalar, bool IsComplex = NumTraits<Scalar>::IsComplex>
124 struct imag_default_impl
128 static inline RealScalar
run(
const Scalar&)
130 return RealScalar(0);
134 template<
typename Scalar>
135 struct imag_default_impl<Scalar,true>
139 static inline RealScalar
run(
const Scalar& x)
146 template<
typename Scalar>
struct imag_impl : imag_default_impl<Scalar> {};
150 struct imag_impl<std::complex<T> >
152 typedef T RealScalar;
154 static inline T
run(
const std::complex<T>& x)
161 template<
typename Scalar>
171 template<
typename Scalar>
176 static inline RealScalar&
run(Scalar& x)
178 return reinterpret_cast<RealScalar*
>(&x)[0];
181 static inline const RealScalar&
run(
const Scalar& x)
183 return reinterpret_cast<const RealScalar*
>(&x)[0];
187 template<
typename Scalar>
188 struct real_ref_retval
197 template<
typename Scalar,
bool IsComplex>
198 struct imag_ref_default_impl
202 static inline RealScalar&
run(Scalar& x)
204 return reinterpret_cast<RealScalar*
>(&x)[1];
207 static inline const RealScalar&
run(
const Scalar& x)
209 return reinterpret_cast<RealScalar*
>(&x)[1];
213 template<
typename Scalar>
214 struct imag_ref_default_impl<Scalar, false>
217 static inline Scalar
run(Scalar&)
222 static inline const Scalar
run(
const Scalar&)
228 template<
typename Scalar>
229 struct imag_ref_impl : imag_ref_default_impl<Scalar, NumTraits<Scalar>::IsComplex> {};
231 template<
typename Scalar>
232 struct imag_ref_retval
241 template<typename Scalar, bool IsComplex = NumTraits<Scalar>::IsComplex>
245 static inline Scalar
run(
const Scalar& x)
251 template<
typename Scalar>
252 struct conj_impl<Scalar,true>
255 static inline Scalar
run(
const Scalar& x)
262 template<
typename Scalar>
272 template<
typename Scalar,
bool IsComplex>
273 struct abs2_impl_default
277 static inline RealScalar
run(
const Scalar& x)
283 template<
typename Scalar>
284 struct abs2_impl_default<Scalar, true>
288 static inline RealScalar
run(
const Scalar& x)
294 template<
typename Scalar>
299 static inline RealScalar
run(
const Scalar& x)
301 return abs2_impl_default<Scalar,NumTraits<Scalar>::IsComplex>
::run(x);
305 template<
typename Scalar>
315 template<
typename Scalar,
bool IsComplex>
316 struct norm1_default_impl
320 static inline RealScalar
run(
const Scalar& x)
322 EIGEN_USING_STD_MATH(
abs);
327 template<
typename Scalar>
328 struct norm1_default_impl<Scalar, false>
331 static inline Scalar
run(
const Scalar& x)
333 EIGEN_USING_STD_MATH(
abs);
338 template<
typename Scalar>
339 struct norm1_impl : norm1_default_impl<Scalar, NumTraits<Scalar>::IsComplex> {};
341 template<
typename Scalar>
351 template<
typename Scalar>
355 static inline RealScalar
run(
const Scalar& x,
const Scalar&
y)
357 EIGEN_USING_STD_MATH(
abs);
358 EIGEN_USING_STD_MATH(
sqrt);
359 RealScalar _x =
abs(x);
360 RealScalar _y =
abs(y);
372 if(p==RealScalar(0))
return RealScalar(0);
373 return p *
sqrt(RealScalar(1) + qp*qp);
377 template<
typename Scalar>
387 template<
typename OldType,
typename NewType>
391 static inline NewType
run(
const OldType& x)
393 return static_cast<NewType
>(x);
399 template<
typename OldType,
typename NewType>
401 inline NewType
cast(
const OldType& x)
410 #if EIGEN_HAS_CXX11_MATH 411 template<
typename Scalar>
413 static inline Scalar
run(
const Scalar& x)
421 template<
typename Scalar>
424 static inline Scalar
run(
const Scalar& x)
427 EIGEN_USING_STD_MATH(
floor);
428 EIGEN_USING_STD_MATH(
ceil);
429 return (x > Scalar(0)) ?
floor(x + Scalar(0.5)) :
ceil(x - Scalar(0.5));
434 template<
typename Scalar>
444 #if EIGEN_HAS_CXX11_MATH 445 template<
typename Scalar>
447 static inline Scalar
run(
const Scalar& x)
449 EIGEN_USING_STD_MATH(
arg);
454 template<typename Scalar, bool IsComplex = NumTraits<Scalar>::IsComplex>
455 struct arg_default_impl
459 static inline RealScalar
run(
const Scalar& x)
461 return (x < Scalar(0)) ? Scalar(
EIGEN_PI) : Scalar(0); }
464 template<
typename Scalar>
465 struct arg_default_impl<Scalar,true>
469 static inline RealScalar
run(
const Scalar& x)
471 EIGEN_USING_STD_MATH(
arg);
476 template<
typename Scalar>
struct arg_impl : arg_default_impl<Scalar> {};
479 template<
typename Scalar>
489 namespace std_fallback {
492 template<
typename Scalar>
493 EIGEN_DEVICE_FUNC
inline Scalar
log1p(
const Scalar& x) {
496 EIGEN_USING_STD_MATH(
log);
497 Scalar x1p = RealScalar(1) + x;
498 return ( x1p == Scalar(1) ) ? x : x * (
log(x1p) / (x1p - RealScalar(1)) );
502 template<
typename Scalar>
504 static inline Scalar
run(
const Scalar& x)
507 #if EIGEN_HAS_CXX11_MATH 516 template<
typename Scalar>
530 typedef typename ScalarBinaryOpTraits<ScalarX,ScalarY,internal::scalar_pow_op<ScalarX,ScalarY> >::ReturnType result_type;
531 static EIGEN_DEVICE_FUNC
inline result_type
run(
const ScalarX& x,
const ScalarY&
y)
533 EIGEN_USING_STD_MATH(
pow);
538 template<
typename ScalarX,
typename ScalarY>
539 struct pow_impl<ScalarX,ScalarY, true>
541 typedef ScalarX result_type;
542 static EIGEN_DEVICE_FUNC
inline ScalarX
run(ScalarX x, ScalarY
y)
562 template<
typename Scalar,
565 struct random_default_impl {};
567 template<
typename Scalar>
568 struct random_impl : random_default_impl<Scalar, NumTraits<Scalar>::IsComplex, NumTraits<Scalar>::IsInteger> {};
570 template<
typename Scalar>
579 template<
typename Scalar>
580 struct random_default_impl<Scalar, false, false>
582 static inline Scalar
run(
const Scalar& x,
const Scalar& y)
584 return x + (y-x) * Scalar(std::rand()) / Scalar(RAND_MAX);
586 static inline Scalar
run()
593 meta_floor_log2_terminate,
594 meta_floor_log2_move_up,
595 meta_floor_log2_move_down,
596 meta_floor_log2_bogus
599 template<
unsigned int n,
int lower,
int upper>
struct meta_floor_log2_selector
601 enum { middle = (lower + upper) / 2,
602 value = (upper <= lower + 1) ? int(meta_floor_log2_terminate)
603 : (n < (1 << middle)) ? int(meta_floor_log2_move_down)
604 : (n==0) ?
int(meta_floor_log2_bogus)
605 : int(meta_floor_log2_move_up)
609 template<
unsigned int n,
611 int upper =
sizeof(
unsigned int) * CHAR_BIT - 1,
612 int selector = meta_floor_log2_selector<n, lower, upper>::value>
613 struct meta_floor_log2 {};
615 template<
unsigned int n,
int lower,
int upper>
616 struct meta_floor_log2<n, lower, upper, meta_floor_log2_move_down>
618 enum { value = meta_floor_log2<n, lower, meta_floor_log2_selector<n, lower, upper>::middle>::value };
621 template<
unsigned int n,
int lower,
int upper>
622 struct meta_floor_log2<n, lower, upper, meta_floor_log2_move_up>
624 enum { value = meta_floor_log2<n, meta_floor_log2_selector<n, lower, upper>::middle, upper>::value };
627 template<
unsigned int n,
int lower,
int upper>
628 struct meta_floor_log2<n, lower, upper, meta_floor_log2_terminate>
630 enum { value = (n >= ((
unsigned int)(1) << (lower+1))) ? lower+1 : lower };
633 template<
unsigned int n,
int lower,
int upper>
634 struct meta_floor_log2<n, lower, upper, meta_floor_log2_bogus>
639 template<
typename Scalar>
640 struct random_default_impl<Scalar, false, true>
642 static inline Scalar
run(
const Scalar& x,
const Scalar& y)
644 typedef typename conditional<NumTraits<Scalar>::IsSigned,std::ptrdiff_t,std::size_t>::type ScalarX;
649 std::size_t range = ScalarX(y)-ScalarX(x);
650 std::size_t offset = 0;
652 std::size_t divisor = 1;
653 std::size_t multiplier = 1;
654 if(range<RAND_MAX) divisor = (std::size_t(RAND_MAX)+1)/(range+1);
655 else multiplier = 1 + range/(std::size_t(RAND_MAX)+1);
657 offset = (std::size_t(std::rand()) * multiplier) / divisor;
658 }
while (offset > range);
659 return Scalar(ScalarX(x) + offset);
662 static inline Scalar
run()
664 #ifdef EIGEN_MAKING_DOCS 667 enum { rand_bits = meta_floor_log2<(unsigned int)(RAND_MAX)+1>::value,
668 scalar_bits =
sizeof(Scalar) * CHAR_BIT,
672 return Scalar((std::rand() >> shift) - offset);
677 template<
typename Scalar>
678 struct random_default_impl<Scalar, true, false>
680 static inline Scalar
run(
const Scalar& x,
const Scalar& y)
685 static inline Scalar
run()
688 return Scalar(random<RealScalar>(), random<RealScalar>());
692 template<
typename Scalar>
698 template<
typename Scalar>
707 #if (EIGEN_HAS_CXX11_MATH && !(EIGEN_COMP_GNUC_STRICT && __FINITE_MATH_ONLY__)) || (EIGEN_COMP_MSVC>=1800) || (EIGEN_COMP_CLANG) 708 #define EIGEN_USE_STD_FPCLASSIFY 1 710 #define EIGEN_USE_STD_FPCLASSIFY 0 715 typename internal::enable_if<internal::is_integral<T>::value,
bool>::type
716 isnan_impl(
const T&) {
return false; }
720 typename internal::enable_if<internal::is_integral<T>::value,
bool>::type
721 isinf_impl(
const T&) {
return false; }
725 typename internal::enable_if<internal::is_integral<T>::value,
bool>::type
726 isfinite_impl(
const T&) {
return true; }
731 isfinite_impl(
const T& x)
735 #elif EIGEN_USE_STD_FPCLASSIFY 739 return x<=NumTraits<T>::highest() && x>=NumTraits<T>::lowest();
746 isinf_impl(
const T& x)
750 #elif EIGEN_USE_STD_FPCLASSIFY 754 return x>NumTraits<T>::highest() || x<NumTraits<T>::lowest();
761 isnan_impl(
const T& x)
765 #elif EIGEN_USE_STD_FPCLASSIFY 773 #if (!EIGEN_USE_STD_FPCLASSIFY) 777 template<
typename T> EIGEN_DEVICE_FUNC
bool isinf_msvc_helper(T x)
779 return _fpclass(x)==_FPCLASS_NINF || _fpclass(x)==_FPCLASS_PINF;
783 EIGEN_DEVICE_FUNC
inline bool isnan_impl(
const long double& x) {
return _isnan(x)!=0; }
784 EIGEN_DEVICE_FUNC
inline bool isnan_impl(
const double& x) {
return _isnan(x)!=0; }
785 EIGEN_DEVICE_FUNC
inline bool isnan_impl(
const float& x) {
return _isnan(x)!=0; }
787 EIGEN_DEVICE_FUNC
inline bool isinf_impl(
const long double& x) {
return isinf_msvc_helper(x); }
788 EIGEN_DEVICE_FUNC
inline bool isinf_impl(
const double& x) {
return isinf_msvc_helper(x); }
789 EIGEN_DEVICE_FUNC
inline bool isinf_impl(
const float& x) {
return isinf_msvc_helper(x); }
791 #elif (defined __FINITE_MATH_ONLY__ && __FINITE_MATH_ONLY__ && EIGEN_COMP_GNUC) 793 #if EIGEN_GNUC_AT_LEAST(5,0) 794 #define EIGEN_TMP_NOOPT_ATTRIB EIGEN_DEVICE_FUNC inline __attribute__((optimize("no-finite-math-only"))) 798 #define EIGEN_TMP_NOOPT_ATTRIB EIGEN_DEVICE_FUNC inline __attribute__((noinline,optimize("no-finite-math-only"))) 801 template<> EIGEN_TMP_NOOPT_ATTRIB
bool isnan_impl(
const long double& x) {
return __builtin_isnan(x); }
802 template<> EIGEN_TMP_NOOPT_ATTRIB
bool isnan_impl(
const double& x) {
return __builtin_isnan(x); }
803 template<> EIGEN_TMP_NOOPT_ATTRIB
bool isnan_impl(
const float& x) {
return __builtin_isnan(x); }
804 template<> EIGEN_TMP_NOOPT_ATTRIB
bool isinf_impl(
const double& x) {
return __builtin_isinf(x); }
805 template<> EIGEN_TMP_NOOPT_ATTRIB
bool isinf_impl(
const float& x) {
return __builtin_isinf(x); }
806 template<> EIGEN_TMP_NOOPT_ATTRIB
bool isinf_impl(
const long double& x) {
return __builtin_isinf(x); }
808 #undef EIGEN_TMP_NOOPT_ATTRIB 815 template<
typename T> EIGEN_DEVICE_FUNC
bool isfinite_impl(
const std::complex<T>& x);
816 template<
typename T> EIGEN_DEVICE_FUNC
bool isnan_impl(
const std::complex<T>& x);
817 template<
typename T> EIGEN_DEVICE_FUNC
bool isinf_impl(
const std::complex<T>& x);
829 #ifndef __CUDA_ARCH__ 834 EIGEN_USING_STD_MATH(
min);
842 EIGEN_USING_STD_MATH(
max);
850 return y < x ? y : x;
862 return x < y ? y : x;
873 template<
typename Scalar>
880 template<
typename Scalar>
887 template<
typename Scalar>
894 template<
typename Scalar>
901 template<
typename Scalar>
908 template<
typename Scalar>
915 template<
typename Scalar>
922 template<
typename Scalar>
929 template<
typename Scalar>
936 template<
typename Scalar>
943 template<
typename Scalar>
950 template<
typename Scalar>
959 float log1p(
const float &x) { return ::log1pf(x); }
965 template<
typename ScalarX,
typename ScalarY>
967 inline typename internal::pow_impl<ScalarX,ScalarY>::result_type
pow(
const ScalarX& x,
const ScalarY& y)
972 template<
typename T> EIGEN_DEVICE_FUNC bool (
isnan) (
const T &x) {
return internal::isnan_impl(x); }
973 template<
typename T> EIGEN_DEVICE_FUNC bool (
isinf) (
const T &x) {
return internal::isinf_impl(x); }
974 template<
typename T> EIGEN_DEVICE_FUNC bool (
isfinite)(
const T &x) {
return internal::isfinite_impl(x); }
976 template<
typename Scalar>
985 T (
floor)(
const T& x)
987 EIGEN_USING_STD_MATH(
floor);
993 float floor(
const float &x) { return ::floorf(x); }
1001 T (
ceil)(
const T& x)
1003 EIGEN_USING_STD_MATH(
ceil);
1009 float ceil(
const float &x) { return ::ceilf(x); }
1018 inline int log2(
int x)
1022 static const int table[32] = { 0, 9, 1, 10, 13, 21, 2, 29, 11, 14, 16, 18, 22, 25, 3, 30, 8, 12, 20, 28, 15, 17, 24, 7, 19, 27, 23, 6, 26, 5, 4, 31 };
1028 return table[(v * 0x07C4ACDDU) >> 27];
1039 template<
typename T>
1043 EIGEN_USING_STD_MATH(
sqrt);
1047 template<
typename T>
1050 EIGEN_USING_STD_MATH(
log);
1056 float log(
const float &x) { return ::logf(x); }
1062 template<
typename T>
1066 EIGEN_USING_STD_MATH(
abs);
1070 template<
typename T>
1077 #if defined(__SYCL_DEVICE_ONLY__) 1080 #endif // defined(__SYCL_DEVICE_ONLY__) 1084 float abs(
const float &x) { return ::fabsf(x); }
1090 float abs(
const std::complex<float>& x) {
1091 return ::hypotf(x.real(), x.imag());
1095 double abs(
const std::complex<double>& x) {
1100 template<
typename T>
1103 EIGEN_USING_STD_MATH(
exp);
1109 float exp(
const float &x) { return ::expf(x); }
1115 template<
typename T>
1118 EIGEN_USING_STD_MATH(
cos);
1124 float cos(
const float &x) { return ::cosf(x); }
1130 template<
typename T>
1133 EIGEN_USING_STD_MATH(
sin);
1139 float sin(
const float &x) { return ::sinf(x); }
1145 template<
typename T>
1148 EIGEN_USING_STD_MATH(
tan);
1154 float tan(
const float &x) { return ::tanf(x); }
1160 template<
typename T>
1162 T
acos(
const T &x) {
1163 EIGEN_USING_STD_MATH(
acos);
1169 float acos(
const float &x) { return ::acosf(x); }
1175 template<
typename T>
1177 T
asin(
const T &x) {
1178 EIGEN_USING_STD_MATH(
asin);
1184 float asin(
const float &x) { return ::asinf(x); }
1190 template<
typename T>
1192 T
atan(
const T &x) {
1193 EIGEN_USING_STD_MATH(
atan);
1199 float atan(
const float &x) { return ::atanf(x); }
1206 template<
typename T>
1208 T
cosh(
const T &x) {
1209 EIGEN_USING_STD_MATH(
cosh);
1215 float cosh(
const float &x) { return ::coshf(x); }
1221 template<
typename T>
1223 T
sinh(
const T &x) {
1224 EIGEN_USING_STD_MATH(
sinh);
1230 float sinh(
const float &x) { return ::sinhf(x); }
1236 template<
typename T>
1238 T
tanh(
const T &x) {
1239 EIGEN_USING_STD_MATH(
tanh);
1243 #if (!defined(__CUDACC__)) && EIGEN_FAST_MATH 1250 float tanh(
const float &x) { return ::tanhf(x); }
1256 template <
typename T>
1258 T
fmod(
const T& a,
const T&
b) {
1259 EIGEN_USING_STD_MATH(
fmod);
1266 float fmod(
const float& a,
const float& b) {
1267 return ::fmodf(a, b);
1272 double fmod(
const double& a,
const double& b) {
1281 template<
typename T>
1282 EIGEN_DEVICE_FUNC
bool isfinite_impl(
const std::complex<T>& x)
1287 template<
typename T>
1288 EIGEN_DEVICE_FUNC
bool isnan_impl(
const std::complex<T>& x)
1293 template<
typename T>
1294 EIGEN_DEVICE_FUNC
bool isinf_impl(
const std::complex<T>& x)
1303 template<
typename Scalar,
1306 struct scalar_fuzzy_default_impl {};
1308 template<
typename Scalar>
1309 struct scalar_fuzzy_default_impl<Scalar, false, false>
1312 template<
typename OtherScalar> EIGEN_DEVICE_FUNC
1313 static inline bool isMuchSmallerThan(
const Scalar& x,
const OtherScalar&
y,
const RealScalar& prec)
1318 static inline bool isApprox(
const Scalar& x,
const Scalar& y,
const RealScalar& prec)
1323 static inline bool isApproxOrLessThan(
const Scalar& x,
const Scalar& y,
const RealScalar& prec)
1325 return x <= y || isApprox(x, y, prec);
1329 template<
typename Scalar>
1330 struct scalar_fuzzy_default_impl<Scalar, false, true>
1333 template<
typename OtherScalar> EIGEN_DEVICE_FUNC
1334 static inline bool isMuchSmallerThan(
const Scalar& x,
const Scalar&,
const RealScalar&)
1336 return x == Scalar(0);
1339 static inline bool isApprox(
const Scalar& x,
const Scalar&
y,
const RealScalar&)
1344 static inline bool isApproxOrLessThan(
const Scalar& x,
const Scalar& y,
const RealScalar&)
1350 template<
typename Scalar>
1351 struct scalar_fuzzy_default_impl<Scalar, true, false>
1354 template<
typename OtherScalar> EIGEN_DEVICE_FUNC
1355 static inline bool isMuchSmallerThan(
const Scalar& x,
const OtherScalar&
y,
const RealScalar& prec)
1360 static inline bool isApprox(
const Scalar& x,
const Scalar& y,
const RealScalar& prec)
1366 template<
typename Scalar>
1367 struct scalar_fuzzy_impl : scalar_fuzzy_default_impl<Scalar, NumTraits<Scalar>::IsComplex, NumTraits<Scalar>::IsInteger> {};
1369 template<
typename Scalar,
typename OtherScalar> EIGEN_DEVICE_FUNC
1370 inline bool isMuchSmallerThan(
const Scalar& x,
const OtherScalar&
y,
1373 return scalar_fuzzy_impl<Scalar>::template isMuchSmallerThan<OtherScalar>(x,
y, precision);
1376 template<
typename Scalar> EIGEN_DEVICE_FUNC
1377 inline bool isApprox(
const Scalar& x,
const Scalar& y,
1380 return scalar_fuzzy_impl<Scalar>::isApprox(x, y, precision);
1383 template<
typename Scalar> EIGEN_DEVICE_FUNC
1384 inline bool isApproxOrLessThan(
const Scalar& x,
const Scalar& y,
1387 return scalar_fuzzy_impl<Scalar>::isApproxOrLessThan(x, y, precision);
1394 template<>
struct random_impl<bool>
1396 static inline bool run()
1398 return random<int>(0,1)==0 ?
false :
true;
1402 template<>
struct scalar_fuzzy_impl<bool>
1404 typedef bool RealScalar;
1406 template<
typename OtherScalar> EIGEN_DEVICE_FUNC
1407 static inline bool isMuchSmallerThan(
const bool& x,
const bool&,
const bool&)
1413 static inline bool isApprox(
bool x,
bool y,
bool)
1419 static inline bool isApproxOrLessThan(
const bool& x,
const bool& y,
const bool&)
1431 #endif // EIGEN_MATHFUNCTIONS_H
#define EIGEN_ALWAYS_INLINE
EIGEN_STRONG_INLINE EIGEN_DEVICE_FUNC bool() isfinite(const half &a)
EIGEN_STRONG_INLINE EIGEN_DEVICE_FUNC half pow(const half &a, const half &b)
const AutoDiffScalar< DerType > & conj(const AutoDiffScalar< DerType > &x)
#define EIGEN_NOT_A_MACRO
EIGEN_DEVICE_FUNC RealReturnType real() const
EIGEN_DEVICE_FUNC const ExpReturnType exp() const
EIGEN_DEVICE_FUNC const TanhReturnType tanh() const
EIGEN_DEVICE_FUNC const LogReturnType log() const
#define EIGEN_PLAIN_ENUM_MAX(a, b)
EIGEN_DEVICE_FUNC const SqrtReturnType sqrt() const
EIGEN_DEVICE_FUNC const CoshReturnType cosh() const
const mpreal fabs(const mpreal &x, mp_rnd_t r=mpreal::get_default_rnd())
DerType::Scalar imag(const AutoDiffScalar< DerType > &)
T generic_fast_tanh_float(const T &a_x)
#define EIGEN_STATIC_ASSERT(CONDITION, MSG)
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const AbsReturnType abs() const
EIGEN_STRONG_INLINE EIGEN_DEVICE_FUNC bool() isinf(const half &a)
EIGEN_STRONG_INLINE EIGEN_DEVICE_FUNC half() max(const half &a, const half &b)
EIGEN_DEVICE_FUNC const RoundReturnType round() const
EIGEN_DEVICE_FUNC const CosReturnType cos() const
EIGEN_DEVICE_FUNC const CeilReturnType ceil() const
EIGEN_DEVICE_FUNC const Log1pReturnType log1p() const
const mpreal fmod(const mpreal &x, const mpreal &y, mp_rnd_t rnd_mode=mpreal::get_default_rnd())
EIGEN_DEVICE_FUNC const SinhReturnType sinh() const
EIGEN_DEVICE_FUNC const AtanReturnType atan() const
#define EIGEN_STATIC_ASSERT_NON_INTEGER(TYPE)
EIGEN_DEVICE_FUNC const TanReturnType tan() const
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const Abs2ReturnType abs2() const
EIGEN_DEVICE_FUNC const AcosReturnType acos() const
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const ArgReturnType arg() const
#define EIGEN_MATHFUNC_RETVAL(func, scalar)
const mpreal hypot(const mpreal &x, const mpreal &y, mp_rnd_t rnd_mode=mpreal::get_default_rnd())
EIGEN_DEVICE_FUNC const FloorReturnType floor() const
#define EIGEN_PLAIN_ENUM_MIN(a, b)
EIGEN_DEVICE_FUNC CastXpr< NewType >::Type cast() const
const mpreal random(unsigned int seed=0)
EIGEN_DEVICE_FUNC const ImagReturnType imag() const
EIGEN_DEVICE_FUNC const SinReturnType sin() const
EIGEN_STRONG_INLINE EIGEN_DEVICE_FUNC bool() isnan(const half &a)
void run(Expr &expr, Dev &dev)
const AutoDiffScalar< DerType > & real(const AutoDiffScalar< DerType > &x)
EIGEN_DEVICE_FUNC const Scalar & b
#define EIGEN_MATHFUNC_IMPL(func, scalar)
const mpreal log2(const mpreal &x, mp_rnd_t r=mpreal::get_default_rnd())
EIGEN_DEVICE_FUNC const AsinReturnType asin() const