Eigen::internal::bytewise_bitwise_helper< T > Struct Template Reference

#include <GenericPacketMath.h>

+ Inheritance diagram for Eigen::internal::bytewise_bitwise_helper< T >:

Static Public Member Functions

static EIGEN_DEVICE_FUNC T bitwise_and (const T &a, const T &b)
 
static EIGEN_DEVICE_FUNC T bitwise_or (const T &a, const T &b)
 
static EIGEN_DEVICE_FUNC T bitwise_xor (const T &a, const T &b)
 
static EIGEN_DEVICE_FUNC T bitwise_not (const T &a)
 

Static Private Member Functions

template<typename Op >
static EIGEN_DEVICE_FUNC T unary (const T &a, Op op)
 
template<typename Op >
static EIGEN_DEVICE_FUNC T binary (const T &a, const T &b, Op op)
 

Member Function Documentation

◆ binary()

template<typename T >
template<typename Op >
static EIGEN_DEVICE_FUNC T Eigen::internal::bytewise_bitwise_helper< T >::binary ( const T a,
const T b,
Op  op 
)
inlinestaticprivate
530  {
531  const unsigned char* a_ptr = reinterpret_cast<const unsigned char*>(&a);
532  const unsigned char* b_ptr = reinterpret_cast<const unsigned char*>(&b);
533  T c;
534  unsigned char* c_ptr = reinterpret_cast<unsigned char*>(&c);
535  for (size_t i = 0; i < sizeof(T); ++i) {
536  *c_ptr++ = op(*a_ptr++, *b_ptr++);
537  }
538  return c;
539  }
int i
Definition: BiCGSTAB_step_by_step.cpp:9
Eigen::Triplet< double > T
Definition: EigenUnitTest.cpp:11
Scalar * b
Definition: benchVecAdd.cpp:17
const Scalar * a
Definition: level2_cplx_impl.h:32
char char * op
Definition: level2_impl.h:374
int c
Definition: calibrate.py:100

References a, b, calibrate::c, i, and op.

Referenced by Eigen::internal::bytewise_bitwise_helper< T >::bitwise_and(), Eigen::internal::bytewise_bitwise_helper< T >::bitwise_or(), and Eigen::internal::bytewise_bitwise_helper< T >::bitwise_xor().

◆ bitwise_and()

template<typename T >
static EIGEN_DEVICE_FUNC T Eigen::internal::bytewise_bitwise_helper< T >::bitwise_and ( const T a,
const T b 
)
inlinestatic
508  {
509  return binary(a, b, bit_and<unsigned char>());
510  }
static EIGEN_DEVICE_FUNC T binary(const T &a, const T &b, Op op)
Definition: GenericPacketMath.h:530

References a, b, and Eigen::internal::bytewise_bitwise_helper< T >::binary().

Referenced by Eigen::internal::pand().

◆ bitwise_not()

template<typename T >
static EIGEN_DEVICE_FUNC T Eigen::internal::bytewise_bitwise_helper< T >::bitwise_not ( const T a)
inlinestatic
515 { return unary(a, bit_not<unsigned char>()); }
static EIGEN_DEVICE_FUNC T unary(const T &a, Op op)
Definition: GenericPacketMath.h:519

References a, and Eigen::internal::bytewise_bitwise_helper< T >::unary().

Referenced by Eigen::internal::pnot().

◆ bitwise_or()

template<typename T >
static EIGEN_DEVICE_FUNC T Eigen::internal::bytewise_bitwise_helper< T >::bitwise_or ( const T a,
const T b 
)
inlinestatic
511 { return binary(a, b, bit_or<unsigned char>()); }

References a, b, and Eigen::internal::bytewise_bitwise_helper< T >::binary().

Referenced by Eigen::internal::por().

◆ bitwise_xor()

template<typename T >
static EIGEN_DEVICE_FUNC T Eigen::internal::bytewise_bitwise_helper< T >::bitwise_xor ( const T a,
const T b 
)
inlinestatic
512  {
513  return binary(a, b, bit_xor<unsigned char>());
514  }

References a, b, and Eigen::internal::bytewise_bitwise_helper< T >::binary().

Referenced by Eigen::internal::pxor().

◆ unary()

template<typename T >
template<typename Op >
static EIGEN_DEVICE_FUNC T Eigen::internal::bytewise_bitwise_helper< T >::unary ( const T a,
Op  op 
)
inlinestaticprivate
519  {
520  const unsigned char* a_ptr = reinterpret_cast<const unsigned char*>(&a);
521  T c;
522  unsigned char* c_ptr = reinterpret_cast<unsigned char*>(&c);
523  for (size_t i = 0; i < sizeof(T); ++i) {
524  *c_ptr++ = op(*a_ptr++);
525  }
526  return c;
527  }

References a, calibrate::c, i, and op.

Referenced by Eigen::internal::bytewise_bitwise_helper< T >::bitwise_not().


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