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 pmsub(const PACKET_REAL& x, const PACKET_CPLX& y, const PACKET_CPLX& c) const { \
21 return psub(this->pmul(x, y), c); \
23 EIGEN_STRONG_INLINE PACKET_CPLX pmul(const PACKET_REAL& x, 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, const PACKET_REAL& y, const PACKET_CPLX& c) const { \
31 return padd(c, this->pmul(x, y)); \
33 EIGEN_STRONG_INLINE PACKET_CPLX pmsub(const PACKET_CPLX& x, const PACKET_REAL& y, const PACKET_CPLX& c) const { \
34 return psub(this->pmul(x, y), c); \
36 EIGEN_STRONG_INLINE PACKET_CPLX pmul(const PACKET_CPLX& x, const PACKET_REAL& y) const { \
37 return PACKET_CPLX(Eigen::internal::pmul<PACKET_REAL>(x.v, y)); \
42#include "../../InternalHeaderCheck.h"
47template <
bool Conjugate>
53 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE T operator()(
const T& x)
const {
54 return numext::conj(x);
57 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE T pconj(
const T& x)
const {
58 return internal::pconj(x);
63struct conj_if<false> {
65 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
const T& operator()(
const T& x)
const {
69 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
const T& pconj(
const T& x)
const {
76template <
typename LhsType,
typename RhsType,
bool ConjLhs,
bool ConjRhs>
78 typedef typename ScalarBinaryOpTraits<LhsType, RhsType>::ReturnType ResultType;
80 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE ResultType pmadd(
const LhsType& x,
const RhsType& y,
81 const ResultType& c)
const {
82 return this->pmul(x, y) + c;
85 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE ResultType pmsub(
const LhsType& x,
const RhsType& y,
86 const ResultType& c)
const {
87 return this->pmul(x, y) - c;
90 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE ResultType pmul(
const LhsType& x,
const RhsType& y)
const {
91 return conj_if<ConjLhs>()(x) * conj_if<ConjRhs>()(y);
95template <
typename LhsScalar,
typename RhsScalar>
96struct conj_helper<LhsScalar, RhsScalar, true, true> {
97 typedef typename ScalarBinaryOpTraits<LhsScalar, RhsScalar>::ReturnType ResultType;
99 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE ResultType pmadd(
const LhsScalar& x,
const RhsScalar& y,
100 const ResultType& c)
const {
101 return this->pmul(x, y) + c;
105 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE ResultType pmul(
const LhsScalar& x,
const RhsScalar& y)
const {
106 return numext::conj(x * y);
111template <
typename Packet,
bool ConjLhs,
bool ConjRhs>
112struct conj_helper<Packet, Packet, ConjLhs, ConjRhs> {
113 typedef Packet ResultType;
114 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Packet pmadd(
const Packet& x,
const Packet& y,
const Packet& c)
const {
115 return Eigen::internal::pmadd(conj_if<ConjLhs>().pconj(x), conj_if<ConjRhs>().pconj(y), c);
118 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Packet pmsub(
const Packet& x,
const Packet& y,
const Packet& c)
const {
119 return Eigen::internal::pmsub(conj_if<ConjLhs>().pconj(x), conj_if<ConjRhs>().pconj(y), c);
122 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Packet pmul(
const Packet& x,
const Packet& y)
const {
123 return Eigen::internal::pmul(conj_if<ConjLhs>().pconj(x), conj_if<ConjRhs>().pconj(y));
127template <
typename Packet>
128struct conj_helper<Packet, Packet, true, true> {
129 typedef Packet ResultType;
131 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Packet pmadd(
const Packet& x,
const Packet& y,
const Packet& c)
const {
132 return Eigen::internal::pmadd(pconj(x), pconj(y), c);
134 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Packet pmsub(
const Packet& x,
const Packet& y,
const Packet& c)
const {
135 return Eigen::internal::pmsub(pconj(x), pconj(y), c);
138 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Packet pmul(
const Packet& x,
const Packet& y)
const {
139 return pconj(Eigen::internal::pmul(x, y));
Namespace containing all symbols from the Eigen library.
Definition B01_Experimental.dox:1