realroot_doc 0.1.1
|
00001 #ifndef realroot_ARITHM_TRAITS_STRUCTUREOF_H 00002 #define realroot_ARITHM_TRAITS_STRUCTUREOF_H 00003 00004 #include <realroot/texp.hpp> 00005 #include <realroot/texp_kernelof.hpp> 00006 00007 namespace mmx { 00008 00009 namespace texp { 00010 00011 namespace structure { 00012 00013 struct scalar 00014 { 00015 struct floating; 00016 struct integer; 00017 struct rational; 00018 struct complex; 00019 struct interval; 00020 }; 00021 00022 struct vector; 00023 struct matrix; 00024 struct polynomial; 00025 00026 struct dense; 00027 struct sparse; 00028 struct structured; 00029 struct univariate; 00030 struct multivariate; 00031 struct monomial; 00032 struct bernstein; 00033 }; 00034 00035 template<class X> struct scalar_type {}; 00036 00037 template<class X> struct structureof_ 00038 { 00039 typedef texp::null_t T; 00040 }; 00041 00042 template<class K, class X> 00043 struct kernel_structureof { typedef structure::scalar T; }; 00044 00045 template<class X> 00046 struct kernel_structureof<null_t,X> { typedef typename structureof_<X>::T T; }; 00047 00048 template<class K> 00049 struct kernel_structureof< K, typename K::integer > { typedef structure::scalar T; }; 00050 template<class K> 00051 struct kernel_structureof< K, typename K::rational > { typedef structure::scalar T; }; 00052 template<class K> 00053 struct kernel_structureof< K, typename K::floating > { typedef structure::scalar T; }; 00054 template<class K> 00055 struct kernel_structureof< K, typename K::ieee > { typedef structure::scalar T; }; 00056 00057 00058 00059 00060 template<class X> struct structureof { 00061 typedef typename ucstref<X>::T _X; 00062 typedef typename kernelof<X>::T K; 00063 typedef typename kernel_structureof<K, _X >::T T; 00064 }; 00065 00066 00067 00068 // template<> struct structureof_<double> { typedef structure::scalar T; }; 00069 00070 00071 00072 00073 }; 00074 00075 }// end namespace mmx 00076 00077 #endif