PolyBoRi

BlockDegRevLexAscOrder.h

Go to the documentation of this file.
00001 // -*- c++ -*-
00002 //*****************************************************************************
00051 //*****************************************************************************
00052 
00053 // include basic definitions
00054 #include "pbori_defs.h"
00055 
00056 // include base order definitions
00057 #include "COrderBase.h"
00058 
00059 #ifndef BlockDegRevLexAscOrder_h_
00060 #define BlockDegRevLexAscOrder_h_
00061 
00062 BEGIN_NAMESPACE_PBORI
00063 
00069 class BlockDegRevLexAscOrder:
00070   public COrderBase {
00071 
00072  public:
00073   //-------------------------------------------------------------------------
00074   // types definitions
00075   //-------------------------------------------------------------------------
00076 
00078   typedef BlockDegRevLexAscOrder self;
00079 
00081 
00082   typedef valid_tag blockorder_property;
00083   typedef invalid_tag descending_property;
00084   typedef block_dp_asc_tag order_tag;
00086 
00088   typedef std::greater<idx_type> idx_comparer_type;
00089 
00091   enum { order_code = CTypes::block_dp_asc, baseorder_code = CTypes::dp_asc };
00092 
00094   BlockDegRevLexAscOrder(): base(), m_indices() {
00095     m_indices.push_back(0); 
00096     m_indices.push_back(CTypes::max_idx); 
00097   };
00098 
00100   BlockDegRevLexAscOrder(const self& rhs): base(rhs), m_indices(rhs.m_indices) {};
00101 
00103   ~BlockDegRevLexAscOrder() {};
00104 
00106   comp_type compare(idx_type, idx_type) const;
00107 
00109   comp_type compare(const monom_type&, const monom_type&) const;
00110 
00112   comp_type compare(const exp_type&, const exp_type&) const;
00113 
00115   monom_type lead(const poly_type&) const;
00116 
00118   monom_type lead(const poly_type& poly, deg_type) const;
00119 
00121   exp_type leadExp(const poly_type&) const;
00122 
00124   exp_type leadExp(const poly_type&, deg_type) const;
00125 
00127   indirect_iterator leadIteratorBegin(const poly_type&) const;
00128   indirect_iterator leadIteratorEnd() const;
00129   indirect_exp_iterator leadExpIteratorBegin(const poly_type&) const;
00130   indirect_exp_iterator leadExpIteratorEnd() const;
00131 
00133 
00134   block_iterator blockBegin() const { return m_indices.begin() + 1; }
00135   block_iterator blockEnd() const { return m_indices.end(); }
00136   void appendBlock(idx_type idx) { 
00137     m_indices.back() = idx;
00138     m_indices.push_back(CTypes::max_idx);
00139   }
00140   void clearBlocks() {
00141     m_indices.clear(); 
00142     m_indices.push_back(0); 
00143     m_indices.push_back(CTypes::max_idx); 
00144   }
00146 
00147 private:
00148   block_idx_type m_indices;
00149 };
00150 
00151 
00152 END_NAMESPACE_PBORI
00153 
00154 #endif // BlockDegRevLexAscOrder_h_