Developer documentation

texp_ringof.hpp
Go to the documentation of this file.
1 #ifndef realroot_ARITHM_TRAITS_RINGOF_H
2 #define realroot_ARITHM_TRAITS_RINGOF_H
3 
4 #include <realroot/texp_sup.hpp>
5 
6 namespace mmx {
7 
8 namespace texp {
9 
10  template<class X, class Y>
11  struct ringof_ { typedef null_t T; };
12 
13  template<>
14  struct ringof_<int, unsigned int> { typedef int T; };
15  template<>
16  struct ringof_<unsigned int, int> { typedef int T; };
17  template<>
18  struct ringof_<double,int> { typedef double T; };
19  template<>
20  struct ringof_<int,double> { typedef double T; };
21 
22 
23  template<class K, class X, class Y>
24  struct kernel_ringof { typedef null_t T; };
25  template<class K>
26  struct kernel_ringof< K, typename K::integer, typename K::ieee >
27  { typedef typename K::ieee T; };
28  template<class K>
29  struct kernel_ringof< K, typename K::ieee, typename K::integer >
30  { typedef typename K::ieee T; };
31  template<class K>
32  struct kernel_ringof< K, typename K::integer, typename K::rational >
33  { typedef typename K::rational T; };
34  template<class K>
35  struct kernel_ringof< K, typename K::rational, typename K::integer >
36  { typedef typename K::rational T; };
37  template<class K>
38  struct kernel_ringof< K, typename K::integer, typename K::floating >
39  { typedef typename K::floating T; };
40  template<class K>
41  struct kernel_ringof< K, typename K::floating, typename K::integer >
42  { typedef typename K::floating T; };
43  template<class K>
44  struct kernel_ringof< K, typename K::floating, typename K::rational >
45  { typedef typename K::rational T; };
46  template<class K>
47  struct kernel_ringof< K, typename K::rational, typename K::floating >
48  { typedef typename K::rational T; };
49  template<class K>
50  struct kernel_ringof< K, typename K::floating, typename K::ieee >
51  { typedef typename K::floating T; };
52  template<class K>
53  struct kernel_ringof< K, typename K::ieee, typename K::floating >
54  { typedef typename K::floating T; };
55  template<class K>
56  struct kernel_ringof< K, typename K::rational, typename K::ieee >
57  { typedef typename K::rational T; };
58  template<class K>
59  struct kernel_ringof< K, typename K::ieee, typename K::rational >
60  { typedef typename K::rational T; };
61 
62  /*
63  template<class X>
64  struct ringof_<double, X >
65  {
66  typedef typename kernel_ringof< typename kernelof<X>::T, double, X >::T KX;
67  };
68  */
69 
71  template<class X, class Y>
72  struct ringof
73  {
76  typedef typename ucstref<X>::T _X;
77  typedef typename ucstref<Y>::T _Y;
80  typedef typename sfirstnn< typename ringof_<_X,_Y>::T,
81  KXY, KYX, typename sup<X,Y>::T >::T T;
82  };
83 }
84 }// end namespace mmx
85 
86 #endif
x (in X) + y (in Y) is subset of ringof::T
Definition: texp_ringof.hpp:72
structure defining a the empty list
Definition: texp_bool.hpp:11
Definition: texp_ringof.hpp:11
null_t T
Definition: texp_ringof.hpp:11
double T
Definition: texp_ringof.hpp:20
ucstref< X >::T _X
Definition: texp_ringof.hpp:76
Definition: texp_ringof.hpp:24
sfirstnn< typename ringof_< _X, _Y >::T, KXY, KYX, typename sup< X, Y >::T >::T T
Definition: texp_ringof.hpp:81
int T
Definition: texp_ringof.hpp:14
null_t T
Definition: texp_ringof.hpp:24
ucstref< Y >::T _Y
Definition: texp_ringof.hpp:77
uref< typename ucst< X >::T >::T T
Definition: texp_strip_qualifiers.hpp:28
kernel_ringof< typename kernelof< Y >::T, _Y, _X >::T KYX
Definition: texp_ringof.hpp:79
Definition: texp_list.hpp:82
kernel_ringof< typename kernelof< X >::T, _X, _Y >::T KXY
Definition: texp_ringof.hpp:78
sfirstnn< C, A, B >::T T
Definition: texp_sup.hpp:31
int T
Definition: texp_ringof.hpp:16
Definition: array.hpp:12
double T
Definition: texp_ringof.hpp:18
Home