Eigen::internal::scalar_boolean_xor_op< Scalar > Struct Template Reference

Template functor to compute the xor of two scalars as if they were booleans. More...

#include <BinaryFunctors.h>

Public Types

using result_type = Scalar
 

Public Member Functions

EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Scalar operator() (const Scalar &a, const Scalar &b) const
 
template<typename Packet >
EIGEN_STRONG_INLINE Packet packetOp (const Packet &a, const Packet &b) const
 

Detailed Description

template<typename Scalar>
struct Eigen::internal::scalar_boolean_xor_op< Scalar >

Template functor to compute the xor of two scalars as if they were booleans.

See also
class CwiseBinaryOp, ArrayBase::operator^

Member Typedef Documentation

◆ result_type

template<typename Scalar >
using Eigen::internal::scalar_boolean_xor_op< Scalar >::result_type = Scalar

Member Function Documentation

◆ operator()()

template<typename Scalar >
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Scalar Eigen::internal::scalar_boolean_xor_op< Scalar >::operator() ( const Scalar a,
const Scalar b 
) const
inline
520  {
521  return (a != Scalar(0)) != (b != Scalar(0)) ? Scalar(1) : Scalar(0);
522  }
Scalar * b
Definition: benchVecAdd.cpp:17
SCALAR Scalar
Definition: bench_gemm.cpp:45
const Scalar * a
Definition: level2_cplx_impl.h:32

References a, and b.

◆ packetOp()

template<typename Scalar >
template<typename Packet >
EIGEN_STRONG_INLINE Packet Eigen::internal::scalar_boolean_xor_op< Scalar >::packetOp ( const Packet a,
const Packet b 
) const
inline
524  {
525  const Packet cst_one = pset1<Packet>(Scalar(1));
526  // xor(a,b) == xor(!a,!b)
527  Packet not_a = pcmp_eq(a, pzero(a));
528  Packet not_b = pcmp_eq(b, pzero(b));
529  Packet a_xor_b = pxor(not_a, not_b);
530  return pand(cst_one, a_xor_b);
531  }
EIGEN_STRONG_INLINE Packet8f pzero(const Packet8f &)
Definition: AVX/PacketMath.h:774
EIGEN_STRONG_INLINE Packet2cf pcmp_eq(const Packet2cf &a, const Packet2cf &b)
Definition: AltiVec/Complex.h:353
EIGEN_STRONG_INLINE Packet8h pand(const Packet8h &a, const Packet8h &b)
Definition: AVX/PacketMath.h:2319
EIGEN_STRONG_INLINE Packet8h pxor(const Packet8h &a, const Packet8h &b)
Definition: AVX/PacketMath.h:2315

References a, b, Eigen::internal::pand(), Eigen::internal::pcmp_eq(), Eigen::internal::pxor(), and Eigen::internal::pzero().


The documentation for this struct was generated from the following file: