PolyBoRi
BlockDegRevLexAscOrder.h
Go to the documentation of this file.
1 // -*- c++ -*-
2 //*****************************************************************************
48 //*****************************************************************************
49 
50 // include basic definitions
51 #include "pbori_defs.h"
52 
53 // include base order definitions
54 #include "COrderBase.h"
55 
56 #ifndef BlockDegRevLexAscOrder_h_
57 #define BlockDegRevLexAscOrder_h_
58 
60 
67  public COrderBase {
68 
69  public:
70  //-------------------------------------------------------------------------
71  // types definitions
72  //-------------------------------------------------------------------------
73 
75  typedef BlockDegRevLexAscOrder self;
76 
78 
83 
85  typedef std::greater<idx_type> idx_comparer_type;
86 
88  enum { order_code = CTypes::block_dp_asc, baseorder_code = CTypes::dp_asc };
89 
91  BlockDegRevLexAscOrder(): base(), m_indices() {
92  m_indices.push_back(0);
93  m_indices.push_back(CTypes::max_idx);
94  };
95 
97  BlockDegRevLexAscOrder(const self& rhs): base(rhs), m_indices(rhs.m_indices) {};
98 
101 
103  comp_type compare(idx_type, idx_type) const;
104 
106  comp_type compare(const monom_type&, const monom_type&) const;
107 
109  comp_type compare(const exp_type&, const exp_type&) const;
110 
112  monom_type lead(const poly_type&) const;
113 
115  monom_type lead(const poly_type& poly, size_type) const;
116 
118  exp_type leadExp(const poly_type&) const;
119 
121  exp_type leadExp(const poly_type&, size_type) const;
122 
124  indirect_iterator leadIteratorBegin(const poly_type&) const;
125  indirect_iterator leadIteratorEnd() const;
126  indirect_exp_iterator leadExpIteratorBegin(const poly_type&) const;
127  indirect_exp_iterator leadExpIteratorEnd() const;
128 
130 
131  block_iterator blockBegin() const { return m_indices.begin() + 1; }
132  block_iterator blockEnd() const { return m_indices.end(); }
133  void appendBlock(idx_type idx) {
134  m_indices.back() = idx;
135  m_indices.push_back(CTypes::max_idx);
136  }
137  void clearBlocks() {
138  m_indices.clear();
139  m_indices.push_back(0);
140  m_indices.push_back(CTypes::max_idx);
141  }
143 
144 private:
145  block_idx_type m_indices;
146 };
147 
148 
150 
151 #endif // BlockDegRevLexAscOrder_h_