vtkITKNumericTraits.h
Go to the documentation of this file.00001
00002
00003
00004 #ifndef __vtkITKNumericTraits_h
00005 #define __vtkITKNumericTraits_h
00006
00007 #include "vtkITK.h"
00008 #include "vtkSystemIncludes.h"
00009
00010 #include "itkNumericTraits.h"
00011
00012 namespace itk
00013 {
00014
00015 #if defined(VTK_TYPE_USE___INT64)
00016 template <>
00017 class NumericTraits<__int64> : public vcl_numeric_limits<__int64> {
00018 public:
00019 typedef __int64 ValueType;
00020 typedef __int64 PrintType;
00021 typedef unsigned __int64 AbsType;
00022 typedef __int64 AccumulateType;
00023 typedef double RealType;
00024 typedef RealType ScalarRealType;
00025 typedef float FloatType;
00026 static const __int64 VTK_ITK_EXPORT Zero;
00027 static const __int64 VTK_ITK_EXPORT One;
00028
00029 static __int64 min( ) { return vcl_numeric_limits<__int64>::min(); }
00030 static __int64 max( ) { return vcl_numeric_limits<__int64>::max(); }
00031 static __int64 min( __int64 ) { return vcl_numeric_limits<__int64>::min(); }
00032 static __int64 max( __int64 ) { return vcl_numeric_limits<__int64>::max(); }
00033 static __int64 NonpositiveMin() { return min(); }
00034 static bool IsPositive(__int64 val) { return val > Zero; }
00035 static bool IsNonpositive(__int64 val) { return val <= Zero; }
00036 static bool IsNegative(__int64 val) { return val < Zero; }
00037 static bool IsNonnegative(__int64 val) {return val >= Zero; }
00038 static __int64 ZeroValue() { return Zero; }
00039 };
00040
00041 template <>
00042 class NumericTraits<unsigned __int64> : public vcl_numeric_limits<unsigned __int64> {
00043 public:
00044 typedef unsigned __int64 ValueType;
00045 typedef unsigned __int64 PrintType;
00046 typedef unsigned __int64 AbsType;
00047 typedef unsigned __int64 AccumulateType;
00048 typedef double RealType;
00049 typedef RealType ScalarRealType;
00050 typedef float FloatType;
00051 static const unsigned __int64 VTK_ITK_EXPORT Zero;
00052 static const unsigned __int64 VTK_ITK_EXPORT One;
00053
00054 static unsigned __int64 min( ) { return vcl_numeric_limits<unsigned __int64>::min(); }
00055 static unsigned __int64 max( ) { return vcl_numeric_limits<unsigned __int64>::max(); }
00056 static unsigned __int64 min( unsigned __int64 ) { return vcl_numeric_limits<unsigned __int64>::min(); }
00057 static unsigned __int64 max( unsigned __int64 ) { return vcl_numeric_limits<unsigned __int64>::max(); }
00058 static unsigned __int64 NonpositiveMin() { return min(); }
00059 static bool IsPositive(unsigned __int64 val) { return val != Zero; }
00060 static bool IsNonpositive(unsigned __int64 val) { return val == Zero; }
00061 static bool IsNegative(unsigned __int64) { return false; }
00062 static bool IsNonnegative(unsigned __int64) {return true; }
00063 static unsigned __int64 ZeroValue() { return Zero; }
00064 };
00065 #endif
00066
00067 #if defined(VTK_TYPE_USE_LONG_LONG) && !defined(ITK_TYPE_USE_LONG_LONG)
00068 template <>
00069 class NumericTraits<long long> : public vcl_numeric_limits<long long> {
00070 public:
00071 typedef long long ValueType;
00072 typedef long long PrintType;
00073 typedef unsigned long long AbsType;
00074 typedef long long AccumulateType;
00075 typedef double RealType;
00076 typedef RealType ScalarRealType;
00077 typedef float FloatType;
00078 static const long long VTK_ITK_EXPORT Zero;
00079 static const long long VTK_ITK_EXPORT One;
00080
00081 static long long min( ) { return vcl_numeric_limits<long long>::min(); }
00082 static long long max( ) { return vcl_numeric_limits<long long>::max(); }
00083 static long long min( long long ) { return vcl_numeric_limits<long long>::min(); }
00084 static long long max( long long ) { return vcl_numeric_limits<long long>::max(); }
00085 static long long NonpositiveMin() { return vcl_numeric_limits<long long>::min(); }
00086 static bool IsPositive(long long val) { return val > Zero; }
00087 static bool IsNonpositive(long long val) { return val <= Zero; }
00088 static bool IsNegative(long long val) { return val < Zero; }
00089 static bool IsNonnegative(long long val) {return val >= Zero; }
00090 static long long ZeroValue() { return Zero; }
00091 };
00092
00093 template <>
00094 class NumericTraits<unsigned long long> : public vcl_numeric_limits<unsigned long long> {
00095 public:
00096 typedef unsigned long long ValueType;
00097 typedef unsigned long long PrintType;
00098 typedef unsigned long long AbsType;
00099 typedef unsigned long long AccumulateType;
00100 typedef double RealType;
00101 typedef RealType ScalarRealType;
00102 typedef float FloatType;
00103 static const unsigned long long VTK_ITK_EXPORT Zero;
00104 static const unsigned long long VTK_ITK_EXPORT One;
00105
00106 static unsigned long long min( ) { return vcl_numeric_limits<unsigned long long>::min(); }
00107 static unsigned long long max( ) { return vcl_numeric_limits<unsigned long long>::max(); }
00108 static unsigned long long min( unsigned long long ) { return vcl_numeric_limits<unsigned long long>::min(); }
00109 static unsigned long long max( unsigned long long ) { return vcl_numeric_limits<unsigned long long>::max(); }
00110 static unsigned long long NonpositiveMin() { return vcl_numeric_limits<unsigned long long>::min(); }
00111 static bool IsPositive(unsigned long long val) { return val != Zero; }
00112 static bool IsNonpositive(unsigned long long val) { return val == Zero; }
00113 static bool IsNegative(unsigned long long) { return false; }
00114 static bool IsNonnegative(unsigned long long) {return true; }
00115 static unsigned long long ZeroValue() { return Zero; }
00116 };
00117 #endif
00118
00119 }
00120
00121 #endif