• Main Page
  • Related Pages
  • Namespaces
  • Classes
  • Files
  • File List
  • File Members

BlockDegRevLexAscOrder.h

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

Generated on Thu Oct 21 2010 15:45:39 for PolyBoRi by  doxygen 1.7.1