ITK  4.9.0
Insight Segmentation and Registration Toolkit
Classes | Namespaces | Functions | Variables
itkMath.h File Reference
#include "itkIntTypes.h"
#include "itkMathDetail.h"
#include "itkConceptChecking.h"
#include "itkNumericTraits.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

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 >
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)
 
ITKCommon_EXPORT bool itk::Math::IsPrime (unsigned short n)
 
ITKCommon_EXPORT bool itk::Math::IsPrime (unsigned int n)
 
ITKCommon_EXPORT bool itk::Math::IsPrime (unsigned long n)
 
ITKCommon_EXPORT bool itk::Math::IsPrime (unsigned long long n)
 
ITKCommon_EXPORT unsigned short itk::Math::GreatestPrimeFactor (unsigned short n)
 
ITKCommon_EXPORT unsigned int itk::Math::GreatestPrimeFactor (unsigned int n)
 
ITKCommon_EXPORT unsigned long itk::Math::GreatestPrimeFactor (unsigned long n)
 
ITKCommon_EXPORT unsigned long long itk::Math::GreatestPrimeFactor (unsigned long long n)
 

Variables

static const double itk::Math::e = 2.7182818284590452354
 
static const double itk::Math::ln10 = 2.30258509299404568402
 
static const double itk::Math::ln2 = 0.69314718055994530942
 
static const double itk::Math::log10e = 0.43429448190325182765
 
static const double itk::Math::log2e = 1.4426950408889634074
 
static const double itk::Math::one_over_pi = 0.31830988618379067154
 
static const double itk::Math::one_over_sqrt2pi = 0.39894228040143267794
 
static const double itk::Math::pi = 3.14159265358979323846
 
static const double itk::Math::pi_over_2 = 1.57079632679489661923
 
static const double itk::Math::pi_over_4 = 0.78539816339744830962
 
static const double itk::Math::sqrt1_2 = 0.70710678118654752440
 
static const double itk::Math::sqrt2 = 1.41421356237309504880
 
static const double itk::Math::two_over_pi = 0.63661977236758134308
 
static const double itk::Math::two_over_sqrtpi = 1.12837916709551257390
 

Macro Definition Documentation

#define itkTemplateFloatingToIntegerMacro (   name)
Value:
template< typename TReturn, typename TInput > \
inline TReturn name(TInput x) \
{ \
\
if ( sizeof( TReturn ) <= 4 ) \
{ \
return static_cast< TReturn >( Detail::name##_32(x) ); \
} \
else if ( 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 78 of file itkMath.h.