mirror of
https://gitlab.com/libeigen/eigen.git
synced 2026-04-10 11:34:33 +08:00
Modify pselect and various masks to use Scalar(1) for true.
This commit is contained in:
@@ -182,10 +182,6 @@ struct imag_ref_retval {
|
||||
typedef typename NumTraits<Scalar>::Real& type;
|
||||
};
|
||||
|
||||
// implementation in MathFunctionsImpl.h
|
||||
template <typename Mask, bool is_built_in_float = std::is_floating_point<Mask>::value>
|
||||
struct scalar_select_mask;
|
||||
|
||||
} // namespace internal
|
||||
|
||||
namespace numext {
|
||||
@@ -211,9 +207,9 @@ EIGEN_DEVICE_FUNC inline EIGEN_MATHFUNC_RETVAL(imag, Scalar) imag(const Scalar&
|
||||
return EIGEN_MATHFUNC_IMPL(imag, Scalar)::run(x);
|
||||
}
|
||||
|
||||
template <typename Scalar, typename Mask>
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Scalar select(const Mask& mask, const Scalar& a, const Scalar& b) {
|
||||
return internal::scalar_select_mask<Mask>::run(mask) ? b : a;
|
||||
template <typename Scalar>
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Scalar select(const Scalar& mask, const Scalar& a, const Scalar& b) {
|
||||
return numext::is_exactly_zero(mask) ? b : a;
|
||||
}
|
||||
|
||||
} // namespace numext
|
||||
|
||||
Reference in New Issue
Block a user