11#ifndef EIGEN_ARCH_CONJ_HELPER_H
12#define EIGEN_ARCH_CONJ_HELPER_H
14#define EIGEN_MAKE_CONJ_HELPER_CPLX_REAL(PACKET_CPLX, PACKET_REAL) \
16 struct conj_helper<PACKET_REAL, PACKET_CPLX, false, false> { \
17 EIGEN_STRONG_INLINE PACKET_CPLX pmadd(const PACKET_REAL& x, \
18 const PACKET_CPLX& y, \
19 const PACKET_CPLX& c) const { \
20 return padd(c, this->pmul(x, y)); \
22 EIGEN_STRONG_INLINE PACKET_CPLX pmul(const PACKET_REAL& x, \
23 const PACKET_CPLX& y) const { \
24 return PACKET_CPLX(Eigen::internal::pmul<PACKET_REAL>(x, y.v)); \
29 struct conj_helper<PACKET_CPLX, PACKET_REAL, false, false> { \
30 EIGEN_STRONG_INLINE PACKET_CPLX pmadd(const PACKET_CPLX& x, \
31 const PACKET_REAL& y, \
32 const PACKET_CPLX& c) const { \
33 return padd(c, this->pmul(x, y)); \
35 EIGEN_STRONG_INLINE PACKET_CPLX pmul(const PACKET_CPLX& x, \
36 const PACKET_REAL& y) const { \
37 return PACKET_CPLX(Eigen::internal::pmul<PACKET_REAL>(x.v, y)); \
44template<
bool Conjugate>
struct conj_if;
46template<>
struct conj_if<true> {
48 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE T operator()(
const T& x)
const {
return numext::conj(x); }
50 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE T pconj(
const T& x)
const {
return internal::pconj(x); }
53template<>
struct conj_if<false> {
55 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
const T& operator()(
const T& x)
const {
return x; }
57 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
const T& pconj(
const T& x)
const {
return x; }
62template<
typename LhsType,
typename RhsType,
bool ConjLhs,
bool ConjRhs>
64 typedef typename ScalarBinaryOpTraits<LhsType, RhsType>::ReturnType ResultType;
66 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE ResultType
67 pmadd(
const LhsType& x,
const RhsType& y,
const ResultType& c)
const
68 {
return this->pmul(x, y) + c; }
70 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE ResultType
71 pmul(
const LhsType& x,
const RhsType& y)
const
72 {
return conj_if<ConjLhs>()(x) * conj_if<ConjRhs>()(y); }
75template<
typename LhsScalar,
typename RhsScalar>
76struct conj_helper<LhsScalar, RhsScalar, true, true> {
77 typedef typename ScalarBinaryOpTraits<LhsScalar,RhsScalar>::ReturnType ResultType;
79 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE ResultType
80 pmadd(
const LhsScalar& x,
const RhsScalar& y,
const ResultType& c)
const
81 {
return this->pmul(x, y) + c; }
84 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE ResultType
85 pmul(
const LhsScalar& x,
const RhsScalar& y)
const
86 {
return numext::conj(x * y); }
90template<
typename Packet,
bool ConjLhs,
bool ConjRhs>
91struct conj_helper<Packet, Packet, ConjLhs, ConjRhs>
93 typedef Packet ResultType;
94 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Packet pmadd(
const Packet& x,
const Packet& y,
const Packet& c)
const
95 {
return Eigen::internal::pmadd(conj_if<ConjLhs>().pconj(x), conj_if<ConjRhs>().pconj(y), c); }
98 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Packet pmul(
const Packet& x,
const Packet& y)
const
99 {
return Eigen::internal::pmul(conj_if<ConjLhs>().pconj(x), conj_if<ConjRhs>().pconj(y)); }
102template<
typename Packet>
103struct conj_helper<Packet, Packet, true, true>
105 typedef Packet ResultType;
107 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Packet pmadd(
const Packet& x,
const Packet& y,
const Packet& c)
const
108 {
return Eigen::internal::pmadd(pconj(x), pconj(y), c); }
110 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Packet pmul(
const Packet& x,
const Packet& y)
const
111 {
return pconj(Eigen::internal::pmul(x, y)); }
Namespace containing all symbols from the Eigen library.
Definition: Core:141