Eigen::internal::unary_pow::exponent_helper< ScalarExponent, IsInteger > Struct Template Reference

#include <GenericPacketMathFunctions.h>

Public Types

using safe_abs_type = ScalarExponent
 

Static Public Member Functions

static EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE ScalarExponent safe_abs (const ScalarExponent &exp)
 
static EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE bool is_odd (const ScalarExponent &exp)
 
static EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE ScalarExponent floor_div_two (const ScalarExponent &exp)
 

Static Public Attributes

static constexpr ScalarExponent one_half = ScalarExponent(0.5)
 

Member Typedef Documentation

◆ safe_abs_type

template<typename ScalarExponent , bool IsInteger = NumTraits<ScalarExponent>::IsInteger>
using Eigen::internal::unary_pow::exponent_helper< ScalarExponent, IsInteger >::safe_abs_type = ScalarExponent

Member Function Documentation

◆ floor_div_two()

template<typename ScalarExponent , bool IsInteger = NumTraits<ScalarExponent>::IsInteger>
static EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE ScalarExponent Eigen::internal::unary_pow::exponent_helper< ScalarExponent, IsInteger >::floor_div_two ( const ScalarExponent &  exp)
inlinestatic
2149  {
2150  ScalarExponent exp_div_2 = exp * one_half;
2151  return numext::floor(exp_div_2);
2152  }
EIGEN_STRONG_INLINE EIGEN_DEVICE_FUNC bfloat16 exp(const bfloat16 &a)
Definition: BFloat16.h:615
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Scalar() floor(const Scalar &x)
Definition: MathFunctions.h:1200
static constexpr ScalarExponent one_half
Definition: GenericPacketMathFunctions.h:2138

References Eigen::bfloat16_impl::exp(), Eigen::numext::floor(), and Eigen::internal::unary_pow::exponent_helper< ScalarExponent, IsInteger >::one_half.

◆ is_odd()

template<typename ScalarExponent , bool IsInteger = NumTraits<ScalarExponent>::IsInteger>
static EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE bool Eigen::internal::unary_pow::exponent_helper< ScalarExponent, IsInteger >::is_odd ( const ScalarExponent &  exp)
inlinestatic
2143  {
2144  eigen_assert(((numext::isfinite)(exp) && exp == numext::floor(exp)) && "exp must be an integer");
2145  ScalarExponent exp_div_2 = exp * one_half;
2146  ScalarExponent floor_exp_div_2 = numext::floor(exp_div_2);
2147  return exp_div_2 != floor_exp_div_2;
2148  }
#define eigen_assert(x)
Definition: Macros.h:910
EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE bool() isfinite(const Eigen::bfloat16 &h)
Definition: BFloat16.h:752

References eigen_assert, Eigen::bfloat16_impl::exp(), Eigen::numext::floor(), Eigen::numext::isfinite(), and Eigen::internal::unary_pow::exponent_helper< ScalarExponent, IsInteger >::one_half.

◆ safe_abs()

template<typename ScalarExponent , bool IsInteger = NumTraits<ScalarExponent>::IsInteger>
static EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE ScalarExponent Eigen::internal::unary_pow::exponent_helper< ScalarExponent, IsInteger >::safe_abs ( const ScalarExponent &  exp)
inlinestatic
2140  {
2141  return numext::abs(exp);
2142  }
EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE std::enable_if_t< NumTraits< T >::IsSigned||NumTraits< T >::IsComplex, typename NumTraits< T >::Real > abs(const T &x)
Definition: MathFunctions.h:1355

References Eigen::numext::abs(), and Eigen::bfloat16_impl::exp().

Member Data Documentation

◆ one_half

template<typename ScalarExponent , bool IsInteger = NumTraits<ScalarExponent>::IsInteger>
constexpr ScalarExponent Eigen::internal::unary_pow::exponent_helper< ScalarExponent, IsInteger >::one_half = ScalarExponent(0.5)
staticconstexpr

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