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
polybori::BooleExponent
This class is just a wrapper for using variables for storing indices as interim data structure for Bo...
Definition: BooleExponent.h:34
END_NAMESPACE_PBORI
#define END_NAMESPACE_PBORI
Finish project's namespace.
Definition: pbori_defs.h:77
BEGIN_NAMESPACE_PBORI
#define BEGIN_NAMESPACE_PBORI
Start project's namespace.
Definition: pbori_defs.h:74
polybori::groebner::deg_type
int deg_type
Definition: groebner_defs.h:42
polybori::COrderingBase::ordered_iterator
COrderedIter< navigator, monom_type > ordered_iterator
Definition: COrderingBase.h:57
polybori::COrderingBase::set_type
BooleSet set_type
Type of Boolean sets.
Definition: COrderingBase.h:71
polybori::COrderingBase
Definition: COrderingBase.h:43
polybori::COrderingBase::ordered_exp_iterator
COrderedIter< navigator, exp_type > ordered_exp_iterator
Definition: COrderingBase.h:58
COrderedIter.h
polybori::CAuxTypes
This struct contains auxiliary type definitions.
Definition: pbori_defs.h:210
polybori::PBoRiGenericError
This template class is used for polybori's exception handling.
Definition: PBoRiGenericError.h:35
polybori::COrderingBase::clearBlocks
virtual void clearBlocks()
Definition: COrderingBase.h:151
polybori::BoolePolynomial
This class wraps the underlying decicion diagram type and defines the necessary operations.
Definition: BoolePolynomial.h:85
polybori::COrderedIter
Definition: BoolePolynomial.h:63
polybori::COrderingBase::block_iterator
block_idx_type::const_iterator block_iterator
Type for block iterators.
Definition: COrderingBase.h:68
polybori::CCuddDDFacade::isZero
bool isZero() const
Test whether diagram represents the empty set.
Definition: CCuddDDFacade.h:244
pbori_defs.h
polybori::COrderingBase::monom
monom_type monom(const set_type &rhs) const
Get monomial from set of subsets of Boolean variables (internal use only)
Definition: COrderingBase.h:163
polybori::COrderingBase::appendBlock
virtual void appendBlock(checked_idx_type)
Definition: COrderingBase.h:150
polybori::COrderingBase::block_idx_type
std::vector< idx_type > block_idx_type
Type for block indices.
Definition: COrderingBase.h:65
polybori::COrderingBase::exp_type
BooleExponent exp_type
Definition: COrderingBase.h:55
BoolePolynomial.h
BooleMonomial.h
polybori::COrderingBase::checked_idx_type
CCheckedIdx checked_idx_type
Check index on input.
Definition: COrderingBase.h:62
PBoRiError.h
polybori::COrderingBase::navigator
CCuddNavigator navigator
Definition: COrderingBase.h:54
CCheckedIdx.h
polybori::COrderingBase::COrderingBase
COrderingBase()
Default constructor.
Definition: COrderingBase.h:74
polybori::COrderingBase::monom_type
BooleMonomial monom_type
Definition: COrderingBase.h:53
polybori::groebner::idx_type
polybori::CTypes::idx_type idx_type
Definition: groebner_defs.h:44
polybori::COrderingBase::blockEnd
virtual block_iterator blockEnd() const
Definition: COrderingBase.h:149
polybori::COrderingBase::poly_type
BoolePolynomial poly_type
Definition: COrderingBase.h:52
polybori::CCuddNavigator
This class defines an iterator for navigating through then and else branches of ZDDs.
Definition: CCuddNavigator.h:36
polybori::COrderingBase::blockBegin
virtual block_iterator blockBegin() const
Definition: COrderingBase.h:148
polybori::BooleSet
Definition: BooleSet.h:57
BooleExponent.h
polybori::BooleMonomial
This class is just a wrapper for using variables from cudd's decicion diagram.
Definition: BooleMonomial.h:50
PBORI_UNLIKELY
#define PBORI_UNLIKELY(expression)
Definition: pbori_defs.h:59
polybori::CCheckedIdx
This class defines CCheckedIdx.
Definition: CCheckedIdx.h:29