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
This class is just a wrapper for using variables for storing indices as interim data structure for Bo...
Definition: BooleExponent.h:34
#define END_NAMESPACE_PBORI
Finish project's namespace.
Definition: pbori_defs.h:77
#define BEGIN_NAMESPACE_PBORI
Start project's namespace.
Definition: pbori_defs.h:74
int deg_type
Definition: groebner_defs.h:42
COrderedIter< navigator, monom_type > ordered_iterator
Definition: COrderingBase.h:57
BooleSet set_type
Type of Boolean sets.
Definition: COrderingBase.h:71
Definition: COrderingBase.h:43
COrderedIter< navigator, exp_type > ordered_exp_iterator
Definition: COrderingBase.h:58
This struct contains auxiliary type definitions.
Definition: pbori_defs.h:210
This template class is used for polybori's exception handling.
Definition: PBoRiGenericError.h:35
virtual void clearBlocks()
Definition: COrderingBase.h:151
This class wraps the underlying decicion diagram type and defines the necessary operations.
Definition: BoolePolynomial.h:85
Definition: BoolePolynomial.h:63
block_idx_type::const_iterator block_iterator
Type for block iterators.
Definition: COrderingBase.h:68
bool isZero() const
Test whether diagram represents the empty set.
Definition: CCuddDDFacade.h:244
monom_type monom(const set_type &rhs) const
Get monomial from set of subsets of Boolean variables (internal use only)
Definition: COrderingBase.h:163
virtual void appendBlock(checked_idx_type)
Definition: COrderingBase.h:150
std::vector< idx_type > block_idx_type
Type for block indices.
Definition: COrderingBase.h:65
BooleExponent exp_type
Definition: COrderingBase.h:55
CCheckedIdx checked_idx_type
Check index on input.
Definition: COrderingBase.h:62
CCuddNavigator navigator
Definition: COrderingBase.h:54
COrderingBase()
Default constructor.
Definition: COrderingBase.h:74
BooleMonomial monom_type
Definition: COrderingBase.h:53
polybori::CTypes::idx_type idx_type
Definition: groebner_defs.h:44
virtual block_iterator blockEnd() const
Definition: COrderingBase.h:149
BoolePolynomial poly_type
Definition: COrderingBase.h:52
This class defines an iterator for navigating through then and else branches of ZDDs.
Definition: CCuddNavigator.h:36
virtual block_iterator blockBegin() const
Definition: COrderingBase.h:148
Definition: BooleSet.h:57
This class is just a wrapper for using variables from cudd's decicion diagram.
Definition: BooleMonomial.h:50
#define PBORI_UNLIKELY(expression)
Definition: pbori_defs.h:59
This class defines CCheckedIdx.
Definition: CCheckedIdx.h:29