Developer documentation

set_of.hpp
Go to the documentation of this file.
1 /*******************************************************************
2  * This file is part of the source code of the realroot kernel.
3  * Author(s): B. Mourrain, GALAAD, INRIA
4  ********************************************************************/
5 #ifndef mmx_realroot_set_of_hpp
6 #define mmx_realroot_set_of_hpp
7 //===================================================================
8 #include <basix/basix.hpp>
9 //#include <basix/glue.hpp>
10 //====================================================================
11 namespace mmx {
12 //===================================================================
13 
14  template<class X> struct set_of
15  {
16  typedef X T;
18  set_of<X>(const set_of<X>& t) {}
19  set_of<X>(const X& x) {}
20  };
21 
22  template<class X>
23  bool operator== (const set_of<X>& r1, const set_of<X>& r2) { return true; }
24  template<class X>
25  bool operator!= (const set_of<X>& r1, const set_of<X>& r2) { return !(r1==r2); }
26 
27  template<class C> inline set_of<C> make_set(const C& c) { return set_of<C>(); }
28  template<class C> inline int hash(const set_of<C>& R){ return 1;}
29  template<class C> inline int soft_hash(const set_of<C>& R){ return 1;}
30  template<class C> inline bool eq(const set_of<C>& R1, const set_of<C>& R2)
31  {
32  return R1==R2;
33  }
34 
35  template<class X> inline syntactic flatten(const set_of<X>& s)
36  {
37  return syntactic("XXX");//type_name< X >());
38  }
39 
40  template<typename U,typename T>
41  struct as_helper<set_of<U>,set_of<T> >
42  {
43  static inline
44  set_of<U> cv (const set_of<T>& x) { return set_of<U>(); }
45  };
46 
47 #define DECLARE_SET(X,T) \
48 template<> inline syntactic flatten(const set_of<T>& Z){return syntactic(X);}
49 
50 #define DEFINE_SET(X,T) \
51  static set_of<T> T##_set= set_of<T>(); \
52  define_constant<always,set_of<T> > (X, T##_set); \
53  define<always> ("set_of", make_set<T>);
54 
55 //===================================================================
56 }
57 #endif //
bool operator==(const extended< NT > &lhs, const extended< NT > &rhs)
Definition: extended.hpp:88
bool eq(const Seq< C, R > &v1, const Seq< C, R > &v2)
Definition: Seq.hpp:200
static set_of< U > cv(const set_of< T > &x)
Definition: set_of.hpp:44
TMPL X
Definition: polynomial_operators.hpp:148
Definition: assign.hpp:48
Definition: set_of.hpp:14
X T
Definition: set_of.hpp:16
TMPL unsigned hash(const Monomial &v)
Definition: monomial_glue.hpp:26
set_of< C > make_set(const C &c)
Definition: set_of.hpp:27
TMPL syntactic flatten(const MONOMIAL &v)
Definition: monomial_glue.hpp:36
const C & c
Definition: Interval_glue.hpp:45
double C
Definition: solver_mv_fatarcs.cpp:16
bool operator!=(const extended< NT > &lhs, const extended< NT > &rhs)
Definition: extended.hpp:95
TMPL unsigned soft_hash(const Monomial &m)
Definition: monomial_glue.hpp:33
Definition: array.hpp:12
Home