PolyBoRi
BlockDegLexOrder.h
Go to the documentation of this file.
1 // -*- c++ -*-
2 //*****************************************************************************
39 //*****************************************************************************
40 
41 // include basic definitions
42 #include "pbori_defs.h"
43 
44 // include base order definitions
45 #include "COrderBase.h"
46 
47 #ifndef BlockDegLexOrder_h_
48 #define BlockDegLexOrder_h_
49 
51 
58  public COrderBase {
59 
60  public:
61  //-------------------------------------------------------------------------
62  // types definitions
63  //-------------------------------------------------------------------------
64 
66  typedef BlockDegLexOrder self;
67 
69 
74 
76  typedef std::less<idx_type> idx_comparer_type;
77 
79  enum { order_code = CTypes::block_dlex, baseorder_code = CTypes::dlex };
80 
82  BlockDegLexOrder(): base(), m_indices() {
83  m_indices.push_back(0);
84  m_indices.push_back(CTypes::max_idx);
85  };
86 
88  BlockDegLexOrder(const self& rhs): base(rhs), m_indices(rhs.m_indices) {};
89 
92 
94  comp_type compare(idx_type, idx_type) const;
95 
97  comp_type compare(const monom_type&, const monom_type&) const;
98 
100  comp_type compare(const exp_type&, const exp_type&) const;
101 
103  monom_type lead(const poly_type&) const;
104 
106  monom_type lead(const poly_type& poly, size_type) const;
107 
109  exp_type leadExp(const poly_type&) const;
110 
112  exp_type leadExp(const poly_type&, size_type) const;
113 
115  indirect_iterator leadIteratorBegin(const poly_type&) const;
116  indirect_iterator leadIteratorEnd() const;
117  indirect_exp_iterator leadExpIteratorBegin(const poly_type&) const;
118  indirect_exp_iterator leadExpIteratorEnd() const;
119 
121 
122  block_iterator blockBegin() const { return m_indices.begin() + 1; }
123  block_iterator blockEnd() const { return m_indices.end(); }
124  void appendBlock(idx_type idx) {
125  m_indices.back() = idx;
126  m_indices.push_back(CTypes::max_idx);
127  }
128  void clearBlocks() {
129  m_indices.clear();
130  m_indices.push_back(0);
131  m_indices.push_back(CTypes::max_idx);
132  }
134 
135 private:
136  block_idx_type m_indices;
137 };
138 
139 
141 
142 #endif // BlockDegLexOrder_h_