00001 # ifndef realroot_ring_hpp
00002 # define realroot_ring_hpp
00003 # include <realroot/variables.hpp>
00004 # define TMPL template<class C, class B, class O>
00005 # define SELF ring<C,B,O>
00006
00038
00039 #include <realroot/texp_bool.hpp>
00040 #include <realroot/monomial_ordering.hpp>
00041 #include <realroot/variables.hpp>
00042
00043 namespace mmx {
00044 template<class C, class V> struct with;
00045 template<class C, class V> struct polynomial;
00046
00048 template<class C, class B, class O=B>
00049 struct ring {
00050
00051 typedef polynomial<C, with<B,O> > Polynomial;
00052
00053 ring(){}
00054 ring(const SELF& r){}
00055 ring(const char* s) {var = variables(s); }
00056
00057 Polynomial operator[](int i) const {
00058 return Polynomial((C)1,1,i);
00059 }
00060
00061 static int nbvar() { return var.nbvar(); }
00062
00063 static variables var;
00064 static variables& vars () { return var;}
00065
00066 };
00067 TMPL variables SELF::var;
00068
00070 TMPL C sample (const SELF& R) { return (C)0; }
00071
00072
00073
00074
00075 template<class V> struct default_variant_of {
00076 typedef V Variant;
00077 } ;
00078
00079
00080
00081
00082
00083
00084
00085
00086
00087
00088
00089
00090 template<class U> struct ring_of;
00091 template<class C, class V> struct polynomial;
00092 template<class C, class V>
00093 struct ring_of< polynomial<C,V> > {
00094 typedef ring<C, V> Ring;
00095 };
00096
00097 template<class C, class V, class W>
00098 struct ring_of< polynomial<C,with<V,W> > > {
00099 typedef ring<C, V, W> Ring;
00100 };
00101
00102 }
00103
00104 #undef TMPL
00105 #undef SELF
00106
00107 #endif //realroot_ring_hpp