Eigen/src/Core/MathFunctions.h
Go to the documentation of this file.
1 // This file is part of Eigen, a lightweight C++ template library
2 // for linear algebra.
3 //
4 // Copyright (C) 2006-2010 Benoit Jacob <jacob.benoit.1@gmail.com>
5 // Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved.
6 //
7 // This Source Code Form is subject to the terms of the Mozilla
8 // Public License v. 2.0. If a copy of the MPL was not distributed
9 // with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
10 
11 #ifndef EIGEN_MATHFUNCTIONS_H
12 #define EIGEN_MATHFUNCTIONS_H
13 
14 // TODO this should better be moved to NumTraits
15 // Source: WolframAlpha
16 #define EIGEN_PI 3.141592653589793238462643383279502884197169399375105820974944592307816406L
17 #define EIGEN_LOG2E 1.442695040888963407359924681001892137426645954152985934135449406931109219L
18 #define EIGEN_LN2 0.693147180559945309417232121458176568075500134360255254120680009493393621L
19 
20 namespace Eigen {
21 
22 // On WINCE, std::abs is defined for int only, so let's defined our own overloads:
23 // This issue has been confirmed with MSVC 2008 only, but the issue might exist for more recent versions too.
24 #if EIGEN_OS_WINCE && EIGEN_COMP_MSVC && EIGEN_COMP_MSVC<=1500
25 long abs(long x) { return (labs(x)); }
26 double abs(double x) { return (fabs(x)); }
27 float abs(float x) { return (fabsf(x)); }
28 long double abs(long double x) { return (fabsl(x)); }
29 #endif
30 
31 namespace internal {
32 
53 template<typename T, typename dummy = void>
55 {
56  typedef T type;
57 };
58 
59 template<typename T> struct always_void { typedef void type; };
60 
61 template<typename T>
63  <T,
64  typename always_void<typename T::Eigen_BaseClassForSpecializationOfGlobalMathFuncImpl>::type
65  >
66 {
67  typedef typename T::Eigen_BaseClassForSpecializationOfGlobalMathFuncImpl type;
68 };
69 
70 #define EIGEN_MATHFUNC_IMPL(func, scalar) Eigen::internal::func##_impl<typename Eigen::internal::global_math_functions_filtering_base<scalar>::type>
71 #define EIGEN_MATHFUNC_RETVAL(func, scalar) typename Eigen::internal::func##_retval<typename Eigen::internal::global_math_functions_filtering_base<scalar>::type>::type
72 
73 /****************************************************************************
74 * Implementation of real *
75 ****************************************************************************/
76 
79 {
80  typedef typename NumTraits<Scalar>::Real RealScalar;
82  static inline RealScalar run(const Scalar& x)
83  {
84  return x;
85  }
86 };
87 
88 template<typename Scalar>
90 {
93  static inline RealScalar run(const Scalar& x)
94  {
95  using std::real;
96  return real(x);
97  }
98 };
99 
100 template<typename Scalar> struct real_impl : real_default_impl<Scalar> {};
101 
102 #if defined(EIGEN_GPU_COMPILE_PHASE)
103 template<typename T>
104 struct real_impl<std::complex<T> >
105 {
106  typedef T RealScalar;
108  static inline T run(const std::complex<T>& x)
109  {
110  return x.real();
111  }
112 };
113 #endif
114 
115 template<typename Scalar>
117 {
118  typedef typename NumTraits<Scalar>::Real type;
119 };
120 
121 /****************************************************************************
122 * Implementation of imag *
123 ****************************************************************************/
124 
127 {
128  typedef typename NumTraits<Scalar>::Real RealScalar;
130  static inline RealScalar run(const Scalar&)
131  {
132  return RealScalar(0);
133  }
134 };
135 
136 template<typename Scalar>
138 {
141  static inline RealScalar run(const Scalar& x)
142  {
143  using std::imag;
144  return imag(x);
145  }
146 };
147 
148 template<typename Scalar> struct imag_impl : imag_default_impl<Scalar> {};
149 
150 #if defined(EIGEN_GPU_COMPILE_PHASE)
151 template<typename T>
152 struct imag_impl<std::complex<T> >
153 {
154  typedef T RealScalar;
156  static inline T run(const std::complex<T>& x)
157  {
158  return x.imag();
159  }
160 };
161 #endif
162 
163 template<typename Scalar>
165 {
166  typedef typename NumTraits<Scalar>::Real type;
167 };
168 
169 /****************************************************************************
170 * Implementation of real_ref *
171 ****************************************************************************/
172 
173 template<typename Scalar>
175 {
176  typedef typename NumTraits<Scalar>::Real RealScalar;
178  static inline RealScalar& run(Scalar& x)
179  {
180  return reinterpret_cast<RealScalar*>(&x)[0];
181  }
183  static inline const RealScalar& run(const Scalar& x)
184  {
185  return reinterpret_cast<const RealScalar*>(&x)[0];
186  }
187 };
188 
189 template<typename Scalar>
191 {
192  typedef typename NumTraits<Scalar>::Real & type;
193 };
194 
195 /****************************************************************************
196 * Implementation of imag_ref *
197 ****************************************************************************/
198 
199 template<typename Scalar, bool IsComplex>
201 {
202  typedef typename NumTraits<Scalar>::Real RealScalar;
204  static inline RealScalar& run(Scalar& x)
205  {
206  return reinterpret_cast<RealScalar*>(&x)[1];
207  }
209  static inline const RealScalar& run(const Scalar& x)
210  {
211  return reinterpret_cast<RealScalar*>(&x)[1];
212  }
213 };
214 
215 template<typename Scalar>
217 {
219  static inline Scalar run(Scalar&)
220  {
221  return Scalar(0);
222  }
224  static inline const Scalar run(const Scalar&)
225  {
226  return Scalar(0);
227  }
228 };
229 
230 template<typename Scalar>
231 struct imag_ref_impl : imag_ref_default_impl<Scalar, NumTraits<Scalar>::IsComplex> {};
232 
233 template<typename Scalar>
235 {
236  typedef typename NumTraits<Scalar>::Real & type;
237 };
238 
239 /****************************************************************************
240 * Implementation of conj *
241 ****************************************************************************/
242 
245 {
247  static inline Scalar run(const Scalar& x)
248  {
249  return x;
250  }
251 };
252 
253 template<typename Scalar>
255 {
257  static inline Scalar run(const Scalar& x)
258  {
259  using std::conj;
260  return conj(x);
261  }
262 };
263 
265 struct conj_impl : conj_default_impl<Scalar, IsComplex> {};
266 
267 template<typename Scalar>
269 {
270  typedef Scalar type;
271 };
272 
273 /****************************************************************************
274 * Implementation of abs2 *
275 ****************************************************************************/
276 
277 template<typename Scalar,bool IsComplex>
279 {
280  typedef typename NumTraits<Scalar>::Real RealScalar;
282  static inline RealScalar run(const Scalar& x)
283  {
284  return x*x;
285  }
286 };
287 
288 template<typename Scalar>
289 struct abs2_impl_default<Scalar, true> // IsComplex
290 {
293  static inline RealScalar run(const Scalar& x)
294  {
295  return x.real()*x.real() + x.imag()*x.imag();
296  }
297 };
298 
299 template<typename Scalar>
300 struct abs2_impl
301 {
304  static inline RealScalar run(const Scalar& x)
305  {
307  }
308 };
309 
310 template<typename Scalar>
312 {
313  typedef typename NumTraits<Scalar>::Real type;
314 };
315 
316 /****************************************************************************
317 * Implementation of sqrt/rsqrt *
318 ****************************************************************************/
319 
320 template<typename Scalar>
321 struct sqrt_impl
322 {
324  static EIGEN_ALWAYS_INLINE Scalar run(const Scalar& x)
325  {
327  return sqrt(x);
328  }
329 };
330 
331 // Complex sqrt defined in MathFunctionsImpl.h.
332 template<typename T> EIGEN_DEVICE_FUNC std::complex<T> complex_sqrt(const std::complex<T>& a_x);
333 
334 // Custom implementation is faster than `std::sqrt`, works on
335 // GPU, and correctly handles special cases (unlike MSVC).
336 template<typename T>
337 struct sqrt_impl<std::complex<T> >
338 {
340  static EIGEN_ALWAYS_INLINE std::complex<T> run(const std::complex<T>& x)
341  {
342  return complex_sqrt<T>(x);
343  }
344 };
345 
346 template<typename Scalar>
348 {
349  typedef Scalar type;
350 };
351 
352 // Default implementation relies on numext::sqrt, at bottom of file.
353 template<typename T>
354 struct rsqrt_impl;
355 
356 // Complex rsqrt defined in MathFunctionsImpl.h.
357 template<typename T> EIGEN_DEVICE_FUNC std::complex<T> complex_rsqrt(const std::complex<T>& a_x);
358 
359 template<typename T>
360 struct rsqrt_impl<std::complex<T> >
361 {
363  static EIGEN_ALWAYS_INLINE std::complex<T> run(const std::complex<T>& x)
364  {
365  return complex_rsqrt<T>(x);
366  }
367 };
368 
369 template<typename Scalar>
371 {
372  typedef Scalar type;
373 };
374 
375 /****************************************************************************
376 * Implementation of norm1 *
377 ****************************************************************************/
378 
379 template<typename Scalar, bool IsComplex>
381 
382 template<typename Scalar>
384 {
387  static inline RealScalar run(const Scalar& x)
388  {
390  return abs(x.real()) + abs(x.imag());
391  }
392 };
393 
394 template<typename Scalar>
396 {
398  static inline Scalar run(const Scalar& x)
399  {
401  return abs(x);
402  }
403 };
404 
405 template<typename Scalar>
406 struct norm1_impl : norm1_default_impl<Scalar, NumTraits<Scalar>::IsComplex> {};
407 
408 template<typename Scalar>
410 {
411  typedef typename NumTraits<Scalar>::Real type;
412 };
413 
414 /****************************************************************************
415 * Implementation of hypot *
416 ****************************************************************************/
417 
418 template<typename Scalar> struct hypot_impl;
419 
420 template<typename Scalar>
422 {
423  typedef typename NumTraits<Scalar>::Real type;
424 };
425 
426 /****************************************************************************
427 * Implementation of cast *
428 ****************************************************************************/
429 
430 template<typename OldType, typename NewType, typename EnableIf = void>
431 struct cast_impl
432 {
434  static inline NewType run(const OldType& x)
435  {
436  return static_cast<NewType>(x);
437  }
438 };
439 
440 // Casting from S -> Complex<T> leads to an implicit conversion from S to T,
441 // generating warnings on clang. Here we explicitly cast the real component.
442 template<typename OldType, typename NewType>
443 struct cast_impl<OldType, NewType,
444  typename internal::enable_if<
445  !NumTraits<OldType>::IsComplex && NumTraits<NewType>::IsComplex
446  >::type>
447 {
449  static inline NewType run(const OldType& x)
450  {
451  typedef typename NumTraits<NewType>::Real NewReal;
452  return static_cast<NewType>(static_cast<NewReal>(x));
453  }
454 };
455 
456 // here, for once, we're plainly returning NewType: we don't want cast to do weird things.
457 
458 template<typename OldType, typename NewType>
460 inline NewType cast(const OldType& x)
461 {
463 }
464 
465 /****************************************************************************
466 * Implementation of round *
467 ****************************************************************************/
468 
469 template<typename Scalar>
471 {
473  static inline Scalar run(const Scalar& x)
474  {
475  EIGEN_STATIC_ASSERT((!NumTraits<Scalar>::IsComplex), NUMERIC_TYPE_MUST_BE_REAL)
476 #if EIGEN_HAS_CXX11_MATH
478 #endif
479  return Scalar(round(x));
480  }
481 };
482 
483 #if !EIGEN_HAS_CXX11_MATH
484 #if EIGEN_HAS_C99_MATH
485 // Use ::roundf for float.
486 template<>
487 struct round_impl<float> {
489  static inline float run(const float& x)
490  {
491  return ::roundf(x);
492  }
493 };
494 #else
495 template<typename Scalar>
497 {
499  static inline Scalar run(const Scalar& x)
500  {
501  EIGEN_STATIC_ASSERT((!NumTraits<Scalar>::IsComplex), NUMERIC_TYPE_MUST_BE_REAL)
502  // Without C99 round/roundf, resort to floor/ceil.
505  // If not enough precision to resolve a decimal at all, return the input.
506  // Otherwise, adding 0.5 can trigger an increment by 1.
507  const Scalar limit = Scalar(1ull << (NumTraits<Scalar>::digits() - 1));
508  if (x >= limit || x <= -limit) {
509  return x;
510  }
511  return (x > Scalar(0)) ? Scalar(floor(x + Scalar(0.5))) : Scalar(ceil(x - Scalar(0.5)));
512  }
513 };
514 
515 template<>
517 
518 template<>
519 struct round_impl<double> : round_using_floor_ceil_impl<double> {};
520 #endif // EIGEN_HAS_C99_MATH
521 #endif // !EIGEN_HAS_CXX11_MATH
522 
523 template<typename Scalar>
525 {
526  typedef Scalar type;
527 };
528 
529 /****************************************************************************
530 * Implementation of rint *
531 ****************************************************************************/
532 
533 template<typename Scalar>
534 struct rint_impl {
536  static inline Scalar run(const Scalar& x)
537  {
538  EIGEN_STATIC_ASSERT((!NumTraits<Scalar>::IsComplex), NUMERIC_TYPE_MUST_BE_REAL)
539 #if EIGEN_HAS_CXX11_MATH
541 #endif
542  return rint(x);
543  }
544 };
545 
546 #if !EIGEN_HAS_CXX11_MATH
547 template<>
548 struct rint_impl<double> {
550  static inline double run(const double& x)
551  {
552  return ::rint(x);
553  }
554 };
555 template<>
556 struct rint_impl<float> {
558  static inline float run(const float& x)
559  {
560  return ::rintf(x);
561  }
562 };
563 #endif
564 
565 template<typename Scalar>
567 {
568  typedef Scalar type;
569 };
570 
571 /****************************************************************************
572 * Implementation of arg *
573 ****************************************************************************/
574 
575 // Visual Studio 2017 has a bug where arg(float) returns 0 for negative inputs.
576 // This seems to be fixed in VS 2019.
577 #if EIGEN_HAS_CXX11_MATH && (!EIGEN_COMP_MSVC || EIGEN_COMP_MSVC >= 1920)
578 // std::arg is only defined for types of std::complex, or integer types or float/double/long double
579 template<typename Scalar,
583 struct arg_default_impl;
584 
585 template<typename Scalar>
586 struct arg_default_impl<Scalar, true> {
587  typedef typename NumTraits<Scalar>::Real RealScalar;
589  static inline RealScalar run(const Scalar& x)
590  {
591  #if defined(EIGEN_HIP_DEVICE_COMPILE)
592  // HIP does not seem to have a native device side implementation for the math routine "arg"
593  using std::arg;
594  #else
596  #endif
597  return static_cast<RealScalar>(arg(x));
598  }
599 };
600 
601 // Must be non-complex floating-point type (e.g. half/bfloat16).
602 template<typename Scalar>
603 struct arg_default_impl<Scalar, false> {
604  typedef typename NumTraits<Scalar>::Real RealScalar;
606  static inline RealScalar run(const Scalar& x)
607  {
608  return (x < Scalar(0)) ? RealScalar(EIGEN_PI) : RealScalar(0);
609  }
610 };
611 #else
614 {
615  typedef typename NumTraits<Scalar>::Real RealScalar;
617  static inline RealScalar run(const Scalar& x)
618  {
619  return (x < RealScalar(0)) ? RealScalar(EIGEN_PI) : RealScalar(0);
620  }
621 };
622 
623 template<typename Scalar>
625 {
628  static inline RealScalar run(const Scalar& x)
629  {
631  return arg(x);
632  }
633 };
634 #endif
635 template<typename Scalar> struct arg_impl : arg_default_impl<Scalar> {};
636 
637 template<typename Scalar>
639 {
640  typedef typename NumTraits<Scalar>::Real type;
641 };
642 
643 /****************************************************************************
644 * Implementation of expm1 *
645 ****************************************************************************/
646 
647 // This implementation is based on GSL Math's expm1.
648 namespace std_fallback {
649  // fallback expm1 implementation in case there is no expm1(Scalar) function in namespace of Scalar,
650  // or that there is no suitable std::expm1 function available. Implementation
651  // attributed to Kahan. See: http://www.plunk.org/~hatch/rightway.php.
652  template<typename Scalar>
653  EIGEN_DEVICE_FUNC inline Scalar expm1(const Scalar& x) {
655  typedef typename NumTraits<Scalar>::Real RealScalar;
656 
658  Scalar u = exp(x);
659  if (numext::equal_strict(u, Scalar(1))) {
660  return x;
661  }
662  Scalar um1 = u - RealScalar(1);
663  if (numext::equal_strict(um1, Scalar(-1))) {
664  return RealScalar(-1);
665  }
666 
668  Scalar logu = log(u);
669  return numext::equal_strict(u, logu) ? u : (u - RealScalar(1)) * x / logu;
670  }
671 }
672 
673 template<typename Scalar>
674 struct expm1_impl {
675  EIGEN_DEVICE_FUNC static inline Scalar run(const Scalar& x)
676  {
678  #if EIGEN_HAS_CXX11_MATH
679  using std::expm1;
680  #else
681  using std_fallback::expm1;
682  #endif
683  return expm1(x);
684  }
685 };
686 
687 template<typename Scalar>
689 {
690  typedef Scalar type;
691 };
692 
693 /****************************************************************************
694 * Implementation of log *
695 ****************************************************************************/
696 
697 // Complex log defined in MathFunctionsImpl.h.
698 template<typename T> EIGEN_DEVICE_FUNC std::complex<T> complex_log(const std::complex<T>& z);
699 
700 template<typename Scalar>
701 struct log_impl {
702  EIGEN_DEVICE_FUNC static inline Scalar run(const Scalar& x)
703  {
705  return static_cast<Scalar>(log(x));
706  }
707 };
708 
709 template<typename Scalar>
710 struct log_impl<std::complex<Scalar> > {
711  EIGEN_DEVICE_FUNC static inline std::complex<Scalar> run(const std::complex<Scalar>& z)
712  {
713  return complex_log(z);
714  }
715 };
716 
717 /****************************************************************************
718 * Implementation of log1p *
719 ****************************************************************************/
720 
721 namespace std_fallback {
722  // fallback log1p implementation in case there is no log1p(Scalar) function in namespace of Scalar,
723  // or that there is no suitable std::log1p function available
724  template<typename Scalar>
725  EIGEN_DEVICE_FUNC inline Scalar log1p(const Scalar& x) {
727  typedef typename NumTraits<Scalar>::Real RealScalar;
729  Scalar x1p = RealScalar(1) + x;
730  Scalar log_1p = log_impl<Scalar>::run(x1p);
731  const bool is_small = numext::equal_strict(x1p, Scalar(1));
732  const bool is_inf = numext::equal_strict(x1p, log_1p);
733  return (is_small || is_inf) ? x : x * (log_1p / (x1p - RealScalar(1)));
734  }
735 }
736 
737 template<typename Scalar>
738 struct log1p_impl {
739  EIGEN_DEVICE_FUNC static inline Scalar run(const Scalar& x)
740  {
742  #if EIGEN_HAS_CXX11_MATH
743  using std::log1p;
744  #else
745  using std_fallback::log1p;
746  #endif
747  return log1p(x);
748  }
749 };
750 
751 // Specialization for complex types that are not supported by std::log1p.
752 template <typename RealScalar>
753 struct log1p_impl<std::complex<RealScalar> > {
754  EIGEN_DEVICE_FUNC static inline std::complex<RealScalar> run(
755  const std::complex<RealScalar>& x) {
757  return std_fallback::log1p(x);
758  }
759 };
760 
761 template<typename Scalar>
763 {
764  typedef Scalar type;
765 };
766 
767 /****************************************************************************
768 * Implementation of pow *
769 ****************************************************************************/
770 
771 template<typename ScalarX,typename ScalarY, bool IsInteger = NumTraits<ScalarX>::IsInteger&&NumTraits<ScalarY>::IsInteger>
772 struct pow_impl
773 {
774  //typedef Scalar retval;
776  static EIGEN_DEVICE_FUNC inline result_type run(const ScalarX& x, const ScalarY& y)
777  {
779  return pow(x, y);
780  }
781 };
782 
783 template<typename ScalarX,typename ScalarY>
784 struct pow_impl<ScalarX,ScalarY, true>
785 {
786  typedef ScalarX result_type;
787  static EIGEN_DEVICE_FUNC inline ScalarX run(ScalarX x, ScalarY y)
788  {
789  ScalarX res(1);
791  if(y & 1) res *= x;
792  y >>= 1;
793  while(y)
794  {
795  x *= x;
796  if(y&1) res *= x;
797  y >>= 1;
798  }
799  return res;
800  }
801 };
802 
803 /****************************************************************************
804 * Implementation of random *
805 ****************************************************************************/
806 
807 template<typename Scalar,
808  bool IsComplex,
809  bool IsInteger>
811 
812 template<typename Scalar>
813 struct random_impl : random_default_impl<Scalar, NumTraits<Scalar>::IsComplex, NumTraits<Scalar>::IsInteger> {};
814 
815 template<typename Scalar>
817 {
818  typedef Scalar type;
819 };
820 
821 template<typename Scalar> inline EIGEN_MATHFUNC_RETVAL(random, Scalar) random(const Scalar& x, const Scalar& y);
822 template<typename Scalar> inline EIGEN_MATHFUNC_RETVAL(random, Scalar) random();
823 
824 template<typename Scalar>
825 struct random_default_impl<Scalar, false, false>
826 {
827  static inline Scalar run(const Scalar& x, const Scalar& y)
828  {
829  return x + (y-x) * Scalar(std::rand()) / Scalar(RAND_MAX);
830  }
831  static inline Scalar run()
832  {
833  return run(Scalar(NumTraits<Scalar>::IsSigned ? -1 : 0), Scalar(1));
834  }
835 };
836 
837 enum {
842 };
843 
844 template<unsigned int n, int lower, int upper> struct meta_floor_log2_selector
845 {
846  enum { middle = (lower + upper) / 2,
848  : (n < (1 << middle)) ? int(meta_floor_log2_move_down)
849  : (n==0) ? int(meta_floor_log2_bogus)
851  };
852 };
853 
854 template<unsigned int n,
855  int lower = 0,
856  int upper = sizeof(unsigned int) * CHAR_BIT - 1,
858 struct meta_floor_log2 {};
859 
860 template<unsigned int n, int lower, int upper>
862 {
864 };
865 
866 template<unsigned int n, int lower, int upper>
868 {
870 };
871 
872 template<unsigned int n, int lower, int upper>
874 {
875  enum { value = (n >= ((unsigned int)(1) << (lower+1))) ? lower+1 : lower };
876 };
877 
878 template<unsigned int n, int lower, int upper>
880 {
881  // no value, error at compile time
882 };
883 
884 template<typename Scalar>
885 struct random_default_impl<Scalar, false, true>
886 {
887  static inline Scalar run(const Scalar& x, const Scalar& y)
888  {
889  if (y <= x)
890  return x;
891  // ScalarU is the unsigned counterpart of Scalar, possibly Scalar itself.
892  typedef typename make_unsigned<Scalar>::type ScalarU;
893  // ScalarX is the widest of ScalarU and unsigned int.
894  // We'll deal only with ScalarX and unsigned int below thus avoiding signed
895  // types and arithmetic and signed overflows (which are undefined behavior).
896  typedef typename conditional<(ScalarU(-1) > unsigned(-1)), ScalarU, unsigned>::type ScalarX;
897  // The following difference doesn't overflow, provided our integer types are two's
898  // complement and have the same number of padding bits in signed and unsigned variants.
899  // This is the case in most modern implementations of C++.
900  ScalarX range = ScalarX(y) - ScalarX(x);
901  ScalarX offset = 0;
902  ScalarX divisor = 1;
903  ScalarX multiplier = 1;
904  const unsigned rand_max = RAND_MAX;
905  if (range <= rand_max) divisor = (rand_max + 1) / (range + 1);
906  else multiplier = 1 + range / (rand_max + 1);
907  // Rejection sampling.
908  do {
909  offset = (unsigned(std::rand()) * multiplier) / divisor;
910  } while (offset > range);
911  return Scalar(ScalarX(x) + offset);
912  }
913 
914  static inline Scalar run()
915  {
916 #ifdef EIGEN_MAKING_DOCS
917  return run(Scalar(NumTraits<Scalar>::IsSigned ? -10 : 0), Scalar(10));
918 #else
919  enum { rand_bits = meta_floor_log2<(unsigned int)(RAND_MAX)+1>::value,
920  scalar_bits = sizeof(Scalar) * CHAR_BIT,
921  shift = EIGEN_PLAIN_ENUM_MAX(0, int(rand_bits) - int(scalar_bits)),
922  offset = NumTraits<Scalar>::IsSigned ? (1 << (EIGEN_PLAIN_ENUM_MIN(rand_bits,scalar_bits)-1)) : 0
923  };
924  return Scalar((std::rand() >> shift) - offset);
925 #endif
926  }
927 };
928 
929 template<typename Scalar>
930 struct random_default_impl<Scalar, true, false>
931 {
932  static inline Scalar run(const Scalar& x, const Scalar& y)
933  {
934  return Scalar(random(x.real(), y.real()),
935  random(x.imag(), y.imag()));
936  }
937  static inline Scalar run()
938  {
939  typedef typename NumTraits<Scalar>::Real RealScalar;
940  return Scalar(random<RealScalar>(), random<RealScalar>());
941  }
942 };
943 
944 template<typename Scalar>
945 inline EIGEN_MATHFUNC_RETVAL(random, Scalar) random(const Scalar& x, const Scalar& y)
946 {
947  return EIGEN_MATHFUNC_IMPL(random, Scalar)::run(x, y);
948 }
949 
950 template<typename Scalar>
951 inline EIGEN_MATHFUNC_RETVAL(random, Scalar) random()
952 {
953  return EIGEN_MATHFUNC_IMPL(random, Scalar)::run();
954 }
955 
956 // Implementation of is* functions
957 
958 // std::is* do not work with fast-math and gcc, std::is* are available on MSVC 2013 and newer, as well as in clang.
959 #if (EIGEN_HAS_CXX11_MATH && !(EIGEN_COMP_GNUC_STRICT && __FINITE_MATH_ONLY__)) || (EIGEN_COMP_MSVC>=1800) || (EIGEN_COMP_CLANG)
960 #define EIGEN_USE_STD_FPCLASSIFY 1
961 #else
962 #define EIGEN_USE_STD_FPCLASSIFY 0
963 #endif
964 
965 template<typename T>
968 isnan_impl(const T&) { return false; }
969 
970 template<typename T>
973 isinf_impl(const T&) { return false; }
974 
975 template<typename T>
978 isfinite_impl(const T&) { return true; }
979 
980 template<typename T>
984 {
985  #if defined(EIGEN_GPU_COMPILE_PHASE)
986  return (::isfinite)(x);
987  #elif EIGEN_USE_STD_FPCLASSIFY
988  using std::isfinite;
989  return isfinite EIGEN_NOT_A_MACRO (x);
990  #else
991  return x<=NumTraits<T>::highest() && x>=NumTraits<T>::lowest();
992  #endif
993 }
994 
995 template<typename T>
998 isinf_impl(const T& x)
999 {
1000  #if defined(EIGEN_GPU_COMPILE_PHASE)
1001  return (::isinf)(x);
1002  #elif EIGEN_USE_STD_FPCLASSIFY
1003  using std::isinf;
1004  return isinf EIGEN_NOT_A_MACRO (x);
1005  #else
1006  return x>NumTraits<T>::highest() || x<NumTraits<T>::lowest();
1007  #endif
1008 }
1009 
1010 template<typename T>
1013 isnan_impl(const T& x)
1014 {
1015  #if defined(EIGEN_GPU_COMPILE_PHASE)
1016  return (::isnan)(x);
1017  #elif EIGEN_USE_STD_FPCLASSIFY
1018  using std::isnan;
1019  return isnan EIGEN_NOT_A_MACRO (x);
1020  #else
1021  return x != x;
1022  #endif
1023 }
1024 
1025 #if (!EIGEN_USE_STD_FPCLASSIFY)
1026 
1027 #if EIGEN_COMP_MSVC
1028 
1029 template<typename T> EIGEN_DEVICE_FUNC bool isinf_msvc_helper(T x)
1030 {
1031  return _fpclass(x)==_FPCLASS_NINF || _fpclass(x)==_FPCLASS_PINF;
1032 }
1033 
1034 //MSVC defines a _isnan builtin function, but for double only
1035 EIGEN_DEVICE_FUNC inline bool isnan_impl(const long double& x) { return _isnan(x)!=0; }
1036 EIGEN_DEVICE_FUNC inline bool isnan_impl(const double& x) { return _isnan(x)!=0; }
1037 EIGEN_DEVICE_FUNC inline bool isnan_impl(const float& x) { return _isnan(x)!=0; }
1038 
1039 EIGEN_DEVICE_FUNC inline bool isinf_impl(const long double& x) { return isinf_msvc_helper(x); }
1040 EIGEN_DEVICE_FUNC inline bool isinf_impl(const double& x) { return isinf_msvc_helper(x); }
1041 EIGEN_DEVICE_FUNC inline bool isinf_impl(const float& x) { return isinf_msvc_helper(x); }
1042 
1043 #elif (defined __FINITE_MATH_ONLY__ && __FINITE_MATH_ONLY__ && EIGEN_COMP_GNUC)
1044 
1045 #if EIGEN_GNUC_AT_LEAST(5,0)
1046  #define EIGEN_TMP_NOOPT_ATTRIB EIGEN_DEVICE_FUNC inline __attribute__((optimize("no-finite-math-only")))
1047 #else
1048  // NOTE the inline qualifier and noinline attribute are both needed: the former is to avoid linking issue (duplicate symbol),
1049  // while the second prevent too aggressive optimizations in fast-math mode:
1050  #define EIGEN_TMP_NOOPT_ATTRIB EIGEN_DEVICE_FUNC inline __attribute__((noinline,optimize("no-finite-math-only")))
1051 #endif
1052 
1053 template<> EIGEN_TMP_NOOPT_ATTRIB bool isnan_impl(const long double& x) { return __builtin_isnan(x); }
1054 template<> EIGEN_TMP_NOOPT_ATTRIB bool isnan_impl(const double& x) { return __builtin_isnan(x); }
1055 template<> EIGEN_TMP_NOOPT_ATTRIB bool isnan_impl(const float& x) { return __builtin_isnan(x); }
1056 template<> EIGEN_TMP_NOOPT_ATTRIB bool isinf_impl(const double& x) { return __builtin_isinf(x); }
1057 template<> EIGEN_TMP_NOOPT_ATTRIB bool isinf_impl(const float& x) { return __builtin_isinf(x); }
1058 template<> EIGEN_TMP_NOOPT_ATTRIB bool isinf_impl(const long double& x) { return __builtin_isinf(x); }
1059 
1060 #undef EIGEN_TMP_NOOPT_ATTRIB
1061 
1062 #endif
1063 
1064 #endif
1065 
1066 // The following overload are defined at the end of this file
1067 template<typename T> EIGEN_DEVICE_FUNC bool isfinite_impl(const std::complex<T>& x);
1068 template<typename T> EIGEN_DEVICE_FUNC bool isnan_impl(const std::complex<T>& x);
1069 template<typename T> EIGEN_DEVICE_FUNC bool isinf_impl(const std::complex<T>& x);
1070 
1071 template<typename T> T generic_fast_tanh_float(const T& a_x);
1072 } // end namespace internal
1073 
1074 /****************************************************************************
1075 * Generic math functions *
1076 ****************************************************************************/
1077 
1078 namespace numext {
1079 
1080 #if (!defined(EIGEN_GPUCC) || defined(EIGEN_CONSTEXPR_ARE_DEVICE_FUNC))
1081 template<typename T>
1083 EIGEN_ALWAYS_INLINE T mini(const T& x, const T& y)
1084 {
1086  return min EIGEN_NOT_A_MACRO (x,y);
1087 }
1088 
1089 template<typename T>
1091 EIGEN_ALWAYS_INLINE T maxi(const T& x, const T& y)
1092 {
1094  return max EIGEN_NOT_A_MACRO (x,y);
1095 }
1096 #else
1097 template<typename T>
1099 EIGEN_ALWAYS_INLINE T mini(const T& x, const T& y)
1100 {
1101  return y < x ? y : x;
1102 }
1103 template<>
1105 EIGEN_ALWAYS_INLINE float mini(const float& x, const float& y)
1106 {
1107  return fminf(x, y);
1108 }
1109 template<>
1111 EIGEN_ALWAYS_INLINE double mini(const double& x, const double& y)
1112 {
1113  return fmin(x, y);
1114 }
1115 template<>
1117 EIGEN_ALWAYS_INLINE long double mini(const long double& x, const long double& y)
1118 {
1119 #if defined(EIGEN_HIPCC)
1120  // no "fminl" on HIP yet
1121  return (x < y) ? x : y;
1122 #else
1123  return fminl(x, y);
1124 #endif
1125 }
1126 
1127 template<typename T>
1129 EIGEN_ALWAYS_INLINE T maxi(const T& x, const T& y)
1130 {
1131  return x < y ? y : x;
1132 }
1133 template<>
1135 EIGEN_ALWAYS_INLINE float maxi(const float& x, const float& y)
1136 {
1137  return fmaxf(x, y);
1138 }
1139 template<>
1141 EIGEN_ALWAYS_INLINE double maxi(const double& x, const double& y)
1142 {
1143  return fmax(x, y);
1144 }
1145 template<>
1147 EIGEN_ALWAYS_INLINE long double maxi(const long double& x, const long double& y)
1148 {
1149 #if defined(EIGEN_HIPCC)
1150  // no "fmaxl" on HIP yet
1151  return (x > y) ? x : y;
1152 #else
1153  return fmaxl(x, y);
1154 #endif
1155 }
1156 #endif
1157 
1158 #if defined(SYCL_DEVICE_ONLY)
1159 
1160 
1161 #define SYCL_SPECIALIZE_SIGNED_INTEGER_TYPES_BINARY(NAME, FUNC) \
1162  SYCL_SPECIALIZE_BINARY_FUNC(NAME, FUNC, cl::sycl::cl_char) \
1163  SYCL_SPECIALIZE_BINARY_FUNC(NAME, FUNC, cl::sycl::cl_short) \
1164  SYCL_SPECIALIZE_BINARY_FUNC(NAME, FUNC, cl::sycl::cl_int) \
1165  SYCL_SPECIALIZE_BINARY_FUNC(NAME, FUNC, cl::sycl::cl_long)
1166 #define SYCL_SPECIALIZE_SIGNED_INTEGER_TYPES_UNARY(NAME, FUNC) \
1167  SYCL_SPECIALIZE_UNARY_FUNC(NAME, FUNC, cl::sycl::cl_char) \
1168  SYCL_SPECIALIZE_UNARY_FUNC(NAME, FUNC, cl::sycl::cl_short) \
1169  SYCL_SPECIALIZE_UNARY_FUNC(NAME, FUNC, cl::sycl::cl_int) \
1170  SYCL_SPECIALIZE_UNARY_FUNC(NAME, FUNC, cl::sycl::cl_long)
1171 #define SYCL_SPECIALIZE_UNSIGNED_INTEGER_TYPES_BINARY(NAME, FUNC) \
1172  SYCL_SPECIALIZE_BINARY_FUNC(NAME, FUNC, cl::sycl::cl_uchar) \
1173  SYCL_SPECIALIZE_BINARY_FUNC(NAME, FUNC, cl::sycl::cl_ushort) \
1174  SYCL_SPECIALIZE_BINARY_FUNC(NAME, FUNC, cl::sycl::cl_uint) \
1175  SYCL_SPECIALIZE_BINARY_FUNC(NAME, FUNC, cl::sycl::cl_ulong)
1176 #define SYCL_SPECIALIZE_UNSIGNED_INTEGER_TYPES_UNARY(NAME, FUNC) \
1177  SYCL_SPECIALIZE_UNARY_FUNC(NAME, FUNC, cl::sycl::cl_uchar) \
1178  SYCL_SPECIALIZE_UNARY_FUNC(NAME, FUNC, cl::sycl::cl_ushort) \
1179  SYCL_SPECIALIZE_UNARY_FUNC(NAME, FUNC, cl::sycl::cl_uint) \
1180  SYCL_SPECIALIZE_UNARY_FUNC(NAME, FUNC, cl::sycl::cl_ulong)
1181 #define SYCL_SPECIALIZE_INTEGER_TYPES_BINARY(NAME, FUNC) \
1182  SYCL_SPECIALIZE_SIGNED_INTEGER_TYPES_BINARY(NAME, FUNC) \
1183  SYCL_SPECIALIZE_UNSIGNED_INTEGER_TYPES_BINARY(NAME, FUNC)
1184 #define SYCL_SPECIALIZE_INTEGER_TYPES_UNARY(NAME, FUNC) \
1185  SYCL_SPECIALIZE_SIGNED_INTEGER_TYPES_UNARY(NAME, FUNC) \
1186  SYCL_SPECIALIZE_UNSIGNED_INTEGER_TYPES_UNARY(NAME, FUNC)
1187 #define SYCL_SPECIALIZE_FLOATING_TYPES_BINARY(NAME, FUNC) \
1188  SYCL_SPECIALIZE_BINARY_FUNC(NAME, FUNC, cl::sycl::cl_float) \
1189  SYCL_SPECIALIZE_BINARY_FUNC(NAME, FUNC,cl::sycl::cl_double)
1190 #define SYCL_SPECIALIZE_FLOATING_TYPES_UNARY(NAME, FUNC) \
1191  SYCL_SPECIALIZE_UNARY_FUNC(NAME, FUNC, cl::sycl::cl_float) \
1192  SYCL_SPECIALIZE_UNARY_FUNC(NAME, FUNC,cl::sycl::cl_double)
1193 #define SYCL_SPECIALIZE_FLOATING_TYPES_UNARY_FUNC_RET_TYPE(NAME, FUNC, RET_TYPE) \
1194  SYCL_SPECIALIZE_GEN_UNARY_FUNC(NAME, FUNC, RET_TYPE, cl::sycl::cl_float) \
1195  SYCL_SPECIALIZE_GEN_UNARY_FUNC(NAME, FUNC, RET_TYPE, cl::sycl::cl_double)
1196 
1197 #define SYCL_SPECIALIZE_GEN_UNARY_FUNC(NAME, FUNC, RET_TYPE, ARG_TYPE) \
1198 template<> \
1199  EIGEN_DEVICE_FUNC \
1200  EIGEN_ALWAYS_INLINE RET_TYPE NAME(const ARG_TYPE& x) { \
1201  return cl::sycl::FUNC(x); \
1202  }
1203 
1204 #define SYCL_SPECIALIZE_UNARY_FUNC(NAME, FUNC, TYPE) \
1205  SYCL_SPECIALIZE_GEN_UNARY_FUNC(NAME, FUNC, TYPE, TYPE)
1206 
1207 #define SYCL_SPECIALIZE_GEN1_BINARY_FUNC(NAME, FUNC, RET_TYPE, ARG_TYPE1, ARG_TYPE2) \
1208  template<> \
1209  EIGEN_DEVICE_FUNC \
1210  EIGEN_ALWAYS_INLINE RET_TYPE NAME(const ARG_TYPE1& x, const ARG_TYPE2& y) { \
1211  return cl::sycl::FUNC(x, y); \
1212  }
1213 
1214 #define SYCL_SPECIALIZE_GEN2_BINARY_FUNC(NAME, FUNC, RET_TYPE, ARG_TYPE) \
1215  SYCL_SPECIALIZE_GEN1_BINARY_FUNC(NAME, FUNC, RET_TYPE, ARG_TYPE, ARG_TYPE)
1216 
1217 #define SYCL_SPECIALIZE_BINARY_FUNC(NAME, FUNC, TYPE) \
1218  SYCL_SPECIALIZE_GEN2_BINARY_FUNC(NAME, FUNC, TYPE, TYPE)
1219 
1220 SYCL_SPECIALIZE_INTEGER_TYPES_BINARY(mini, min)
1221 SYCL_SPECIALIZE_FLOATING_TYPES_BINARY(mini, fmin)
1222 SYCL_SPECIALIZE_INTEGER_TYPES_BINARY(maxi, max)
1223 SYCL_SPECIALIZE_FLOATING_TYPES_BINARY(maxi, fmax)
1224 
1225 #endif
1226 
1227 
1228 template<typename Scalar>
1230 inline EIGEN_MATHFUNC_RETVAL(real, Scalar) real(const Scalar& x)
1231 {
1233 }
1234 
1235 template<typename Scalar>
1238 {
1240 }
1241 
1242 template<typename Scalar>
1245 {
1247 }
1248 
1249 template<typename Scalar>
1251 inline EIGEN_MATHFUNC_RETVAL(imag, Scalar) imag(const Scalar& x)
1252 {
1254 }
1255 
1256 template<typename Scalar>
1258 inline EIGEN_MATHFUNC_RETVAL(arg, Scalar) arg(const Scalar& x)
1259 {
1261 }
1262 
1263 template<typename Scalar>
1266 {
1268 }
1269 
1270 template<typename Scalar>
1273 {
1275 }
1276 
1277 template<typename Scalar>
1279 inline EIGEN_MATHFUNC_RETVAL(conj, Scalar) conj(const Scalar& x)
1280 {
1282 }
1283 
1284 template<typename Scalar>
1286 inline EIGEN_MATHFUNC_RETVAL(abs2, Scalar) abs2(const Scalar& x)
1287 {
1289 }
1290 
1292 inline bool abs2(bool x) { return x; }
1293 
1294 template<typename T>
1296 EIGEN_ALWAYS_INLINE T absdiff(const T& x, const T& y)
1297 {
1298  return x > y ? x - y : y - x;
1299 }
1300 template<>
1302 EIGEN_ALWAYS_INLINE float absdiff(const float& x, const float& y)
1303 {
1304  return fabsf(x - y);
1305 }
1306 template<>
1308 EIGEN_ALWAYS_INLINE double absdiff(const double& x, const double& y)
1309 {
1310  return fabs(x - y);
1311 }
1312 
1313 #if !defined(EIGEN_GPUCC)
1314 // HIP and CUDA do not support long double.
1315 template<>
1317 EIGEN_ALWAYS_INLINE long double absdiff(const long double& x, const long double& y) {
1318  return fabsl(x - y);
1320 #endif
1321 
1322 template<typename Scalar>
1324 inline EIGEN_MATHFUNC_RETVAL(norm1, Scalar) norm1(const Scalar& x)
1325 {
1326  return EIGEN_MATHFUNC_IMPL(norm1, Scalar)::run(x);
1327 }
1328 
1329 template<typename Scalar>
1331 inline EIGEN_MATHFUNC_RETVAL(hypot, Scalar) hypot(const Scalar& x, const Scalar& y)
1332 {
1333  return EIGEN_MATHFUNC_IMPL(hypot, Scalar)::run(x, y);
1335 
1336 #if defined(SYCL_DEVICE_ONLY)
1337  SYCL_SPECIALIZE_FLOATING_TYPES_BINARY(hypot, hypot)
1338 #endif
1339 
1340 template<typename Scalar>
1343 {
1345 }
1346 
1347 #if defined(SYCL_DEVICE_ONLY)
1348 SYCL_SPECIALIZE_FLOATING_TYPES_UNARY(log1p, log1p)
1349 #endif
1350 
1351 #if defined(EIGEN_GPUCC)
1353 float log1p(const float &x) { return ::log1pf(x); }
1354 
1356 double log1p(const double &x) { return ::log1p(x); }
1357 #endif
1358 
1359 template<typename ScalarX,typename ScalarY>
1361 inline typename internal::pow_impl<ScalarX,ScalarY>::result_type pow(const ScalarX& x, const ScalarY& y)
1362 {
1364 }
1365 
1366 #if defined(SYCL_DEVICE_ONLY)
1367 SYCL_SPECIALIZE_FLOATING_TYPES_BINARY(pow, pow)
1368 #endif
1369 
1370 template<typename T> EIGEN_DEVICE_FUNC bool (isnan) (const T &x) { return internal::isnan_impl(x); }
1371 template<typename T> EIGEN_DEVICE_FUNC bool (isinf) (const T &x) { return internal::isinf_impl(x); }
1372 template<typename T> EIGEN_DEVICE_FUNC bool (isfinite)(const T &x) { return internal::isfinite_impl(x); }
1374 #if defined(SYCL_DEVICE_ONLY)
1375 SYCL_SPECIALIZE_FLOATING_TYPES_UNARY_FUNC_RET_TYPE(isnan, isnan, bool)
1376 SYCL_SPECIALIZE_FLOATING_TYPES_UNARY_FUNC_RET_TYPE(isinf, isinf, bool)
1377 SYCL_SPECIALIZE_FLOATING_TYPES_UNARY_FUNC_RET_TYPE(isfinite, isfinite, bool)
1378 #endif
1379 
1380 template<typename Scalar>
1382 inline EIGEN_MATHFUNC_RETVAL(rint, Scalar) rint(const Scalar& x)
1383 {
1385 }
1386 
1387 template<typename Scalar>
1390 {
1392 }
1393 
1394 #if defined(SYCL_DEVICE_ONLY)
1395 SYCL_SPECIALIZE_FLOATING_TYPES_UNARY(round, round)
1396 #endif
1397 
1398 template<typename T>
1400 T (floor)(const T& x)
1401 {
1403  return floor(x);
1404 }
1405 
1406 #if defined(SYCL_DEVICE_ONLY)
1407 SYCL_SPECIALIZE_FLOATING_TYPES_UNARY(floor, floor)
1408 #endif
1409 
1410 #if defined(EIGEN_GPUCC)
1412 float floor(const float &x) { return ::floorf(x); }
1413 
1415 double floor(const double &x) { return ::floor(x); }
1416 #endif
1417 
1418 template<typename T>
1420 T (ceil)(const T& x)
1421 {
1423  return ceil(x);
1424 }
1425 
1426 #if defined(SYCL_DEVICE_ONLY)
1427 SYCL_SPECIALIZE_FLOATING_TYPES_UNARY(ceil, ceil)
1428 #endif
1429 
1430 #if defined(EIGEN_GPUCC)
1432 float ceil(const float &x) { return ::ceilf(x); }
1433 
1435 double ceil(const double &x) { return ::ceil(x); }
1436 #endif
1437 
1438 
1441 inline int log2(int x)
1442 {
1444  unsigned int v(x);
1445  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 };
1446  v |= v >> 1;
1447  v |= v >> 2;
1448  v |= v >> 4;
1449  v |= v >> 8;
1450  v |= v >> 16;
1451  return table[(v * 0x07C4ACDDU) >> 27];
1452 }
1453 
1463 template<typename Scalar>
1466 {
1468 }
1469 
1470 // Boolean specialization, avoids implicit float to bool conversion (-Wimplicit-conversion-floating-point-to-bool).
1471 template<>
1473 bool sqrt<bool>(const bool &x) { return x; }
1474 
1475 #if defined(SYCL_DEVICE_ONLY)
1476 SYCL_SPECIALIZE_FLOATING_TYPES_UNARY(sqrt, sqrt)
1477 #endif
1478 
1480 template<typename T>
1482 T rsqrt(const T& x)
1483 {
1485 }
1486 
1487 template<typename T>
1489 T log(const T &x) {
1490  return internal::log_impl<T>::run(x);
1492 
1493 #if defined(SYCL_DEVICE_ONLY)
1494 SYCL_SPECIALIZE_FLOATING_TYPES_UNARY(log, log)
1495 #endif
1496 
1497 
1498 #if defined(EIGEN_GPUCC)
1500 float log(const float &x) { return ::logf(x); }
1501 
1503 double log(const double &x) { return ::log(x); }
1504 #endif
1505 
1506 template<typename T>
1508 typename internal::enable_if<NumTraits<T>::IsSigned || NumTraits<T>::IsComplex,typename NumTraits<T>::Real>::type
1509 abs(const T &x) {
1511  return abs(x);
1512 }
1513 
1514 template<typename T>
1517 abs(const T &x) {
1518  return x;
1520 
1521 #if defined(SYCL_DEVICE_ONLY)
1522 SYCL_SPECIALIZE_INTEGER_TYPES_UNARY(abs, abs)
1523 SYCL_SPECIALIZE_FLOATING_TYPES_UNARY(abs, fabs)
1524 #endif
1525 
1526 #if defined(EIGEN_GPUCC)
1528 float abs(const float &x) { return ::fabsf(x); }
1529 
1531 double abs(const double &x) { return ::fabs(x); }
1532 
1534 float abs(const std::complex<float>& x) {
1535  return ::hypotf(x.real(), x.imag());
1536 }
1537 
1539 double abs(const std::complex<double>& x) {
1540  return ::hypot(x.real(), x.imag());
1541 }
1542 #endif
1543 
1544 template<typename T>
1546 T exp(const T &x) {
1548  return exp(x);
1549 }
1550 
1551 #if defined(SYCL_DEVICE_ONLY)
1552 SYCL_SPECIALIZE_FLOATING_TYPES_UNARY(exp, exp)
1553 #endif
1554 
1555 #if defined(EIGEN_GPUCC)
1557 float exp(const float &x) { return ::expf(x); }
1558 
1560 double exp(const double &x) { return ::exp(x); }
1561 
1563 std::complex<float> exp(const std::complex<float>& x) {
1564  float com = ::expf(x.real());
1565  float res_real = com * ::cosf(x.imag());
1566  float res_imag = com * ::sinf(x.imag());
1567  return std::complex<float>(res_real, res_imag);
1568 }
1569 
1571 std::complex<double> exp(const std::complex<double>& x) {
1572  double com = ::exp(x.real());
1573  double res_real = com * ::cos(x.imag());
1574  double res_imag = com * ::sin(x.imag());
1575  return std::complex<double>(res_real, res_imag);
1576 }
1577 #endif
1578 
1579 template<typename Scalar>
1582 {
1584 }
1585 
1586 #if defined(SYCL_DEVICE_ONLY)
1587 SYCL_SPECIALIZE_FLOATING_TYPES_UNARY(expm1, expm1)
1588 #endif
1589 
1590 #if defined(EIGEN_GPUCC)
1592 float expm1(const float &x) { return ::expm1f(x); }
1593 
1595 double expm1(const double &x) { return ::expm1(x); }
1596 #endif
1597 
1598 template<typename T>
1600 T cos(const T &x) {
1602  return cos(x);
1603 }
1604 
1605 #if defined(SYCL_DEVICE_ONLY)
1606 SYCL_SPECIALIZE_FLOATING_TYPES_UNARY(cos,cos)
1607 #endif
1608 
1609 #if defined(EIGEN_GPUCC)
1611 float cos(const float &x) { return ::cosf(x); }
1612 
1614 double cos(const double &x) { return ::cos(x); }
1615 #endif
1616 
1617 template<typename T>
1619 T sin(const T &x) {
1621  return sin(x);
1622 }
1623 
1624 #if defined(SYCL_DEVICE_ONLY)
1625 SYCL_SPECIALIZE_FLOATING_TYPES_UNARY(sin, sin)
1626 #endif
1627 
1628 #if defined(EIGEN_GPUCC)
1630 float sin(const float &x) { return ::sinf(x); }
1631 
1633 double sin(const double &x) { return ::sin(x); }
1634 #endif
1635 
1636 template<typename T>
1638 T tan(const T &x) {
1640  return tan(x);
1641 }
1642 
1643 #if defined(SYCL_DEVICE_ONLY)
1644 SYCL_SPECIALIZE_FLOATING_TYPES_UNARY(tan, tan)
1645 #endif
1646 
1647 #if defined(EIGEN_GPUCC)
1649 float tan(const float &x) { return ::tanf(x); }
1650 
1652 double tan(const double &x) { return ::tan(x); }
1653 #endif
1654 
1655 template<typename T>
1657 T acos(const T &x) {
1659  return acos(x);
1660 }
1661 
1662 #if EIGEN_HAS_CXX11_MATH
1663 template<typename T>
1665 T acosh(const T &x) {
1666  EIGEN_USING_STD(acosh);
1667  return static_cast<T>(acosh(x));
1668 }
1669 #endif
1670 
1671 #if defined(SYCL_DEVICE_ONLY)
1672 SYCL_SPECIALIZE_FLOATING_TYPES_UNARY(acos, acos)
1673 SYCL_SPECIALIZE_FLOATING_TYPES_UNARY(acosh, acosh)
1674 #endif
1675 
1676 #if defined(EIGEN_GPUCC)
1678 float acos(const float &x) { return ::acosf(x); }
1679 
1681 double acos(const double &x) { return ::acos(x); }
1682 #endif
1683 
1684 template<typename T>
1686 T asin(const T &x) {
1688  return asin(x);
1689 }
1690 
1691 #if EIGEN_HAS_CXX11_MATH
1692 template<typename T>
1694 T asinh(const T &x) {
1695  EIGEN_USING_STD(asinh);
1696  return static_cast<T>(asinh(x));
1697 }
1698 #endif
1699 
1700 #if defined(SYCL_DEVICE_ONLY)
1701 SYCL_SPECIALIZE_FLOATING_TYPES_UNARY(asin, asin)
1702 SYCL_SPECIALIZE_FLOATING_TYPES_UNARY(asinh, asinh)
1703 #endif
1704 
1705 #if defined(EIGEN_GPUCC)
1707 float asin(const float &x) { return ::asinf(x); }
1708 
1710 double asin(const double &x) { return ::asin(x); }
1711 #endif
1712 
1713 template<typename T>
1715 T atan(const T &x) {
1717  return static_cast<T>(atan(x));
1718 }
1719 
1720 #if EIGEN_HAS_CXX11_MATH
1721 template<typename T>
1723 T atanh(const T &x) {
1724  EIGEN_USING_STD(atanh);
1725  return static_cast<T>(atanh(x));
1726 }
1727 #endif
1728 
1729 #if defined(SYCL_DEVICE_ONLY)
1730 SYCL_SPECIALIZE_FLOATING_TYPES_UNARY(atan, atan)
1731 SYCL_SPECIALIZE_FLOATING_TYPES_UNARY(atanh, atanh)
1732 #endif
1733 
1734 #if defined(EIGEN_GPUCC)
1736 float atan(const float &x) { return ::atanf(x); }
1737 
1739 double atan(const double &x) { return ::atan(x); }
1740 #endif
1741 
1742 
1743 template<typename T>
1745 T cosh(const T &x) {
1747  return static_cast<T>(cosh(x));
1748 }
1749 
1750 #if defined(SYCL_DEVICE_ONLY)
1751 SYCL_SPECIALIZE_FLOATING_TYPES_UNARY(cosh, cosh)
1752 #endif
1753 
1754 #if defined(EIGEN_GPUCC)
1756 float cosh(const float &x) { return ::coshf(x); }
1757 
1759 double cosh(const double &x) { return ::cosh(x); }
1760 #endif
1761 
1762 template<typename T>
1764 T sinh(const T &x) {
1766  return static_cast<T>(sinh(x));
1767 }
1768 
1769 #if defined(SYCL_DEVICE_ONLY)
1770 SYCL_SPECIALIZE_FLOATING_TYPES_UNARY(sinh, sinh)
1771 #endif
1772 
1773 #if defined(EIGEN_GPUCC)
1775 float sinh(const float &x) { return ::sinhf(x); }
1776 
1778 double sinh(const double &x) { return ::sinh(x); }
1779 #endif
1780 
1781 template<typename T>
1783 T tanh(const T &x) {
1785  return tanh(x);
1786 }
1787 
1788 #if (!defined(EIGEN_GPUCC)) && EIGEN_FAST_MATH && !defined(SYCL_DEVICE_ONLY)
1790 float tanh(float x) { return internal::generic_fast_tanh_float(x); }
1791 #endif
1792 
1793 #if defined(SYCL_DEVICE_ONLY)
1794 SYCL_SPECIALIZE_FLOATING_TYPES_UNARY(tanh, tanh)
1795 #endif
1796 
1797 #if defined(EIGEN_GPUCC)
1799 float tanh(const float &x) { return ::tanhf(x); }
1800 
1802 double tanh(const double &x) { return ::tanh(x); }
1803 #endif
1804 
1805 template <typename T>
1807 T fmod(const T& a, const T& b) {
1809  return fmod(a, b);
1810 }
1811 
1812 #if defined(SYCL_DEVICE_ONLY)
1813 SYCL_SPECIALIZE_FLOATING_TYPES_BINARY(fmod, fmod)
1814 #endif
1815 
1816 #if defined(EIGEN_GPUCC)
1817 template <>
1819 float fmod(const float& a, const float& b) {
1820  return ::fmodf(a, b);
1821 }
1822 
1823 template <>
1825 double fmod(const double& a, const double& b) {
1826  return ::fmod(a, b);
1827 }
1828 #endif
1829 
1830 #if defined(SYCL_DEVICE_ONLY)
1831 #undef SYCL_SPECIALIZE_SIGNED_INTEGER_TYPES_BINARY
1832 #undef SYCL_SPECIALIZE_SIGNED_INTEGER_TYPES_UNARY
1833 #undef SYCL_SPECIALIZE_UNSIGNED_INTEGER_TYPES_BINARY
1834 #undef SYCL_SPECIALIZE_UNSIGNED_INTEGER_TYPES_UNARY
1835 #undef SYCL_SPECIALIZE_INTEGER_TYPES_BINARY
1836 #undef SYCL_SPECIALIZE_UNSIGNED_INTEGER_TYPES_UNARY
1837 #undef SYCL_SPECIALIZE_FLOATING_TYPES_BINARY
1838 #undef SYCL_SPECIALIZE_FLOATING_TYPES_UNARY
1839 #undef SYCL_SPECIALIZE_FLOATING_TYPES_UNARY_FUNC_RET_TYPE
1840 #undef SYCL_SPECIALIZE_GEN_UNARY_FUNC
1841 #undef SYCL_SPECIALIZE_UNARY_FUNC
1842 #undef SYCL_SPECIALIZE_GEN1_BINARY_FUNC
1843 #undef SYCL_SPECIALIZE_GEN2_BINARY_FUNC
1844 #undef SYCL_SPECIALIZE_BINARY_FUNC
1845 #endif
1846 
1847 } // end namespace numext
1848 
1849 namespace internal {
1850 
1851 template<typename T>
1852 EIGEN_DEVICE_FUNC bool isfinite_impl(const std::complex<T>& x)
1853 {
1855 }
1856 
1857 template<typename T>
1858 EIGEN_DEVICE_FUNC bool isnan_impl(const std::complex<T>& x)
1859 {
1861 }
1862 
1863 template<typename T>
1864 EIGEN_DEVICE_FUNC bool isinf_impl(const std::complex<T>& x)
1865 {
1866  return ((numext::isinf)(numext::real(x)) || (numext::isinf)(numext::imag(x))) && (!(numext::isnan)(x));
1867 }
1868 
1869 /****************************************************************************
1870 * Implementation of fuzzy comparisons *
1871 ****************************************************************************/
1872 
1873 template<typename Scalar,
1874  bool IsComplex,
1875  bool IsInteger>
1877 
1878 template<typename Scalar>
1879 struct scalar_fuzzy_default_impl<Scalar, false, false>
1880 {
1882  template<typename OtherScalar> EIGEN_DEVICE_FUNC
1883  static inline bool isMuchSmallerThan(const Scalar& x, const OtherScalar& y, const RealScalar& prec)
1884  {
1885  return numext::abs(x) <= numext::abs(y) * prec;
1886  }
1888  static inline bool isApprox(const Scalar& x, const Scalar& y, const RealScalar& prec)
1889  {
1890  return numext::abs(x - y) <= numext::mini(numext::abs(x), numext::abs(y)) * prec;
1891  }
1893  static inline bool isApproxOrLessThan(const Scalar& x, const Scalar& y, const RealScalar& prec)
1894  {
1895  return x <= y || isApprox(x, y, prec);
1896  }
1897 };
1898 
1899 template<typename Scalar>
1900 struct scalar_fuzzy_default_impl<Scalar, false, true>
1901 {
1903  template<typename OtherScalar> EIGEN_DEVICE_FUNC
1904  static inline bool isMuchSmallerThan(const Scalar& x, const Scalar&, const RealScalar&)
1905  {
1906  return x == Scalar(0);
1907  }
1909  static inline bool isApprox(const Scalar& x, const Scalar& y, const RealScalar&)
1910  {
1911  return x == y;
1912  }
1914  static inline bool isApproxOrLessThan(const Scalar& x, const Scalar& y, const RealScalar&)
1915  {
1916  return x <= y;
1917  }
1918 };
1919 
1920 template<typename Scalar>
1921 struct scalar_fuzzy_default_impl<Scalar, true, false>
1922 {
1924  template<typename OtherScalar> EIGEN_DEVICE_FUNC
1925  static inline bool isMuchSmallerThan(const Scalar& x, const OtherScalar& y, const RealScalar& prec)
1926  {
1927  return numext::abs2(x) <= numext::abs2(y) * prec * prec;
1928  }
1930  static inline bool isApprox(const Scalar& x, const Scalar& y, const RealScalar& prec)
1931  {
1932  return numext::abs2(x - y) <= numext::mini(numext::abs2(x), numext::abs2(y)) * prec * prec;
1933  }
1934 };
1935 
1936 template<typename Scalar>
1937 struct scalar_fuzzy_impl : scalar_fuzzy_default_impl<Scalar, NumTraits<Scalar>::IsComplex, NumTraits<Scalar>::IsInteger> {};
1938 
1939 template<typename Scalar, typename OtherScalar> EIGEN_DEVICE_FUNC
1940 inline bool isMuchSmallerThan(const Scalar& x, const OtherScalar& y,
1942 {
1943  return scalar_fuzzy_impl<Scalar>::template isMuchSmallerThan<OtherScalar>(x, y, precision);
1944 }
1945 
1946 template<typename Scalar> EIGEN_DEVICE_FUNC
1947 inline bool isApprox(const Scalar& x, const Scalar& y,
1949 {
1951 }
1952 
1953 template<typename Scalar> EIGEN_DEVICE_FUNC
1954 inline bool isApproxOrLessThan(const Scalar& x, const Scalar& y,
1956 {
1958 }
1959 
1960 /******************************************
1961 *** The special case of the bool type ***
1962 ******************************************/
1963 
1964 template<> struct random_impl<bool>
1965 {
1966  static inline bool run()
1967  {
1968  return random<int>(0,1)==0 ? false : true;
1969  }
1970 
1971  static inline bool run(const bool& a, const bool& b)
1972  {
1973  return random<int>(a, b)==0 ? false : true;
1974  }
1975 };
1976 
1977 template<> struct scalar_fuzzy_impl<bool>
1978 {
1979  typedef bool RealScalar;
1980 
1981  template<typename OtherScalar> EIGEN_DEVICE_FUNC
1982  static inline bool isMuchSmallerThan(const bool& x, const bool&, const bool&)
1983  {
1984  return !x;
1985  }
1986 
1988  static inline bool isApprox(bool x, bool y, bool)
1989  {
1990  return x == y;
1991  }
1992 
1994  static inline bool isApproxOrLessThan(const bool& x, const bool& y, const bool&)
1995  {
1996  return (!x) || y;
1997  }
1998 
1999 };
2000 
2001 } // end namespace internal
2002 
2003 // Default implementations that rely on other numext implementations
2004 namespace internal {
2005 
2006 // Specialization for complex types that are not supported by std::expm1.
2007 template <typename RealScalar>
2008 struct expm1_impl<std::complex<RealScalar> > {
2009  EIGEN_DEVICE_FUNC static inline std::complex<RealScalar> run(
2010  const std::complex<RealScalar>& x) {
2012  RealScalar xr = x.real();
2013  RealScalar xi = x.imag();
2014  // expm1(z) = exp(z) - 1
2015  // = exp(x + i * y) - 1
2016  // = exp(x) * (cos(y) + i * sin(y)) - 1
2017  // = exp(x) * cos(y) - 1 + i * exp(x) * sin(y)
2018  // Imag(expm1(z)) = exp(x) * sin(y)
2019  // Real(expm1(z)) = exp(x) * cos(y) - 1
2020  // = exp(x) * cos(y) - 1.
2021  // = expm1(x) + exp(x) * (cos(y) - 1)
2022  // = expm1(x) + exp(x) * (2 * sin(y / 2) ** 2)
2023  RealScalar erm1 = numext::expm1<RealScalar>(xr);
2024  RealScalar er = erm1 + RealScalar(1.);
2025  RealScalar sin2 = numext::sin(xi / RealScalar(2.));
2026  sin2 = sin2 * sin2;
2028  RealScalar real_part = erm1 - RealScalar(2.) * er * sin2;
2029  return std::complex<RealScalar>(real_part, er * s);
2030  }
2031 };
2032 
2033 template<typename T>
2034 struct rsqrt_impl {
2036  static EIGEN_ALWAYS_INLINE T run(const T& x) {
2037  return T(1)/numext::sqrt(x);
2038  }
2039 };
2040 
2041 #if defined(EIGEN_GPU_COMPILE_PHASE)
2042 template<typename T>
2043 struct conj_impl<std::complex<T>, true>
2044 {
2046  static inline std::complex<T> run(const std::complex<T>& x)
2047  {
2048  return std::complex<T>(numext::real(x), -numext::imag(x));
2049  }
2050 };
2051 #endif
2052 
2053 } // end namespace internal
2054 
2055 } // end namespace Eigen
2056 
2057 #endif // EIGEN_MATHFUNCTIONS_H
Eigen::internal::real_ref_retval
Definition: Eigen/src/Core/MathFunctions.h:190
Eigen::internal::random_default_impl< Scalar, false, true >::run
static Scalar run()
Definition: Eigen/src/Core/MathFunctions.h:914
Eigen::internal::global_math_functions_filtering_base
Definition: Eigen/src/Core/MathFunctions.h:54
gtsam.examples.DogLegOptimizerExample.int
int
Definition: DogLegOptimizerExample.py:111
Eigen::internal::cast_impl
Definition: Eigen/src/Core/MathFunctions.h:431
Eigen::internal::real_ref_impl::RealScalar
NumTraits< Scalar >::Real RealScalar
Definition: Eigen/src/Core/MathFunctions.h:178
Eigen::conj
const AutoDiffScalar< DerType > & conj(const AutoDiffScalar< DerType > &x)
Definition: AutoDiffScalar.h:574
Eigen::internal::abs2_impl_default::RealScalar
NumTraits< Scalar >::Real RealScalar
Definition: Eigen/src/Core/MathFunctions.h:282
Eigen::internal::log1p_retval::type
Scalar type
Definition: Eigen/src/Core/MathFunctions.h:764
Eigen::internal::random_retval
Definition: Eigen/src/Core/MathFunctions.h:816
EIGEN_DEVICE_FUNC
#define EIGEN_DEVICE_FUNC
Definition: Macros.h:976
Eigen
Namespace containing all symbols from the Eigen library.
Definition: jet.h:637
Eigen::internal::hypot_retval::type
NumTraits< Scalar >::Real type
Definition: Eigen/src/Core/MathFunctions.h:423
Eigen::internal::sqrt_impl
Definition: Eigen/src/Core/MathFunctions.h:321
Eigen::max
CleanedUpDerType< DerType >::type() max(const AutoDiffScalar< DerType > &x, const T &y)
Definition: AutoDiffScalar.h:585
Eigen::internal::pow_impl::run
static EIGEN_DEVICE_FUNC result_type run(const ScalarX &x, const ScalarY &y)
Definition: Eigen/src/Core/MathFunctions.h:778
Eigen::internal::isfinite_impl
EIGEN_DEVICE_FUNC internal::enable_if< internal::is_integral< T >::value, bool >::type isfinite_impl(const T &)
Definition: Eigen/src/Core/MathFunctions.h:978
Eigen::internal::hypot_impl
Definition: Eigen/src/Core/MathFunctions.h:418
EIGEN_PI
#define EIGEN_PI
Definition: Eigen/src/Core/MathFunctions.h:16
Eigen::internal::abs2_impl::RealScalar
NumTraits< Scalar >::Real RealScalar
Definition: Eigen/src/Core/MathFunctions.h:302
Eigen::internal::random_default_impl< Scalar, true, false >::run
static Scalar run(const Scalar &x, const Scalar &y)
Definition: Eigen/src/Core/MathFunctions.h:932
EIGEN_USING_STD
#define EIGEN_USING_STD(FUNC)
Definition: Macros.h:1185
Eigen::internal::pow_impl
Definition: Eigen/src/Core/MathFunctions.h:772
s
RealScalar s
Definition: level1_cplx_impl.h:126
atan
const EIGEN_DEVICE_FUNC AtanReturnType atan() const
Definition: ArrayCwiseUnaryOps.h:283
Eigen::internal::abs2_impl::run
static EIGEN_DEVICE_FUNC RealScalar run(const Scalar &x)
Definition: Eigen/src/Core/MathFunctions.h:304
Eigen::numext::imag_ref
EIGEN_DEVICE_FUNC internal::add_const_on_value_type< EIGEN_MATHFUNC_RETVAL(imag_ref, Scalar) >::type imag_ref(const Scalar &x)
Definition: Eigen/src/Core/MathFunctions.h:1267
Eigen::internal::isinf_impl
EIGEN_DEVICE_FUNC internal::enable_if< internal::is_integral< T >::value, bool >::type isinf_impl(const T &)
Definition: Eigen/src/Core/MathFunctions.h:973
Eigen::internal::real_retval::type
NumTraits< Scalar >::Real type
Definition: Eigen/src/Core/MathFunctions.h:118
Eigen::internal::isApproxOrLessThan
EIGEN_DEVICE_FUNC bool isApproxOrLessThan(const Scalar &x, const Scalar &y, const typename NumTraits< Scalar >::Real &precision=NumTraits< Scalar >::dummy_precision())
Definition: Eigen/src/Core/MathFunctions.h:1954
screwPose2::xi
Vector xi
Definition: testPose2.cpp:148
Eigen::internal::norm1_default_impl< Scalar, false >::run
static EIGEN_DEVICE_FUNC Scalar run(const Scalar &x)
Definition: Eigen/src/Core/MathFunctions.h:398
Eigen::internal::conj_retval
Definition: Eigen/src/Core/MathFunctions.h:268
Eigen::internal::cast_impl::run
static EIGEN_DEVICE_FUNC NewType run(const OldType &x)
Definition: Eigen/src/Core/MathFunctions.h:436
Eigen::internal::round_impl::run
static EIGEN_DEVICE_FUNC Scalar run(const Scalar &x)
Definition: Eigen/src/Core/MathFunctions.h:475
Eigen::internal::scalar_fuzzy_default_impl< Scalar, false, false >::isMuchSmallerThan
static EIGEN_DEVICE_FUNC bool isMuchSmallerThan(const Scalar &x, const OtherScalar &y, const RealScalar &prec)
Definition: Eigen/src/Core/MathFunctions.h:1883
Eigen::numext::isfinite
EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE bool() isfinite(const Eigen::bfloat16 &h)
Definition: BFloat16.h:671
Eigen::internal::sqrt_retval::type
Scalar type
Definition: Eigen/src/Core/MathFunctions.h:349
Eigen::internal::scalar_fuzzy_default_impl< Scalar, true, false >::isMuchSmallerThan
static EIGEN_DEVICE_FUNC bool isMuchSmallerThan(const Scalar &x, const OtherScalar &y, const RealScalar &prec)
Definition: Eigen/src/Core/MathFunctions.h:1925
Eigen::internal::arg_default_impl< Scalar, true >::RealScalar
NumTraits< Scalar >::Real RealScalar
Definition: Eigen/src/Core/MathFunctions.h:626
Eigen::internal::random_default_impl< Scalar, true, false >::run
static Scalar run()
Definition: Eigen/src/Core/MathFunctions.h:937
b
Scalar * b
Definition: benchVecAdd.cpp:17
Eigen::internal::conj_retval::type
Scalar type
Definition: Eigen/src/Core/MathFunctions.h:270
Eigen::internal::scalar_fuzzy_default_impl< Scalar, false, false >::isApproxOrLessThan
static EIGEN_DEVICE_FUNC bool isApproxOrLessThan(const Scalar &x, const Scalar &y, const RealScalar &prec)
Definition: Eigen/src/Core/MathFunctions.h:1893
eigen_assert
#define eigen_assert(x)
Definition: Macros.h:1037
Eigen::internal::log_impl< std::complex< Scalar > >::run
static EIGEN_DEVICE_FUNC std::complex< Scalar > run(const std::complex< Scalar > &z)
Definition: Eigen/src/Core/MathFunctions.h:711
Eigen::internal::log_impl::run
static EIGEN_DEVICE_FUNC Scalar run(const Scalar &x)
Definition: Eigen/src/Core/MathFunctions.h:702
Eigen::internal::random_default_impl< Scalar, false, false >::run
static Scalar run(const Scalar &x, const Scalar &y)
Definition: Eigen/src/Core/MathFunctions.h:827
Eigen::internal::norm1_impl
Definition: Eigen/src/Core/MathFunctions.h:406
Eigen::internal::imag_default_impl::RealScalar
NumTraits< Scalar >::Real RealScalar
Definition: Eigen/src/Core/MathFunctions.h:130
Eigen::internal::meta_floor_log2
Definition: Eigen/src/Core/MathFunctions.h:858
x
set noclip points set clip one set noclip two set bar set border lt lw set xdata set ydata set zdata set x2data set y2data set boxwidth set dummy x
Definition: gnuplot_common_settings.hh:12
Eigen::internal::expm1_impl< std::complex< RealScalar > >::run
static EIGEN_DEVICE_FUNC std::complex< RealScalar > run(const std::complex< RealScalar > &x)
Definition: Eigen/src/Core/MathFunctions.h:2009
Eigen::numext::isinf
EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE bool() isinf(const Eigen::bfloat16 &h)
Definition: BFloat16.h:665
Eigen::internal::scalar_fuzzy_default_impl< Scalar, false, true >::isApprox
static EIGEN_DEVICE_FUNC bool isApprox(const Scalar &x, const Scalar &y, const RealScalar &)
Definition: Eigen/src/Core/MathFunctions.h:1909
Eigen::internal::meta_floor_log2< n, lower, upper, meta_floor_log2_move_down >
Definition: Eigen/src/Core/MathFunctions.h:861
EIGEN_CONSTEXPR
#define EIGEN_CONSTEXPR
Definition: Macros.h:787
Eigen::internal::real_default_impl< Scalar, true >::RealScalar
NumTraits< Scalar >::Real RealScalar
Definition: Eigen/src/Core/MathFunctions.h:91
Eigen::internal::meta_floor_log2_terminate
@ meta_floor_log2_terminate
Definition: Eigen/src/Core/MathFunctions.h:838
Eigen::internal::abs2_impl_default
Definition: Eigen/src/Core/MathFunctions.h:278
Eigen::internal::conj_default_impl
Definition: Eigen/src/Core/MathFunctions.h:244
Eigen::internal::isnan_impl
EIGEN_DEVICE_FUNC internal::enable_if< internal::is_integral< T >::value, bool >::type isnan_impl(const T &)
Definition: Eigen/src/Core/MathFunctions.h:968
real
float real
Definition: datatypes.h:10
Eigen::internal::scalar_fuzzy_default_impl< Scalar, false, true >::RealScalar
NumTraits< Scalar >::Real RealScalar
Definition: Eigen/src/Core/MathFunctions.h:1902
Eigen::internal::arg_retval::type
NumTraits< Scalar >::Real type
Definition: Eigen/src/Core/MathFunctions.h:640
type
Definition: pytypes.h:1525
Eigen::internal::arg_default_impl
Definition: Eigen/src/Core/MathFunctions.h:613
T
Eigen::Triplet< double > T
Definition: Tutorial_sparse_example.cpp:6
lower
static char lower
Definition: blas_interface.hh:60
Eigen::internal::isApprox
EIGEN_DEVICE_FUNC bool isApprox(const Scalar &x, const Scalar &y, const typename NumTraits< Scalar >::Real &precision=NumTraits< Scalar >::dummy_precision())
Definition: Eigen/src/Core/MathFunctions.h:1947
log
const EIGEN_DEVICE_FUNC LogReturnType log() const
Definition: ArrayCwiseUnaryOps.h:128
Eigen::internal::pow_impl::result_type
ScalarBinaryOpTraits< ScalarX, ScalarY, internal::scalar_pow_op< ScalarX, ScalarY > >::ReturnType result_type
Definition: Eigen/src/Core/MathFunctions.h:777
Eigen::internal::real_default_impl::run
static EIGEN_DEVICE_FUNC RealScalar run(const Scalar &x)
Definition: Eigen/src/Core/MathFunctions.h:84
Eigen::ScalarBinaryOpTraits
Determines whether the given binary operation of two numeric types is allowed and what the scalar ret...
Definition: XprHelper.h:801
abs2
EIGEN_DEVICE_FUNC const EIGEN_STRONG_INLINE Abs2ReturnType abs2() const
Definition: ArrayCwiseUnaryOps.h:80
isnan
#define isnan(X)
Definition: main.h:93
res
cout<< "Here is the matrix m:"<< endl<< m<< endl;Matrix< ptrdiff_t, 3, 1 > res
Definition: PartialRedux_count.cpp:3
Eigen::internal::isMuchSmallerThan
EIGEN_DEVICE_FUNC bool isMuchSmallerThan(const Scalar &x, const OtherScalar &y, const typename NumTraits< Scalar >::Real &precision=NumTraits< Scalar >::dummy_precision())
Definition: Eigen/src/Core/MathFunctions.h:1940
asin
const EIGEN_DEVICE_FUNC AsinReturnType asin() const
Definition: ArrayCwiseUnaryOps.h:311
exp
const EIGEN_DEVICE_FUNC ExpReturnType exp() const
Definition: ArrayCwiseUnaryOps.h:97
Eigen::internal::norm1_default_impl< Scalar, true >::run
static EIGEN_DEVICE_FUNC RealScalar run(const Scalar &x)
Definition: Eigen/src/Core/MathFunctions.h:387
Eigen::internal::sqrt_impl::run
static EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE Scalar run(const Scalar &x)
Definition: Eigen/src/Core/MathFunctions.h:326
Eigen::internal::rint_impl< double >::run
static EIGEN_DEVICE_FUNC double run(const double &x)
Definition: Eigen/src/Core/MathFunctions.h:550
Eigen::internal::complex_rsqrt
EIGEN_DEVICE_FUNC std::complex< T > complex_rsqrt(const std::complex< T > &a_x)
Definition: MathFunctionsImpl.h:148
IsComplex
@ IsComplex
Definition: gtsam/3rdparty/Eigen/blas/common.h:98
Eigen::internal::rsqrt_impl< std::complex< T > >::run
static EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE std::complex< T > run(const std::complex< T > &x)
Definition: Eigen/src/Core/MathFunctions.h:363
Eigen::internal::scalar_fuzzy_default_impl< Scalar, true, false >::isApprox
static EIGEN_DEVICE_FUNC bool isApprox(const Scalar &x, const Scalar &y, const RealScalar &prec)
Definition: Eigen/src/Core/MathFunctions.h:1930
Eigen::internal::rsqrt_retval
Definition: Eigen/src/Core/MathFunctions.h:370
Eigen::internal::imag_ref_retval
Definition: Eigen/src/Core/MathFunctions.h:234
Eigen::internal::complex_sqrt
EIGEN_DEVICE_FUNC std::complex< T > complex_sqrt(const std::complex< T > &a_x)
Definition: MathFunctionsImpl.h:111
boost::multiprecision::fabs
Real fabs(const Real &a)
Definition: boostmultiprec.cpp:119
cosh
const EIGEN_DEVICE_FUNC CoshReturnType cosh() const
Definition: ArrayCwiseUnaryOps.h:353
Eigen::internal::scalar_fuzzy_default_impl< Scalar, false, false >::RealScalar
NumTraits< Scalar >::Real RealScalar
Definition: Eigen/src/Core/MathFunctions.h:1881
gtsam::range
Double_ range(const Point2_ &p, const Point2_ &q)
Definition: slam/expressions.h:30
n
int n
Definition: BiCGSTAB_simple.cpp:1
Eigen::internal::abs2_retval::type
NumTraits< Scalar >::Real type
Definition: Eigen/src/Core/MathFunctions.h:313
EIGEN_PLAIN_ENUM_MIN
#define EIGEN_PLAIN_ENUM_MIN(a, b)
Definition: Macros.h:1288
Eigen::internal::pow_impl< ScalarX, ScalarY, true >::run
static EIGEN_DEVICE_FUNC ScalarX run(ScalarX x, ScalarY y)
Definition: Eigen/src/Core/MathFunctions.h:787
Eigen::internal::arg_default_impl::run
static EIGEN_DEVICE_FUNC RealScalar run(const Scalar &x)
Definition: Eigen/src/Core/MathFunctions.h:619
Eigen::internal::imag_default_impl< Scalar, true >::run
static EIGEN_DEVICE_FUNC RealScalar run(const Scalar &x)
Definition: Eigen/src/Core/MathFunctions.h:141
Eigen::internal::abs2_impl_default::run
static EIGEN_DEVICE_FUNC RealScalar run(const Scalar &x)
Definition: Eigen/src/Core/MathFunctions.h:284
Eigen::internal::rint_retval::type
Scalar type
Definition: Eigen/src/Core/MathFunctions.h:568
Eigen::internal::meta_floor_log2_move_up
@ meta_floor_log2_move_up
Definition: Eigen/src/Core/MathFunctions.h:839
Eigen::internal::norm1_default_impl
Definition: Eigen/src/Core/MathFunctions.h:380
Eigen::internal::imag_default_impl
Definition: Eigen/src/Core/MathFunctions.h:126
Eigen::internal::meta_floor_log2_move_down
@ meta_floor_log2_move_down
Definition: Eigen/src/Core/MathFunctions.h:840
Eigen::internal::global_math_functions_filtering_base< T, typename always_void< typename T::Eigen_BaseClassForSpecializationOfGlobalMathFuncImpl >::type >::type
T::Eigen_BaseClassForSpecializationOfGlobalMathFuncImpl type
Definition: Eigen/src/Core/MathFunctions.h:67
Eigen::internal::expm1_impl::run
static EIGEN_DEVICE_FUNC Scalar run(const Scalar &x)
Definition: Eigen/src/Core/MathFunctions.h:675
table
ArrayXXf table(10, 4)
Eigen::internal::log1p_impl< std::complex< RealScalar > >::run
static EIGEN_DEVICE_FUNC std::complex< RealScalar > run(const std::complex< RealScalar > &x)
Definition: Eigen/src/Core/MathFunctions.h:754
Eigen::internal::log1p_impl::run
static EIGEN_DEVICE_FUNC Scalar run(const Scalar &x)
Definition: Eigen/src/Core/MathFunctions.h:739
Eigen::numext::abs
EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE internal::enable_if<!(NumTraits< T >::IsSigned||NumTraits< T >::IsComplex), typename NumTraits< T >::Real >::type abs(const T &x)
Definition: Eigen/src/Core/MathFunctions.h:1519
Eigen::internal::scalar_fuzzy_impl< bool >::isApprox
static EIGEN_DEVICE_FUNC bool isApprox(bool x, bool y, bool)
Definition: Eigen/src/Core/MathFunctions.h:1988
Eigen::internal::abs2_retval
Definition: Eigen/src/Core/MathFunctions.h:311
Eigen::internal::real_ref_retval::type
NumTraits< Scalar >::Real & type
Definition: Eigen/src/Core/MathFunctions.h:192
Eigen::internal::scalar_fuzzy_default_impl
Definition: Eigen/src/Core/MathFunctions.h:1876
Eigen::internal::imag_retval
Definition: Eigen/src/Core/MathFunctions.h:164
Eigen::internal::norm1_retval::type
NumTraits< Scalar >::Real type
Definition: Eigen/src/Core/MathFunctions.h:411
Eigen::internal::scalar_fuzzy_default_impl< Scalar, false, false >::isApprox
static EIGEN_DEVICE_FUNC bool isApprox(const Scalar &x, const Scalar &y, const RealScalar &prec)
Definition: Eigen/src/Core/MathFunctions.h:1888
Eigen::internal::hypot_retval
Definition: Eigen/src/Core/MathFunctions.h:421
Eigen::internal::scalar_fuzzy_impl< bool >::RealScalar
bool RealScalar
Definition: Eigen/src/Core/MathFunctions.h:1979
Eigen::numext::real_ref
EIGEN_DEVICE_FUNC internal::add_const_on_value_type< EIGEN_MATHFUNC_RETVAL(real_ref, Scalar) >::type real_ref(const Scalar &x)
Definition: Eigen/src/Core/MathFunctions.h:1239
Eigen::numext::mini
EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE T mini(const T &x, const T &y)
Definition: Eigen/src/Core/MathFunctions.h:1085
Eigen::internal::generic_fast_tanh_float
T generic_fast_tanh_float(const T &a_x)
Definition: MathFunctionsImpl.h:29
Eigen::internal::log1p_impl
Definition: Eigen/src/Core/MathFunctions.h:738
arg
Definition: cast.h:1412
Eigen::internal::imag_default_impl::run
static EIGEN_DEVICE_FUNC RealScalar run(const Scalar &)
Definition: Eigen/src/Core/MathFunctions.h:132
Eigen::internal::log_impl
Definition: Eigen/src/Core/MathFunctions.h:701
rint
const EIGEN_DEVICE_FUNC RintReturnType rint() const
Definition: ArrayCwiseUnaryOps.h:453
Eigen::internal::log1p_retval
Definition: Eigen/src/Core/MathFunctions.h:762
round
double round(double x)
Definition: round.c:38
isfinite
#define isfinite(X)
Definition: main.h:95
Eigen::internal::expm1_impl
Definition: Eigen/src/Core/MathFunctions.h:674
Eigen::internal::arg_retval
Definition: Eigen/src/Core/MathFunctions.h:638
Eigen::internal::round_using_floor_ceil_impl::run
static EIGEN_DEVICE_FUNC Scalar run(const Scalar &x)
Definition: Eigen/src/Core/MathFunctions.h:499
Eigen::numext::isnan
EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE bool() isnan(const Eigen::bfloat16 &h)
Definition: BFloat16.h:659
Eigen::internal::rint_impl
Definition: Eigen/src/Core/MathFunctions.h:534
Eigen::internal::arg_default_impl< Scalar, true >::run
static EIGEN_DEVICE_FUNC RealScalar run(const Scalar &x)
Definition: Eigen/src/Core/MathFunctions.h:628
Eigen::internal::scalar_fuzzy_impl< bool >::isMuchSmallerThan
static EIGEN_DEVICE_FUNC bool isMuchSmallerThan(const bool &x, const bool &, const bool &)
Definition: Eigen/src/Core/MathFunctions.h:1982
Eigen::internal::abs2_impl
Definition: Eigen/src/Core/MathFunctions.h:300
imag
const EIGEN_DEVICE_FUNC ImagReturnType imag() const
Definition: CommonCwiseUnaryOps.h:109
gtsam.examples.DogLegOptimizerExample.run
def run(args)
Definition: DogLegOptimizerExample.py:21
Eigen::internal::real_default_impl< Scalar, true >::run
static EIGEN_DEVICE_FUNC RealScalar run(const Scalar &x)
Definition: Eigen/src/Core/MathFunctions.h:93
Eigen::numext::fmod
EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE T fmod(const T &a, const T &b)
Definition: Eigen/src/Core/MathFunctions.h:1809
imag
Definition: main.h:101
pybind_wrapper_test_script.z
z
Definition: pybind_wrapper_test_script.py:61
Eigen::numext::acos
EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE T acos(const T &x)
Definition: Eigen/src/Core/MathFunctions.h:1659
Eigen::internal::random_default_impl
Definition: Eigen/src/Core/MathFunctions.h:810
EIGEN_ALWAYS_INLINE
#define EIGEN_ALWAYS_INLINE
Definition: Macros.h:932
Eigen::internal::expm1_retval::type
Scalar type
Definition: Eigen/src/Core/MathFunctions.h:690
Eigen::internal::rint_impl::run
static EIGEN_DEVICE_FUNC Scalar run(const Scalar &x)
Definition: Eigen/src/Core/MathFunctions.h:538
Eigen::Triplet< double >
arg
EIGEN_DEVICE_FUNC const EIGEN_STRONG_INLINE ArgReturnType arg() const
Definition: ArrayCwiseUnaryOps.h:66
Eigen::internal::random_impl
Definition: Eigen/src/Core/MathFunctions.h:813
Eigen::numext::absdiff
EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE long double absdiff(const long double &x, const long double &y)
Definition: Eigen/src/Core/MathFunctions.h:1319
Eigen::internal::scalar_fuzzy_default_impl< Scalar, false, true >::isApproxOrLessThan
static EIGEN_DEVICE_FUNC bool isApproxOrLessThan(const Scalar &x, const Scalar &y, const RealScalar &)
Definition: Eigen/src/Core/MathFunctions.h:1914
tan
const EIGEN_DEVICE_FUNC TanReturnType tan() const
Definition: ArrayCwiseUnaryOps.h:269
rsqrt
const EIGEN_DEVICE_FUNC RsqrtReturnType rsqrt() const
Definition: ArrayCwiseUnaryOps.h:203
conj
AnnoyingScalar conj(const AnnoyingScalar &x)
Definition: AnnoyingScalar.h:104
Eigen::bfloat16_impl::fmin
EIGEN_STRONG_INLINE EIGEN_DEVICE_FUNC bfloat16 fmin(const bfloat16 &a, const bfloat16 &b)
Definition: BFloat16.h:582
Eigen::internal::is_integral
Definition: Meta.h:159
Eigen::internal::imag_ref_default_impl::run
static EIGEN_DEVICE_FUNC RealScalar & run(Scalar &x)
Definition: Eigen/src/Core/MathFunctions.h:206
Eigen::internal::rint_retval
Definition: Eigen/src/Core/MathFunctions.h:566
offset
set noclip points set clip one set noclip two set bar set border lt lw set xdata set ydata set zdata set x2data set y2data set boxwidth set dummy y set format x g set format y g set format x2 g set format y2 g set format z g set angles radians set nogrid set key title set key left top Right noreverse box linetype linewidth samplen spacing width set nolabel set noarrow set nologscale set logscale x set set pointsize set encoding default set nopolar set noparametric set set set set surface set nocontour set clabel set mapping cartesian set nohidden3d set cntrparam order set cntrparam linear set cntrparam levels auto set cntrparam points set size set set xzeroaxis lt lw set x2zeroaxis lt lw set yzeroaxis lt lw set y2zeroaxis lt lw set tics in set ticslevel set tics set mxtics default set mytics default set mx2tics default set my2tics default set xtics border mirror norotate autofreq set ytics border mirror norotate autofreq set ztics border nomirror norotate autofreq set nox2tics set noy2tics set timestamp bottom norotate offset
Definition: gnuplot_common_settings.hh:64
Eigen::numext::pow
EIGEN_DEVICE_FUNC internal::pow_impl< ScalarX, ScalarY >::result_type pow(const ScalarX &x, const ScalarY &y)
Definition: Eigen/src/Core/MathFunctions.h:1363
Eigen::internal::conj_impl
Definition: Eigen/src/Core/MathFunctions.h:265
Eigen::internal::std_fallback::log1p
EIGEN_DEVICE_FUNC Scalar log1p(const Scalar &x)
Definition: Eigen/src/Core/MathFunctions.h:727
RealScalar
NumTraits< Scalar >::Real RealScalar
Definition: bench_gemm.cpp:47
Eigen::real
const AutoDiffScalar< DerType > & real(const AutoDiffScalar< DerType > &x)
Definition: AutoDiffScalar.h:576
Eigen::internal::scalar_fuzzy_impl
Definition: Eigen/src/Core/MathFunctions.h:1937
Eigen::internal::real_default_impl
Definition: Eigen/src/Core/MathFunctions.h:78
a
ArrayXXi a
Definition: Array_initializer_list_23_cxx11.cpp:1
Eigen::internal::sqrt_retval
Definition: Eigen/src/Core/MathFunctions.h:347
Eigen::internal::rsqrt_impl::run
static EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE T run(const T &x)
Definition: Eigen/src/Core/MathFunctions.h:2036
Eigen::internal::arg_default_impl::RealScalar
NumTraits< Scalar >::Real RealScalar
Definition: Eigen/src/Core/MathFunctions.h:617
Eigen::numext::abs2
EIGEN_DEVICE_FUNC bool abs2(bool x)
Definition: Eigen/src/Core/MathFunctions.h:1294
tanh
const EIGEN_DEVICE_FUNC TanhReturnType tanh() const
Definition: ArrayCwiseUnaryOps.h:325
Eigen::numext::log2
int log2(int x)
Definition: Eigen/src/Core/MathFunctions.h:1443
Eigen::internal::random_default_impl< Scalar, false, true >::run
static Scalar run(const Scalar &x, const Scalar &y)
Definition: Eigen/src/Core/MathFunctions.h:887
Eigen::internal::round_retval::type
Scalar type
Definition: Eigen/src/Core/MathFunctions.h:526
Eigen::imag
DerType::Scalar imag(const AutoDiffScalar< DerType > &)
Definition: AutoDiffScalar.h:578
precision
cout precision(2)
Eigen::internal::std_fallback::expm1
EIGEN_DEVICE_FUNC Scalar expm1(const Scalar &x)
Definition: Eigen/src/Core/MathFunctions.h:655
Eigen::internal::real_impl
Definition: Eigen/src/Core/MathFunctions.h:100
EIGEN_NOT_A_MACRO
#define EIGEN_NOT_A_MACRO
Definition: Macros.h:896
Eigen::internal::round_using_floor_ceil_impl
Definition: Eigen/src/Core/MathFunctions.h:496
Eigen::internal::random_default_impl< Scalar, false, false >::run
static Scalar run()
Definition: Eigen/src/Core/MathFunctions.h:831
EIGEN_STATIC_ASSERT
#define EIGEN_STATIC_ASSERT(CONDITION, MSG)
Definition: StaticAssert.h:127
Eigen::internal::real_retval
Definition: Eigen/src/Core/MathFunctions.h:116
Eigen::internal::global_math_functions_filtering_base::type
T type
Definition: Eigen/src/Core/MathFunctions.h:56
Eigen::internal::real_ref_impl::run
static EIGEN_DEVICE_FUNC RealScalar & run(Scalar &x)
Definition: Eigen/src/Core/MathFunctions.h:180
Eigen::internal::EIGEN_MATHFUNC_RETVAL
EIGEN_MATHFUNC_RETVAL(random, Scalar) random(const Scalar &x
Eigen::internal::scalar_fuzzy_default_impl< Scalar, false, true >::isMuchSmallerThan
static EIGEN_DEVICE_FUNC bool isMuchSmallerThan(const Scalar &x, const Scalar &, const RealScalar &)
Definition: Eigen/src/Core/MathFunctions.h:1904
Eigen::internal::imag_ref_default_impl::RealScalar
NumTraits< Scalar >::Real RealScalar
Definition: Eigen/src/Core/MathFunctions.h:204
return
if n return
Definition: level1_cplx_impl.h:33
Eigen::internal::y
const Scalar & y
Definition: Eigen/src/Core/MathFunctions.h:821
std
Definition: BFloat16.h:88
Eigen::bfloat16_impl::fmax
EIGEN_STRONG_INLINE EIGEN_DEVICE_FUNC bfloat16 fmax(const bfloat16 &a, const bfloat16 &b)
Definition: BFloat16.h:587
Eigen::internal::conditional
Definition: Meta.h:109
EIGEN_PLAIN_ENUM_MAX
#define EIGEN_PLAIN_ENUM_MAX(a, b)
Definition: Macros.h:1289
Real
mp::number< mp::cpp_dec_float< 100 >, mp::et_on > Real
Definition: boostmultiprec.cpp:78
Eigen::internal::abs2_impl_default< Scalar, true >::RealScalar
NumTraits< Scalar >::Real RealScalar
Definition: Eigen/src/Core/MathFunctions.h:291
Eigen::internal::imag_default_impl< Scalar, true >::RealScalar
NumTraits< Scalar >::Real RealScalar
Definition: Eigen/src/Core/MathFunctions.h:139
v
Array< int, Dynamic, 1 > v
Definition: Array_initializer_list_vector_cxx11.cpp:1
Eigen::internal::round_retval
Definition: Eigen/src/Core/MathFunctions.h:524
Eigen::internal::rsqrt_retval::type
Scalar type
Definition: Eigen/src/Core/MathFunctions.h:372
Eigen::internal::always_void::type
void type
Definition: Eigen/src/Core/MathFunctions.h:59
if
if((m *x).isApprox(y))
Definition: FullPivLU_solve.cpp:6
Eigen::numext::sin
EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE T sin(const T &x)
Definition: Eigen/src/Core/MathFunctions.h:1621
Eigen::internal::norm1_default_impl< Scalar, true >::RealScalar
NumTraits< Scalar >::Real RealScalar
Definition: Eigen/src/Core/MathFunctions.h:385
Eigen::internal::pow_impl< ScalarX, ScalarY, true >::result_type
ScalarX result_type
Definition: Eigen/src/Core/MathFunctions.h:786
U
@ U
Definition: testDecisionTree.cpp:349
ceil
const EIGEN_DEVICE_FUNC CeilReturnType ceil() const
Definition: ArrayCwiseUnaryOps.h:495
gtsam.examples.DogLegOptimizerExample.float
float
Definition: DogLegOptimizerExample.py:113
Eigen::internal::meta_floor_log2_selector
Definition: Eigen/src/Core/MathFunctions.h:844
Eigen::internal::is_same
Definition: Meta.h:148
Eigen::numext::abs
EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE internal::enable_if< NumTraits< T >::IsSigned||NumTraits< T >::IsComplex, typename NumTraits< T >::Real >::type abs(const T &x)
Definition: Eigen/src/Core/MathFunctions.h:1511
Eigen::internal::complex_log
EIGEN_DEVICE_FUNC std::complex< T > complex_log(const std::complex< T > &z)
Definition: MathFunctionsImpl.h:188
internal
Definition: BandTriangularSolver.h:13
Eigen::numext::maxi
EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE T maxi(const T &x, const T &y)
Definition: Eigen/src/Core/MathFunctions.h:1093
Eigen::min
CleanedUpDerType< DerType >::type() min(const AutoDiffScalar< DerType > &x, const T &y)
Definition: AutoDiffScalar.h:580
Eigen::internal::conj_default_impl::run
static EIGEN_DEVICE_FUNC Scalar run(const Scalar &x)
Definition: Eigen/src/Core/MathFunctions.h:249
Eigen::internal::round_impl
Definition: Eigen/src/Core/MathFunctions.h:470
Eigen::internal::imag_impl
Definition: Eigen/src/Core/MathFunctions.h:148
Eigen::internal::enable_if
Definition: Meta.h:273
Eigen::internal::expm1_retval
Definition: Eigen/src/Core/MathFunctions.h:688
Eigen::internal::real_default_impl::RealScalar
NumTraits< Scalar >::Real RealScalar
Definition: Eigen/src/Core/MathFunctions.h:82
Eigen::internal::scalar_fuzzy_default_impl< Scalar, true, false >::RealScalar
NumTraits< Scalar >::Real RealScalar
Definition: Eigen/src/Core/MathFunctions.h:1923
Eigen::internal::random_retval::type
Scalar type
Definition: Eigen/src/Core/MathFunctions.h:818
sinh
const EIGEN_DEVICE_FUNC SinhReturnType sinh() const
Definition: ArrayCwiseUnaryOps.h:339
Eigen::GenericNumTraits::IsComplex
@ IsComplex
Definition: NumTraits.h:157
Eigen::internal::imag_ref_impl
Definition: Eigen/src/Core/MathFunctions.h:231
Eigen::internal::imag_ref_default_impl
Definition: Eigen/src/Core/MathFunctions.h:200
Eigen::internal::always_void
Definition: Eigen/src/Core/MathFunctions.h:59
Eigen::numext::sqrt
EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE float sqrt(const float &x)
Definition: Eigen/src/Core/arch/SSE/MathFunctions.h:177
Eigen::internal::conj_default_impl< Scalar, true >::run
static EIGEN_DEVICE_FUNC Scalar run(const Scalar &x)
Definition: Eigen/src/Core/MathFunctions.h:257
Eigen::internal::imag_retval::type
NumTraits< Scalar >::Real type
Definition: Eigen/src/Core/MathFunctions.h:166
Eigen::internal::norm1_retval
Definition: Eigen/src/Core/MathFunctions.h:409
Eigen::internal::scalar_fuzzy_impl< bool >::isApproxOrLessThan
static EIGEN_DEVICE_FUNC bool isApproxOrLessThan(const bool &x, const bool &y, const bool &)
Definition: Eigen/src/Core/MathFunctions.h:1994
Eigen::internal::sqrt_impl< std::complex< T > >::run
static EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE std::complex< T > run(const std::complex< T > &x)
Definition: Eigen/src/Core/MathFunctions.h:340
Eigen::internal::rint_impl< float >::run
static EIGEN_DEVICE_FUNC float run(const float &x)
Definition: Eigen/src/Core/MathFunctions.h:558
real
Definition: main.h:100
Eigen::NumTraits
Holds information about the various numeric (i.e. scalar) types allowed by Eigen.
Definition: NumTraits.h:232
Eigen::numext::sqrt< bool >
EIGEN_DEFINE_FUNCTION_ALLOWING_MULTIPLE_DEFINITIONS EIGEN_DEVICE_FUNC bool sqrt< bool >(const bool &x)
Definition: Eigen/src/Core/MathFunctions.h:1475
test_callbacks.value
value
Definition: test_callbacks.py:160
ceres::sqrt
Jet< T, N > sqrt(const Jet< T, N > &f)
Definition: jet.h:418
Eigen::numext::equal_strict
EIGEN_STRONG_INLINE EIGEN_DEVICE_FUNC bool equal_strict(const X &x, const Y &y)
Definition: Meta.h:787
Eigen::internal::make_unsigned
Definition: Meta.h:182
Eigen::numext::cos
EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE T cos(const T &x)
Definition: Eigen/src/Core/MathFunctions.h:1602
Eigen::internal::arg_impl
Definition: Eigen/src/Core/MathFunctions.h:635
Eigen::internal::imag_ref_default_impl< Scalar, false >::run
EIGEN_DEVICE_FUNC static const EIGEN_CONSTEXPR Scalar run(const Scalar &)
Definition: Eigen/src/Core/MathFunctions.h:224
Eigen::internal::cast
EIGEN_DEVICE_FUNC NewType cast(const OldType &x)
Definition: Eigen/src/Core/MathFunctions.h:460
Eigen::internal::meta_floor_log2_bogus
@ meta_floor_log2_bogus
Definition: Eigen/src/Core/MathFunctions.h:841
Eigen::internal::imag_ref_retval::type
NumTraits< Scalar >::Real & type
Definition: Eigen/src/Core/MathFunctions.h:236
EIGEN_DEFINE_FUNCTION_ALLOWING_MULTIPLE_DEFINITIONS
#define EIGEN_DEFINE_FUNCTION_ALLOWING_MULTIPLE_DEFINITIONS
Definition: Macros.h:985
Eigen::internal::abs2_impl_default< Scalar, true >::run
static EIGEN_DEVICE_FUNC RealScalar run(const Scalar &x)
Definition: Eigen/src/Core/MathFunctions.h:293
floor
const EIGEN_DEVICE_FUNC FloorReturnType floor() const
Definition: ArrayCwiseUnaryOps.h:481
Eigen::GenericNumTraits< Scalar >::Real
Scalar Real
Definition: NumTraits.h:164
Eigen::internal::imag_ref_default_impl< Scalar, false >::run
EIGEN_DEVICE_FUNC static EIGEN_CONSTEXPR Scalar run(Scalar &)
Definition: Eigen/src/Core/MathFunctions.h:219
complex
Definition: datatypes.h:12
Scalar
SCALAR Scalar
Definition: bench_gemm.cpp:46
Eigen::internal::cast_impl< OldType, NewType, typename internal::enable_if< !NumTraits< OldType >::IsComplex &&NumTraits< NewType >::IsComplex >::type >::run
static EIGEN_DEVICE_FUNC NewType run(const OldType &x)
Definition: Eigen/src/Core/MathFunctions.h:449
EIGEN_MATHFUNC_IMPL
#define EIGEN_MATHFUNC_IMPL(func, scalar)
Definition: Eigen/src/Core/MathFunctions.h:70
Eigen::internal::real_ref_impl
Definition: Eigen/src/Core/MathFunctions.h:174
Eigen::internal::rsqrt_impl
Definition: Eigen/src/Core/MathFunctions.h:354
isinf
#define isinf(X)
Definition: main.h:94
EIGEN_STATIC_ASSERT_NON_INTEGER
#define EIGEN_STATIC_ASSERT_NON_INTEGER(TYPE)
Definition: StaticAssert.h:187
Eigen::internal::add_const_on_value_type
Definition: Meta.h:214


gtsam
Author(s):
autogenerated on Fri Nov 1 2024 03:33:33