10 #ifndef EIGEN_TERNARY_FUNCTORS_H
11 #define EIGEN_TERNARY_FUNCTORS_H
13 #include "../InternalHeaderCheck.h"
21 template <
typename ThenScalar,
typename ElseScalar,
typename ConditionScalar>
22 struct scalar_boolean_select_op {
23 static constexpr
bool ThenElseAreSame = is_same<ThenScalar, ElseScalar>::value;
25 using Scalar = ThenScalar;
26 using result_type = Scalar;
28 return cond == ConditionScalar(0) ?
b :
a;
30 template <
typename Packet>
31 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Packet packetOp(
const Packet&
a,
const Packet&
b,
const Packet& cond)
const {
36 template <
typename ThenScalar,
typename ElseScalar,
typename ConditionScalar>
37 struct functor_traits<scalar_boolean_select_op<ThenScalar, ElseScalar, ConditionScalar>> {
38 using Scalar = ThenScalar;
41 PacketAccess = is_same<ThenScalar, ElseScalar>::value && is_same<ConditionScalar, Scalar>::value && packet_traits<Scalar>::HasCmp
IndexedView_or_Block operator()(const RowIndices &rowIndices, const ColIndices &colIndices)
#define EIGEN_DEVICE_FUNC
#define EIGEN_STATIC_ASSERT(X, MSG)
Packet8f pzero(const Packet8f &)
Packet2cf pcmp_eq(const Packet2cf &a, const Packet2cf &b)
Packet4f pselect(const Packet4f &mask, const Packet4f &a, const Packet4f &b)