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, const PACKET_CPLX& y, const PACKET_CPLX& c) const { \
18 return padd(c, this->pmul(x, y)); \
20 EIGEN_STRONG_INLINE PACKET_CPLX pmul(const PACKET_REAL& x, const PACKET_CPLX& y) const { \
21 return PACKET_CPLX(Eigen::internal::pmul<PACKET_REAL>(x, y.v)); \
26 struct conj_helper<PACKET_CPLX, PACKET_REAL, false, false> { \
27 EIGEN_STRONG_INLINE PACKET_CPLX pmadd(const PACKET_CPLX& x, const PACKET_REAL& y, const PACKET_CPLX& c) const { \
28 return padd(c, this->pmul(x, y)); \
30 EIGEN_STRONG_INLINE PACKET_CPLX pmul(const PACKET_CPLX& x, const PACKET_REAL& y) const { \
31 return PACKET_CPLX(Eigen::internal::pmul<PACKET_REAL>(x.v, y)); \
36#include "../../InternalHeaderCheck.h"
41template <
bool Conjugate>
47 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE T operator()(
const T& x)
const {
48 return numext::conj(x);
51 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE T pconj(
const T& x)
const {
52 return internal::pconj(x);
57struct conj_if<false> {
59 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
const T& operator()(
const T& x)
const {
63 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
const T& pconj(
const T& x)
const {
70template <
typename LhsType,
typename RhsType,
bool ConjLhs,
bool ConjRhs>
72 typedef typename ScalarBinaryOpTraits<LhsType, RhsType>::ReturnType ResultType;
74 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE ResultType pmadd(
const LhsType& x,
const RhsType& y,
75 const ResultType& c)
const {
76 return this->pmul(x, y) + c;
79 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE ResultType pmul(
const LhsType& x,
const RhsType& y)
const {
80 return conj_if<ConjLhs>()(x) * conj_if<ConjRhs>()(y);
84template <
typename LhsScalar,
typename RhsScalar>
85struct conj_helper<LhsScalar, RhsScalar, true, true> {
86 typedef typename ScalarBinaryOpTraits<LhsScalar, RhsScalar>::ReturnType ResultType;
88 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE ResultType pmadd(
const LhsScalar& x,
const RhsScalar& y,
89 const ResultType& c)
const {
90 return this->pmul(x, y) + c;
94 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE ResultType pmul(
const LhsScalar& x,
const RhsScalar& y)
const {
95 return numext::conj(x * y);
100template <
typename Packet,
bool ConjLhs,
bool ConjRhs>
101struct conj_helper<Packet, Packet, ConjLhs, ConjRhs> {
102 typedef Packet ResultType;
103 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Packet pmadd(
const Packet& x,
const Packet& y,
const Packet& c)
const {
104 return Eigen::internal::pmadd(conj_if<ConjLhs>().pconj(x), conj_if<ConjRhs>().pconj(y), c);
107 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Packet pmul(
const Packet& x,
const Packet& y)
const {
108 return Eigen::internal::pmul(conj_if<ConjLhs>().pconj(x), conj_if<ConjRhs>().pconj(y));
112template <
typename Packet>
113struct conj_helper<Packet, Packet, true, true> {
114 typedef Packet ResultType;
116 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Packet pmadd(
const Packet& x,
const Packet& y,
const Packet& c)
const {
117 return Eigen::internal::pmadd(pconj(x), pconj(y), c);
120 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Packet pmul(
const Packet& x,
const Packet& y)
const {
121 return pconj(Eigen::internal::pmul(x, y));
Namespace containing all symbols from the Eigen library.
Definition Core:137