COrderingBase.h
Go to the documentation of this file.
// -*- c++ -*-
//*****************************************************************************
//*****************************************************************************
#ifndef polybori_orderings_COrderingBase_h_
#define polybori_orderings_COrderingBase_h_
// include basic definitions
#include <polybori/pbori_defs.h>
#include <polybori/BoolePolynomial.h>
#include <polybori/BooleMonomial.h>
#include <polybori/BooleExponent.h>
#include <polybori/iterators/COrderedIter.h>
#include <polybori/except/PBoRiError.h>
#include <polybori/common/CCheckedIdx.h>
#include <vector>
BEGIN_NAMESPACE_PBORI
class BoolePolynomial;
class BooleMonomial;
class BooleExponent;
class CCuddNavigator;
class COrderingBase:
public CTypes::auxtypes_type {
typedef COrderingBase self;
public:
typedef BoolePolynomial poly_type;
typedef BooleMonomial monom_type;
typedef CCuddNavigator navigator;
typedef BooleExponent exp_type;
typedef COrderedIter<navigator, monom_type> ordered_iterator;
typedef COrderedIter<navigator, exp_type> ordered_exp_iterator;
typedef CCheckedIdx checked_idx_type;
typedef std::vector<idx_type> block_idx_type;
typedef block_idx_type::const_iterator block_iterator;
typedef BooleSet set_type;
COrderingBase() { }
// Destructor
virtual ~COrderingBase() = 0;
virtual comp_type compare(idx_type, idx_type) const = 0;
virtual comp_type compare(const monom_type&, const monom_type&) const = 0;
virtual comp_type compare(const exp_type&, const exp_type&) const = 0;
virtual monom_type lead(const poly_type&) const = 0;
virtual monom_type lead(const poly_type&, deg_type) const = 0;
virtual exp_type leadExp(const poly_type&) const = 0;
virtual exp_type leadExp(const poly_type&, deg_type) const = 0;
virtual poly_type leadFirst(const poly_type&) const = 0;
virtual bool_type isLexicographical() const = 0;
virtual bool_type orderedStandardIteration() const = 0;
virtual bool_type isSymmetric() const = 0;
virtual bool_type isDegreeOrder() const = 0;
virtual bool_type isBlockOrder() const = 0;
virtual bool_type isTotalDegreeOrder() const = 0;
virtual bool_type ascendingVariables() const = 0;
virtual bool_type descendingVariables() const = 0;
virtual bool_type isDegreeReverseLexicographical() const = 0;
virtual ordered_iterator leadIteratorBegin(const poly_type&) const = 0;
virtual ordered_iterator leadIteratorEnd(const poly_type&) const = 0;
virtual ordered_exp_iterator leadExpIteratorBegin(const poly_type&) const = 0;
virtual ordered_exp_iterator leadExpIteratorEnd(const poly_type&) const = 0;
virtual ordercode_type getOrderCode() const = 0;
virtual ordercode_type getBaseOrderCode() const = 0 ;
virtual block_iterator blockBegin() const { return block_iterator(); }
virtual block_iterator blockEnd() const { return block_iterator(); }
virtual void appendBlock(checked_idx_type) {}
virtual void clearBlocks() {}
virtual bool_type lieInSameBlock(idx_type, idx_type) const = 0;
virtual idx_type lastBlockStart() const = 0;
protected:
monom_type monom(const set_type& rhs) const {
if PBORI_UNLIKELY(rhs.isZero())
throw PBoRiGenericError<CTypes::illegal_on_zero>();
return monom_type(rhs);
}
};
inline
COrderingBase::~COrderingBase() { }
END_NAMESPACE_PBORI
#endif