00001 // -*- c++ -*- 00002 //***************************************************************************** 00015 //***************************************************************************** 00016 00017 #ifndef polybori_factories_PolynomialFactory_h_ 00018 #define polybori_factories_PolynomialFactory_h_ 00019 00020 // include basic definitions 00021 #include <polybori/pbori_defs.h> 00022 #include <polybori/factories/CFactoryBase.h> 00023 #include <polybori/BoolePolynomial.h> 00024 #include <polybori/BooleMonomial.h> 00025 BEGIN_NAMESPACE_PBORI 00026 00033 class PolynomialFactory: 00034 public CFactoryBase { 00036 typedef PolynomialFactory self; 00037 00039 typedef CFactoryBase base; 00040 00041 public: 00043 typedef base::parent_type parent_type; 00044 00046 typedef BoolePolynomial value_type; 00047 00049 PolynomialFactory(const parent_type& ring): base(ring) {} 00050 00052 PolynomialFactory(const self& rhs): base(rhs) {} 00053 00055 ~PolynomialFactory() {} 00056 00058 value_type operator()() const { 00059 return value_type(parent()); 00060 } 00061 00063 value_type operator()(const value_type& rhs) const { 00064 return rhs; 00065 } 00066 00068 value_type operator()(const value_type::ring_type& ring) const { 00069 return value_type(ring); 00070 } 00071 00073 value_type operator()(const value_type::var_type& var) const { 00074 return value_type::monom_type(var); 00075 } 00076 00078 value_type operator()(const value_type::monom_type& monom) const { 00079 return value_type(monom); 00080 } 00081 00083 value_type operator()(const value_type::exp_type& rhs) const { 00084 return value_type(rhs, parent()); 00085 } 00086 00088 value_type operator()(const value_type::exp_type& rhs, 00089 const value_type::ring_type& ring) const { 00090 return value_type(rhs, ring); 00091 } 00093 value_type operator()(value_type::constant_type isOne, 00094 const value_type::ring_type& ring) const { 00095 return value_type(isOne, ring); 00096 } 00097 00099 value_type operator()(value_type::constant_type isOne) const { 00100 return value_type(isOne, parent()); 00101 } 00102 00104 value_type operator()(const value_type::dd_type& rhs) const { 00105 return value_type(rhs); 00106 } 00107 00109 value_type operator()(const value_type::navigator& rhs, 00110 const value_type::ring_type& ring) const{ 00111 return value_type(rhs, ring); 00112 } 00114 value_type operator()(const value_type::navigator& rhs) const{ 00115 return value_type(rhs, parent()); 00116 } 00117 }; 00118 00119 END_NAMESPACE_PBORI 00120 00121 #endif /* polybori_factories_PolynomialFactory_h_ */