type.hpp

Go to the documentation of this file.
00001 #ifndef boost_numeric_bindings_type_hpp
00002 #define boost_numeric_bindings_type_hpp
00003 
00004 // This header provides typedefs to float complex and double complex.
00005 // This makes it possible to redefine the complex class being used.
00006 
00007 #include <complex>
00008 
00009 namespace boost { namespace numeric { namespace bindings { namespace traits {
00010 
00011   /* The types for single and double precision complex numbers.
00012    * You can use your own types if you define
00013    * BOOST_NUMERIC_BINDINGS_USE_CUSTOM_COMPLEX_TYPE.
00014    * Note that these types must have the same memory layout as the
00015    * corresponding FORTRAN types.
00016    * For that reason you can even use a different type in each translation
00017    * unit and the resulting binary will still work!
00018    */
00019 #ifndef BOOST_NUMERIC_BINDINGS_USE_CUSTOM_COMPLEX_TYPE
00020   typedef std::complex< float >  complex_f ;
00021   typedef std::complex< double > complex_d ; 
00022 #endif
00023 
00024   template <typename T> 
00025   T real (std::complex<T> const& c) { return std::real (c); }
00026   template <typename T> 
00027   T imag (std::complex<T> const& c) { return std::imag (c); }
00028 
00029 }}}}
00030 
00031 #endif // boost_numeric_bindings_type_hpp

Generated on Wed Nov 23 19:00:51 2011 for FreeCAD by  doxygen 1.6.1