ITK
4.1.0
Insight Segmentation and Registration Toolkit
|
#include <itkNumericTraits.h>
Public Types | |
typedef T | AbsType |
typedef double | AccumulateType |
typedef float | FloatType |
typedef FixedArray< ValueType, 1 > | MeasurementVectorType |
typedef T | PrintType |
typedef double | RealType |
typedef RealType | ScalarRealType |
typedef std::numeric_limits< T > | TraitsType |
typedef T | ValueType |
Static Public Member Functions | |
template<class TArray > | |
static void | AssignToArray (const T &v, TArray &mv) |
static unsigned int | GetLength (const T &) |
static unsigned int | GetLength () |
static bool | IsNegative (T val) |
static bool | IsNonnegative (T val) |
static bool | IsNonpositive (T val) |
static bool | IsPositive (T val) |
static T | max (const T &) |
static T | min (const T &) |
static T | NonpositiveMin () |
static T | NonpositiveMin (const T &) |
static T | OneValue () |
static T | OneValue (const T &) |
static void | SetLength (T &, const unsigned int s) |
static T | ZeroValue () |
static T | ZeroValue (const T &) |
Static Public Attributes | |
static const T | One |
static const T | Zero |
Define additional traits for native types such as int or float.
NumericTraits is used to extend the traits associated with native types such as float, char, int, and so on. These traits are extensions of the standard numeric_limits defined by the C++ compilers. Some of the added traits include minimum and maximum value; accumulation type; etc.
Definition at line 70 of file itkNumericTraits.h.
typedef T itk::NumericTraits< T >::AbsType |
Return value of vcl_abs().
Definition at line 83 of file itkNumericTraits.h.
typedef double itk::NumericTraits< T >::AccumulateType |
Accumulation of addition and multiplication.
Definition at line 86 of file itkNumericTraits.h.
typedef float itk::NumericTraits< T >::FloatType |
Typedef for operations that use floating point instead of real precision to save memory
Definition at line 93 of file itkNumericTraits.h.
typedef FixedArray<ValueType, 1> itk::NumericTraits< T >::MeasurementVectorType |
Measurement vector type
Definition at line 89 of file itkNumericTraits.h.
typedef T itk::NumericTraits< T >::PrintType |
Return the type that can be printed.
Definition at line 80 of file itkNumericTraits.h.
typedef double itk::NumericTraits< T >::RealType |
Type for real-valued scalar operations.
Definition at line 96 of file itkNumericTraits.h.
typedef RealType itk::NumericTraits< T >::ScalarRealType |
Type for real-valued scalar operations.
Definition at line 99 of file itkNumericTraits.h.
typedef std::numeric_limits< T > itk::NumericTraits< T >::TraitsType |
The type of this limits trait object.
Definition at line 74 of file itkNumericTraits.h.
typedef T itk::NumericTraits< T >::ValueType |
Return the type of this native type.
Definition at line 77 of file itkNumericTraits.h.
static void itk::NumericTraits< T >::AssignToArray | ( | const T & | v, |
TArray & | mv | ||
) | [inline, static] |
assign the value to an array
Definition at line 196 of file itkNumericTraits.h.
static unsigned int itk::NumericTraits< T >::GetLength | ( | const T & | ) | [inline, static] |
Return the length of the scalar. This API is needed for VariableLengthVector because its length is only known at run-time. Specializations of the VariableLengthVector will provide a different implementation where a vector of the correct size is built.
Definition at line 159 of file itkNumericTraits.h.
static unsigned int itk::NumericTraits< T >::GetLength | ( | ) | [inline, static] |
Return the length of the scalar: 1. Array types can return a different value
Definition at line 165 of file itkNumericTraits.h.
Referenced by itk::NumericTraits< Array< T > >::AssignToArray(), itk::NumericTraits< std::vector< T > >::AssignToArray(), itk::NumericTraits< SymmetricSecondRankTensor< T, D > >::AssignToArray(), itk::NumericTraits< VariableLengthVector< T > >::AssignToArray(), itk::NumericTraits< SymmetricSecondRankTensor< T, D > >::GetLength(), and itk::NumericTraits< InputImagePixelType >::GetLength().
static bool itk::NumericTraits< T >::IsNegative | ( | T | val | ) | [inline, static] |
Is a given value negative?
Definition at line 117 of file itkNumericTraits.h.
static bool itk::NumericTraits< T >::IsNonnegative | ( | T | val | ) | [inline, static] |
Is a given value nonnegative?
Definition at line 120 of file itkNumericTraits.h.
static bool itk::NumericTraits< T >::IsNonpositive | ( | T | val | ) | [inline, static] |
Is a given value nonpositive?
Definition at line 114 of file itkNumericTraits.h.
static bool itk::NumericTraits< T >::IsPositive | ( | T | val | ) | [inline, static] |
Is a given value positive?
Definition at line 111 of file itkNumericTraits.h.
static T itk::NumericTraits< T >::max | ( | const T & | ) | [inline, static] |
Definition at line 135 of file itkNumericTraits.h.
Referenced by itk::NumericTraits< std::vector< T > >::max(), itk::NumericTraits< InputImagePixelType >::max(), and RegressionTestImage().
static T itk::NumericTraits< T >::min | ( | const T & | ) | [inline, static] |
Definition at line 136 of file itkNumericTraits.h.
Referenced by itk::NumericTraits< std::vector< T > >::min(), itk::NumericTraits< InputImagePixelType >::min(), and itk::NumericTraits< InputImagePixelType >::NonpositiveMin().
static T itk::NumericTraits< T >::NonpositiveMin | ( | ) | [inline, static] |
Smallest (most nonpositive) value
Definition at line 108 of file itkNumericTraits.h.
Referenced by itk::NumericTraits< Vector< T, D > >::NonpositiveMin(), itk::NumericTraits< Point< T, D > >::NonpositiveMin(), itk::NumericTraits< RGBAPixel< T > >::NonpositiveMin(), itk::NumericTraits< RGBPixel< T > >::NonpositiveMin(), itk::NumericTraits< SymmetricSecondRankTensor< T, D > >::NonpositiveMin(), itk::NumericTraits< CovariantVector< T, D > >::NonpositiveMin(), itk::NumericTraits< FixedArray< T, D > >::NonpositiveMin(), itk::NumericTraits< std::vector< T > >::NonpositiveMin(), and itk::NumericTraits< InputImagePixelType >::NonpositiveMin().
static T itk::NumericTraits< T >::NonpositiveMin | ( | const T & | ) | [inline, static] |
Smallest (most nonpositive) value. This API is needed for VariableLengthVector because its length is only known at run-time.
Definition at line 173 of file itkNumericTraits.h.
static T itk::NumericTraits< T >::OneValue | ( | ) | [inline, static] |
Return one value. This function should be used to support RGBPixel type and standard types (not vectors)
Definition at line 128 of file itkNumericTraits.h.
Referenced by itk::NumericTraits< Vector< T, D > >::OneValue(), itk::NumericTraits< Point< T, D > >::OneValue(), itk::NumericTraits< RGBAPixel< T > >::OneValue(), itk::NumericTraits< RGBPixel< T > >::OneValue(), itk::NumericTraits< CovariantVector< T, D > >::OneValue(), itk::NumericTraits< SymmetricSecondRankTensor< T, D > >::OneValue(), itk::NumericTraits< FixedArray< T, D > >::OneValue(), and itk::NumericTraits< InputImagePixelType >::OneValue().
static T itk::NumericTraits< T >::OneValue | ( | const T & | ) | [inline, static] |
One value. This API is needed for VariableLengthVector because its length is only known at run-time.
Definition at line 189 of file itkNumericTraits.h.
static void itk::NumericTraits< T >::SetLength | ( | T & | , |
const unsigned int | s | ||
) | [inline, static] |
Scalars cannot be resized, so an exception will be thrown if the input size is not 1. If the size is valid the will be zeros. This API is needed for VariableLengthVector because its length is only known at run-time. Specializations of the VariableLengthVector will provide a different implementation where a vector of the correct size is built.
Definition at line 145 of file itkNumericTraits.h.
static T itk::NumericTraits< T >::ZeroValue | ( | ) | [inline, static] |
Return zero value. This function should be used to support RGBPixel type and standard types (not vectors)
Definition at line 124 of file itkNumericTraits.h.
Referenced by itk::NumericTraits< Vector< T, D > >::ZeroValue(), itk::NumericTraits< Point< T, D > >::ZeroValue(), itk::NumericTraits< RGBAPixel< T > >::ZeroValue(), itk::NumericTraits< RGBPixel< T > >::ZeroValue(), itk::NumericTraits< CovariantVector< T, D > >::ZeroValue(), itk::NumericTraits< SymmetricSecondRankTensor< T, D > >::ZeroValue(), itk::NumericTraits< FixedArray< T, D > >::ZeroValue(), and itk::NumericTraits< InputImagePixelType >::ZeroValue().
static T itk::NumericTraits< T >::ZeroValue | ( | const T & | ) | [inline, static] |
Zero value. This API is needed for VariableLengthVector because its length is only known at run-time.
Definition at line 181 of file itkNumericTraits.h.
const T itk::NumericTraits< T >::One [static] |
Multiplicative identity.
Definition at line 105 of file itkNumericTraits.h.
Referenced by itk::NumericTraits< InputImagePixelType >::OneValue().
const T itk::NumericTraits< T >::Zero [static] |
Additive identity.
Definition at line 102 of file itkNumericTraits.h.
Referenced by itk::NumericTraits< InputImagePixelType >::IsNegative(), itk::NumericTraits< InputImagePixelType >::IsNonnegative(), itk::NumericTraits< InputImagePixelType >::IsNonpositive(), itk::NumericTraits< InputImagePixelType >::IsPositive(), and itk::NumericTraits< InputImagePixelType >::ZeroValue().