PolyBoRi
COrderBase.h
Go to the documentation of this file.
1 // -*- c++ -*-
2 //*****************************************************************************
69 //*****************************************************************************
70 
71 // include basic definitions
72 #include "pbori_defs.h"
73 
74 // include basic definitions for orderings
75 #include "pbori_tags.h"
76 
77 // include polynomial definitions
78 #include "BoolePolynomial.h"
79 
80 // include monomial definitions
81 #include "BooleMonomial.h"
82 
83 // include exponent vector definitions
84 #include "BooleExponent.h"
85 
86 #include "COrderedIter.h"
87 
88 #ifndef COrderBase_h_
89 #define COrderBase_h_
90 
92 
93 
99 class COrderBase:
100  public CTypes::auxtypes_type {
101 
102  public:
103  //-------------------------------------------------------------------------
104  // types definitions
105  //-------------------------------------------------------------------------
106 
108  typedef COrderBase base;
109 
111  typedef BoolePolynomial poly_type;
112 
114  typedef poly_type::size_type size_type;
115 
118 
120  typedef BooleMonomial monom_type;
121 
122  typedef BoolePolynomial::navigator navigator;
123 
124  typedef COrderedIter<navigator, monom_type> indirect_iterator;
125 
127  typedef BooleSet set_type;
128 
130  typedef BooleExponent exp_type;
131 
132  typedef COrderedIter<navigator, exp_type> indirect_exp_iterator;
133 
135  typedef std::vector<idx_type> block_idx_type;
136 
138  typedef block_idx_type::const_iterator block_iterator;
139 
141 
142  typedef invalid_tag lex_property;
143  typedef invalid_tag ordered_property;
144  typedef invalid_tag symmetry_property;
145  typedef invalid_tag degorder_property;
146  typedef invalid_tag blockorder_property;
147  typedef invalid_tag degrevlexorder_property;
148  typedef invalid_tag totaldegorder_property;
149  typedef invalid_tag ascending_property;
150  typedef invalid_tag descending_property;
152 
154  COrderBase() {};
155 
157  COrderBase(const COrderBase&) {};
158 
160  virtual ~COrderBase() {};
161 
163  virtual comp_type compare(idx_type, idx_type) const = 0;
164 
166  virtual comp_type compare(const monom_type&, const monom_type&) const = 0;
167 
169  virtual comp_type compare(const exp_type&, const exp_type&) const = 0;
170 
172  virtual monom_type lead(const poly_type&) const = 0;
173 
175  virtual monom_type lead(const poly_type&, size_type) const = 0;
176 
178  virtual exp_type leadExp(const poly_type&) const = 0;
179 
181  virtual exp_type leadExp(const poly_type&, size_type) const = 0;
182 
184  virtual indirect_iterator leadIteratorBegin(const poly_type&) const = 0;
185  virtual indirect_iterator leadIteratorEnd() const = 0;
186  virtual indirect_exp_iterator leadExpIteratorBegin(const poly_type&) const = 0;
187  virtual indirect_exp_iterator leadExpIteratorEnd() const = 0;
188 
190 
191  virtual block_iterator blockBegin() const { return block_iterator(); }
192  virtual block_iterator blockEnd() const { return block_iterator(); }
193  virtual void appendBlock(idx_type) const { }
194  virtual void clearBlocks() const { }
196 
197 
198 protected:
200  monom_type monom(const set_type& rhs) const { return monom_type(rhs); }
201 };
202 
204 
205 #endif