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)); \
41 #include "../../InternalHeaderCheck.h"
46 template<
bool Conjugate>
struct conj_if;
48 template<>
struct conj_if<true> {
55 template<>
struct conj_if<false> {
64 template<
typename LhsType,
typename RhsType,
bool ConjLhs,
bool ConjRhs>
66 typedef typename ScalarBinaryOpTraits<LhsType, RhsType>::ReturnType ResultType;
69 pmadd(
const LhsType&
x,
const RhsType&
y,
const ResultType&
c)
const
70 {
return this->
pmul(x,
y) +
c; }
73 pmul(
const LhsType&
x,
const RhsType&
y)
const
74 {
return conj_if<ConjLhs>()(
x) * conj_if<ConjRhs>()(
y); }
77 template<
typename LhsScalar,
typename RhsScalar>
78 struct conj_helper<LhsScalar, RhsScalar, true, true> {
79 typedef typename ScalarBinaryOpTraits<LhsScalar,RhsScalar>::ReturnType ResultType;
82 pmadd(
const LhsScalar&
x,
const RhsScalar&
y,
const ResultType&
c)
const
83 {
return this->
pmul(x,
y) +
c; }
87 pmul(
const LhsScalar&
x,
const RhsScalar&
y)
const
92 template<
typename Packet,
bool ConjLhs,
bool ConjRhs>
93 struct conj_helper<Packet, Packet, ConjLhs, ConjRhs>
95 typedef Packet ResultType;
104 template<
typename Packet>
105 struct conj_helper<Packet, Packet, true, true>
107 typedef Packet ResultType;
IndexedView_or_Block operator()(const RowIndices &rowIndices, const ColIndices &colIndices)
#define EIGEN_DEVICE_FUNC
Packet4f pmadd(const Packet4f &a, const Packet4f &b, const Packet4f &c)
Packet pmul(const Packet &a, const Packet &b)
Packet2cf pconj(const Packet2cf &a)
const Eigen::CwiseUnaryOp< Eigen::internal::scalar_conjugate_op< typename Derived::Scalar >, const Derived > conj(const Eigen::ArrayBase< Derived > &x)