2 #ifndef vnl_numeric_traits_h_ 3 #define vnl_numeric_traits_h_ 27 #include <vxl_config.h> 29 # include <vcl_msvc_warnings.h> 31 #include "vnl/vnl_export.h" 35 #if !defined(_MSC_VER) || (_MSC_VER >= 1800 ) 44 class VNL_EXPORT vnl_numeric_traits_not_a_valid_type { };
50 static constexpr vnl_numeric_traits_not_a_valid_type zero;
53 static constexpr vnl_numeric_traits_not_a_valid_type one;
56 static constexpr vnl_numeric_traits_not_a_valid_type maxval;
59 typedef vnl_numeric_traits_not_a_valid_type abs_t;
62 typedef vnl_numeric_traits_not_a_valid_type double_t;
65 typedef vnl_numeric_traits_not_a_valid_type real_t;
75 static constexpr
bool zero =
false;
77 static constexpr
bool one =
true;
79 static constexpr
bool maxval =
true;
81 typedef unsigned int abs_t;
97 static constexpr
char zero = 0;
99 static constexpr
char one = 1;
103 #ifdef _CHAR_UNSIGNED 104 static constexpr
char maxval = 255;
106 static constexpr
char maxval = 127;
109 static constexpr
char maxval = (char(255)<char(0)?char(127):char(255));
112 typedef unsigned char abs_t;
127 static constexpr
unsigned char zero = 0;
129 static constexpr
unsigned char one = 1;
131 static constexpr
unsigned char maxval = 255;
133 typedef unsigned char abs_t;
148 static constexpr
signed char zero = 0;
150 static constexpr
signed char one = 1;
152 static constexpr
signed char maxval = 127;
154 typedef unsigned char abs_t;
169 static constexpr
short zero = 0;
171 static constexpr
short one = 1;
173 static constexpr
short maxval = 0x7fff;
175 typedef unsigned short abs_t;
190 static constexpr
unsigned short zero = 0;
192 static constexpr
unsigned short one = 1;
194 static constexpr
unsigned short maxval = 0xffff;
196 typedef unsigned short abs_t;
211 static constexpr
int zero = 0;
213 static constexpr
int one = 1;
215 static constexpr
int maxval = 0x7fffffff;
217 typedef unsigned int abs_t;
232 static constexpr
unsigned int zero = 0;
234 static constexpr
unsigned int one = 1;
236 static constexpr
unsigned int maxval = 0xffffffff;
238 typedef unsigned int abs_t;
253 static constexpr
long zero = 0;
255 static constexpr
long one = 1;
257 static constexpr
long maxval =
sizeof(long)==8?(vxl_uint_64)(-1)/2:0x7fffffffL;
259 typedef unsigned long abs_t;
274 static constexpr
unsigned long zero = 0;
276 static constexpr
unsigned long one = 1;
278 static constexpr
unsigned long maxval =
sizeof(
unsigned long)==8?((vxl_uint_64)(-1)):0xffffffffL ;
281 typedef unsigned long abs_t;
298 static constexpr
long long zero = 0;
300 static constexpr
long long one = 1;
302 static constexpr
long long maxval =
sizeof(
long long)==8?((vxl_uint_64)(-1))/2:0x7fffffffL ;
304 typedef unsigned long long abs_t;
319 static constexpr
unsigned long long zero = 0;
321 static constexpr
unsigned long long one = 1;
323 static constexpr
unsigned long long maxval =
sizeof(
unsigned long long)==8?(vxl_uint_64)(-1):0xffffffffL;
325 typedef unsigned long long abs_t;
327 typedef unsigned long long double_t;
341 static constexpr
float zero = 0.0F;
343 static constexpr
float one = 1.0F;
345 static constexpr
float maxval = 3.40282346638528860e+38F;
362 static constexpr
double zero = 0.0;
364 static constexpr
double one = 1.0;
366 static constexpr
double maxval = 1.7976931348623157E+308;
368 typedef double abs_t;
383 static constexpr
long double zero = 0.0;
385 static constexpr
long double one = 1.0;
387 static constexpr
long double maxval = 1.7976931348623157E+308;
389 typedef long double abs_t;
393 typedef long double real_t;
404 static const std::complex<float> zero;
406 static const std::complex<float> one;
413 typedef std::complex<vnl_numeric_traits<float>::double_t>
double_t;
415 typedef std::complex<float>
real_t;
426 static const std::complex<double> zero;
428 static const std::complex<double> one;
433 typedef double abs_t;
435 typedef std::complex<vnl_numeric_traits<double>::double_t>
double_t;
437 typedef std::complex<double>
real_t;
448 static const std::complex<long double> zero;
450 static const std::complex<long double> one;
455 typedef long double abs_t;
457 typedef std::complex<vnl_numeric_traits<long double>::double_t>
double_t;
459 typedef std::complex<long double>
real_t;
465 #endif // vnl_numeric_traits_h_ double real_t
Name of type which results from multiplying this type with a double.
long double double_t
Name of a type twice as long as this one for accumulators and products.
unsigned long abs_t
Return value of abs().
unsigned short abs_t
Return value of abs().
unsigned long long abs_t
Return value of abs().
unsigned char abs_t
Return value of abs().
unsigned int abs_t
Return value of abs().
double real_t
Name of type which results from multiplying this type with a double.
double real_t
Name of type which results from multiplying this type with a double.
unsigned int double_t
Name of a type twice as long as this one for accumulators and products.
float abs_t
Return value of abs().
float abs_t
Return value of abs().
double real_t
Name of type which results from multiplying this type with a double.
double real_t
Name of type which results from multiplying this type with a double.
unsigned short double_t
Name of a type twice as long as this one for accumulators and products.
std::complex< vnl_numeric_traits< double >::double_t > double_t
Name of a type twice as long as this one for accumulators and products.
vxl_uint_64 double_t
Name of a type twice as long as this one for accumulators and products.
double real_t
Name of type which results from multiplying this type with a double.
long double_t
Name of a type twice as long as this one for accumulators and products.
double real_t
Name of type which results from multiplying this type with a double.
unsigned short abs_t
Return value of abs().
unsigned int abs_t
Return value of abs().
signed short double_t
Name of a type twice as long as this one for accumulators and products.
long double abs_t
Return value of abs().
long double abs_t
Return value of abs().
std::complex< long double > real_t
Name of type which results from multiplying this type with a double.
int double_t
Name of a type twice as long as this one for accumulators and products.
unsigned long long double_t
Name of a type twice as long as this one for accumulators and products.
unsigned long abs_t
Return value of abs().
long long double_t
Name of a type twice as long as this one for accumulators and products.
double real_t
Name of type which results from multiplying this type with a double.
double real_t
Name of type which results from multiplying this type with a double.
unsigned int abs_t
Return value of abs().
double abs_t
Return value of abs().
double abs_t
Return value of abs().
unsigned int double_t
Name of a type twice as long as this one for accumulators and products.
double real_t
Name of type which results from multiplying this type with a double.
double real_t
Name of type which results from multiplying this type with a double.
unsigned long double_t
Name of a type twice as long as this one for accumulators and products.
short double_t
Name of a type twice as long as this one for accumulators and products.
vxl_sint_64 double_t
Name of a type twice as long as this one for accumulators and products.
double real_t
Name of type which results from multiplying this type with a double.
unsigned char abs_t
Return value of abs().
long double double_t
Name of a type twice as long as this one for accumulators and products.
std::complex< float > real_t
Name of type which results from multiplying this type with a double.
unsigned long long abs_t
Return value of abs().
double double_t
Name of a type twice as long as this one for accumulators and products.
std::complex< vnl_numeric_traits< long double >::double_t > double_t
Name of a type twice as long as this one for accumulators and products.
double real_t
Name of type which results from multiplying this type with a double.
long double real_t
Name of type which results from multiplying this type with a double.
std::complex< vnl_numeric_traits< float >::double_t > double_t
Name of a type twice as long as this one for accumulators and products.
unsigned char abs_t
Return value of abs().
std::complex< double > real_t
Name of type which results from multiplying this type with a double.
double real_t
Name of type which results from multiplying this type with a double.