Eigen::numext Namespace Reference

Classes

struct  equal_strict_impl
 
struct  equal_strict_impl< X, Y, true, false, true, true >
 
struct  equal_strict_impl< X, Y, true, true, true, false >
 
struct  get_integer_by_size
 
struct  get_integer_by_size< 1 >
 
struct  get_integer_by_size< 2 >
 
struct  get_integer_by_size< 4 >
 
struct  get_integer_by_size< 8 >
 
struct  signbit_impl
 
struct  signbit_impl< Scalar, false, true >
 
struct  signbit_impl< Scalar, true, false >
 
struct  signbit_impl< Scalar, true, true >
 

Typedefs

typedef std::int16_t int16_t
 
typedef std::int32_t int32_t
 
typedef std::int64_t int64_t
 
typedef std::int8_t int8_t
 
typedef std::uint16_t uint16_t
 
typedef std::uint32_t uint32_t
 
typedef std::uint64_t uint64_t
 
typedef std::uint8_t uint8_t
 

Functions

template<typename T >
EIGEN_ALWAYS_INLINE std::enable_if_t< NumTraits< T >::IsSigned||NumTraits< T >::IsComplex, typename NumTraits< T >::Real > abs (const T &x)
 
template<typename T >
EIGEN_ALWAYS_INLINE std::enable_if_t<!(NumTraits< T >::IsSigned||NumTraits< T >::IsComplex), typename NumTraits< T >::Real > abs (const T &x)
 
bool abs2 (bool x)
 
template<>
EIGEN_ALWAYS_INLINE double absdiff (const double &x, const double &y)
 
template<>
EIGEN_ALWAYS_INLINE float absdiff (const float &x, const float &y)
 
template<>
EIGEN_ALWAYS_INLINE long double absdiff (const long double &x, const long double &y)
 
template<typename T >
EIGEN_ALWAYS_INLINE T absdiff (const T &x, const T &y)
 
template<typename T >
EIGEN_ALWAYS_INLINE T acos (const T &x)
 
template<typename T >
EIGEN_ALWAYS_INLINE T acosh (const T &x)
 
template<typename T >
EIGEN_ALWAYS_INLINE T asin (const T &x)
 
template<typename T >
EIGEN_ALWAYS_INLINE T asinh (const T &x)
 
template<typename T >
EIGEN_ALWAYS_INLINE T atan (const T &x)
 
template<typename T , std::enable_if_t<!NumTraits< T >::IsComplex, int > = 0>
EIGEN_ALWAYS_INLINE T atan2 (const T &y, const T &x)
 
template<typename T >
EIGEN_ALWAYS_INLINE T atanh (const T &x)
 
template<typename Tgt , typename Src >
Tgt bit_cast (const Src &src)
 
template<>
Eigen::bfloat16 bit_cast< Eigen::bfloat16, uint16_t > (const uint16_t &src)
 
template<>
Eigen::half bit_cast< Eigen::half, uint16_t > (const uint16_t &src)
 
template<>
uint16_t bit_cast< uint16_t, Eigen::bfloat16 > (const Eigen::bfloat16 &src)
 
template<>
uint16_t bit_cast< uint16_t, Eigen::half > (const Eigen::half &src)
 
template<typename Scalar >
Scalar() ceil (const Scalar &x)
 
template<typename T >
EIGEN_ALWAYS_INLINE T cos (const T &x)
 
template<typename T >
EIGEN_ALWAYS_INLINE T cosh (const T &x)
 
template<typename T >
T div_ceil (const T &a, const T &b)
 
template<typename Scalar >
 EIGEN_MATHFUNC_RETVAL (abs2, Scalar) abs2(const Scalar &x)
 
template<typename Scalar >
 EIGEN_MATHFUNC_RETVAL (arg, Scalar) arg(const Scalar &x)
 
template<typename Scalar >
 EIGEN_MATHFUNC_RETVAL (conj, Scalar) conj(const Scalar &x)
 
template<typename Scalar >
 EIGEN_MATHFUNC_RETVAL (expm1, Scalar) expm1(const Scalar &x)
 
