PolyBoRi
COrderingBase.h
Go to the documentation of this file.
1 // -*- c++ -*-
2 //*****************************************************************************
14 //*****************************************************************************
15 
16 #ifndef polybori_orderings_COrderingBase_h_
17 #define polybori_orderings_COrderingBase_h_
18 
19 // include basic definitions
20 #include <polybori/pbori_defs.h>
21 
23 #include <polybori/BooleMonomial.h>
24 #include <polybori/BooleExponent.h>
28 
29 #include <vector>
30 
32 
33 class BoolePolynomial;
34 class BooleMonomial;
35 class BooleExponent;
36 class CCuddNavigator;
37 
44  public CTypes::auxtypes_type {
45 
47  typedef COrderingBase self;
48 
49 public:
51 
56 
60 
63 
65  typedef std::vector<idx_type> block_idx_type;
66 
68  typedef block_idx_type::const_iterator block_iterator;
69 
71  typedef BooleSet set_type;
72 
75 
76  // Destructor
77  virtual ~COrderingBase() = 0;
78 
80  virtual comp_type compare(idx_type, idx_type) const = 0;
81 
82  virtual comp_type compare(const monom_type&, const monom_type&) const = 0;
83 
84  virtual comp_type compare(const exp_type&, const exp_type&) const = 0;
85 
87  virtual monom_type lead(const poly_type&) const = 0;
88 
90  virtual monom_type lead(const poly_type&, deg_type) const = 0;
91 
93  virtual exp_type leadExp(const poly_type&) const = 0;
94 
96  virtual exp_type leadExp(const poly_type&, deg_type) const = 0;
97 
99  virtual poly_type leadFirst(const poly_type&) const = 0;
100 
102  virtual bool_type isLexicographical() const = 0;
103 
105  virtual bool_type orderedStandardIteration() const = 0;
106 
108  virtual bool_type isSymmetric() const = 0;
109 
111  virtual bool_type isDegreeOrder() const = 0;
112 
114  virtual bool_type isBlockOrder() const = 0;
115 
117  virtual bool_type isTotalDegreeOrder() const = 0;
118 
120  virtual bool_type ascendingVariables() const = 0;
121 
123  virtual bool_type descendingVariables() const = 0;
124 
126  virtual bool_type isDegreeReverseLexicographical() const = 0;
127 
129  virtual ordered_iterator leadIteratorBegin(const poly_type&) const = 0;
130 
132  virtual ordered_iterator leadIteratorEnd(const poly_type&) const = 0;
133 
135  virtual ordered_exp_iterator leadExpIteratorBegin(const poly_type&) const = 0;
136 
138  virtual ordered_exp_iterator leadExpIteratorEnd(const poly_type&) const = 0;
139 
141  virtual ordercode_type getOrderCode() const = 0;
142 
144  virtual ordercode_type getBaseOrderCode() const = 0 ;
145 
147 
148  virtual block_iterator blockBegin() const { return block_iterator(); }
149  virtual block_iterator blockEnd() const { return block_iterator(); }
150  virtual void appendBlock(checked_idx_type) {}
151  virtual void clearBlocks() {}
153 
156  virtual bool_type lieInSameBlock(idx_type, idx_type) const = 0;
157 
159  virtual idx_type lastBlockStart() const = 0;
160 
161 protected:
163  monom_type monom(const set_type& rhs) const {
164  if PBORI_UNLIKELY(rhs.isZero())
166  return monom_type(rhs);
167  }
168 };
169 
170 inline
171 COrderingBase::~COrderingBase() { }
172 
174 
175 #endif