UnaryFunctors.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) 2008-2016 Gael Guennebaud <gael.guennebaud@inria.fr>
5 //
6 // This Source Code Form is subject to the terms of the Mozilla
7 // Public License v. 2.0. If a copy of the MPL was not distributed
8 // with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 
10 #ifndef EIGEN_UNARY_FUNCTORS_H
11 #define EIGEN_UNARY_FUNCTORS_H
12 
13 namespace Eigen {
14 
15 namespace internal {
16 
22 template<typename Scalar> struct scalar_opposite_op {
24  EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const Scalar operator() (const Scalar& a) const { return -a; }
25  template<typename Packet>
27  { return internal::pnegate(a); }
28 };
29 template<typename Scalar>
31 { enum {
34 };
35 
41 template<typename Scalar> struct scalar_abs_op {
43  typedef typename NumTraits<Scalar>::Real result_type;
44  EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const result_type operator() (const Scalar& a) const { return numext::abs(a); }
45  template<typename Packet>
47  { return internal::pabs(a); }
48 };
49 template<typename Scalar>
51 {
52  enum {
55  };
56 };
57 
63 template<typename Scalar> struct scalar_score_coeff_op : scalar_abs_op<Scalar>
64 {
65  typedef void Score_is_abs;
66 };
67 template<typename Scalar>
68 struct functor_traits<scalar_score_coeff_op<Scalar> > : functor_traits<scalar_abs_op<Scalar> > {};
69 
70 /* Avoid recomputing abs when we know the score and they are the same. Not a true Eigen functor. */
71 template<typename Scalar, typename=void> struct abs_knowing_score
72 {
74  typedef typename NumTraits<Scalar>::Real result_type;
75  template<typename Score>
76  EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const result_type operator() (const Scalar& a, const Score&) const { return numext::abs(a); }
77 };
78 template<typename Scalar> struct abs_knowing_score<Scalar, typename scalar_score_coeff_op<Scalar>::Score_is_abs>
79 {
81  typedef typename NumTraits<Scalar>::Real result_type;
82  template<typename Scal>
83  EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const result_type operator() (const Scal&, const result_type& a) const { return a; }
84 };
85 
91 template<typename Scalar> struct scalar_abs2_op {
93  typedef typename NumTraits<Scalar>::Real result_type;
95  EIGEN_STRONG_INLINE const result_type operator() (const Scalar& a) const { return numext::abs2(a); }
96  template<typename Packet>
98  { return internal::pmul(a,a); }
99 };
100 template<typename Scalar>
103 
109 template<typename Scalar> struct scalar_conjugate_op {
112  EIGEN_STRONG_INLINE const Scalar operator() (const Scalar& a) const { return numext::conj(a); }
113  template<typename Packet>
115 };
116 template<typename Scalar>
118 {
119  enum {
120  Cost = 0,
121  // Yes the cost is zero even for complexes because in most cases for which
122  // the cost is used, conjugation turns to be a no-op. Some examples:
123  // cost(a*conj(b)) == cost(a*b)
124  // cost(a+conj(b)) == cost(a+b)
125  // <etc.
126  // If we don't set it to zero, then:
127  // A.conjugate().lazyProduct(B.conjugate())
128  // will bake its operands. We definitely don't want that!
130  };
131 };
132 
138 template<typename Scalar> struct scalar_arg_op {
140  typedef typename NumTraits<Scalar>::Real result_type;
141  EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const result_type operator() (const Scalar& a) const { return numext::arg(a); }
142  template<typename Packet>
144  { return internal::parg(a); }
145 };
146 template<typename Scalar>
148 {
149  enum {
152  };
153 };
159 template<typename Scalar, typename NewType>
162  typedef NewType result_type;
163  EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const NewType operator() (const Scalar& a) const { return cast<Scalar, NewType>(a); }
164 };
165 template<typename Scalar, typename NewType>
168 
174 template<typename Scalar, int N>
177 
178  EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const Scalar operator() (const Scalar& a) const
179  { return a >> N; }
180  template<typename Packet>
182  { return internal::parithmetic_shift_right<N>(a); }
183 };
184 template<typename Scalar, int N>
187 
193 template<typename Scalar, int N>
196 
197  EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const Scalar operator() (const Scalar& a) const
198  { return a << N; }
199  template<typename Packet>
201  { return internal::plogical_shift_left<N>(a); }
202 };
203 template<typename Scalar, int N>
206 
212 template<typename Scalar>
215  typedef typename NumTraits<Scalar>::Real result_type;
217  EIGEN_STRONG_INLINE result_type operator() (const Scalar& a) const { return numext::real(a); }
218 };
219 template<typename Scalar>
221 { enum { Cost = 0, PacketAccess = false }; };
222 
228 template<typename Scalar>
231  typedef typename NumTraits<Scalar>::Real result_type;
233  EIGEN_STRONG_INLINE result_type operator() (const Scalar& a) const { return numext::imag(a); }
234 };
235 template<typename Scalar>
237 { enum { Cost = 0, PacketAccess = false }; };
238 
244 template<typename Scalar>
247  typedef typename NumTraits<Scalar>::Real result_type;
249  EIGEN_STRONG_INLINE result_type& operator() (const Scalar& a) const { return numext::real_ref(*const_cast<Scalar*>(&a)); }
250 };
251 template<typename Scalar>
253 { enum { Cost = 0, PacketAccess = false }; };
254 
260 template<typename Scalar>
263  typedef typename NumTraits<Scalar>::Real result_type;
265  EIGEN_STRONG_INLINE result_type& operator() (const Scalar& a) const { return numext::imag_ref(*const_cast<Scalar*>(&a)); }
266 };
267 template<typename Scalar>
269 { enum { Cost = 0, PacketAccess = false }; };
270 
277 template<typename Scalar> struct scalar_exp_op {
279  EIGEN_DEVICE_FUNC inline const Scalar operator() (const Scalar& a) const { return numext::exp(a); }
280  template <typename Packet>
281  EIGEN_DEVICE_FUNC inline Packet packetOp(const Packet& a) const { return internal::pexp(a); }
282 };
283 template <typename Scalar>
285  enum {
287  // The following numbers are based on the AVX implementation.
288 #ifdef EIGEN_VECTORIZE_FMA
289  // Haswell can issue 2 add/mul/madd per cycle.
290  Cost =
291  (sizeof(Scalar) == 4
292  // float: 8 pmadd, 4 pmul, 2 padd/psub, 6 other
294  // double: 7 pmadd, 5 pmul, 3 padd/psub, 1 div, 13 other
298 #else
300  (sizeof(Scalar) == 4
301  // float: 7 pmadd, 6 pmul, 4 padd/psub, 10 other
303  // double: 7 pmadd, 5 pmul, 3 padd/psub, 1 div, 13 other
307 #endif
308  };
309 };
310 
317 template<typename Scalar> struct scalar_expm1_op {
319  EIGEN_DEVICE_FUNC inline const Scalar operator() (const Scalar& a) const { return numext::expm1(a); }
320  template <typename Packet>
321  EIGEN_DEVICE_FUNC inline Packet packetOp(const Packet& a) const { return internal::pexpm1(a); }
322 };
323 template <typename Scalar>
325  enum {
327  Cost = functor_traits<scalar_exp_op<Scalar> >::Cost // TODO measure cost of expm1
328  };
329 };
330 
337 template<typename Scalar> struct scalar_log_op {
339  EIGEN_DEVICE_FUNC inline const Scalar operator() (const Scalar& a) const { return numext::log(a); }
340  template <typename Packet>
341  EIGEN_DEVICE_FUNC inline Packet packetOp(const Packet& a) const { return internal::plog(a); }
342 };
343 template <typename Scalar>
345  enum {
348  (PacketAccess
349  // The following numbers are based on the AVX implementation.
350 #ifdef EIGEN_VECTORIZE_FMA
351  // 8 pmadd, 6 pmul, 8 padd/psub, 16 other, can issue 2 add/mul/madd per cycle.
353 #else
354  // 8 pmadd, 6 pmul, 8 padd/psub, 20 other
356 #endif
357  // Measured cost of std::log.
358  : sizeof(Scalar)==4 ? 40 : 85)
359  };
360 };
361 
368 template<typename Scalar> struct scalar_log1p_op {
370  EIGEN_DEVICE_FUNC inline const Scalar operator() (const Scalar& a) const { return numext::log1p(a); }
371  template <typename Packet>
372  EIGEN_DEVICE_FUNC inline Packet packetOp(const Packet& a) const { return internal::plog1p(a); }
373 };
374 template <typename Scalar>
376  enum {
378  Cost = functor_traits<scalar_log_op<Scalar> >::Cost // TODO measure cost of log1p
379  };
380 };
381 
388 template<typename Scalar> struct scalar_log10_op {
390  EIGEN_DEVICE_FUNC inline const Scalar operator() (const Scalar& a) const { EIGEN_USING_STD(log10) return log10(a); }
391  template <typename Packet>
392  EIGEN_DEVICE_FUNC inline Packet packetOp(const Packet& a) const { return internal::plog10(a); }
393 };
394 template<typename Scalar>
397 
404 template<typename Scalar> struct scalar_log2_op {
406  EIGEN_DEVICE_FUNC inline const Scalar operator() (const Scalar& a) const { return Scalar(EIGEN_LOG2E) * numext::log(a); }
407  template <typename Packet>
408  EIGEN_DEVICE_FUNC inline Packet packetOp(const Packet& a) const { return internal::plog2(a); }
409 };
410 template<typename Scalar>
413 
418 template<typename Scalar> struct scalar_sqrt_op {
420  EIGEN_DEVICE_FUNC inline const Scalar operator() (const Scalar& a) const { return numext::sqrt(a); }
421  template <typename Packet>
422  EIGEN_DEVICE_FUNC inline Packet packetOp(const Packet& a) const { return internal::psqrt(a); }
423 };
424 template <typename Scalar>
426  enum {
427 #if EIGEN_FAST_MATH
428  // The following numbers are based on the AVX implementation.
429  Cost = (sizeof(Scalar) == 8 ? 28
430  // 4 pmul, 1 pmadd, 3 other
433 #else
434  // The following numbers are based on min VSQRT throughput on Haswell.
435  Cost = (sizeof(Scalar) == 8 ? 28 : 14),
436 #endif
438  };
439 };
440 
441 // Boolean specialization to eliminate -Wimplicit-conversion-floating-point-to-bool warnings.
442 template<> struct scalar_sqrt_op<bool> {
444  EIGEN_DEPRECATED EIGEN_DEVICE_FUNC inline bool operator() (const bool& a) const { return a; }
445  template <typename Packet>
446  EIGEN_DEPRECATED EIGEN_DEVICE_FUNC inline Packet packetOp(const Packet& a) const { return a; }
447 };
448 template <>
451 };
452 
457 template<typename Scalar> struct scalar_rsqrt_op {
459  EIGEN_DEVICE_FUNC inline const Scalar operator() (const Scalar& a) const { return numext::rsqrt(a); }
460  template <typename Packet>
461  EIGEN_DEVICE_FUNC inline Packet packetOp(const Packet& a) const { return internal::prsqrt(a); }
462 };
463 
464 template<typename Scalar>
466 { enum {
469  };
470 };
471 
476 template<typename Scalar> struct scalar_cos_op {
478  EIGEN_DEVICE_FUNC inline Scalar operator() (const Scalar& a) const { return numext::cos(a); }
479  template <typename Packet>
480  EIGEN_DEVICE_FUNC inline Packet packetOp(const Packet& a) const { return internal::pcos(a); }
481 };
482 template<typename Scalar>
484 {
485  enum {
488  };
489 };
490 
495 template<typename Scalar> struct scalar_sin_op {
497  EIGEN_DEVICE_FUNC inline const Scalar operator() (const Scalar& a) const { return numext::sin(a); }
498  template <typename Packet>
499  EIGEN_DEVICE_FUNC inline Packet packetOp(const Packet& a) const { return internal::psin(a); }
500 };
501 template<typename Scalar>
503 {
504  enum {
507  };
508 };
509 
510 
515 template<typename Scalar> struct scalar_tan_op {
517  EIGEN_DEVICE_FUNC inline const Scalar operator() (const Scalar& a) const { return numext::tan(a); }
518  template <typename Packet>
519  EIGEN_DEVICE_FUNC inline Packet packetOp(const Packet& a) const { return internal::ptan(a); }
520 };
521 template<typename Scalar>
523 {
524  enum {
527  };
528 };
529 
534 template<typename Scalar> struct scalar_acos_op {
536  EIGEN_DEVICE_FUNC inline const Scalar operator() (const Scalar& a) const { return numext::acos(a); }
537  template <typename Packet>
538  EIGEN_DEVICE_FUNC inline Packet packetOp(const Packet& a) const { return internal::pacos(a); }
539 };
540 template<typename Scalar>
542 {
543  enum {
546  };
547 };
548 
553 template<typename Scalar> struct scalar_asin_op {
555  EIGEN_DEVICE_FUNC inline const Scalar operator() (const Scalar& a) const { return numext::asin(a); }
556  template <typename Packet>
557  EIGEN_DEVICE_FUNC inline Packet packetOp(const Packet& a) const { return internal::pasin(a); }
558 };
559 template<typename Scalar>
561 {
562  enum {
565  };
566 };
567 
568 
573 template<typename Scalar> struct scalar_atan_op {
575  EIGEN_DEVICE_FUNC inline const Scalar operator() (const Scalar& a) const { return numext::atan(a); }
576  template <typename Packet>
577  EIGEN_DEVICE_FUNC inline Packet packetOp(const Packet& a) const { return internal::patan(a); }
578 };
579 template<typename Scalar>
581 {
582  enum {
585  };
586 };
587 
592 template <typename Scalar>
595  EIGEN_DEVICE_FUNC inline const Scalar operator()(const Scalar& a) const { return numext::tanh(a); }
596  template <typename Packet>
597  EIGEN_DEVICE_FUNC inline Packet packetOp(const Packet& x) const { return ptanh(x); }
598 };
599 
600 template <typename Scalar>
602  enum {
605 // The following numbers are based on the AVX implementation,
606 #ifdef EIGEN_VECTORIZE_FMA
607  // Haswell can issue 2 add/mul/madd per cycle.
608  // 9 pmadd, 2 pmul, 1 div, 2 other
612 #else
616 #endif
617  // This number assumes a naive implementation of tanh
622  };
623 };
624 
625 #if EIGEN_HAS_CXX11_MATH
626 
630 template <typename Scalar>
631 struct scalar_atanh_op {
632  EIGEN_EMPTY_STRUCT_CTOR(scalar_atanh_op)
633  EIGEN_DEVICE_FUNC inline const Scalar operator()(const Scalar& a) const { return numext::atanh(a); }
634 };
635 
636 template <typename Scalar>
637 struct functor_traits<scalar_atanh_op<Scalar> > {
638  enum { Cost = 5 * NumTraits<Scalar>::MulCost, PacketAccess = false };
639 };
640 #endif
641 
646 template<typename Scalar> struct scalar_sinh_op {
648  EIGEN_DEVICE_FUNC inline const Scalar operator() (const Scalar& a) const { return numext::sinh(a); }
649  template <typename Packet>
650  EIGEN_DEVICE_FUNC inline Packet packetOp(const Packet& a) const { return internal::psinh(a); }
651 };
652 template<typename Scalar>
654 {
655  enum {
658  };
659 };
660 
661 #if EIGEN_HAS_CXX11_MATH
662 
666 template <typename Scalar>
667 struct scalar_asinh_op {
668  EIGEN_EMPTY_STRUCT_CTOR(scalar_asinh_op)
669  EIGEN_DEVICE_FUNC inline const Scalar operator()(const Scalar& a) const { return numext::asinh(a); }
670 };
671 
672 template <typename Scalar>
673 struct functor_traits<scalar_asinh_op<Scalar> > {
674  enum { Cost = 5 * NumTraits<Scalar>::MulCost, PacketAccess = false };
675 };
676 #endif
677 
682 template<typename Scalar> struct scalar_cosh_op {
684  EIGEN_DEVICE_FUNC inline const Scalar operator() (const Scalar& a) const { return numext::cosh(a); }
685  template <typename Packet>
686  EIGEN_DEVICE_FUNC inline Packet packetOp(const Packet& a) const { return internal::pcosh(a); }
687 };
688 template<typename Scalar>
690 {
691  enum {
694  };
695 };
696 
697 #if EIGEN_HAS_CXX11_MATH
698 
702 template <typename Scalar>
703 struct scalar_acosh_op {
704  EIGEN_EMPTY_STRUCT_CTOR(scalar_acosh_op)
705  EIGEN_DEVICE_FUNC inline const Scalar operator()(const Scalar& a) const { return numext::acosh(a); }
706 };
707 
708 template <typename Scalar>
709 struct functor_traits<scalar_acosh_op<Scalar> > {
710  enum { Cost = 5 * NumTraits<Scalar>::MulCost, PacketAccess = false };
711 };
712 #endif
713 
718 template<typename Scalar>
721  EIGEN_DEVICE_FUNC inline Scalar operator() (const Scalar& a) const { return Scalar(1)/a; }
722  template<typename Packet>
723  EIGEN_DEVICE_FUNC inline const Packet packetOp(const Packet& a) const
724  { return internal::pdiv(pset1<Packet>(Scalar(1)),a); }
725 };
726 template <typename Scalar>
728  enum {
731  };
732 };
733 
738 template<typename Scalar>
741  EIGEN_DEVICE_FUNC inline Scalar operator() (const Scalar& a) const { return a*a; }
742  template<typename Packet>
743  EIGEN_DEVICE_FUNC inline const Packet packetOp(const Packet& a) const
744  { return internal::pmul(a,a); }
745 };
746 template<typename Scalar>
749 
750 // Boolean specialization to avoid -Wint-in-bool-context warnings on GCC.
751 template<>
752 struct scalar_square_op<bool> {
754  EIGEN_DEPRECATED EIGEN_DEVICE_FUNC inline bool operator() (const bool& a) const { return a; }
755  template<typename Packet>
757  { return a; }
758 };
759 template<>
762 
767 template<typename Scalar>
770  EIGEN_DEVICE_FUNC inline Scalar operator() (const Scalar& a) const { return a*a*a; }
771  template<typename Packet>
772  EIGEN_DEVICE_FUNC inline const Packet packetOp(const Packet& a) const
773  { return internal::pmul(a,pmul(a,a)); }
774 };
775 template<typename Scalar>
778 
779 // Boolean specialization to avoid -Wint-in-bool-context warnings on GCC.
780 template<>
781 struct scalar_cube_op<bool> {
783  EIGEN_DEPRECATED EIGEN_DEVICE_FUNC inline bool operator() (const bool& a) const { return a; }
784  template<typename Packet>
786  { return a; }
787 };
788 template<>
791 
796 template<typename Scalar> struct scalar_round_op {
798  EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const Scalar operator() (const Scalar& a) const { return numext::round(a); }
799  template <typename Packet>
800  EIGEN_DEVICE_FUNC inline Packet packetOp(const Packet& a) const { return internal::pround(a); }
801 };
802 template<typename Scalar>
804 {
805  enum {
808  };
809 };
810 
815 template<typename Scalar> struct scalar_floor_op {
817  EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const Scalar operator() (const Scalar& a) const { return numext::floor(a); }
818  template <typename Packet>
819  EIGEN_DEVICE_FUNC inline Packet packetOp(const Packet& a) const { return internal::pfloor(a); }
820 };
821 template<typename Scalar>
823 {
824  enum {
827  };
828 };
829 
834 template<typename Scalar> struct scalar_rint_op {
836  EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const Scalar operator() (const Scalar& a) const { return numext::rint(a); }
837  template <typename Packet>
838  EIGEN_DEVICE_FUNC inline Packet packetOp(const Packet& a) const { return internal::print(a); }
839 };
840 template<typename Scalar>
842 {
843  enum {
846  };
847 };
848 
853 template<typename Scalar> struct scalar_ceil_op {
855  EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const Scalar operator() (const Scalar& a) const { return numext::ceil(a); }
856  template <typename Packet>
857  EIGEN_DEVICE_FUNC inline Packet packetOp(const Packet& a) const { return internal::pceil(a); }
858 };
859 template<typename Scalar>
861 {
862  enum {
865  };
866 };
867 
872 template<typename Scalar> struct scalar_isnan_op {
874  typedef bool result_type;
876 #if defined(SYCL_DEVICE_ONLY)
877  return numext::isnan(a);
878 #else
879  return (numext::isnan)(a);
880 #endif
881  }
882 };
883 template<typename Scalar>
885 {
886  enum {
888  PacketAccess = false
889  };
890 };
891 
896 template<typename Scalar> struct scalar_isinf_op {
898  typedef bool result_type;
900 #if defined(SYCL_DEVICE_ONLY)
901  return numext::isinf(a);
902 #else
903  return (numext::isinf)(a);
904 #endif
905  }
906 };
907 template<typename Scalar>
909 {
910  enum {
912  PacketAccess = false
913  };
914 };
915 
920 template<typename Scalar> struct scalar_isfinite_op {
922  typedef bool result_type;
924 #if defined(SYCL_DEVICE_ONLY)
925  return numext::isfinite(a);
926 #else
927  return (numext::isfinite)(a);
928 #endif
929  }
930 };
931 template<typename Scalar>
933 {
934  enum {
936  PacketAccess = false
937  };
938 };
939 
945 template<typename Scalar> struct scalar_boolean_not_op {
947  EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE bool operator() (const bool& a) const { return !a; }
948 };
949 template<typename Scalar>
951  enum {
953  PacketAccess = false
954  };
955 };
956 
961 template<typename Scalar,bool is_complex=(NumTraits<Scalar>::IsComplex!=0), bool is_integer=(NumTraits<Scalar>::IsInteger!=0) > struct scalar_sign_op;
962 template<typename Scalar>
963 struct scalar_sign_op<Scalar, false, true> {
965  EIGEN_DEVICE_FUNC inline const Scalar operator() (const Scalar& a) const
966  {
967  return Scalar( (a>Scalar(0)) - (a<Scalar(0)) );
968  }
969  //TODO
970  //template <typename Packet>
971  //EIGEN_DEVICE_FUNC inline Packet packetOp(const Packet& a) const { return internal::psign(a); }
972 };
973 
974 template<typename Scalar>
975 struct scalar_sign_op<Scalar, false, false> {
977  EIGEN_DEVICE_FUNC inline const Scalar operator() (const Scalar& a) const
978  {
979  return (numext::isnan)(a) ? a : Scalar( (a>Scalar(0)) - (a<Scalar(0)) );
980  }
981  //TODO
982  //template <typename Packet>
983  //EIGEN_DEVICE_FUNC inline Packet packetOp(const Packet& a) const { return internal::psign(a); }
984 };
985 
986 template<typename Scalar, bool is_integer>
987 struct scalar_sign_op<Scalar,true, is_integer> {
989  EIGEN_DEVICE_FUNC inline const Scalar operator() (const Scalar& a) const
990  {
991  typedef typename NumTraits<Scalar>::Real real_type;
992  real_type aa = numext::abs(a);
993  if (aa==real_type(0))
994  return Scalar(0);
995  aa = real_type(1)/aa;
996  return Scalar(a.real()*aa, a.imag()*aa );
997  }
998  //TODO
999  //template <typename Packet>
1000  //EIGEN_DEVICE_FUNC inline Packet packetOp(const Packet& a) const { return internal::psign(a); }
1001 };
1002 template<typename Scalar>
1004 { enum {
1007  ? ( 8*NumTraits<Scalar>::MulCost ) // roughly
1010  };
1011 };
1012 
1017 template <typename T>
1020  EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE T operator()(const T& x) const {
1021  return packetOp(x);
1022  }
1023 
1024  template <typename Packet> EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
1025  Packet packetOp(const Packet& x) const {
1026  const Packet one = pset1<Packet>(T(1));
1027  return pdiv(one, padd(one, pexp(pnegate(x))));
1028  }
1029 };
1030 
1031 #ifndef EIGEN_GPU_COMPILE_PHASE
1032 
1043 template <>
1046  EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE float operator()(const float& x) const {
1047  return packetOp(x);
1048  }
1049 
1050  template <typename Packet> EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
1051  Packet packetOp(const Packet& _x) const {
1052  const Packet cutoff_lower = pset1<Packet>(-9.f);
1053  const Packet lt_mask = pcmp_lt<Packet>(_x, cutoff_lower);
1054  const bool any_small = predux_any(lt_mask);
1055 
1056  // The upper cut-off is the smallest x for which the rational approximation evaluates to 1.
1057  // Choosing this value saves us a few instructions clamping the results at the end.
1058 #ifdef EIGEN_VECTORIZE_FMA
1059  const Packet cutoff_upper = pset1<Packet>(15.7243833541870117f);
1060 #else
1061  const Packet cutoff_upper = pset1<Packet>(15.6437711715698242f);
1062 #endif
1063  const Packet x = pmin(_x, cutoff_upper);
1064 
1065  // The monomial coefficients of the numerator polynomial (odd).
1066  const Packet alpha_1 = pset1<Packet>(2.48287947061529e-01f);
1067  const Packet alpha_3 = pset1<Packet>(8.51377133304701e-03f);
1068  const Packet alpha_5 = pset1<Packet>(6.08574864600143e-05f);
1069  const Packet alpha_7 = pset1<Packet>(1.15627324459942e-07f);
1070  const Packet alpha_9 = pset1<Packet>(4.37031012579801e-11f);
1071 
1072  // The monomial coefficients of the denominator polynomial (even).
1073  const Packet beta_0 = pset1<Packet>(9.93151921023180e-01f);
1074  const Packet beta_2 = pset1<Packet>(1.16817656904453e-01f);
1075  const Packet beta_4 = pset1<Packet>(1.70198817374094e-03f);
1076  const Packet beta_6 = pset1<Packet>(6.29106785017040e-06f);
1077  const Packet beta_8 = pset1<Packet>(5.76102136993427e-09f);
1078  const Packet beta_10 = pset1<Packet>(6.10247389755681e-13f);
1079 
1080  // Since the polynomials are odd/even, we need x^2.
1081  const Packet x2 = pmul(x, x);
1082 
1083  // Evaluate the numerator polynomial p.
1084  Packet p = pmadd(x2, alpha_9, alpha_7);
1085  p = pmadd(x2, p, alpha_5);
1086  p = pmadd(x2, p, alpha_3);
1087  p = pmadd(x2, p, alpha_1);
1088  p = pmul(x, p);
1089 
1090  // Evaluate the denominator polynomial q.
1091  Packet q = pmadd(x2, beta_10, beta_8);
1092  q = pmadd(x2, q, beta_6);
1093  q = pmadd(x2, q, beta_4);
1094  q = pmadd(x2, q, beta_2);
1095  q = pmadd(x2, q, beta_0);
1096  // Divide the numerator by the denominator and shift it up.
1097  const Packet logistic = padd(pdiv(p, q), pset1<Packet>(0.5f));
1098  if (EIGEN_PREDICT_FALSE(any_small)) {
1099  const Packet exponential = pexp(_x);
1100  return pselect(lt_mask, exponential, logistic);
1101  } else {
1102  return logistic;
1103  }
1104  }
1105 };
1106 #endif // #ifndef EIGEN_GPU_COMPILE_PHASE
1107 
1108 template <typename T>
1110  enum {
1111  // The cost estimate for float here here is for the common(?) case where
1112  // all arguments are greater than -9.
1116  : NumTraits<T>::AddCost * 2 +
1124  };
1125 };
1126 
1127 } // end namespace internal
1128 
1129 } // end namespace Eigen
1130 
1131 #endif // EIGEN_FUNCTORS_H
Eigen::internal::abs_knowing_score
Definition: UnaryFunctors.h:71
EIGEN_EMPTY_STRUCT_CTOR
#define EIGEN_EMPTY_STRUCT_CTOR(X)
Definition: XprHelper.h:22
Eigen::internal::scalar_log_op::packetOp
EIGEN_DEVICE_FUNC Packet packetOp(const Packet &a) const
Definition: UnaryFunctors.h:341
Eigen::internal::scalar_acos_op::packetOp
EIGEN_DEVICE_FUNC Packet packetOp(const Packet &a) const
Definition: UnaryFunctors.h:538
Eigen::internal::print
EIGEN_STRONG_INLINE Packet4f print(const Packet4f &a)
Definition: NEON/PacketMath.h:3115
Eigen::internal::scalar_isnan_op
Definition: UnaryFunctors.h:872
EIGEN_DEVICE_FUNC
#define EIGEN_DEVICE_FUNC
Definition: Macros.h:976
Eigen::internal::scalar_round_op
Definition: UnaryFunctors.h:796
Eigen
Namespace containing all symbols from the Eigen library.
Definition: jet.h:637
Eigen::internal::scalar_shift_right_op::packetOp
EIGEN_DEVICE_FUNC const EIGEN_STRONG_INLINE Packet packetOp(const Packet &a) const
Definition: UnaryFunctors.h:181
Eigen::internal::psqrt
EIGEN_STRONG_INLINE Packet4f psqrt(const Packet4f &a)
Definition: MSA/PacketMath.h:723
Eigen::internal::scalar_imag_ref_op::result_type
NumTraits< Scalar >::Real result_type
Definition: UnaryFunctors.h:263
Eigen::internal::scalar_round_op::packetOp
EIGEN_DEVICE_FUNC Packet packetOp(const Packet &a) const
Definition: UnaryFunctors.h:800
Eigen::internal::pasin
EIGEN_DECLARE_FUNCTION_ALLOWING_MULTIPLE_DEFINITIONS Packet pasin(const Packet &a)
Definition: GenericPacketMath.h:764
Eigen::internal::scalar_logistic_op::packetOp
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Packet packetOp(const Packet &x) const
Definition: UnaryFunctors.h:1025
Eigen::internal::scalar_sqrt_op
Definition: UnaryFunctors.h:418
Eigen::internal::scalar_inverse_op
Definition: UnaryFunctors.h:719
Eigen::internal::scalar_arg_op::result_type
NumTraits< Scalar >::Real result_type
Definition: UnaryFunctors.h:140
EIGEN_USING_STD
#define EIGEN_USING_STD(FUNC)
Definition: Macros.h:1185
logistic
const EIGEN_DEVICE_FUNC LogisticReturnType logistic() const
Definition: ArrayCwiseUnaryOps.h:397
Eigen::numext::asin
EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE T asin(const T &x)
Definition: Eigen/src/Core/MathFunctions.h:1688
e
Array< double, 1, 3 > e(1./3., 0.5, 2.)
Eigen::internal::scalar_square_op
Definition: UnaryFunctors.h:739
Eigen::internal::scalar_abs_op
Definition: UnaryFunctors.h:41
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::scalar_isinf_op::result_type
bool result_type
Definition: UnaryFunctors.h:898
Eigen::numext::isfinite
EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE bool() isfinite(const Eigen::bfloat16 &h)
Definition: BFloat16.h:671
Eigen::internal::scalar_arg_op
Definition: UnaryFunctors.h:138
Eigen::numext::rsqrt
EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE T rsqrt(const T &x)
Definition: Eigen/src/Core/MathFunctions.h:1484
Eigen::internal::scalar_log2_op::packetOp
EIGEN_DEVICE_FUNC Packet packetOp(const Packet &a) const
Definition: UnaryFunctors.h:408
Eigen::internal::scalar_sqrt_op::packetOp
EIGEN_DEVICE_FUNC Packet packetOp(const Packet &a) const
Definition: UnaryFunctors.h:422
Eigen::internal::scalar_tanh_op::packetOp
EIGEN_DEVICE_FUNC Packet packetOp(const Packet &x) const
Definition: UnaryFunctors.h:597
EIGEN_PREDICT_FALSE
#define EIGEN_PREDICT_FALSE(x)
Definition: Macros.h:1321
Eigen::internal::scalar_cast_op::result_type
NewType result_type
Definition: UnaryFunctors.h:162
Eigen::internal::scalar_isfinite_op
Definition: UnaryFunctors.h:920
Eigen::internal::scalar_isnan_op::result_type
bool result_type
Definition: UnaryFunctors.h:874
Eigen::numext::ceil
EIGEN_DEVICE_FUNC T() ceil(const T &x)
Definition: Eigen/src/Core/MathFunctions.h:1422
Eigen::internal::scalar_cos_op::packetOp
EIGEN_DEVICE_FUNC Packet packetOp(const Packet &a) const
Definition: UnaryFunctors.h:480
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::pceil
EIGEN_DECLARE_FUNCTION_ALLOWING_MULTIPLE_DEFINITIONS Packet pceil(const Packet &a)
Definition: GenericPacketMath.h:839
Eigen::internal::scalar_sqrt_op< bool >::packetOp
EIGEN_DEPRECATED EIGEN_DEVICE_FUNC Packet packetOp(const Packet &a) const
Definition: UnaryFunctors.h:446
Eigen::internal::scalar_cast_op
Definition: UnaryFunctors.h:160
Eigen::numext::isinf
EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE bool() isinf(const Eigen::bfloat16 &h)
Definition: BFloat16.h:665
Eigen::internal::packet_traits
Definition: GenericPacketMath.h:106
Eigen::internal::scalar_rsqrt_op::packetOp
EIGEN_DEVICE_FUNC Packet packetOp(const Packet &a) const
Definition: UnaryFunctors.h:461
Eigen::internal::pround
EIGEN_DECLARE_FUNCTION_ALLOWING_MULTIPLE_DEFINITIONS Packet pround(const Packet &a)
Definition: GenericPacketMath.h:826
EIGEN_DEPRECATED
#define EIGEN_DEPRECATED
Definition: Macros.h:1058
Eigen::internal::scalar_real_ref_op::result_type
NumTraits< Scalar >::Real result_type
Definition: UnaryFunctors.h:247
Eigen::internal::scalar_log2_op
Definition: UnaryFunctors.h:404
Eigen::internal::scalar_imag_op
Definition: UnaryFunctors.h:229
real
float real
Definition: datatypes.h:10
Eigen::internal::scalar_log10_op::packetOp
EIGEN_DEVICE_FUNC Packet packetOp(const Packet &a) const
Definition: UnaryFunctors.h:392
Eigen::internal::scalar_boolean_not_op
Definition: UnaryFunctors.h:945
Eigen::internal::scalar_rint_op
Definition: UnaryFunctors.h:834
T
Eigen::Triplet< double > T
Definition: Tutorial_sparse_example.cpp:6
Eigen::internal::pdiv
EIGEN_DEVICE_FUNC Packet pdiv(const Packet &a, const Packet &b)
Definition: GenericPacketMath.h:244
Eigen::internal::scalar_real_op::result_type
NumTraits< Scalar >::Real result_type
Definition: UnaryFunctors.h:215
Eigen::internal::pconj
EIGEN_STRONG_INLINE Packet2cf pconj(const Packet2cf &a)
Definition: AltiVec/Complex.h:167
Eigen::internal::scalar_acos_op
Definition: UnaryFunctors.h:534
Eigen::numext::sinh
EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE T sinh(const T &x)
Definition: Eigen/src/Core/MathFunctions.h:1766
Eigen::internal::scalar_logistic_op< float >::packetOp
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Packet packetOp(const Packet &_x) const
Definition: UnaryFunctors.h:1051
Eigen::internal::scalar_cube_op::packetOp
const EIGEN_DEVICE_FUNC Packet packetOp(const Packet &a) const
Definition: UnaryFunctors.h:772
Eigen::internal::scalar_rint_op::packetOp
EIGEN_DEVICE_FUNC Packet packetOp(const Packet &a) const
Definition: UnaryFunctors.h:838
Eigen::internal::scalar_cosh_op
Definition: UnaryFunctors.h:682
Eigen::internal::scalar_shift_left_op::packetOp
EIGEN_DEVICE_FUNC const EIGEN_STRONG_INLINE Packet packetOp(const Packet &a) const
Definition: UnaryFunctors.h:200
Eigen::internal::scalar_square_op::packetOp
const EIGEN_DEVICE_FUNC Packet packetOp(const Packet &a) const
Definition: UnaryFunctors.h:743
Eigen::internal::scalar_conjugate_op::operator()
EIGEN_DEVICE_FUNC const EIGEN_STRONG_INLINE Scalar operator()(const Scalar &a) const
Definition: UnaryFunctors.h:112
Eigen::internal::scalar_sinh_op::packetOp
EIGEN_DEVICE_FUNC Packet packetOp(const Packet &a) const
Definition: UnaryFunctors.h:650
Eigen::internal::scalar_abs2_op::result_type
NumTraits< Scalar >::Real result_type
Definition: UnaryFunctors.h:93
Eigen::internal::scalar_sign_op
Definition: UnaryFunctors.h:961
Eigen::numext::exp
EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE T exp(const T &x)
Definition: Eigen/src/Core/MathFunctions.h:1548
Eigen::internal::scalar_cube_op< bool >::packetOp
EIGEN_DEPRECATED const EIGEN_DEVICE_FUNC Packet packetOp(const Packet &a) const
Definition: UnaryFunctors.h:785
Eigen::internal::scalar_isfinite_op::result_type
bool result_type
Definition: UnaryFunctors.h:922
Eigen::internal::scalar_score_coeff_op::Score_is_abs
void Score_is_abs
Definition: UnaryFunctors.h:65
Eigen::internal::scalar_conjugate_op::packetOp
EIGEN_DEVICE_FUNC const EIGEN_STRONG_INLINE Packet packetOp(const Packet &a) const
Definition: UnaryFunctors.h:114
Eigen::internal::scalar_log1p_op::packetOp
EIGEN_DEVICE_FUNC Packet packetOp(const Packet &a) const
Definition: UnaryFunctors.h:372
Eigen::internal::scalar_log_op
Definition: UnaryFunctors.h:337
Eigen::internal::scalar_imag_ref_op
Definition: UnaryFunctors.h:261
Eigen::internal::scalar_floor_op
Definition: UnaryFunctors.h:815
Eigen::internal::abs_knowing_score::result_type
NumTraits< Scalar >::Real result_type
Definition: UnaryFunctors.h:74
Eigen::internal::scalar_rsqrt_op
Definition: UnaryFunctors.h:457
Eigen::numext::cosh
EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE T cosh(const T &x)
Definition: Eigen/src/Core/MathFunctions.h:1747
expm1
double expm1(double x)
Definition: unity.c:106
Eigen::internal::scalar_exp_op
Definition: UnaryFunctors.h:277
Eigen::internal::pcos
EIGEN_DECLARE_FUNCTION_ALLOWING_MULTIPLE_DEFINITIONS Packet pcos(const Packet &a)
Definition: GenericPacketMath.h:756
Eigen::internal::scalar_exp_op::packetOp
EIGEN_DEVICE_FUNC Packet packetOp(const Packet &a) const
Definition: UnaryFunctors.h:281
Eigen::internal::scalar_real_op
Definition: UnaryFunctors.h:213
Eigen::GenericNumTraits< Scalar >::MulCost
@ MulCost
Definition: NumTraits.h:161
Eigen::numext::q
EIGEN_DEVICE_FUNC const Scalar & q
Definition: SpecialFunctionsImpl.h:1984
operator()
internal::enable_if< internal::valid_indexed_view_overload< RowIndices, ColIndices >::value &&internal::traits< typename EIGEN_INDEXED_VIEW_METHOD_TYPE< RowIndices, ColIndices >::type >::ReturnAsIndexedView, typename EIGEN_INDEXED_VIEW_METHOD_TYPE< RowIndices, ColIndices >::type >::type operator()(const RowIndices &rowIndices, const ColIndices &colIndices) EIGEN_INDEXED_VIEW_METHOD_CONST
Definition: IndexedViewMethods.h:73
Eigen::internal::scalar_ceil_op
Definition: UnaryFunctors.h:853
Eigen::internal::pnegate
EIGEN_STRONG_INLINE Packet2cf pnegate(const Packet2cf &a)
Definition: AltiVec/Complex.h:166
Eigen::numext::atan
EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE T atan(const T &x)
Definition: Eigen/src/Core/MathFunctions.h:1717
Eigen::internal::scalar_cosh_op::packetOp
EIGEN_DEVICE_FUNC Packet packetOp(const Packet &a) const
Definition: UnaryFunctors.h:686
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::internal::pselect
EIGEN_STRONG_INLINE Packet4f pselect(const Packet4f &mask, const Packet4f &a, const Packet4f &b)
Definition: AltiVec/PacketMath.h:917
Eigen::internal::scalar_log1p_op
Definition: UnaryFunctors.h:368
Eigen::internal::scalar_score_coeff_op
Definition: UnaryFunctors.h:63
Eigen::internal::psinh
EIGEN_DECLARE_FUNCTION_ALLOWING_MULTIPLE_DEFINITIONS Packet psinh(const Packet &a)
Definition: GenericPacketMath.h:776
Eigen::internal::pexpm1
EIGEN_DECLARE_FUNCTION_ALLOWING_MULTIPLE_DEFINITIONS Packet pexpm1(const Packet &a)
Definition: GenericPacketMath.h:792
rint
const EIGEN_DEVICE_FUNC RintReturnType rint() const
Definition: ArrayCwiseUnaryOps.h:453
Eigen::internal::scalar_isinf_op
Definition: UnaryFunctors.h:896
EIGEN_STRONG_INLINE
#define EIGEN_STRONG_INLINE
Definition: Macros.h:917
round
double round(double x)
Definition: round.c:38
log1p
double log1p(double x)
Definition: unity.c:49
Eigen::internal::scalar_asin_op
Definition: UnaryFunctors.h:553
Eigen::numext::isnan
EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE bool() isnan(const Eigen::bfloat16 &h)
Definition: BFloat16.h:659
EIGEN_LOG2E
#define EIGEN_LOG2E
Definition: Eigen/src/Core/MathFunctions.h:17
Eigen::internal::plog2
EIGEN_DECLARE_FUNCTION_ALLOWING_MULTIPLE_DEFINITIONS Packet plog2(const Packet &a)
Definition: GenericPacketMath.h:808
imag
const EIGEN_DEVICE_FUNC ImagReturnType imag() const
Definition: CommonCwiseUnaryOps.h:109
Eigen::internal::scalar_tan_op::packetOp
EIGEN_DEVICE_FUNC Packet packetOp(const Packet &a) const
Definition: UnaryFunctors.h:519
Eigen::internal::Packet
Definition: ZVector/PacketMath.h:47
Eigen::numext::acos
EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE T acos(const T &x)
Definition: Eigen/src/Core/MathFunctions.h:1659
Eigen::Triplet< double >
arg
EIGEN_DEVICE_FUNC const EIGEN_STRONG_INLINE ArgReturnType arg() const
Definition: ArrayCwiseUnaryOps.h:66
Eigen::internal::scalar_sinh_op
Definition: UnaryFunctors.h:646
conj
AnnoyingScalar conj(const AnnoyingScalar &x)
Definition: AnnoyingScalar.h:104
Eigen::internal::functor_traits::PacketAccess
@ PacketAccess
Definition: XprHelper.h:180
Eigen::internal::pexp
EIGEN_DECLARE_FUNCTION_ALLOWING_MULTIPLE_DEFINITIONS Packet pexp(const Packet &a)
Definition: GenericPacketMath.h:788
Eigen::internal::scalar_expm1_op::packetOp
EIGEN_DEVICE_FUNC Packet packetOp(const Packet &a) const
Definition: UnaryFunctors.h:321
Eigen::internal::predux_any
EIGEN_STRONG_INLINE bool predux_any(const Packet4f &x)
Definition: AltiVec/PacketMath.h:1765
tree::f
Point2(* f)(const Point3 &, OptionalJacobian< 2, 3 >)
Definition: testExpression.cpp:218
Eigen::internal::psin
EIGEN_DECLARE_FUNCTION_ALLOWING_MULTIPLE_DEFINITIONS Packet psin(const Packet &a)
Definition: GenericPacketMath.h:752
Eigen::internal::scalar_asin_op::packetOp
EIGEN_DEVICE_FUNC Packet packetOp(const Packet &a) const
Definition: UnaryFunctors.h:557
Eigen::internal::parg
EIGEN_DEVICE_FUNC Packet parg(const Packet &a)
Definition: GenericPacketMath.h:551
Eigen::internal::scalar_tan_op
Definition: UnaryFunctors.h:515
Eigen::internal::scalar_ceil_op::packetOp
EIGEN_DEVICE_FUNC Packet packetOp(const Packet &a) const
Definition: UnaryFunctors.h:857
a
ArrayXXi a
Definition: Array_initializer_list_23_cxx11.cpp:1
Eigen::internal::scalar_div_cost
Definition: XprHelper.h:710
Eigen::internal::scalar_expm1_op
Definition: UnaryFunctors.h:317
Eigen::internal::scalar_real_ref_op
Definition: UnaryFunctors.h:245
Eigen::numext::abs2
EIGEN_DEVICE_FUNC bool abs2(bool x)
Definition: Eigen/src/Core/MathFunctions.h:1294
Eigen::internal::scalar_log10_op
Definition: UnaryFunctors.h:388
Eigen::internal::pmul
EIGEN_DEVICE_FUNC Packet pmul(const Packet &a, const Packet &b)
Definition: GenericPacketMath.h:237
Eigen::internal::functor_traits::Cost
@ Cost
Definition: XprHelper.h:179
Eigen::internal::scalar_logistic_op
Definition: UnaryFunctors.h:1018
Eigen::internal::scalar_abs2_op
Definition: UnaryFunctors.h:91
Eigen::internal::scalar_opposite_op
Definition: UnaryFunctors.h:22
Eigen::internal::scalar_arg_op::packetOp
EIGEN_DEVICE_FUNC const EIGEN_STRONG_INLINE Packet packetOp(const Packet &a) const
Definition: UnaryFunctors.h:143
Eigen::numext::floor
EIGEN_DEVICE_FUNC T() floor(const T &x)
Definition: Eigen/src/Core/MathFunctions.h:1402
Eigen::internal::pmadd
EIGEN_STRONG_INLINE Packet4f pmadd(const Packet4f &a, const Packet4f &b, const Packet4f &c)
Definition: AltiVec/PacketMath.h:827
Eigen::internal::plog
EIGEN_DECLARE_FUNCTION_ALLOWING_MULTIPLE_DEFINITIONS Packet plog(const Packet &a)
Definition: GenericPacketMath.h:796
p
float * p
Definition: Tutorial_Map_using.cpp:9
Eigen::internal::scalar_cube_op
Definition: UnaryFunctors.h:768
Real
mp::number< mp::cpp_dec_float< 100 >, mp::et_on > Real
Definition: boostmultiprec.cpp:78
Eigen::internal::abs_knowing_score< Scalar, typename scalar_score_coeff_op< Scalar >::Score_is_abs >::result_type
NumTraits< Scalar >::Real result_type
Definition: UnaryFunctors.h:81
Eigen::internal::scalar_imag_op::result_type
NumTraits< Scalar >::Real result_type
Definition: UnaryFunctors.h:231
Eigen::internal::pabs
EIGEN_STRONG_INLINE Packet4f pabs(const Packet4f &a)
Definition: AltiVec/PacketMath.h:1176
Eigen::internal::scalar_floor_op::packetOp
EIGEN_DEVICE_FUNC Packet packetOp(const Packet &a) const
Definition: UnaryFunctors.h:819
Eigen::internal::padd
EIGEN_DEVICE_FUNC Packet padd(const Packet &a, const Packet &b)
Definition: GenericPacketMath.h:215
Eigen::numext::sin
EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE T sin(const T &x)
Definition: Eigen/src/Core/MathFunctions.h:1621
Eigen::internal::pmin
EIGEN_DEVICE_FUNC Packet pmin(const Packet &a, const Packet &b)
Definition: GenericPacketMath.h:512
Eigen::internal::scalar_abs2_op::packetOp
EIGEN_DEVICE_FUNC const EIGEN_STRONG_INLINE Packet packetOp(const Packet &a) const
Definition: UnaryFunctors.h:97
gtsam.examples.DogLegOptimizerExample.float
float
Definition: DogLegOptimizerExample.py:113
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::functor_traits
Definition: XprHelper.h:175
Eigen::internal::scalar_shift_right_op
Definition: UnaryFunctors.h:175
Eigen::internal::scalar_sin_op
Definition: UnaryFunctors.h:495
Eigen::internal::ptanh
EIGEN_DECLARE_FUNCTION_ALLOWING_MULTIPLE_DEFINITIONS Packet ptanh(const Packet &a)
Definition: GenericPacketMath.h:784
Eigen::internal::plog1p
EIGEN_DECLARE_FUNCTION_ALLOWING_MULTIPLE_DEFINITIONS Packet plog1p(const Packet &a)
Definition: GenericPacketMath.h:800
N
#define N
Definition: igam.h:9
internal
Definition: BandTriangularSolver.h:13
Eigen::internal::scalar_sin_op::packetOp
EIGEN_DEVICE_FUNC Packet packetOp(const Packet &a) const
Definition: UnaryFunctors.h:499
Eigen::internal::scalar_cos_op
Definition: UnaryFunctors.h:476
Eigen::internal::prsqrt
EIGEN_STRONG_INLINE Packet4f prsqrt(const Packet4f &a)
Definition: MSA/PacketMath.h:730
Eigen::internal::scalar_tanh_op
Definition: UnaryFunctors.h:593
Eigen::internal::scalar_square_op< bool >::packetOp
EIGEN_DEPRECATED const EIGEN_DEVICE_FUNC Packet packetOp(const Packet &a) const
Definition: UnaryFunctors.h:756
Eigen::internal::scalar_abs_op::packetOp
EIGEN_DEVICE_FUNC const EIGEN_STRONG_INLINE Packet packetOp(const Packet &a) const
Definition: UnaryFunctors.h:46
Eigen::numext::tanh
EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE T tanh(const T &x)
Definition: Eigen/src/Core/MathFunctions.h:1785
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::scalar_abs_op::result_type
NumTraits< Scalar >::Real result_type
Definition: UnaryFunctors.h:43
Eigen::numext::log
EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE T log(const T &x)
Definition: Eigen/src/Core/MathFunctions.h:1491
Eigen::internal::pcosh
EIGEN_DECLARE_FUNCTION_ALLOWING_MULTIPLE_DEFINITIONS Packet pcosh(const Packet &a)
Definition: GenericPacketMath.h:780
Eigen::internal::scalar_atan_op
Definition: UnaryFunctors.h:573
Eigen::internal::patan
EIGEN_DECLARE_FUNCTION_ALLOWING_MULTIPLE_DEFINITIONS Packet patan(const Packet &a)
Definition: GenericPacketMath.h:772
Eigen::numext::tan
EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE T tan(const T &x)
Definition: Eigen/src/Core/MathFunctions.h:1640
Eigen::internal::pacos
EIGEN_DECLARE_FUNCTION_ALLOWING_MULTIPLE_DEFINITIONS Packet pacos(const Packet &a)
Definition: GenericPacketMath.h:768
Eigen::NumTraits
Holds information about the various numeric (i.e. scalar) types allowed by Eigen.
Definition: NumTraits.h:232
Eigen::internal::scalar_atan_op::packetOp
EIGEN_DEVICE_FUNC Packet packetOp(const Packet &a) const
Definition: UnaryFunctors.h:577
test_callbacks.value
value
Definition: test_callbacks.py:160
x2
Pose3 x2(Rot3::Ypr(0.0, 0.0, 0.0), l2)
Eigen::internal::pfloor
EIGEN_DECLARE_FUNCTION_ALLOWING_MULTIPLE_DEFINITIONS Packet pfloor(const Packet &a)
Definition: GenericPacketMath.h:830
Eigen::numext::cos
EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE T cos(const T &x)
Definition: Eigen/src/Core/MathFunctions.h:1602
Eigen::internal::ptan
EIGEN_DECLARE_FUNCTION_ALLOWING_MULTIPLE_DEFINITIONS Packet ptan(const Packet &a)
Definition: GenericPacketMath.h:760
Eigen::internal::scalar_shift_left_op
Definition: UnaryFunctors.h:194
Eigen::internal::scalar_conjugate_op
Definition: UnaryFunctors.h:109
Eigen::internal::plog10
EIGEN_DECLARE_FUNCTION_ALLOWING_MULTIPLE_DEFINITIONS Packet plog10(const Packet &a)
Definition: GenericPacketMath.h:804
log10
const EIGEN_DEVICE_FUNC Log10ReturnType log10() const
Definition: ArrayCwiseUnaryOps.h:158
Eigen::internal::scalar_opposite_op::packetOp
EIGEN_DEVICE_FUNC const EIGEN_STRONG_INLINE Packet packetOp(const Packet &a) const
Definition: UnaryFunctors.h:26
Scalar
SCALAR Scalar
Definition: bench_gemm.cpp:46
Eigen::internal::scalar_inverse_op::packetOp
const EIGEN_DEVICE_FUNC Packet packetOp(const Packet &a) const
Definition: UnaryFunctors.h:723
EIGEN_FAST_MATH
#define EIGEN_FAST_MATH
Definition: Macros.h:49


gtsam
Author(s):
autogenerated on Sat Nov 16 2024 04:09:38