Main Page   Groups   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Concepts

vnl_complex.h

Go to the documentation of this file.
00001 // This is vxl/vnl/vnl_complex.h
00002 
00003 //-*- c++ -*-------------------------------------------------------------------
00004 #ifndef vnl_complex_h_
00005 #define vnl_complex_h_
00006 
00007 //: \file
00008 //  \brief Complex additions to vnl_math.
00009 //
00010 //     We don't want everyone to pay for complex when they don't need it, as
00011 //     its ratio of expense to frequency of use is high. So we define those
00012 //     functions from vnl_math which use complex here instead.
00013 //     In a sense, vnl_math should be a namespace, and this file adds to that
00014 //     namespace.
00015 
00016 // Modifications
00017 // LSB (Manchester) 26/3/01 Tidied documentation
00018 
00019 #include <vcl_cmath.h>
00020 #include <vcl_complex.h>
00021 #include <vnl/vnl_math.h>
00022 
00023 // these function could have been templated, if not for the
00024 // broken overload resolution of SGI CC 7.2.x -- fsm
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 // // isinf
00038 // template <class T> inline
00039 // bool vnl_math_isinf(const vcl_complex<T>& z)
00040 // {
00041 //   reutrn vnl_math_isinf(z.real()) || vnl_math_isinf(z.imag());
00042 // }
00043 
00044 #endif // vnl_complex_h_

Generated at Fri May 21 01:15:46 2004 for ITK by doxygen 1.2.15 written by Dimitri van Heesch, © 1997-2000