template<typename Scalar >
 EIGEN_MATHFUNC_RETVAL (hypot, Scalar) hypot(const Scalar &x
 
template<typename Scalar >
 EIGEN_MATHFUNC_RETVAL (imag, Scalar) imag(const Scalar &x)
 
template<typename Scalar >
 EIGEN_MATHFUNC_RETVAL (imag_ref, Scalar) imag_ref(Scalar &x)
 
template<typename Scalar >
 EIGEN_MATHFUNC_RETVAL (log1p, Scalar) log1p(const Scalar &x)
 
template<typename Scalar >
 EIGEN_MATHFUNC_RETVAL (norm1, Scalar) norm1(const Scalar &x)
 
template<typename Scalar >
 EIGEN_MATHFUNC_RETVAL (real, Scalar) real(const Scalar &x)
 
template<typename Scalar >
 EIGEN_MATHFUNC_RETVAL (real_ref, Scalar) real_ref(Scalar &x)
 
template<typename Scalar >
 EIGEN_MATHFUNC_RETVAL (sign, Scalar) sign(const Scalar &x)
 
template<typename Scalar >
EIGEN_ALWAYS_INLINE EIGEN_MATHFUNC_RETVAL (sqrt, Scalar) sqrt(const Scalar &x)
 
template<>
bool equal_strict (const double &x, const double &y)
 
template<>
bool equal_strict (const float &x, const float &y)
 
template<typename X , typename Y >
bool equal_strict (const X &x, const Y &y)
 
template<typename T >
EIGEN_ALWAYS_INLINE T exp (const T &x)
 
template<typename Scalar >
Scalar() floor (const Scalar &x)
 
template<typename T >
EIGEN_ALWAYS_INLINE T fmod (const T &a, const T &b)
 
template<typename Scalar >
internal::add_const_on_value_type_t< EIGEN_MATHFUNC_RETVAL(imag_ref, Scalar) > imag_ref (const Scalar &x)
 
template<typename X >
bool is_exactly_one (const X &x)
 
template<typename X >
bool is_exactly_zero (const X &x)
 
template<>
EIGEN_ALWAYS_INLINE bool() isfinite (const Eigen::bfloat16 &h)
 
template<typename T >
bool() isfinite (const T &x)
 
template<>
EIGEN_ALWAYS_INLINE bool() isinf (const Eigen::bfloat16 &h)
 
template<typename T >
bool() isinf (const T &x)
 
template<>
EIGEN_ALWAYS_INLINE bool() isnan (const Eigen::bfloat16 &h)
 
template<typename T >
bool() isnan (const T &x)
 
template<typename T >
EIGEN_ALWAYS_INLINE T log (const T &x)
 
int log2 (int x)
 
template<typename T >
EIGEN_ALWAYS_INLINE T maxi (const T &x, const T &y)
 
template<typename T >
EIGEN_ALWAYS_INLINE T mini (const T &x, const T &y)
 
template<>
bool not_equal_strict (const double &x, const double &y)
 
template<>
bool not_equal_strict (const float &x, const float &y)
 
template<typename X , typename Y >
bool not_equal_strict (const X &x, const Y &y)
 
template<typename ScalarX , typename ScalarY >
internal::pow_impl< ScalarX, ScalarY >::result_type pow (const ScalarX &x, const ScalarY &y)
 
template<typename Scalar >
internal::add_const_on_value_type_t< EIGEN_MATHFUNC_RETVAL(real_ref, Scalar) > real_ref (const Scalar &x)
 
template<typename Scalar >
Scalar rint (const Scalar &x)
 
template<typename Scalar >
Scalar round (const Scalar &x)
 
template<typename T >
EIGEN_ALWAYS_INLINE T rsqrt (const T &x)
 
template<typename Scalar >
static constexpr EIGEN_ALWAYS_INLINE Scalar signbit (const Scalar &x)
 
template<typename T >
EIGEN_ALWAYS_INLINE T sin (const T &x)
 
template<typename T >
EIGEN_ALWAYS_INLINE T sinh (const T &x)
 
template<>
EIGEN_ALWAYS_INLINE double sqrt (const double &x)
 
template<>
EIGEN_ALWAYS_INLINE float sqrt (const float &x)
 
template<>
EIGEN_DEFINE_FUNCTION_ALLOWING_MULTIPLE_DEFINITIONS bool sqrt< bool > (const bool &x)
 
template<typename T >
void swap (T &a, T &b)
 
template<typename T >
EIGEN_ALWAYS_INLINE T tan (const T &x)
 
template<typename T >
EIGEN_ALWAYS_INLINE T tanh (const T &x)
 

Variables

const Scalar & y
 

Detailed Description

Generic math functions *

Typedef Documentation

◆ int16_t

typedef std::int16_t Eigen::numext::int16_t

Definition at line 38 of file Meta.h.

◆ int32_t

typedef std::int32_t Eigen::numext::int32_t

Definition at line 40 of file Meta.h.

◆ int64_t

typedef std::int64_t Eigen::numext::int64_t

Definition at line 42 of file Meta.h.

◆ int8_t

typedef std::int8_t Eigen::numext::int8_t

Definition at line 36 of file Meta.h.

◆ uint16_t

typedef std::uint16_t Eigen::numext::uint16_t

Definition at line 37 of file Meta.h.

◆ uint32_t

typedef std::uint32_t Eigen::numext::uint32_t

Definition at line 39 of file Meta.h.

◆ uint64_t

typedef std::uint64_t Eigen::numext::uint64_t

Definition at line 41 of file Meta.h.

◆ uint8_t

typedef std::uint8_t Eigen::numext::uint8_t

Definition at line 35 of file Meta.h.

Function Documentation

◆ abs() [1/2]

template<typename T >
EIGEN_ALWAYS_INLINE std::enable_if_t<NumTraits<T>::IsSigned || NumTraits<T>::IsComplex,typename NumTraits<T>::Real> Eigen::numext::abs ( const T x)

Definition at line 1413 of file MathFunctions.h.

1413  {
1415  return abs(x);
1416 }
const AbsReturnType abs() const
#define EIGEN_USING_STD(FUNC)
Definition: Macros.h:1080

◆ abs() [2/2]

template<typename T >
EIGEN_ALWAYS_INLINE std::enable_if_t<!(NumTraits<T>::IsSigned || NumTraits<T>::IsComplex),typename NumTraits<T>::Real> Eigen::numext::abs ( const T x)

Definition at line 1421 of file MathFunctions.h.

1421  {
1422  return x;
1423 }

◆ abs2()

bool Eigen::numext::abs2 ( bool  x)
inline

Definition at line 1198 of file MathFunctions.h.

1198 { return x; }

◆ absdiff() [1/4]

template<>
EIGEN_ALWAYS_INLINE double Eigen::numext::absdiff ( const double &  x,
const double &  y 
)

Definition at line 1214 of file MathFunctions.h.

1215 {
1216  return fabs(x - y);
1217 }
const Scalar & y

◆ absdiff() [2/4]

template<>
EIGEN_ALWAYS_INLINE float Eigen::numext::absdiff ( const float &  x,
const float &  y 
)

Definition at line 1208 of file MathFunctions.h.

1209 {
1210  return fabsf(x - y);
1211 }

◆ absdiff() [3/4]

template<>
EIGEN_ALWAYS_INLINE long double Eigen::numext::absdiff ( const long double &  x,
const long double &  y 
)

Definition at line 1223 of file MathFunctions.h.

1223  {
1224  return fabsl(x - y);
1225 }

◆ absdiff() [4/4]

template<typename T >
EIGEN_ALWAYS_INLINE T Eigen::numext::absdiff ( const T x,
const T y 
)

Definition at line 1202 of file MathFunctions.h.

1203 {
1204  return x > y ? x - y : y - x;
1205 }

◆ acos()

template<typename T >
EIGEN_ALWAYS_INLINE T Eigen::numext::acos ( const T x)

Definition at line 1592 of file MathFunctions.h.

1592  {
1594  return acos(x);
1595 }
const AcosReturnType acos() const

◆ acosh()

template<typename T >
EIGEN_ALWAYS_INLINE T Eigen::numext::acosh ( const T x)

Definition at line 1599 of file MathFunctions.h.

1599  {
1601  return static_cast<T>(acosh(x));
1602 }
const AcoshReturnType acosh() const

◆ asin()

template<typename T >
EIGEN_ALWAYS_INLINE T Eigen::numext::asin ( const T x)

Definition at line 1619 of file MathFunctions.h.

1619  {
1621  return asin(x);
1622 }
const AsinReturnType asin() const

◆ asinh()

template<typename T >
EIGEN_ALWAYS_INLINE T Eigen::numext::asinh ( const T x)

Definition at line 1626 of file MathFunctions.h.

1626  {
1628  return static_cast<T>(asinh(x));
1629 }
const AsinhReturnType asinh() const

◆ atan()

template<typename T >
EIGEN_ALWAYS_INLINE T Eigen::numext::atan ( const T x)

Definition at line 1646 of file MathFunctions.h.

1646  {
1648  return static_cast<T>(atan(x));
1649 }
const AtanReturnType atan() const

◆ atan2()

template<typename T , std::enable_if_t<!NumTraits< T >::IsComplex, int > = 0>
EIGEN_ALWAYS_INLINE T Eigen::numext::atan2 ( const T y,
const T x 
)

Definition at line 1652 of file MathFunctions.h.

1652  {
1654  return static_cast<T>(atan2(y, x));
1655 }
const std::enable_if_t< std::is_same< typename LhsDerived::Scalar, typename RhsDerived::Scalar >::value, Eigen::CwiseBinaryOp< Eigen::internal::scalar_atan2_op< typename LhsDerived::Scalar, typename RhsDerived::Scalar >, const LhsDerived, const RhsDerived > > atan2(const Eigen::ArrayBase< LhsDerived > &x, const Eigen::ArrayBase< RhsDerived > &exponents)

◆ atanh()

template<typename T >
EIGEN_ALWAYS_INLINE T Eigen::numext::atanh ( const T x)

Definition at line 1659 of file MathFunctions.h.

1659  {
1661  return static_cast<T>(atanh(x));
1662 }
const AtanhReturnType atanh() const

◆ bit_cast()

template<typename Tgt , typename Src >
Tgt Eigen::numext::bit_cast ( const Src &  src)
inline

Definition at line 87 of file NumTraits.h.

87  {
88  // The behaviour of memcpy is not specified for non-trivially copyable types
89  EIGEN_STATIC_ASSERT(std::is_trivially_copyable<Src>::value, THIS_TYPE_IS_NOT_SUPPORTED);
90  EIGEN_STATIC_ASSERT(std::is_trivially_copyable<Tgt>::value && std::is_default_constructible<Tgt>::value,
91  THIS_TYPE_IS_NOT_SUPPORTED);
92  EIGEN_STATIC_ASSERT(sizeof(Src) == sizeof(Tgt), THIS_TYPE_IS_NOT_SUPPORTED);
93 
94  Tgt tgt;
95  // Load src into registers first. This allows the memcpy to be elided by CUDA.
96  const Src staged = src;
97  EIGEN_USING_STD(memcpy)
98  memcpy(static_cast<void*>(&tgt),static_cast<const void*>(&staged), sizeof(Tgt));
99  return tgt;
100 }
#define EIGEN_STATIC_ASSERT(X, MSG)
Definition: StaticAssert.h:26

◆ bit_cast< Eigen::bfloat16, uint16_t >()

Definition at line 795 of file BFloat16.h.

795  {
797 }
EIGEN_CONSTEXPR __bfloat16_raw raw_uint16_to_bfloat16(unsigned short value)

◆ bit_cast< Eigen::half, uint16_t >()

template<>
Eigen::half Eigen::numext::bit_cast< Eigen::half, uint16_t > ( const uint16_t src)
inline

Definition at line 925 of file Half.h.

925  {
927 }
EIGEN_CONSTEXPR __half_raw raw_uint16_to_half(numext::uint16_t x)
Definition: Half.h:551

◆ bit_cast< uint16_t, Eigen::bfloat16 >()

Definition at line 800 of file BFloat16.h.

800  {
802 }
EIGEN_CONSTEXPR numext::uint16_t raw_bfloat16_as_uint16(const __bfloat16_raw &bf)
Definition: BFloat16.h:370

◆ bit_cast< uint16_t, Eigen::half >()

template<>
uint16_t Eigen::numext::bit_cast< uint16_t, Eigen::half > ( const Eigen::half src)
inline

Definition at line 930 of file Half.h.

930  {
932 }
numext::uint16_t raw_half_as_uint16(const __half_raw &h)
Definition: Half.h:567

◆ ceil()

template<typename Scalar >
Scalar() Eigen::numext::ceil ( const Scalar &  x)
inline

Definition at line 1325 of file MathFunctions.h.

1326 {
1327  return internal::nearest_integer_impl<Scalar>::run_ceil(x);
1328 }

◆ cos()

template<typename T >
EIGEN_ALWAYS_INLINE T Eigen::numext::cos ( const T x)

Definition at line 1535 of file MathFunctions.h.

1535  {
1537  return cos(x);
1538 }
const CosReturnType cos() const

◆ cosh()

template<typename T >
EIGEN_ALWAYS_INLINE T Eigen::numext::cosh ( const T x)

Definition at line 1680 of file MathFunctions.h.

1680  {
1682  return static_cast<T>(cosh(x));
1683 }
const CoshReturnType cosh() const

◆ div_ceil()

template<typename T >
T Eigen::numext::div_ceil ( const T a,
const T b 
)

Definition at line 428 of file Meta.h.

429 {
430  return (a+b-1) / b;
431 }
Array< int, 3, 1 > b

◆ EIGEN_MATHFUNC_RETVAL() [1/13]

template<typename Scalar >
Eigen::numext::EIGEN_MATHFUNC_RETVAL ( abs2  ,
Scalar   
) const &
inline

Definition at line 1192 of file MathFunctions.h.

1193 {
1194  return EIGEN_MATHFUNC_IMPL(abs2, Scalar)::run(x);
1195 }
const Abs2ReturnType abs2() const
#define EIGEN_MATHFUNC_IMPL(func, scalar)
Definition: MathFunctions.h:63

◆ EIGEN_MATHFUNC_RETVAL() [2/13]

template<typename Scalar >
Eigen::numext::EIGEN_MATHFUNC_RETVAL ( arg  ,
Scalar   
) const &
inline

Definition at line 1157 of file MathFunctions.h.

1158 {
1159  return EIGEN_MATHFUNC_IMPL(arg, Scalar)::run(x);
1160 }
const ArgReturnType arg() const

◆ EIGEN_MATHFUNC_RETVAL() [3/13]

template<typename Scalar >
Eigen::numext::EIGEN_MATHFUNC_RETVAL ( conj  ,
Scalar   
) const &
inline

Definition at line 1178 of file MathFunctions.h.

1179 {
1180  return EIGEN_MATHFUNC_IMPL(conj, Scalar)::run(x);
1181 }
const Eigen::CwiseUnaryOp< Eigen::internal::scalar_conjugate_op< typename Derived::Scalar >, const Derived > conj(const Eigen::ArrayBase< Derived > &x)

◆ EIGEN_MATHFUNC_RETVAL() [4/13]

template<typename Scalar >
Eigen::numext::EIGEN_MATHFUNC_RETVAL ( expm1  ,
Scalar   
) const &
inline

Definition at line 1516 of file MathFunctions.h.

1517 {
1518  return EIGEN_MATHFUNC_IMPL(expm1, Scalar)::run(x);
1519 }
const Expm1ReturnType expm1() const

◆ EIGEN_MATHFUNC_RETVAL() [5/13]

template<typename Scalar >
Eigen::numext::EIGEN_MATHFUNC_RETVAL ( hypot  ,
Scalar   
) const &
inline

◆ EIGEN_MATHFUNC_RETVAL() [6/13]

template<typename Scalar >
Eigen::numext::EIGEN_MATHFUNC_RETVAL ( imag  ,
Scalar   
) const &
inline

Definition at line 1150 of file MathFunctions.h.

1151 {
1152  return EIGEN_MATHFUNC_IMPL(imag, Scalar)::run(x);
1153 }
const ImagReturnType imag() const

◆ EIGEN_MATHFUNC_RETVAL() [7/13]

template<typename Scalar >
Eigen::numext::EIGEN_MATHFUNC_RETVAL ( imag_ref  ,
Scalar   
) &
inline

Definition at line 1171 of file MathFunctions.h.

1172 {
1173  return EIGEN_MATHFUNC_IMPL(imag_ref, Scalar)::run(x);
1174 }
internal::add_const_on_value_type_t< EIGEN_MATHFUNC_RETVAL(imag_ref, Scalar) > imag_ref(const Scalar &x)

◆ EIGEN_MATHFUNC_RETVAL() [8/13]

template<typename Scalar >
Eigen::numext::EIGEN_MATHFUNC_RETVAL ( log1p  ,
Scalar   
) const &
inline

Definition at line 1248 of file MathFunctions.h.

1249 {
1250  return EIGEN_MATHFUNC_IMPL(log1p, Scalar)::run(x);
1251 }
const Log1pReturnType log1p() const

◆ EIGEN_MATHFUNC_RETVAL() [9/13]

template<typename Scalar >
Eigen::numext::EIGEN_MATHFUNC_RETVAL ( norm1  ,
Scalar   
) const &
inline

Definition at line 1230 of file MathFunctions.h.

1231 {
1232  return EIGEN_MATHFUNC_IMPL(norm1, Scalar)::run(x);
1233 }

◆ EIGEN_MATHFUNC_RETVAL() [10/13]

template<typename Scalar >
Eigen::numext::EIGEN_MATHFUNC_RETVAL ( real  ,
Scalar   
) const &
inline

Definition at line 1129 of file MathFunctions.h.

1130 {
1131  return EIGEN_MATHFUNC_IMPL(real, Scalar)::run(x);
1132 }
RealReturnType real() const

◆ EIGEN_MATHFUNC_RETVAL() [11/13]

template<typename Scalar >
Eigen::numext::EIGEN_MATHFUNC_RETVAL ( real_ref  ,
Scalar   
) &
inline

Definition at line 1143 of file MathFunctions.h.

1144 {
1145  return EIGEN_MATHFUNC_IMPL(real_ref, Scalar)::run(x);
1146 }
internal::add_const_on_value_type_t< EIGEN_MATHFUNC_RETVAL(real_ref, Scalar) > real_ref(const Scalar &x)

◆ EIGEN_MATHFUNC_RETVAL() [12/13]

template<typename Scalar >
Eigen::numext::EIGEN_MATHFUNC_RETVAL ( sign  ,
Scalar   
) const &
inline

Definition at line 1185 of file MathFunctions.h.

1186 {
1187  return EIGEN_MATHFUNC_IMPL(sign, Scalar)::run(x);
1188 }
const SignReturnType sign() const

◆ EIGEN_MATHFUNC_RETVAL() [13/13]

template<typename Scalar >
EIGEN_ALWAYS_INLINE Eigen::numext::EIGEN_MATHFUNC_RETVAL ( sqrt  ,
Scalar   
) const &
Returns
the square root of x.

It is essentially equivalent to

using std::sqrt; return sqrt(x);
const SqrtReturnType sqrt() const
EIGEN_ALWAYS_INLINE float sqrt(const float &x)

but slightly faster for float/double and some compilers (e.g., gcc), thanks to specializations when SSE is enabled.

It's usage is justified in performance critical functions, like norm/normalize.

Definition at line 1369 of file MathFunctions.h.

1370 {
1371  return EIGEN_MATHFUNC_IMPL(sqrt, Scalar)::run(x);
1372 }

◆ equal_strict() [1/3]

template<>
bool Eigen::numext::equal_strict ( const double &  x,
const double &  y 
)
inline

Definition at line 467 of file Meta.h.

467 { return std::equal_to<double>()(x,y); }
const Scalar & y

◆ equal_strict() [2/3]

template<>
bool Eigen::numext::equal_strict ( const float &  x,
const float &  y 
)
inline

Definition at line 464 of file Meta.h.

464 { return std::equal_to<float>()(x,y); }

◆ equal_strict() [3/3]

template<typename X , typename Y >
bool Eigen::numext::equal_strict ( const X x,
const Y &  y 
)
inline

Definition at line 460 of file Meta.h.

460 { return equal_strict_impl<X, Y>::run(x, y); }

◆ exp()

template<typename T >
EIGEN_ALWAYS_INLINE T Eigen::numext::exp ( const T x)

Definition at line 1481 of file MathFunctions.h.

1481  {
1483  return exp(x);
1484 }
const ExpReturnType exp() const

◆ floor()

template<typename Scalar >
Scalar() Eigen::numext::floor ( const Scalar &  x)
inline

Definition at line 1306 of file MathFunctions.h.

1307 {
1308  return internal::nearest_integer_impl<Scalar>::run_floor(x);
1309 }

◆ fmod()

template<typename T >
EIGEN_ALWAYS_INLINE T Eigen::numext::fmod ( const T a,
const T b 
)

Definition at line 1742 of file MathFunctions.h.

1742  {
1744  return fmod(a, b);
1745 }
EIGEN_ALWAYS_INLINE T fmod(const T &a, const T &b)

◆ imag_ref()

template<typename Scalar >
internal::add_const_on_value_type_t< EIGEN_MATHFUNC_RETVAL(imag_ref, Scalar) > Eigen::numext::imag_ref ( const Scalar &  x)
inline

Definition at line 1164 of file MathFunctions.h.

1165 {
1166  return internal::imag_ref_impl<Scalar>::run(x);
1167 }

◆ is_exactly_one()

template<typename X >
bool Eigen::numext::is_exactly_one ( const X x)
inline

Definition at line 482 of file Meta.h.

482 { return equal_strict(x, typename NumTraits<X>::Literal{1}); }
bool equal_strict(const double &x, const double &y)
Definition: Meta.h:467

◆ is_exactly_zero()

template<typename X >
bool Eigen::numext::is_exactly_zero ( const X x)
inline

Definition at line 475 of file Meta.h.

475 { return equal_strict(x, typename NumTraits<X>::Literal{0}); }

◆ isfinite() [1/2]

template<>
EIGEN_ALWAYS_INLINE bool() Eigen::numext::isfinite ( const Eigen::bfloat16 h)

Definition at line 790 of file BFloat16.h.

790  {
791  return (bfloat16_impl::isfinite)(h);
792 }
EIGEN_ALWAYS_INLINE bool() isfinite(const Eigen::bfloat16 &h)
Definition: BFloat16.h:790

◆ isfinite() [2/2]

template<typename T >
bool() Eigen::numext::isfinite ( const T x)

Definition at line 1278 of file MathFunctions.h.

1278 { return internal::isfinite_impl(x); }
bool isfinite_impl(const std::complex< T > &x)

◆ isinf() [1/2]

template<>
EIGEN_ALWAYS_INLINE bool() Eigen::numext::isinf ( const Eigen::bfloat16 h)

Definition at line 784 of file BFloat16.h.

784  {
785  return (bfloat16_impl::isinf)(h);
786 }
EIGEN_ALWAYS_INLINE bool() isinf(const Eigen::bfloat16 &h)
Definition: BFloat16.h:784

◆ isinf() [2/2]

template<typename T >
bool() Eigen::numext::isinf ( const T x)

Definition at line 1277 of file MathFunctions.h.

1277 { return internal::isinf_impl(x); }
bool isinf_impl(const std::complex< T > &x)

◆ isnan() [1/2]

template<>
EIGEN_ALWAYS_INLINE bool() Eigen::numext::isnan ( const Eigen::bfloat16 h)

Definition at line 778 of file BFloat16.h.

778  {
779  return (bfloat16_impl::isnan)(h);
780 }
EIGEN_ALWAYS_INLINE bool() isnan(const Eigen::bfloat16 &h)
Definition: BFloat16.h:778

◆ isnan() [2/2]

template<typename T >
bool() Eigen::numext::isnan ( const T x)

Definition at line 1276 of file MathFunctions.h.

1276 { return internal::isnan_impl(x); }
bool isnan_impl(const std::complex< T > &x)

◆ log()

template<typename T >
EIGEN_ALWAYS_INLINE T Eigen::numext::log ( const T x)

Definition at line 1393 of file MathFunctions.h.

1393  {
1394  return internal::log_impl<T>::run(x);
1395 }

◆ log2()

int Eigen::numext::log2 ( int  x)
inline

Log base 2 for 32 bits positive integers. Conveniently returns 0 for x==0.

Definition at line 1345 of file MathFunctions.h.

1346 {
1347  eigen_assert(x>=0);
1348  unsigned int v(x);
1349  static const int table[32] = { 0, 9, 1, 10, 13, 21, 2, 29, 11, 14, 16, 18, 22, 25, 3, 30, 8, 12, 20, 28, 15, 17, 24, 7, 19, 27, 23, 6, 26, 5, 4, 31 };
1350  v |= v >> 1;
1351  v |= v >> 2;
1352  v |= v >> 4;
1353  v |= v >> 8;
1354  v |= v >> 16;
1355  return table[(v * 0x07C4ACDDU) >> 27];
1356 }
Array< int, Dynamic, 1 > v
#define eigen_assert(x)
Definition: Macros.h:902
ArrayXXf table(10, 4)

◆ maxi()

template<typename T >
EIGEN_ALWAYS_INLINE T Eigen::numext::maxi ( const T x,
const T y 
)

Definition at line 985 of file MathFunctions.h.

986 {
988  return max EIGEN_NOT_A_MACRO (x,y);
989 }
#define EIGEN_NOT_A_MACRO
Definition: Macros.h:804
bfloat16() max(const bfloat16 &a, const bfloat16 &b)
Definition: BFloat16.h:690

◆ mini()

template<typename T >
EIGEN_ALWAYS_INLINE T Eigen::numext::mini ( const T x,
const T y 
)

Definition at line 977 of file MathFunctions.h.

978 {
980  return min EIGEN_NOT_A_MACRO (x,y);
981 }
bfloat16() min(const bfloat16 &a, const bfloat16 &b)
Definition: BFloat16.h:684

◆ not_equal_strict() [1/3]

template<>
bool Eigen::numext::not_equal_strict ( const double &  x,
const double &  y 
)
inline

Definition at line 492 of file Meta.h.

492 { return std::not_equal_to<double>()(x,y); }

◆ not_equal_strict() [2/3]

template<>
bool Eigen::numext::not_equal_strict ( const float &  x,
const float &  y 
)
inline

Definition at line 489 of file Meta.h.

489 { return std::not_equal_to<float>()(x,y); }

◆ not_equal_strict() [3/3]

template<typename X , typename Y >
bool Eigen::numext::not_equal_strict ( const X x,
const Y &  y 
)
inline

Definition at line 485 of file Meta.h.

485 { return !equal_strict_impl<X, Y>::run(x, y); }

◆ pow()

template<typename ScalarX , typename ScalarY >
internal::pow_impl<ScalarX,ScalarY>::result_type Eigen::numext::pow ( const ScalarX &  x,
const ScalarY &  y 
)
inline

Definition at line 1267 of file MathFunctions.h.

1268 {
1269  return internal::pow_impl<ScalarX,ScalarY>::run(x, y);
1270 }

◆ real_ref()

template<typename Scalar >
internal::add_const_on_value_type_t< EIGEN_MATHFUNC_RETVAL(real_ref, Scalar) > Eigen::numext::real_ref ( const Scalar &  x)
inline

Definition at line 1136 of file MathFunctions.h.

1137 {
1138  return internal::real_ref_impl<Scalar>::run(x);
1139 }

◆ rint()

template<typename Scalar >
Scalar Eigen::numext::rint ( const Scalar &  x)
inline

Definition at line 1288 of file MathFunctions.h.

1289 {
1290  return internal::nearest_integer_impl<Scalar>::run_rint(x);
1291 }

◆ round()

template<typename Scalar >
Scalar Eigen::numext::round ( const Scalar &  x)
inline

Definition at line 1295 of file MathFunctions.h.

1296 {
1297  return internal::nearest_integer_impl<Scalar>::run_round(x);
1298 }

◆ rsqrt()

template<typename T >
EIGEN_ALWAYS_INLINE T Eigen::numext::rsqrt ( const T x)
Returns
the reciprocal square root of x.

Definition at line 1386 of file MathFunctions.h.

1387 {
1388  return internal::rsqrt_impl<T>::run(x);
1389 }

◆ signbit()

template<typename Scalar >
static constexpr EIGEN_ALWAYS_INLINE Scalar Eigen::numext::signbit ( const Scalar &  x)
staticconstexpr

Definition at line 1475 of file MathFunctions.h.

1475  {
1476  return signbit_impl<Scalar>::run(x);
1477 }

◆ sin()

template<typename T >
EIGEN_ALWAYS_INLINE T Eigen::numext::sin ( const T x)

Definition at line 1554 of file MathFunctions.h.

1554  {
1556  return sin(x);
1557 }
const SinReturnType sin() const

◆ sinh()

template<typename T >
EIGEN_ALWAYS_INLINE T Eigen::numext::sinh ( const T x)

Definition at line 1699 of file MathFunctions.h.

1699  {
1701  return static_cast<T>(sinh(x));
1702 }
const SinhReturnType sinh() const

◆ sqrt() [1/2]

template<>
EIGEN_ALWAYS_INLINE double Eigen::numext::sqrt ( const double &  x)

Definition at line 69 of file arch/SSE/MathFunctions.h.

70 {
71 #if EIGEN_COMP_GNUC_STRICT
72  // This works around a GCC bug generating poor code for _mm_sqrt_pd
73  // See https://gitlab.com/libeigen/eigen/commit/8dca9f97e38970
74  return internal::pfirst(internal::Packet2d(__builtin_ia32_sqrtsd(_mm_set_sd(x))));
75 #else
76  return internal::pfirst(internal::Packet2d(_mm_sqrt_pd(_mm_set_sd(x))));
77 #endif
78 }
bfloat16 pfirst(const Packet8bf &a)

◆ sqrt() [2/2]

template<>
EIGEN_ALWAYS_INLINE float Eigen::numext::sqrt ( const float &  x)

Definition at line 62 of file arch/SSE/MathFunctions.h.

63 {
64  return internal::pfirst(internal::Packet4f(_mm_sqrt_ss(_mm_set_ss(x))));
65 }
__vector float Packet4f

◆ sqrt< bool >()

Definition at line 1377 of file MathFunctions.h.

1377 { return x; }

◆ swap()

template<typename T >
void Eigen::numext::swap ( T a,
T b 
)
inline

Definition at line 419 of file Meta.h.

419 { std::swap(a,b); }
void swap(T &a, T &b)
Definition: Meta.h:419

◆ tan()

template<typename T >
EIGEN_ALWAYS_INLINE T Eigen::numext::tan ( const T x)

Definition at line 1573 of file MathFunctions.h.

1573  {
1575  return tan(x);
1576 }
const TanReturnType tan() const

◆ tanh()

template<typename T >
EIGEN_ALWAYS_INLINE T Eigen::numext::tanh ( const T x)

Definition at line 1718 of file MathFunctions.h.

1718  {
1720  return tanh(x);
1721 }
const TanhReturnType tanh() const

Variable Documentation

◆ y

const Scalar& Eigen::numext::y

Definition at line 1237 of file MathFunctions.h.