ITK  4.2.0
Insight Segmentation and Registration Toolkit
Namespaces | Functions | Variables
itkMath.h File Reference

Go to the source code of this file.

Namespaces

namespace  itk
namespace  itk::Math

Macros

#define itkTemplateFloatingToIntegerMacro(name)

Functions

template<typename TReturn , typename TInput >
TReturn itk::Math::CastWithRangeCheck (TInput x)
template<TReturn , typename TInput >
 itk::Math::Ceil (TInput x)
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 *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 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)

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 76 of file itkMath.h.