GenericPacketMath.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 Gael Guennebaud <gael.guennebaud@inria.fr>
5 // Copyright (C) 2006-2008 Benoit Jacob <jacob.benoit.1@gmail.com>
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_GENERIC_PACKET_MATH_H
12 #define EIGEN_GENERIC_PACKET_MATH_H
13 
14 namespace Eigen {
15 
16 namespace internal {
17 
26 #ifndef EIGEN_DEBUG_ALIGNED_LOAD
27 #define EIGEN_DEBUG_ALIGNED_LOAD
28 #endif
29 
30 #ifndef EIGEN_DEBUG_UNALIGNED_LOAD
31 #define EIGEN_DEBUG_UNALIGNED_LOAD
32 #endif
33 
34 #ifndef EIGEN_DEBUG_ALIGNED_STORE
35 #define EIGEN_DEBUG_ALIGNED_STORE
36 #endif
37 
38 #ifndef EIGEN_DEBUG_UNALIGNED_STORE
39 #define EIGEN_DEBUG_UNALIGNED_STORE
40 #endif
41 
43 {
44  enum {
46 
47  HasAdd = 1,
48  HasSub = 1,
49  HasShift = 1,
50  HasMul = 1,
51  HasNegate = 1,
52  HasAbs = 1,
53  HasArg = 0,
54  HasAbs2 = 1,
56  HasMin = 1,
57  HasMax = 1,
58  HasConj = 1,
60  HasBlend = 0,
61  // This flag is used to indicate whether packet comparison is supported.
62  // pcmp_eq, pcmp_lt and pcmp_le should be defined for it to be true.
63  HasCmp = 0,
64 
65  HasDiv = 0,
66  HasSqrt = 0,
67  HasRsqrt = 0,
68  HasExp = 0,
69  HasExpm1 = 0,
70  HasLog = 0,
71  HasLog1p = 0,
72  HasLog10 = 0,
73  HasPow = 0,
74 
75  HasSin = 0,
76  HasCos = 0,
77  HasTan = 0,
78  HasASin = 0,
79  HasACos = 0,
80  HasATan = 0,
81  HasSinh = 0,
82  HasCosh = 0,
83  HasTanh = 0,
84  HasLGamma = 0,
86  HasZeta = 0,
88  HasErf = 0,
89  HasErfc = 0,
90  HasNdtri = 0,
91  HasBessel = 0,
92  HasIGamma = 0,
97 
98  HasRound = 0,
99  HasRint = 0,
100  HasFloor = 0,
101  HasCeil = 0,
103  };
104 };
105 
106 template<typename T> struct packet_traits : default_packet_traits
107 {
108  typedef T type;
109  typedef T half;
110  enum {
112  size = 1,
115  };
116  enum {
117  HasAdd = 0,
118  HasSub = 0,
119  HasMul = 0,
121  HasAbs = 0,
122  HasAbs2 = 0,
123  HasMin = 0,
124  HasMax = 0,
125  HasConj = 0,
127  };
128 };
129 
130 template<typename T> struct packet_traits<const T> : packet_traits<T> { };
131 
132 template<typename T> struct unpacket_traits
133 {
134  typedef T type;
135  typedef T half;
136  enum
137  {
138  size = 1,
140  vectorizable = false,
143  };
144 };
145 
146 template<typename T> struct unpacket_traits<const T> : unpacket_traits<T> { };
147 
148 template <typename Src, typename Tgt> struct type_casting_traits {
149  enum {
153  };
154 };
155 
158 template<typename T, int unique_id = 0>
160 {
161  EIGEN_ALWAYS_INLINE operator T&() { return m_val; }
162  EIGEN_ALWAYS_INLINE operator const T&() const { return m_val; }
166  m_val = v;
167  return *this;
168  }
169 
171 };
172 
173 
177 template<typename Packet>
178 struct is_scalar {
180  enum {
182  };
183 };
184 
186 template <typename SrcPacket, typename TgtPacket>
187 EIGEN_DEVICE_FUNC inline TgtPacket
188 pcast(const SrcPacket& a) {
189  return static_cast<TgtPacket>(a);
190 }
191 template <typename SrcPacket, typename TgtPacket>
192 EIGEN_DEVICE_FUNC inline TgtPacket
193 pcast(const SrcPacket& a, const SrcPacket& /*b*/) {
194  return static_cast<TgtPacket>(a);
195 }
196 template <typename SrcPacket, typename TgtPacket>
197 EIGEN_DEVICE_FUNC inline TgtPacket
198 pcast(const SrcPacket& a, const SrcPacket& /*b*/, const SrcPacket& /*c*/, const SrcPacket& /*d*/) {
199  return static_cast<TgtPacket>(a);
200 }
201 template <typename SrcPacket, typename TgtPacket>
202 EIGEN_DEVICE_FUNC inline TgtPacket
203 pcast(const SrcPacket& a, const SrcPacket& /*b*/, const SrcPacket& /*c*/, const SrcPacket& /*d*/,
204  const SrcPacket& /*e*/, const SrcPacket& /*f*/, const SrcPacket& /*g*/, const SrcPacket& /*h*/) {
205  return static_cast<TgtPacket>(a);
206 }
207 
209 template <typename Target, typename Packet>
211 preinterpret(const Packet& a); /* { return reinterpret_cast<const Target&>(a); } */
212 
214 template<typename Packet> EIGEN_DEVICE_FUNC inline Packet
215 padd(const Packet& a, const Packet& b) { return a+b; }
216 // Avoid compiler warning for boolean algebra.
217 template<> EIGEN_DEVICE_FUNC inline bool
218 padd(const bool& a, const bool& b) { return a || b; }
219 
221 template<typename Packet> EIGEN_DEVICE_FUNC inline Packet
222 psub(const Packet& a, const Packet& b) { return a-b; }
223 
225 template<typename Packet> EIGEN_DEVICE_FUNC inline Packet
226 pnegate(const Packet& a) { return -a; }
227 
228 template<> EIGEN_DEVICE_FUNC inline bool
229 pnegate(const bool& a) { return !a; }
230 
232 template<typename Packet> EIGEN_DEVICE_FUNC inline Packet
233 pconj(const Packet& a) { return numext::conj(a); }
234 
236 template<typename Packet> EIGEN_DEVICE_FUNC inline Packet
237 pmul(const Packet& a, const Packet& b) { return a*b; }
238 // Avoid compiler warning for boolean algebra.
239 template<> EIGEN_DEVICE_FUNC inline bool
240 pmul(const bool& a, const bool& b) { return a && b; }
241 
243 template<typename Packet> EIGEN_DEVICE_FUNC inline Packet
244 pdiv(const Packet& a, const Packet& b) { return a/b; }
245 
246 // In the generic case, memset to all one bits.
247 template<typename Packet, typename EnableIf = void>
248 struct ptrue_impl {
249  static EIGEN_DEVICE_FUNC inline Packet run(const Packet& /*a*/){
250  Packet b;
251  memset(static_cast<void*>(&b), 0xff, sizeof(Packet));
252  return b;
253  }
254 };
255 
256 // For non-trivial scalars, set to Scalar(1) (i.e. a non-zero value).
257 // Although this is technically not a valid bitmask, the scalar path for pselect
258 // uses a comparison to zero, so this should still work in most cases. We don't
259 // have another option, since the scalar type requires initialization.
260 template<typename T>
261 struct ptrue_impl<T,
262  typename internal::enable_if<is_scalar<T>::value && NumTraits<T>::RequireInitialization>::type > {
263  static EIGEN_DEVICE_FUNC inline T run(const T& /*a*/){
264  return T(1);
265  }
266 };
267 
269 template<typename Packet> EIGEN_DEVICE_FUNC inline Packet
270 ptrue(const Packet& a) {
271  return ptrue_impl<Packet>::run(a);
272 }
273 
274 // In the general case, memset to zero.
275 template<typename Packet, typename EnableIf = void>
276 struct pzero_impl {
277  static EIGEN_DEVICE_FUNC inline Packet run(const Packet& /*a*/) {
278  Packet b;
279  memset(static_cast<void*>(&b), 0x00, sizeof(Packet));
280  return b;
281  }
282 };
283 
284 // For scalars, explicitly set to Scalar(0), since the underlying representation
285 // for zero may not consist of all-zero bits.
286 template<typename T>
287 struct pzero_impl<T,
288  typename internal::enable_if<is_scalar<T>::value>::type> {
289  static EIGEN_DEVICE_FUNC inline T run(const T& /*a*/) {
290  return T(0);
291  }
292 };
293 
295 template<typename Packet> EIGEN_DEVICE_FUNC inline Packet
296 pzero(const Packet& a) {
297  return pzero_impl<Packet>::run(a);
298 }
299 
301 template<typename Packet> EIGEN_DEVICE_FUNC inline Packet
302 pcmp_le(const Packet& a, const Packet& b) { return a<=b ? ptrue(a) : pzero(a); }
303 
305 template<typename Packet> EIGEN_DEVICE_FUNC inline Packet
306 pcmp_lt(const Packet& a, const Packet& b) { return a<b ? ptrue(a) : pzero(a); }
307 
309 template<typename Packet> EIGEN_DEVICE_FUNC inline Packet
310 pcmp_eq(const Packet& a, const Packet& b) { return a==b ? ptrue(a) : pzero(a); }
311 
313 template<typename Packet> EIGEN_DEVICE_FUNC inline Packet
314 pcmp_lt_or_nan(const Packet& a, const Packet& b) { return a>=b ? pzero(a) : ptrue(a); }
315 
316 template<typename T>
317 struct bit_and {
319  return a & b;
320  }
321 };
322 
323 template<typename T>
324 struct bit_or {
326  return a | b;
327  }
328 };
329 
330 template<typename T>
331 struct bit_xor {
333  return a ^ b;
334  }
335 };
336 
337 template<typename T>
338 struct bit_not {
340  return ~a;
341  }
342 };
343 
344 // Use operators &, |, ^, ~.
345 template<typename T>
347  EIGEN_DEVICE_FUNC static inline T bitwise_and(const T& a, const T& b) { return bit_and<T>()(a, b); }
348  EIGEN_DEVICE_FUNC static inline T bitwise_or(const T& a, const T& b) { return bit_or<T>()(a, b); }
349  EIGEN_DEVICE_FUNC static inline T bitwise_xor(const T& a, const T& b) { return bit_xor<T>()(a, b); }
350  EIGEN_DEVICE_FUNC static inline T bitwise_not(const T& a) { return bit_not<T>()(a); }
351 };
352 
353 // Apply binary operations byte-by-byte
354 template<typename T>
356  EIGEN_DEVICE_FUNC static inline T bitwise_and(const T& a, const T& b) {
357  return binary(a, b, bit_and<unsigned char>());
358  }
359  EIGEN_DEVICE_FUNC static inline T bitwise_or(const T& a, const T& b) {
360  return binary(a, b, bit_or<unsigned char>());
361  }
362  EIGEN_DEVICE_FUNC static inline T bitwise_xor(const T& a, const T& b) {
363  return binary(a, b, bit_xor<unsigned char>());
364  }
365  EIGEN_DEVICE_FUNC static inline T bitwise_not(const T& a) {
366  return unary(a,bit_not<unsigned char>());
367  }
368 
369  private:
370  template<typename Op>
371  EIGEN_DEVICE_FUNC static inline T unary(const T& a, Op op) {
372  const unsigned char* a_ptr = reinterpret_cast<const unsigned char*>(&a);
373  T c;
374  unsigned char* c_ptr = reinterpret_cast<unsigned char*>(&c);
375  for (size_t i = 0; i < sizeof(T); ++i) {
376  *c_ptr++ = op(*a_ptr++);
377  }
378  return c;
379  }
380 
381  template<typename Op>
382  EIGEN_DEVICE_FUNC static inline T binary(const T& a, const T& b, Op op) {
383  const unsigned char* a_ptr = reinterpret_cast<const unsigned char*>(&a);
384  const unsigned char* b_ptr = reinterpret_cast<const unsigned char*>(&b);
385  T c;
386  unsigned char* c_ptr = reinterpret_cast<unsigned char*>(&c);
387  for (size_t i = 0; i < sizeof(T); ++i) {
388  *c_ptr++ = op(*a_ptr++, *b_ptr++);
389  }
390  return c;
391  }
392 };
393 
394 // In the general case, use byte-by-byte manipulation.
395 template<typename T, typename EnableIf = void>
397 
398 // For integers or non-trivial scalars, use binary operators.
399 template<typename T>
401  typename internal::enable_if<
402  is_scalar<T>::value && (NumTraits<T>::IsInteger || NumTraits<T>::RequireInitialization)>::type
403  > : public operator_bitwise_helper<T> {};
404 
406 template<typename Packet> EIGEN_DEVICE_FUNC inline Packet
407 pand(const Packet& a, const Packet& b) {
409 }
410 
412 template<typename Packet> EIGEN_DEVICE_FUNC inline Packet
413 por(const Packet& a, const Packet& b) {
415 }
416 
418 template<typename Packet> EIGEN_DEVICE_FUNC inline Packet
419 pxor(const Packet& a, const Packet& b) {
421 }
422 
424 template<typename Packet> EIGEN_DEVICE_FUNC inline Packet
425 pnot(const Packet& a) {
427 }
428 
430 template<typename Packet> EIGEN_DEVICE_FUNC inline Packet
431 pandnot(const Packet& a, const Packet& b) { return pand(a, pnot(b)); }
432 
433 // In the general case, use bitwise select.
434 template<typename Packet, typename EnableIf = void>
435 struct pselect_impl {
436  static EIGEN_DEVICE_FUNC inline Packet run(const Packet& mask, const Packet& a, const Packet& b) {
437  return por(pand(a,mask),pandnot(b,mask));
438  }
439 };
440 
441 // For scalars, use ternary select.
442 template<typename Packet>
444  typename internal::enable_if<is_scalar<Packet>::value>::type > {
445  static EIGEN_DEVICE_FUNC inline Packet run(const Packet& mask, const Packet& a, const Packet& b) {
446  return numext::equal_strict(mask, Packet(0)) ? b : a;
447  }
448 };
449 
451 template<typename Packet> EIGEN_DEVICE_FUNC inline Packet
452 pselect(const Packet& mask, const Packet& a, const Packet& b) {
453  return pselect_impl<Packet>::run(mask, a, b);
454 }
455 
456 template<> EIGEN_DEVICE_FUNC inline bool pselect<bool>(
457  const bool& cond, const bool& a, const bool& b) {
458  return cond ? a : b;
459 }
460 
463 template<int NaNPropagation>
464 struct pminmax_impl {
465  template <typename Packet, typename Op>
466  static EIGEN_DEVICE_FUNC inline Packet run(const Packet& a, const Packet& b, Op op) {
467  return op(a,b);
468  }
469 };
470 
473 template<>
475  template <typename Packet, typename Op>
476  static EIGEN_DEVICE_FUNC inline Packet run(const Packet& a, const Packet& b, Op op) {
477  Packet not_nan_mask_a = pcmp_eq(a, a);
478  Packet not_nan_mask_b = pcmp_eq(b, b);
479  return pselect(not_nan_mask_a,
480  pselect(not_nan_mask_b, op(a, b), b),
481  a);
482  }
483 };
484 
488 template<>
490  template <typename Packet, typename Op>
491  static EIGEN_DEVICE_FUNC inline Packet run(const Packet& a, const Packet& b, Op op) {
492  Packet not_nan_mask_a = pcmp_eq(a, a);
493  Packet not_nan_mask_b = pcmp_eq(b, b);
494  return pselect(not_nan_mask_a,
495  pselect(not_nan_mask_b, op(a, b), a),
496  b);
497  }
498 };
499 
500 
501 #ifndef SYCL_DEVICE_ONLY
502 #define EIGEN_BINARY_OP_NAN_PROPAGATION(Type, Func) Func
503 #else
504 #define EIGEN_BINARY_OP_NAN_PROPAGATION(Type, Func) \
505 [](const Type& a, const Type& b) { \
506  return Func(a, b);}
507 #endif
508 
511 template<typename Packet> EIGEN_DEVICE_FUNC inline Packet
512 pmin(const Packet& a, const Packet& b) { return numext::mini(a,b); }
513 
516 template <int NaNPropagation, typename Packet>
517 EIGEN_DEVICE_FUNC inline Packet pmin(const Packet& a, const Packet& b) {
519 }
520 
523 template<typename Packet> EIGEN_DEVICE_FUNC inline Packet
524 pmax(const Packet& a, const Packet& b) { return numext::maxi(a, b); }
525 
528 template <int NaNPropagation, typename Packet>
529 EIGEN_DEVICE_FUNC inline Packet pmax(const Packet& a, const Packet& b) {
531 }
532 
534 template<typename Packet> EIGEN_DEVICE_FUNC inline Packet
535 pabs(const Packet& a) { return numext::abs(a); }
536 template<> EIGEN_DEVICE_FUNC inline unsigned int
537 pabs(const unsigned int& a) { return a; }
538 template<> EIGEN_DEVICE_FUNC inline unsigned long
539 pabs(const unsigned long& a) { return a; }
540 template<> EIGEN_DEVICE_FUNC inline unsigned long long
541 pabs(const unsigned long long& a) { return a; }
542 
544 template<typename Packet> EIGEN_DEVICE_FUNC inline Packet
545 paddsub(const Packet& a, const Packet& b) {
546  return pselect(peven_mask(a), padd(a, b), psub(a, b));
547  }
548 
550 template<typename Packet> EIGEN_DEVICE_FUNC inline Packet
551 parg(const Packet& a) { using numext::arg; return arg(a); }
552 
553 
555 template<int N> EIGEN_DEVICE_FUNC inline int
556 parithmetic_shift_right(const int& a) { return a >> N; }
557 template<int N> EIGEN_DEVICE_FUNC inline long int
558 parithmetic_shift_right(const long int& a) { return a >> N; }
559 
561 template<int N> EIGEN_DEVICE_FUNC inline int
562 plogical_shift_right(const int& a) { return static_cast<int>(static_cast<unsigned int>(a) >> N); }
563 template<int N> EIGEN_DEVICE_FUNC inline long int
564 plogical_shift_right(const long int& a) { return static_cast<long>(static_cast<unsigned long>(a) >> N); }
565 
567 template<int N> EIGEN_DEVICE_FUNC inline int
568 plogical_shift_left(const int& a) { return a << N; }
569 template<int N> EIGEN_DEVICE_FUNC inline long int
570 plogical_shift_left(const long int& a) { return a << N; }
571 
575 template <typename Packet>
576 EIGEN_DEVICE_FUNC inline Packet pfrexp(const Packet& a, Packet& exponent) {
577  int exp;
578  EIGEN_USING_STD(frexp);
579  Packet result = static_cast<Packet>(frexp(a, &exp));
580  exponent = static_cast<Packet>(exp);
581  return result;
582 }
583 
587 template<typename Packet> EIGEN_DEVICE_FUNC inline Packet
588 pldexp(const Packet &a, const Packet &exponent) {
589  EIGEN_USING_STD(ldexp)
590  return static_cast<Packet>(ldexp(a, static_cast<int>(exponent)));
591 }
592 
594 template<typename Packet> EIGEN_DEVICE_FUNC inline Packet
595 pabsdiff(const Packet& a, const Packet& b) { return pselect(pcmp_lt(a, b), psub(b, a), psub(a, b)); }
596 
598 template<typename Packet> EIGEN_DEVICE_FUNC inline Packet
599 pload(const typename unpacket_traits<Packet>::type* from) { return *from; }
600 
602 template<typename Packet> EIGEN_DEVICE_FUNC inline Packet
603 ploadu(const typename unpacket_traits<Packet>::type* from) { return *from; }
604 
609 template<typename Packet> EIGEN_DEVICE_FUNC inline
610 typename enable_if<unpacket_traits<Packet>::masked_load_available, Packet>::type
611 ploadu(const typename unpacket_traits<Packet>::type* from, typename unpacket_traits<Packet>::mask_t umask);
612 
614 template<typename Packet> EIGEN_DEVICE_FUNC inline Packet
615 pset1(const typename unpacket_traits<Packet>::type& a) { return a; }
616 
618 template<typename Packet,typename BitsType> EIGEN_DEVICE_FUNC inline Packet
619 pset1frombits(BitsType a);
620 
622 template<typename Packet> EIGEN_DEVICE_FUNC inline Packet
623 pload1(const typename unpacket_traits<Packet>::type *a) { return pset1<Packet>(*a); }
624 
630 template<typename Packet> EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Packet
631 ploaddup(const typename unpacket_traits<Packet>::type* from) { return *from; }
632 
639 template<typename Packet> EIGEN_DEVICE_FUNC inline Packet
641 { return pload1<Packet>(from); }
642 
652 template<typename Packet> EIGEN_DEVICE_FUNC
653 inline void pbroadcast4(const typename unpacket_traits<Packet>::type *a,
654  Packet& a0, Packet& a1, Packet& a2, Packet& a3)
655 {
656  a0 = pload1<Packet>(a+0);
657  a1 = pload1<Packet>(a+1);
658  a2 = pload1<Packet>(a+2);
659  a3 = pload1<Packet>(a+3);
660 }
661 
669 template<typename Packet> EIGEN_DEVICE_FUNC
670 inline void pbroadcast2(const typename unpacket_traits<Packet>::type *a,
671  Packet& a0, Packet& a1)
672 {
673  a0 = pload1<Packet>(a+0);
674  a1 = pload1<Packet>(a+1);
675 }
676 
678 template<typename Packet> EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Packet
679 plset(const typename unpacket_traits<Packet>::type& a) { return a; }
680 
683 template<typename Packet> EIGEN_DEVICE_FUNC inline Packet
684 peven_mask(const Packet& /*a*/) {
685  typedef typename unpacket_traits<Packet>::type Scalar;
686  const size_t n = unpacket_traits<Packet>::size;
687  EIGEN_ALIGN_TO_BOUNDARY(sizeof(Packet)) Scalar elements[n];
688  for(size_t i = 0; i < n; ++i) {
689  memset(elements+i, ((i & 1) == 0 ? 0xff : 0), sizeof(Scalar));
690  }
691  return ploadu<Packet>(elements);
692 }
693 
694 
696 template<typename Scalar, typename Packet> EIGEN_DEVICE_FUNC inline void pstore(Scalar* to, const Packet& from)
697 { (*to) = from; }
698 
700 template<typename Scalar, typename Packet> EIGEN_DEVICE_FUNC inline void pstoreu(Scalar* to, const Packet& from)
701 { (*to) = from; }
702 
707 template<typename Scalar, typename Packet>
708 EIGEN_DEVICE_FUNC inline
709 typename enable_if<unpacket_traits<Packet>::masked_store_available, void>::type
710 pstoreu(Scalar* to, const Packet& from, typename unpacket_traits<Packet>::mask_t umask);
711 
712  template<typename Scalar, typename Packet> EIGEN_DEVICE_FUNC inline Packet pgather(const Scalar* from, Index /*stride*/)
713  { return ploadu<Packet>(from); }
714 
715  template<typename Scalar, typename Packet> EIGEN_DEVICE_FUNC inline void pscatter(Scalar* to, const Packet& from, Index /*stride*/)
716  { pstore(to, from); }
717 
719 template<typename Scalar> EIGEN_DEVICE_FUNC inline void prefetch(const Scalar* addr)
720 {
721 #if defined(EIGEN_HIP_DEVICE_COMPILE)
722  // do nothing
723 #elif defined(EIGEN_CUDA_ARCH)
724 #if defined(__LP64__) || EIGEN_OS_WIN64
725  // 64-bit pointer operand constraint for inlined asm
726  asm(" prefetch.L1 [ %1 ];" : "=l"(addr) : "l"(addr));
727 #else
728  // 32-bit pointer operand constraint for inlined asm
729  asm(" prefetch.L1 [ %1 ];" : "=r"(addr) : "r"(addr));
730 #endif
731 #elif (!EIGEN_COMP_MSVC) && (EIGEN_COMP_GNUC || EIGEN_COMP_CLANG || EIGEN_COMP_ICC)
732  __builtin_prefetch(addr);
733 #endif
734 }
735 
737 template<typename Packet> EIGEN_DEVICE_FUNC inline Packet preverse(const Packet& a)
738 { return a; }
739 
741 template<typename Packet> EIGEN_DEVICE_FUNC inline Packet pcplxflip(const Packet& a)
742 {
743  return Packet(numext::imag(a),numext::real(a));
744 }
745 
746 /**************************
747 * Special math functions
748 ***************************/
749 
752 Packet psin(const Packet& a) { EIGEN_USING_STD(sin); return sin(a); }
753 
756 Packet pcos(const Packet& a) { EIGEN_USING_STD(cos); return cos(a); }
757 
760 Packet ptan(const Packet& a) { EIGEN_USING_STD(tan); return tan(a); }
761 
764 Packet pasin(const Packet& a) { EIGEN_USING_STD(asin); return asin(a); }
765 
768 Packet pacos(const Packet& a) { EIGEN_USING_STD(acos); return acos(a); }
769 
772 Packet patan(const Packet& a) { EIGEN_USING_STD(atan); return atan(a); }
773 
776 Packet psinh(const Packet& a) { EIGEN_USING_STD(sinh); return sinh(a); }
777 
780 Packet pcosh(const Packet& a) { EIGEN_USING_STD(cosh); return cosh(a); }
781 
784 Packet ptanh(const Packet& a) { EIGEN_USING_STD(tanh); return tanh(a); }
785 
788 Packet pexp(const Packet& a) { EIGEN_USING_STD(exp); return exp(a); }
789 
792 Packet pexpm1(const Packet& a) { return numext::expm1(a); }
793 
796 Packet plog(const Packet& a) { EIGEN_USING_STD(log); return log(a); }
797 
800 Packet plog1p(const Packet& a) { return numext::log1p(a); }
801 
805 
808 Packet plog2(const Packet& a) {
810  return pmul(pset1<Packet>(Scalar(EIGEN_LOG2E)), plog(a));
811 }
812 
815 Packet psqrt(const Packet& a) { return numext::sqrt(a); }
816 
821  return pdiv(pset1<Packet>(Scalar(1)), psqrt(a));
822 }
823 
826 Packet pround(const Packet& a) { using numext::round; return round(a); }
827 
830 Packet pfloor(const Packet& a) { using numext::floor; return floor(a); }
831 
835 Packet print(const Packet& a) { using numext::rint; return rint(a); }
836 
839 Packet pceil(const Packet& a) { using numext::ceil; return ceil(a); }
840 
842 template<typename Packet>
844 pfirst(const Packet& a)
845 { return a; }
846 
851 template<typename Packet>
854 { return a; }
855 
856 // Slow generic implementation of Packet reduction.
857 template <typename Packet, typename Op>
859 predux_helper(const Packet& a, Op op) {
860  typedef typename unpacket_traits<Packet>::type Scalar;
861  const size_t n = unpacket_traits<Packet>::size;
862  EIGEN_ALIGN_TO_BOUNDARY(sizeof(Packet)) Scalar elements[n];
863  pstoreu<Scalar>(elements, a);
864  for(size_t k = n / 2; k > 0; k /= 2) {
865  for(size_t i = 0; i < k; ++i) {
866  elements[i] = op(elements[i], elements[i + k]);
867  }
868  }
869  return elements[0];
870 }
871 
873 template<typename Packet>
875 predux(const Packet& a)
876 {
877  return a;
878 }
879 
881 template <typename Packet>
883  const Packet& a) {
884  typedef typename unpacket_traits<Packet>::type Scalar;
885  return predux_helper(a, EIGEN_BINARY_OP_NAN_PROPAGATION(Scalar, (pmul<Scalar>)));
886 }
887 
889 template <typename Packet>
891  const Packet &a) {
892  typedef typename unpacket_traits<Packet>::type Scalar;
893  return predux_helper(a, EIGEN_BINARY_OP_NAN_PROPAGATION(Scalar, (pmin<PropagateFast, Scalar>)));
894 }
895 
896 template <int NaNPropagation, typename Packet>
898  const Packet& a) {
899  typedef typename unpacket_traits<Packet>::type Scalar;
900  return predux_helper(a, EIGEN_BINARY_OP_NAN_PROPAGATION(Scalar, (pmin<NaNPropagation, Scalar>)));
901 }
902 
904 template <typename Packet>
906  const Packet &a) {
907  typedef typename unpacket_traits<Packet>::type Scalar;
908  return predux_helper(a, EIGEN_BINARY_OP_NAN_PROPAGATION(Scalar, (pmax<PropagateFast, Scalar>)));
909 }
910 
911 template <int NaNPropagation, typename Packet>
913  const Packet& a) {
914  typedef typename unpacket_traits<Packet>::type Scalar;
915  return predux_helper(a, EIGEN_BINARY_OP_NAN_PROPAGATION(Scalar, (pmax<NaNPropagation, Scalar>)));
916 }
917 
918 #undef EIGEN_BINARY_OP_NAN_PROPAGATION
919 
923 // not needed yet
924 // template<typename Packet> EIGEN_DEVICE_FUNC inline bool predux_all(const Packet& a)
925 // { return bool(a); }
926 
930 template<typename Packet> EIGEN_DEVICE_FUNC inline bool predux_any(const Packet& a)
931 {
932  // Dirty but generic implementation where "true" is assumed to be non 0 and all the sames.
933  // It is expected that "true" is either:
934  // - Scalar(1)
935  // - bits full of ones (NaN for floats),
936  // - or first bit equals to 1 (1 for ints, smallest denormal for floats).
937  // For all these cases, taking the sum is just fine, and this boils down to a no-op for scalars.
938  typedef typename unpacket_traits<Packet>::type Scalar;
940 }
941 
942 /***************************************************************************
943 * The following functions might not have to be overwritten for vectorized types
944 ***************************************************************************/
945 
947 // NOTE: this function must really be templated on the packet type (think about different packet types for the same scalar type)
948 template<typename Packet>
949 inline void pstore1(typename unpacket_traits<Packet>::type* to, const typename unpacket_traits<Packet>::type& a)
950 {
951  pstore(to, pset1<Packet>(a));
952 }
953 
955 template<typename Packet> EIGEN_DEVICE_FUNC inline Packet
956 pmadd(const Packet& a,
957  const Packet& b,
958  const Packet& c)
959 { return padd(pmul(a, b),c); }
960 
963 template<typename Packet, int Alignment>
965 {
966  if(Alignment >= unpacket_traits<Packet>::alignment)
967  return pload<Packet>(from);
968  else
969  return ploadu<Packet>(from);
970 }
971 
974 template<typename Scalar, typename Packet, int Alignment>
976 {
977  if(Alignment >= unpacket_traits<Packet>::alignment)
978  pstore(to, from);
979  else
980  pstoreu(to, from);
981 }
982 
988 template<typename Packet, int LoadMode>
990 {
991  return ploadt<Packet, LoadMode>(from);
992 }
993 
994 /***************************************************************************
995 * Fast complex products (GCC generates a function call which is very slow)
996 ***************************************************************************/
997 
998 // Eigen+CUDA does not support complexes.
999 #if !defined(EIGEN_GPUCC)
1000 
1001 template<> inline std::complex<float> pmul(const std::complex<float>& a, const std::complex<float>& b)
1002 { return std::complex<float>(a.real()*b.real() - a.imag()*b.imag(), a.imag()*b.real() + a.real()*b.imag()); }
1003 
1004 template<> inline std::complex<double> pmul(const std::complex<double>& a, const std::complex<double>& b)
1005 { return std::complex<double>(a.real()*b.real() - a.imag()*b.imag(), a.imag()*b.real() + a.real()*b.imag()); }
1006 
1007 #endif
1008 
1009 
1010 /***************************************************************************
1011  * PacketBlock, that is a collection of N packets where the number of words
1012  * in the packet is a multiple of N.
1013 ***************************************************************************/
1015  Packet packet[N];
1016 };
1017 
1018 template<typename Packet> EIGEN_DEVICE_FUNC inline void
1020  // Nothing to do in the scalar case, i.e. a 1x1 matrix.
1021 }
1022 
1023 /***************************************************************************
1024  * Selector, i.e. vector of N boolean values used to select (i.e. blend)
1025  * words from 2 packets.
1026 ***************************************************************************/
1027 template <size_t N> struct Selector {
1028  bool select[N];
1029 };
1030 
1031 template<typename Packet> EIGEN_DEVICE_FUNC inline Packet
1032 pblend(const Selector<unpacket_traits<Packet>::size>& ifPacket, const Packet& thenPacket, const Packet& elsePacket) {
1033  return ifPacket.select[0] ? thenPacket : elsePacket;
1034 }
1035 
1036 } // end namespace internal
1037 
1038 } // end namespace Eigen
1039 
1040 #endif // EIGEN_GENERIC_PACKET_MATH_H
Eigen::internal::eigen_packet_wrapper
Definition: GenericPacketMath.h:159
Eigen::internal::default_packet_traits::HasSign
@ HasSign
Definition: GenericPacketMath.h:102
Eigen::internal::pldexp
EIGEN_STRONG_INLINE Packet8h pldexp(const Packet8h &a, const Packet8h &exponent)
Definition: Eigen/src/Core/arch/AVX/MathFunctions.h:196
Eigen::internal::pcmp_eq
EIGEN_STRONG_INLINE Packet2cf pcmp_eq(const Packet2cf &a, const Packet2cf &b)
Definition: AltiVec/Complex.h:231
Eigen::internal::print
EIGEN_STRONG_INLINE Packet4f print(const Packet4f &a)
Definition: NEON/PacketMath.h:3115
Eigen::internal::is_scalar::Scalar
unpacket_traits< Packet >::type Scalar
Definition: GenericPacketMath.h:179
EIGEN_DEVICE_FUNC
#define EIGEN_DEVICE_FUNC
Definition: Macros.h:976
Eigen::internal::packet_traits::HasAbs
@ HasAbs
Definition: GenericPacketMath.h:121
Eigen
Namespace containing all symbols from the Eigen library.
Definition: jet.h:637
EIGEN_DECLARE_FUNCTION_ALLOWING_MULTIPLE_DEFINITIONS
#define EIGEN_DECLARE_FUNCTION_ALLOWING_MULTIPLE_DEFINITIONS
Definition: Macros.h:984
Eigen::internal::default_packet_traits::HasIGammac
@ HasIGammac
Definition: GenericPacketMath.h:95
Eigen::internal::psqrt
EIGEN_STRONG_INLINE Packet4f psqrt(const Packet4f &a)
Definition: MSA/PacketMath.h:723
Eigen::internal::operator_bitwise_helper::bitwise_not
static EIGEN_DEVICE_FUNC T bitwise_not(const T &a)
Definition: GenericPacketMath.h:350
Eigen::internal::pzero_impl
Definition: GenericPacketMath.h:276
Eigen::internal::default_packet_traits::HasLog10
@ HasLog10
Definition: GenericPacketMath.h:72
Eigen::internal::default_packet_traits::HasBetaInc
@ HasBetaInc
Definition: GenericPacketMath.h:96
Eigen::internal::default_packet_traits::HasLog
@ HasLog
Definition: GenericPacketMath.h:70
Eigen::internal::packet_traits::HasSub
@ HasSub
Definition: GenericPacketMath.h:118
Eigen::internal::eigen_packet_wrapper::eigen_packet_wrapper
EIGEN_ALWAYS_INLINE eigen_packet_wrapper(const T &v)
Definition: GenericPacketMath.h:164
Eigen::internal::pstoreu
EIGEN_DEVICE_FUNC void pstoreu(Scalar *to, const Packet &from)
Definition: GenericPacketMath.h:700
Eigen::internal::default_packet_traits::HasNegate
@ HasNegate
Definition: GenericPacketMath.h:51
Eigen::internal::paddsub
EIGEN_DEVICE_FUNC Packet paddsub(const Packet &a, const Packet &b)
Definition: GenericPacketMath.h:545
Eigen::internal::pasin
EIGEN_DECLARE_FUNCTION_ALLOWING_MULTIPLE_DEFINITIONS Packet pasin(const Packet &a)
Definition: GenericPacketMath.h:764
Eigen::internal::packet_traits::size
@ size
Definition: GenericPacketMath.h:112
EIGEN_USING_STD
#define EIGEN_USING_STD(FUNC)
Definition: Macros.h:1185
Eigen::internal::ptrue_impl
Definition: GenericPacketMath.h:248
atan
const EIGEN_DEVICE_FUNC AtanReturnType atan() const
Definition: ArrayCwiseUnaryOps.h:283
Eigen::internal::predux_half_dowto4
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Packet4c predux_half_dowto4(const Packet8c &a)
Definition: NEON/PacketMath.h:2478
Eigen::internal::pminmax_impl::run
static EIGEN_DEVICE_FUNC Packet run(const Packet &a, const Packet &b, Op op)
Definition: GenericPacketMath.h:466
ceres::sin
Jet< T, N > sin(const Jet< T, N > &f)
Definition: jet.h:439
Eigen::internal::peven_mask
EIGEN_STRONG_INLINE Packet8f peven_mask(const Packet8f &)
Definition: AVX/PacketMath.h:252
Eigen::internal::pselect_impl
Definition: GenericPacketMath.h:435
Packet
internal::packet_traits< Scalar >::type Packet
Definition: benchmark-blocking-sizes.cpp:54
Eigen::internal::PacketBlock
Definition: GenericPacketMath.h:1014
c
Scalar Scalar * c
Definition: benchVecAdd.cpp:17
b
Scalar * b
Definition: benchVecAdd.cpp:17
Eigen::internal::default_packet_traits::HasASin
@ HasASin
Definition: GenericPacketMath.h:78
Eigen::internal::pcmp_lt
EIGEN_STRONG_INLINE Packet4f pcmp_lt(const Packet4f &a, const Packet4f &b)
Definition: AltiVec/PacketMath.h:868
Eigen::internal::is_scalar::value
@ value
Definition: GenericPacketMath.h:181
Eigen::internal::eigen_packet_wrapper::eigen_packet_wrapper
EIGEN_ALWAYS_INLINE eigen_packet_wrapper()
Definition: GenericPacketMath.h:163
Eigen::internal::pfirst
EIGEN_STRONG_INLINE bfloat16 pfirst(const Packet8bf &a)
Definition: AltiVec/PacketMath.h:1429
Eigen::numext::ceil
EIGEN_DEVICE_FUNC T() ceil(const T &x)
Definition: Eigen/src/Core/MathFunctions.h:1422
Eigen::internal::default_packet_traits::HasMul
@ HasMul
Definition: GenericPacketMath.h:50
Eigen::internal::bytewise_bitwise_helper::unary
static EIGEN_DEVICE_FUNC T unary(const T &a, Op op)
Definition: GenericPacketMath.h:371
Eigen::internal::default_packet_traits::HasLog1p
@ HasLog1p
Definition: GenericPacketMath.h:71
Eigen::internal::pminmax_impl
Definition: GenericPacketMath.h:464
Eigen::internal::ptrue_impl::run
static EIGEN_DEVICE_FUNC Packet run(const Packet &)
Definition: GenericPacketMath.h:249
Eigen::internal::pceil
EIGEN_DECLARE_FUNCTION_ALLOWING_MULTIPLE_DEFINITIONS Packet pceil(const Packet &a)
Definition: GenericPacketMath.h:839
Eigen::internal::Selector
Definition: GenericPacketMath.h:1027
Eigen::internal::packet_traits
Definition: GenericPacketMath.h:106
Eigen::internal::parithmetic_shift_right
EIGEN_STRONG_INLINE Packet4i parithmetic_shift_right(const Packet4i &a)
Definition: AltiVec/PacketMath.h:1187
Eigen::internal::pround
EIGEN_DECLARE_FUNCTION_ALLOWING_MULTIPLE_DEFINITIONS Packet pround(const Packet &a)
Definition: GenericPacketMath.h:826
EIGEN_CONSTEXPR
#define EIGEN_CONSTEXPR
Definition: Macros.h:787
Eigen::internal::preverse
EIGEN_STRONG_INLINE Packet2cf preverse(const Packet2cf &a)
Definition: AltiVec/Complex.h:184
Eigen::internal::default_packet_traits::HasIGammaDerA
@ HasIGammaDerA
Definition: GenericPacketMath.h:93
Eigen::internal::packet_traits::type
T type
Definition: GenericPacketMath.h:108
Eigen::internal::predux_mul
EIGEN_DEVICE_FUNC unpacket_traits< Packet >::type predux_mul(const Packet &a)
Definition: GenericPacketMath.h:882
Eigen::internal::PacketBlock::packet
Packet packet[N]
Definition: GenericPacketMath.h:1018
real
float real
Definition: datatypes.h:10
Eigen::internal::packet_traits::HasMin
@ HasMin
Definition: GenericPacketMath.h:123
Eigen::internal::default_packet_traits::HasPow
@ HasPow
Definition: GenericPacketMath.h:73
type
Definition: pytypes.h:1525
Eigen::internal::default_packet_traits::HasAdd
@ HasAdd
Definition: GenericPacketMath.h:47
T
Eigen::Triplet< double > T
Definition: Tutorial_sparse_example.cpp:6
Eigen::internal::Selector::select
bool select[N]
Definition: GenericPacketMath.h:1031
Eigen::internal::bytewise_bitwise_helper
Definition: GenericPacketMath.h:355
Eigen::internal::pdiv
EIGEN_DEVICE_FUNC Packet pdiv(const Packet &a, const Packet &b)
Definition: GenericPacketMath.h:244
log
const EIGEN_DEVICE_FUNC LogReturnType log() const
Definition: ArrayCwiseUnaryOps.h:128
Eigen::internal::pconj
EIGEN_STRONG_INLINE Packet2cf pconj(const Packet2cf &a)
Definition: AltiVec/Complex.h:167
Eigen::internal::ploadquad
EIGEN_STRONG_INLINE Packet16h ploadquad(const Eigen::half *from)
Definition: AVX512/PacketMath.h:1420
Eigen::internal::default_packet_traits::HasConj
@ HasConj
Definition: GenericPacketMath.h:58
Eigen::internal::default_packet_traits::HasACos
@ HasACos
Definition: GenericPacketMath.h:79
Eigen::internal::default_packet_traits::HasPolygamma
@ HasPolygamma
Definition: GenericPacketMath.h:87
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::pset1frombits
EIGEN_DEVICE_FUNC Packet pset1frombits(BitsType a)
Eigen::internal::unpacket_traits::vectorizable
@ vectorizable
Definition: GenericPacketMath.h:140
Eigen::internal::default_packet_traits::HasBlend
@ HasBlend
Definition: GenericPacketMath.h:60
Eigen::internal::default_packet_traits::HasCos
@ HasCos
Definition: GenericPacketMath.h:76
Eigen::internal::default_packet_traits
Definition: GenericPacketMath.h:42
result
Values result
Definition: OdometryOptimize.cpp:8
Eigen::internal::pcast
EIGEN_DEVICE_FUNC TgtPacket pcast(const SrcPacket &a)
Definition: GenericPacketMath.h:188
Eigen::internal::default_packet_traits::HasDiGamma
@ HasDiGamma
Definition: GenericPacketMath.h:85
ceres::acos
Jet< T, N > acos(const Jet< T, N > &f)
Definition: jet.h:432
Eigen::internal::default_packet_traits::HasTan
@ HasTan
Definition: GenericPacketMath.h:77
Eigen::internal::default_packet_traits::HasZeta
@ HasZeta
Definition: GenericPacketMath.h:86
Eigen::internal::bytewise_bitwise_helper::bitwise_and
static EIGEN_DEVICE_FUNC T bitwise_and(const T &a, const T &b)
Definition: GenericPacketMath.h:356
ceres::cos
Jet< T, N > cos(const Jet< T, N > &f)
Definition: jet.h:426
Eigen::internal::bitwise_helper
Definition: GenericPacketMath.h:396
Eigen::internal::pxor
EIGEN_STRONG_INLINE Packet8h pxor(const Packet8h &a, const Packet8h &b)
Definition: AVX/PacketMath.h:1047
Eigen::internal::packet_traits::HasHalfPacket
@ HasHalfPacket
Definition: GenericPacketMath.h:114
size
Scalar Scalar int size
Definition: benchVecAdd.cpp:17
Eigen::internal::unpacket_traits::masked_store_available
@ masked_store_available
Definition: GenericPacketMath.h:142
cosh
const EIGEN_DEVICE_FUNC CoshReturnType cosh() const
Definition: ArrayCwiseUnaryOps.h:353
Eigen::internal::pzero_impl< T, typename internal::enable_if< is_scalar< T >::value >::type >::run
static EIGEN_DEVICE_FUNC T run(const T &)
Definition: GenericPacketMath.h:289
n
int n
Definition: BiCGSTAB_simple.cpp:1
align_3::a1
Point2 a1
Definition: testPose2.cpp:769
Eigen::internal::pgather
EIGEN_DEVICE_FUNC Packet pgather(const Scalar *from, Index)
Definition: GenericPacketMath.h:712
Eigen::internal::default_packet_traits::HasSinh
@ HasSinh
Definition: GenericPacketMath.h:81
Eigen::internal::default_packet_traits::HasMin
@ HasMin
Definition: GenericPacketMath.h:56
align_3::a3
Point2 a3
Definition: testPose2.cpp:771
Eigen::internal::pstoret
EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE void pstoret(Eigen::TensorSycl::internal::RangeAccess< cl::sycl::access::mode::read_write, typename unpacket_traits< packet_type >::type > to, const packet_type &from)
Definition: SYCL/PacketMath.h:669
Eigen::internal::unpacket_traits::size
@ size
Definition: GenericPacketMath.h:138
Eigen::internal::plogical_shift_left
EIGEN_STRONG_INLINE Packet4i plogical_shift_left(const Packet4i &a)
Definition: AltiVec/PacketMath.h:1191
expm1
double expm1(double x)
Definition: unity.c:106
Eigen::internal::unpacket_traits::alignment
@ alignment
Definition: GenericPacketMath.h:139
Eigen::PropagateNaN
@ PropagateNaN
Definition: Constants.h:343
Eigen::internal::pcos
EIGEN_DECLARE_FUNCTION_ALLOWING_MULTIPLE_DEFINITIONS Packet pcos(const Packet &a)
Definition: GenericPacketMath.h:756
Eigen::internal::unpacket_traits::half
T half
Definition: GenericPacketMath.h:135
Eigen::internal::default_packet_traits::HasGammaSampleDerAlpha
@ HasGammaSampleDerAlpha
Definition: GenericPacketMath.h:94
Eigen::internal::pfrexp
EIGEN_STRONG_INLINE Packet8h pfrexp(const Packet8h &a, Packet8h &exponent)
Definition: Eigen/src/Core/arch/AVX/MathFunctions.h:188
Eigen::Architecture::Target
@ Target
Definition: Constants.h:492
Eigen::internal::packet_traits::HasConj
@ HasConj
Definition: GenericPacketMath.h:125
Eigen::internal::default_packet_traits::HasSin
@ HasSin
Definition: GenericPacketMath.h:75
Eigen::internal::pabsdiff
EIGEN_DEVICE_FUNC Packet pabsdiff(const Packet &a, const Packet &b)
Definition: GenericPacketMath.h:595
Eigen::internal::packet_traits::AlignedOnScalar
@ AlignedOnScalar
Definition: GenericPacketMath.h:113
Eigen::internal::default_packet_traits::HasNdtri
@ HasNdtri
Definition: GenericPacketMath.h:90
Eigen::internal::bit_not
Definition: GenericPacketMath.h:338
Eigen::internal::packet_traits::half
T half
Definition: GenericPacketMath.h:109
Eigen::internal::pstore1
void pstore1(typename unpacket_traits< Packet >::type *to, const typename unpacket_traits< Packet >::type &a)
Definition: GenericPacketMath.h:949
Eigen::internal::pnegate
EIGEN_STRONG_INLINE Packet2cf pnegate(const Packet2cf &a)
Definition: AltiVec/Complex.h:166
Eigen::internal::default_packet_traits::HasBessel
@ HasBessel
Definition: GenericPacketMath.h:91
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::unpacket_traits
Definition: GenericPacketMath.h:132
Eigen::internal::ptranspose
EIGEN_STRONG_INLINE void ptranspose(PacketBlock< Packet2cf, 2 > &kernel)
Definition: AltiVec/Complex.h:224
Eigen::internal::default_packet_traits::HasAbs2
@ HasAbs2
Definition: GenericPacketMath.h:54
Eigen::internal::pselect
EIGEN_STRONG_INLINE Packet4f pselect(const Packet4f &mask, const Packet4f &a, const Packet4f &b)
Definition: AltiVec/PacketMath.h:917
Eigen::internal::bytewise_bitwise_helper::binary
static EIGEN_DEVICE_FUNC T binary(const T &a, const T &b, Op op)
Definition: GenericPacketMath.h:382
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_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::pmax
EIGEN_DEVICE_FUNC Packet pmax(const Packet &a, const Packet &b)
Definition: GenericPacketMath.h:524
Eigen::internal::default_packet_traits::HasMax
@ HasMax
Definition: GenericPacketMath.h:57
Eigen::internal::default_packet_traits::HasErf
@ HasErf
Definition: GenericPacketMath.h:88
EIGEN_BINARY_OP_NAN_PROPAGATION
#define EIGEN_BINARY_OP_NAN_PROPAGATION(Type, Func)
Definition: GenericPacketMath.h:502
Eigen::internal::pblend
EIGEN_STRONG_INLINE Packet4i pblend(const Selector< 4 > &ifPacket, const Packet4i &thenPacket, const Packet4i &elsePacket)
Definition: AltiVec/PacketMath.h:2107
Eigen::internal::pscatter
EIGEN_DEVICE_FUNC void pscatter(Scalar *to, const Packet &from, Index)
Definition: GenericPacketMath.h:715
Eigen::internal::bit_and
Definition: GenericPacketMath.h:317
Eigen::internal::pcmp_lt_or_nan
EIGEN_STRONG_INLINE Packet4f pcmp_lt_or_nan(const Packet4f &a, const Packet4f &b)
Definition: AltiVec/PacketMath.h:870
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
Eigen::internal::default_packet_traits::HasSqrt
@ HasSqrt
Definition: GenericPacketMath.h:66
Eigen::internal::default_packet_traits::HasCosh
@ HasCosh
Definition: GenericPacketMath.h:82
Eigen::internal::pand
EIGEN_STRONG_INLINE Packet8h pand(const Packet8h &a, const Packet8h &b)
Definition: AVX/PacketMath.h:1050
imag
const EIGEN_DEVICE_FUNC ImagReturnType imag() const
Definition: CommonCwiseUnaryOps.h:109
Eigen::internal::Packet
Definition: ZVector/PacketMath.h:47
Eigen::internal::default_packet_traits::HasAbs
@ HasAbs
Definition: GenericPacketMath.h:52
Eigen::internal::psub
EIGEN_DEVICE_FUNC Packet psub(const Packet &a, const Packet &b)
Definition: GenericPacketMath.h:222
EIGEN_ALWAYS_INLINE
#define EIGEN_ALWAYS_INLINE
Definition: Macros.h:932
Eigen::internal::operator_bitwise_helper::bitwise_and
static EIGEN_DEVICE_FUNC T bitwise_and(const T &a, const T &b)
Definition: GenericPacketMath.h:347
Eigen::Triplet< double >
Eigen::internal::default_packet_traits::HasAbsDiff
@ HasAbsDiff
Definition: GenericPacketMath.h:55
Eigen::internal::bit_xor
Definition: GenericPacketMath.h:331
arg
EIGEN_DEVICE_FUNC const EIGEN_STRONG_INLINE ArgReturnType arg() const
Definition: ArrayCwiseUnaryOps.h:66
tan
const EIGEN_DEVICE_FUNC TanReturnType tan() const
Definition: ArrayCwiseUnaryOps.h:269
Eigen::internal::default_packet_traits::HasCeil
@ HasCeil
Definition: GenericPacketMath.h:101
Eigen::internal::pbroadcast4
EIGEN_DEVICE_FUNC void pbroadcast4(const typename unpacket_traits< Packet >::type *a, Packet &a0, Packet &a1, Packet &a2, Packet &a3)
Definition: GenericPacketMath.h:653
conj
AnnoyingScalar conj(const AnnoyingScalar &x)
Definition: AnnoyingScalar.h:104
Eigen::internal::default_packet_traits::HasFloor
@ HasFloor
Definition: GenericPacketMath.h:100
Eigen::internal::ploaddup
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Packet ploaddup(const typename unpacket_traits< Packet >::type *from)
Definition: GenericPacketMath.h:631
Eigen::internal::pexp
EIGEN_DECLARE_FUNCTION_ALLOWING_MULTIPLE_DEFINITIONS Packet pexp(const Packet &a)
Definition: GenericPacketMath.h:788
Eigen::internal::pstore
EIGEN_DEVICE_FUNC void pstore(Scalar *to, const Packet &from)
Definition: GenericPacketMath.h:696
Eigen::internal::pnot
EIGEN_DEVICE_FUNC Packet pnot(const Packet &a)
Definition: GenericPacketMath.h:425
Eigen::internal::ploadt_ro
EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE packet_type ploadt_ro(const Eigen::TensorSycl::internal::RangeAccess< cl::sycl::access::mode::read_write, T > &from)
Definition: SYCL/PacketMath.h:65
Eigen::internal::bit_or::operator()
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR EIGEN_ALWAYS_INLINE T operator()(const T &a, const T &b) const
Definition: GenericPacketMath.h:325
Eigen::internal::default_packet_traits::HasTanh
@ HasTanh
Definition: GenericPacketMath.h:83
Eigen::internal::type_casting_traits::SrcCoeffRatio
@ SrcCoeffRatio
Definition: GenericPacketMath.h:151
Eigen::internal::unpacket_traits::masked_load_available
@ masked_load_available
Definition: GenericPacketMath.h:141
Eigen::internal::predux_helper
EIGEN_DEVICE_FUNC unpacket_traits< Packet >::type predux_helper(const Packet &a, Op op)
Definition: GenericPacketMath.h:859
Eigen::internal::predux_any
EIGEN_STRONG_INLINE bool predux_any(const Packet4f &x)
Definition: AltiVec/PacketMath.h:1765
Eigen::internal::pzero
EIGEN_STRONG_INLINE Packet8f pzero(const Packet8f &)
Definition: AVX/PacketMath.h:247
Eigen::internal::psin
EIGEN_DECLARE_FUNCTION_ALLOWING_MULTIPLE_DEFINITIONS Packet psin(const Packet &a)
Definition: GenericPacketMath.h:752
Eigen::numext::not_equal_strict
EIGEN_STRONG_INLINE EIGEN_DEVICE_FUNC bool not_equal_strict(const X &x, const Y &y)
Definition: Meta.h:798
Eigen::internal::parg
EIGEN_DEVICE_FUNC Packet parg(const Packet &a)
Definition: GenericPacketMath.h:551
Eigen::internal::eigen_packet_wrapper::m_val
T m_val
Definition: GenericPacketMath.h:170
Eigen::internal::prefetch
EIGEN_DEVICE_FUNC void prefetch(const Scalar *addr)
Definition: GenericPacketMath.h:719
Eigen::internal::default_packet_traits::HasShift
@ HasShift
Definition: GenericPacketMath.h:49
a
ArrayXXi a
Definition: Array_initializer_list_23_cxx11.cpp:1
Eigen::internal::pbroadcast2
EIGEN_DEVICE_FUNC void pbroadcast2(const typename unpacket_traits< Packet >::type *a, Packet &a0, Packet &a1)
Definition: GenericPacketMath.h:670
Eigen::internal::packet_traits::HasAbs2
@ HasAbs2
Definition: GenericPacketMath.h:122
Eigen::internal::default_packet_traits::HasExp
@ HasExp
Definition: GenericPacketMath.h:68
tanh
const EIGEN_DEVICE_FUNC TanhReturnType tanh() const
Definition: ArrayCwiseUnaryOps.h:325
Eigen::internal::default_packet_traits::HasHalfPacket
@ HasHalfPacket
Definition: GenericPacketMath.h:45
Eigen::internal::predux
EIGEN_DEVICE_FUNC unpacket_traits< Packet >::type predux(const Packet &a)
Definition: GenericPacketMath.h:875
Eigen::internal::pminmax_impl< PropagateNaN >::run
static EIGEN_DEVICE_FUNC Packet run(const Packet &a, const Packet &b, Op op)
Definition: GenericPacketMath.h:476
Eigen::internal::pmul
EIGEN_DEVICE_FUNC Packet pmul(const Packet &a, const Packet &b)
Definition: GenericPacketMath.h:237
Eigen::internal::bytewise_bitwise_helper::bitwise_not
static EIGEN_DEVICE_FUNC T bitwise_not(const T &a)
Definition: GenericPacketMath.h:365
Eigen::internal::unpacket_traits::type
T type
Definition: GenericPacketMath.h:134
Eigen::internal::default_packet_traits::HasRsqrt
@ HasRsqrt
Definition: GenericPacketMath.h:67
Eigen::internal::default_packet_traits::HasIGamma
@ HasIGamma
Definition: GenericPacketMath.h:92
align_3::a2
Point2 a2
Definition: testPose2.cpp:770
Eigen::internal::default_packet_traits::HasExpm1
@ HasExpm1
Definition: GenericPacketMath.h:69
Eigen::internal::type_casting_traits
Definition: GenericPacketMath.h:148
Eigen::numext::floor
EIGEN_DEVICE_FUNC T() floor(const T &x)
Definition: Eigen/src/Core/MathFunctions.h:1402
Eigen::internal::plogical_shift_right
EIGEN_STRONG_INLINE Packet4i plogical_shift_right(const Packet4i &a)
Definition: AltiVec/PacketMath.h:1189
Eigen::internal::is_scalar
Definition: GenericPacketMath.h:178
Eigen::internal::pmadd
EIGEN_STRONG_INLINE Packet4f pmadd(const Packet4f &a, const Packet4f &b, const Packet4f &c)
Definition: AltiVec/PacketMath.h:827
Eigen::internal::pzero_impl::run
static EIGEN_DEVICE_FUNC Packet run(const Packet &)
Definition: GenericPacketMath.h:277
Eigen::internal::plog
EIGEN_DECLARE_FUNCTION_ALLOWING_MULTIPLE_DEFINITIONS Packet plog(const Packet &a)
Definition: GenericPacketMath.h:796
Eigen::internal::type_casting_traits::TgtCoeffRatio
@ TgtCoeffRatio
Definition: GenericPacketMath.h:152
Eigen::internal::pminmax_impl< PropagateNumbers >::run
static EIGEN_DEVICE_FUNC Packet run(const Packet &a, const Packet &b, Op op)
Definition: GenericPacketMath.h:491
Eigen::internal::pselect_impl< Packet, typename internal::enable_if< is_scalar< Packet >::value >::type >::run
static EIGEN_DEVICE_FUNC Packet run(const Packet &mask, const Packet &a, const Packet &b)
Definition: GenericPacketMath.h:445
Eigen::internal::ptrue_impl< T, typename internal::enable_if< is_scalar< T >::value &&NumTraits< T >::RequireInitialization >::type >::run
static EIGEN_DEVICE_FUNC T run(const T &)
Definition: GenericPacketMath.h:263
Eigen::internal::packet_traits::HasAdd
@ HasAdd
Definition: GenericPacketMath.h:117
Eigen::internal::pabs
EIGEN_STRONG_INLINE Packet4f pabs(const Packet4f &a)
Definition: AltiVec/PacketMath.h:1176
v
Array< int, Dynamic, 1 > v
Definition: Array_initializer_list_vector_cxx11.cpp:1
Eigen::internal::pselect_impl::run
static EIGEN_DEVICE_FUNC Packet run(const Packet &mask, const Packet &a, const Packet &b)
Definition: GenericPacketMath.h:436
Eigen::internal::default_packet_traits::HasRint
@ HasRint
Definition: GenericPacketMath.h:99
Eigen::internal::pcplxflip
EIGEN_STRONG_INLINE Packet1cd pcplxflip(const Packet1cd &x)
Definition: MSA/Complex.h:620
Eigen::internal::pload1
EIGEN_DEVICE_FUNC Packet pload1(const typename unpacket_traits< Packet >::type *a)
Definition: GenericPacketMath.h:623
Eigen::internal::bytewise_bitwise_helper::bitwise_xor
static EIGEN_DEVICE_FUNC T bitwise_xor(const T &a, const T &b)
Definition: GenericPacketMath.h:362
Eigen::internal::packet_traits::HasMax
@ HasMax
Definition: GenericPacketMath.h:124
Eigen::internal::padd
EIGEN_DEVICE_FUNC Packet padd(const Packet &a, const Packet &b)
Definition: GenericPacketMath.h:215
Eigen::internal::bit_or
Definition: GenericPacketMath.h:324
Eigen::internal::pmin
EIGEN_DEVICE_FUNC Packet pmin(const Packet &a, const Packet &b)
Definition: GenericPacketMath.h:512
Eigen::internal::default_packet_traits::HasATan
@ HasATan
Definition: GenericPacketMath.h:80
Eigen::internal::plset
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Packet plset(const typename unpacket_traits< Packet >::type &a)
Definition: GenericPacketMath.h:679
Eigen::internal::operator_bitwise_helper
Definition: GenericPacketMath.h:346
ceil
const EIGEN_DEVICE_FUNC CeilReturnType ceil() const
Definition: ArrayCwiseUnaryOps.h:495
Eigen::internal::bytewise_bitwise_helper::bitwise_or
static EIGEN_DEVICE_FUNC T bitwise_or(const T &a, const T &b)
Definition: GenericPacketMath.h:359
Eigen::internal::packet_traits::HasNegate
@ HasNegate
Definition: GenericPacketMath.h:120
Eigen::internal::is_same
Definition: Meta.h:148
Eigen::internal::por
EIGEN_STRONG_INLINE Packet8h por(const Packet8h &a, const Packet8h &b)
Definition: AVX/PacketMath.h:1042
Eigen::internal::default_packet_traits::HasErfc
@ HasErfc
Definition: GenericPacketMath.h:89
Eigen::internal::default_packet_traits::HasDiv
@ HasDiv
Definition: GenericPacketMath.h:65
Eigen::internal::bit_not::operator()
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR EIGEN_ALWAYS_INLINE T operator()(const T &a) const
Definition: GenericPacketMath.h:339
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::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
Eigen::internal::bit_xor::operator()
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR EIGEN_ALWAYS_INLINE T operator()(const T &a, const T &b) const
Definition: GenericPacketMath.h:332
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::internal::eigen_packet_wrapper::operator=
EIGEN_ALWAYS_INLINE eigen_packet_wrapper & operator=(const T &v)
Definition: GenericPacketMath.h:165
Eigen::internal::prsqrt
EIGEN_STRONG_INLINE Packet4f prsqrt(const Packet4f &a)
Definition: MSA/PacketMath.h:730
Eigen::internal::enable_if
Definition: Meta.h:273
Eigen::internal::pset1
EIGEN_DEVICE_FUNC Packet pset1(const typename unpacket_traits< Packet >::type &a)
Definition: GenericPacketMath.h:615
Eigen::internal::default_packet_traits::HasSub
@ HasSub
Definition: GenericPacketMath.h:48
Eigen::internal::pselect< bool >
EIGEN_DEVICE_FUNC bool pselect< bool >(const bool &cond, const bool &a, const bool &b)
Definition: GenericPacketMath.h:456
sinh
const EIGEN_DEVICE_FUNC SinhReturnType sinh() const
Definition: ArrayCwiseUnaryOps.h:339
Eigen::internal::type_casting_traits::VectorizedCast
@ VectorizedCast
Definition: GenericPacketMath.h:150
Eigen::internal::default_packet_traits::HasCmp
@ HasCmp
Definition: GenericPacketMath.h:63
Eigen::internal::pandnot
EIGEN_STRONG_INLINE Packet8h pandnot(const Packet8h &a, const Packet8h &b)
Definition: AVX/PacketMath.h:1053
Eigen::internal::operator_bitwise_helper::bitwise_xor
static EIGEN_DEVICE_FUNC T bitwise_xor(const T &a, const T &b)
Definition: GenericPacketMath.h:349
Eigen::internal::default_packet_traits::HasArg
@ HasArg
Definition: GenericPacketMath.h:53
Eigen::internal::preinterpret
EIGEN_DEVICE_FUNC Target preinterpret(const Packet &a)
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::default_packet_traits::HasSetLinear
@ HasSetLinear
Definition: GenericPacketMath.h:59
Eigen::internal::predux_min
EIGEN_DEVICE_FUNC unpacket_traits< Packet >::type predux_min(const Packet &a)
Definition: GenericPacketMath.h:890
Eigen::internal::pcosh
EIGEN_DECLARE_FUNCTION_ALLOWING_MULTIPLE_DEFINITIONS Packet pcosh(const Packet &a)
Definition: GenericPacketMath.h:780
Eigen::internal::packet_traits::HasMul
@ HasMul
Definition: GenericPacketMath.h:119
Eigen::internal::pcmp_le
EIGEN_STRONG_INLINE Packet4f pcmp_le(const Packet4f &a, const Packet4f &b)
Definition: AltiVec/PacketMath.h:867
Eigen::internal::patan
EIGEN_DECLARE_FUNCTION_ALLOWING_MULTIPLE_DEFINITIONS Packet patan(const Packet &a)
Definition: GenericPacketMath.h:772
Eigen::internal::packet_traits::Vectorizable
@ Vectorizable
Definition: GenericPacketMath.h:111
Eigen::internal::ploadu
EIGEN_DEVICE_FUNC Packet ploadu(const typename unpacket_traits< Packet >::type *from)
Definition: GenericPacketMath.h:603
Eigen::internal::pacos
EIGEN_DECLARE_FUNCTION_ALLOWING_MULTIPLE_DEFINITIONS Packet pacos(const Packet &a)
Definition: GenericPacketMath.h:768
i
int i
Definition: BiCGSTAB_step_by_step.cpp:9
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::pload
EIGEN_DEVICE_FUNC Packet pload(const typename unpacket_traits< Packet >::type *from)
Definition: GenericPacketMath.h:599
Eigen::internal::pfloor
EIGEN_DECLARE_FUNCTION_ALLOWING_MULTIPLE_DEFINITIONS Packet pfloor(const Packet &a)
Definition: GenericPacketMath.h:830
Eigen::internal::ptan
EIGEN_DECLARE_FUNCTION_ALLOWING_MULTIPLE_DEFINITIONS Packet ptan(const Packet &a)
Definition: GenericPacketMath.h:760
Eigen::internal::plog10
EIGEN_DECLARE_FUNCTION_ALLOWING_MULTIPLE_DEFINITIONS Packet plog10(const Packet &a)
Definition: GenericPacketMath.h:804
Eigen::internal::ptrue
EIGEN_STRONG_INLINE Packet8h ptrue(const Packet8h &a)
Definition: AVX/PacketMath.h:978
log10
const EIGEN_DEVICE_FUNC Log10ReturnType log10() const
Definition: ArrayCwiseUnaryOps.h:158
floor
const EIGEN_DEVICE_FUNC FloorReturnType floor() const
Definition: ArrayCwiseUnaryOps.h:481
Eigen::internal::ploadt
EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE packet_type ploadt(const Eigen::TensorSycl::internal::RangeAccess< cl::sycl::access::mode::read_write, typename unpacket_traits< packet_type >::type > &from)
Definition: SYCL/PacketMath.h:129
Eigen::PropagateNumbers
@ PropagateNumbers
Definition: Constants.h:345
Eigen::internal::predux_max
EIGEN_DEVICE_FUNC unpacket_traits< Packet >::type predux_max(const Packet &a)
Definition: GenericPacketMath.h:905
Scalar
SCALAR Scalar
Definition: bench_gemm.cpp:46
Eigen::internal::packet_traits::HasSetLinear
@ HasSetLinear
Definition: GenericPacketMath.h:126
Eigen::Index
EIGEN_DEFAULT_DENSE_INDEX_TYPE Index
The Index type as used for the API.
Definition: Meta.h:74
Eigen::internal::default_packet_traits::HasLGamma
@ HasLGamma
Definition: GenericPacketMath.h:84
Eigen::internal::bit_and::operator()
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR EIGEN_ALWAYS_INLINE T operator()(const T &a, const T &b) const
Definition: GenericPacketMath.h:318
Eigen::internal::default_packet_traits::HasRound
@ HasRound
Definition: GenericPacketMath.h:98
Eigen::internal::operator_bitwise_helper::bitwise_or
static EIGEN_DEVICE_FUNC T bitwise_or(const T &a, const T &b)
Definition: GenericPacketMath.h:348


gtsam
Author(s):
autogenerated on Thu Dec 19 2024 04:01:10