00001
00002
00003
00004 #ifndef vnl_complex_h_
00005 #define vnl_complex_h_
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #include <vcl_cmath.h>
00020 #include <vcl_complex.h>
00021 #include <vnl/vnl_math.h>
00022
00023
00024
00025
00026 #define macro(T) \
00027 inline bool vnl_math_isnan(vcl_complex<T> const& z) { return vnl_math_isnan(z.real()) || vnl_math_isnan(z.imag()); } \
00028 inline bool vnl_math_isfinite(vcl_complex<T> const& z) { return vnl_math_isfinite(z.real()) && vnl_math_isfinite(z.imag()); } \
00029 inline T vnl_math_abs(vcl_complex<T> const& z) { return vcl_abs(z); } \
00030 inline vcl_complex<T> vnl_math_sqr(vcl_complex<T> const& z) { return z*z; } \
00031 inline T vnl_math_squared_magnitude(vcl_complex<T> const& z) { return vcl_norm(z); }
00032 macro(float)
00033 macro(double)
00034 macro(long double)
00035 #undef macro
00036
00037
00038
00039
00040
00041
00042
00043
00044 #endif // vnl_complex_h_