Developer documentation

ring.hpp
Go to the documentation of this file.
1 # ifndef realroot_ring_hpp
2 # define realroot_ring_hpp
3 # include <realroot/variables.hpp>
4 # define TMPL template<class C, class B, class O>
5 # define SELF ring<C,B,O>
6 
37 //====================================================================
38 #include <realroot/texp_bool.hpp>
40 #include <realroot/variables.hpp>
41 //====================================================================
42 namespace mmx {
43  template<class C, class V> struct with;
44  template<class C, class V> struct polynomial;
45 
47  template<class C, class B, class O=B>
48  struct ring {
49 
51 
52  ring(){}
53  ring(const SELF& r){}
54  ring(const char* s) {var = variables(s); }
55 
56  Polynomial operator[](int i) const {
57  return Polynomial((C)1,1,i);
58  }
59 
60  static int nbvar() { return var.nbvar(); }
61 
62  static variables var;
63  static variables& vars () { return var;}
64 
65  };
66  TMPL variables SELF::var;
67 
69  TMPL C sample (const SELF& R) { return (C)0; }
70  //====================================================================
71 
72 
73 
74  template<class V> struct default_variant_of {
75  typedef V Variant;
76  } ;
77 
78 // /**
79 // \brief Generic ring class.
80 
81 // **/
82 // template<class C, class V, class W = typename default_variant_of<V>::Variant >
83 // struct ring {
84 // typedef texp::null_t rep_t;
85 // typedef C Scalar;
86 // };
87 
88  //--------------------------------------------------------------------
89  template<class U> struct ring_of;
90  template<class C, class V> struct polynomial;
91  template<class C, class V>
92  struct ring_of< polynomial<C,V> > {
93  typedef ring<C, V> Ring;
94  };
95 
96  template<class C, class V, class W>
97  struct ring_of< polynomial<C,with<V,W> > > {
99  };
100 
101 }
102 //====================================================================
103 #undef TMPL
104 #undef SELF
105 //====================================================================
106 #endif //realroot_ring_hpp
#define TMPL
Definition: ring.hpp:4
C sample(const RING &rg)
Definition: polynomial_dual.hpp:70
Definition: ring.hpp:74
ring()
Definition: ring.hpp:52
#define SELF
Definition: ring.hpp:5
ring(const char *s)
Definition: ring.hpp:54
V Variant
Definition: ring.hpp:75
static variables & vars()
Definition: ring.hpp:63
Ring of polynomials.
Definition: ring.hpp:48
static variables var
Definition: ring.hpp:62
static int nbvar()
Definition: ring.hpp:60
Definition: polynomial.hpp:37
polynomial< C, with< B, O > > Polynomial
Definition: ring.hpp:50
int nbvar() const
Definition: variables.hpp:90
Generic ring class.
Definition: polynomial_bernstein.hpp:66
double C
Definition: solver_mv_fatarcs.cpp:16
ring< C, V, W > Ring
Definition: ring.hpp:98
ring(const SELF &r)
Definition: ring.hpp:53
Definition: array.hpp:12
Definition: variables.hpp:65
Polynomial operator[](int i) const
Definition: ring.hpp:56
Definition: polynomial.hpp:40
ring< C, V > Ring
Definition: ring.hpp:93
Home