ITK  5.4.0
Insight Toolkit
Classes | Namespaces | Functions | Variables
itkMath.h File Reference
#include <cassert>
#include <cmath>
#include "itkMathDetail.h"
#include "itkConceptChecking.h"
#include <vnl/vnl_math.h>
#include <vxl_version.h>
+ Include dependency graph for itkMath.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  itk::Math::Detail::AlmostEqualsFloatVsFloat
 
struct  itk::Math::Detail::AlmostEqualsFloatVsInteger
 
struct  itk::Math::Detail::AlmostEqualsFunctionSelector< TInput1IsIntger, TInput1IsSigned, TInput2IsInteger, TInput2IsSigned >
 
struct  itk::Math::Detail::AlmostEqualsIntegerVsFloat
 
struct  itk::Math::Detail::AlmostEqualsPlainOldEquals
 
struct  itk::Math::Detail::AlmostEqualsSignedVsUnsigned
 
struct  itk::Math::Detail::AlmostEqualsUnsignedVsSigned
 

Namespaces

 itk
 
 itk::Math
 
 itk::Math::Detail
 

Macros

#define itkTemplateFloatingToIntegerMacro(name)
 

Functions

bool itk::Math::abs (bool x)
 
unsigned char itk::Math::abs (char x)
 
unsigned short itk::Math::abs (short x)
 
unsigned char itk::Math::abs (signed char x)
 
unsigned char itk::Math::abs (unsigned char x)
 
unsigned int itk::Math::abs (unsigned int x)
 
unsigned long long itk::Math::abs (unsigned long long x)
 
unsigned long itk::Math::abs (unsigned long x)
 
unsigned short itk::Math::abs (unsigned short x)
 
template<typename T1 , typename T2 >
bool itk::Math::AlmostEquals (T1 x1, T2 x2)
 
template<typename TReturn , typename TInput >
TReturn itk::Math::CastWithRangeCheck (TInput x)
 
template<TReturn , typename TInput >
 itk::Math::Ceil (TInput x)
 
template<typename TInput1 , typename TInput2 >
bool itk::Math::ExactlyEquals (const TInput1 &x1, const TInput2 &x2)
 
template<typename T >
itk::Math::FloatAddULP (T x, typename Detail::FloatIEEE< T >::IntType ulps)
 
template<typename T >
bool itk::Math::FloatAlmostEqual (T x1, T x2, typename Detail::FloatIEEE< T >::IntType maxUlps=4, typename Detail::FloatIEEE< T >::FloatType maxAbsoluteDifference=0.1 *itk::NumericTraits< T >::epsilon())
 
template<typename T >
Detail::FloatIEEE< T >::IntType itk::Math::FloatDifferenceULP (T x1, T x2)
 
template<TReturn , typename TInput >
 itk::Math::Floor (TInput x)
 
template<typename T1 , typename T2 >
bool itk::Math::NotAlmostEquals (T1 x1, T2 x2)
 
template<typename TInput1 , typename TInput2 >
bool itk::Math::NotExactlyEquals (const TInput1 &x1, const TInput2 &x2)
 
template<typename TReturn , typename TInput >
TReturn itk::Math::Round (TInput x)
 
template<TReturn , typename TInput >
 itk::Math::RoundHalfIntegerToEven (TInput x)
 
template<TReturn , typename TInput >
 itk::Math::RoundHalfIntegerUp (TInput x)
 
template<typename TReturnType = uintmax_t>
constexpr TReturnType itk::Math::UnsignedPower (const uintmax_t base, const uintmax_t exponent) noexcept
 
template<typename TReturnType = uintmax_t>
constexpr TReturnType itk::Math::UnsignedProduct (const uintmax_t a, const uintmax_t b) noexcept
 
ITKCommon_EXPORT bool itk::Math::IsPrime (unsigned int n)
 
ITKCommon_EXPORT bool itk::Math::IsPrime (unsigned long long n)
 
ITKCommon_EXPORT bool itk::Math::IsPrime (unsigned long n)
 
ITKCommon_EXPORT bool itk::Math::IsPrime (unsigned short n)
 
ITKCommon_EXPORT unsigned int itk::Math::GreatestPrimeFactor (unsigned int n)
 
ITKCommon_EXPORT unsigned long long itk::Math::GreatestPrimeFactor (unsigned long long n)
 
ITKCommon_EXPORT unsigned long itk::Math::GreatestPrimeFactor (unsigned long n)
 
ITKCommon_EXPORT unsigned short itk::Math::GreatestPrimeFactor (unsigned short n)
 

Variables

static constexpr double itk::Math::deg_per_rad = vnl_math::deg_per_rad
 
static constexpr double itk::Math::e = vnl_math::e
 
static constexpr double itk::Math::eps = vnl_math::eps
 
static constexpr double itk::Math::euler = vnl_math::euler
 
static constexpr float itk::Math::float_eps = vnl_math::float_eps
 
static constexpr float itk::Math::float_sqrteps = vnl_math::float_sqrteps
 
static constexpr double itk::Math::ln10 = vnl_math::ln10
 
static constexpr double itk::Math::ln2 = vnl_math::ln2
 
static constexpr double itk::Math::log10e = vnl_math::log10e
 
static constexpr double itk::Math::log2e = vnl_math::log2e
 
static constexpr double itk::Math::one_over_pi = vnl_math::one_over_pi
 
static constexpr double itk::Math::one_over_sqrt2pi = vnl_math::one_over_sqrt2pi
 
static constexpr double itk::Math::pi = vnl_math::pi
 
static constexpr double itk::Math::pi_over_180 = vnl_math::pi_over_180
 
static constexpr double itk::Math::pi_over_2 = vnl_math::pi_over_2
 
static constexpr double itk::Math::pi_over_4 = vnl_math::pi_over_4
 
static constexpr double itk::Math::sqrt1_2 = vnl_math::sqrt1_2
 
static constexpr double itk::Math::sqrt1_3 = vnl_math::sqrt1_3
 
static constexpr double itk::Math::sqrt2 = vnl_math::sqrt2
 
static constexpr double itk::Math::sqrt2pi = vnl_math::sqrt2pi
 
static constexpr double itk::Math::sqrteps = vnl_math::sqrteps
 
static constexpr double itk::Math::two_over_pi = vnl_math::two_over_pi
 
static constexpr double itk::Math::two_over_sqrtpi = vnl_math::two_over_sqrtpi
 
static constexpr double itk::Math::twopi = vnl_math::twopi
 

Macro Definition Documentation

◆ itkTemplateFloatingToIntegerMacro

#define itkTemplateFloatingToIntegerMacro (   name)
Value:
template <typename TReturn, typename TInput> \
inline TReturn name(TInput x) \
{ \
if constexpr (sizeof(TReturn) <= 4) \
{ \
return static_cast<TReturn>(Detail::name##_32(x)); \
} \
else if constexpr (sizeof(TReturn) <= 8) \
{ \
return static_cast<TReturn>(Detail::name##_64(x)); \
} \
else \
{ \
return static_cast<TReturn>(Detail::name##_base<TReturn, TInput>(x)); \
} \
}

A useful macro to generate a template floating point to integer conversion templated on the return type and using either the 32 bit, the 64 bit or the vanilla version

Definition at line 106 of file itkMath.h.