Eigen::internal::log_2_impl< BitsType > Struct Template Reference

#include <MathFunctions.h>

Static Public Member Functions

static EIGEN_DEVICE_FUNC int run_ceil (const BitsType &x)
 
static EIGEN_DEVICE_FUNC int run_floor (const BitsType &x)
 

Static Public Attributes

static constexpr int kTotalBits = sizeof(BitsType) * CHAR_BIT
 

Member Function Documentation

◆ run_ceil()

template<typename BitsType >
static EIGEN_DEVICE_FUNC int Eigen::internal::log_2_impl< BitsType >::run_ceil ( const BitsType &  x)
inlinestatic
746  {
747  const int n = kTotalBits - clz(x);
748  bool power_of_two = (x & (x - 1)) == 0;
749  return x == 0 ? 0 : power_of_two ? (n - 1) : n;
750  }
const unsigned n
Definition: CG3DPackingUnitTest.cpp:11
EIGEN_DEVICE_FUNC int clz(BitsType bits)
Definition: MathFunctions.h:644
list x
Definition: plotDoE.py:28
static constexpr int kTotalBits
Definition: MathFunctions.h:745

◆ run_floor()

template<typename BitsType >
static EIGEN_DEVICE_FUNC int Eigen::internal::log_2_impl< BitsType >::run_floor ( const BitsType &  x)
inlinestatic
751  {
752  const int n = kTotalBits - clz(x);
753  return x == 0 ? 0 : n - 1;
754  }

Member Data Documentation

◆ kTotalBits

template<typename BitsType >
constexpr int Eigen::internal::log_2_impl< BitsType >::kTotalBits = sizeof(BitsType) * CHAR_BIT
staticconstexpr

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