mirror of
https://gitlab.com/libeigen/eigen.git
synced 2025-10-10 23:21:29 +08:00
Fix scalar_inner_product_op when binary ops return a different type
This commit is contained in:
parent
c08497ae1c
commit
b27f784ca5
@ -211,8 +211,14 @@ struct scalar_inner_product_op {
|
|||||||
static constexpr bool PacketAccess = false;
|
static constexpr bool PacketAccess = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// Partial specialization for packet access if and only if
|
||||||
|
// LhsScalar == RhsScalar == ScalarBinaryOpTraits<LhsScalar, RhsScalar>::ReturnType.
|
||||||
template <typename Scalar, bool Conj>
|
template <typename Scalar, bool Conj>
|
||||||
struct scalar_inner_product_op<Scalar, Scalar, Conj> {
|
struct scalar_inner_product_op<
|
||||||
|
Scalar,
|
||||||
|
typename std::enable_if<internal::is_same<typename ScalarBinaryOpTraits<Scalar, Scalar>::ReturnType, Scalar>::value,
|
||||||
|
Scalar>::type,
|
||||||
|
Conj> {
|
||||||
using result_type = Scalar;
|
using result_type = Scalar;
|
||||||
using conj_helper = conditional_conj<Scalar, Conj>;
|
using conj_helper = conditional_conj<Scalar, Conj>;
|
||||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Scalar coeff(const Scalar& a, const Scalar& b) const {
|
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Scalar coeff(const Scalar& a, const Scalar& b) const {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user