LLReductor.h
Go to the documentation of this file.
// -*- c++ -*-
//*****************************************************************************
//*****************************************************************************
#ifndef polybori_groebner_LLReductor_h_
#define polybori_groebner_LLReductor_h_
#include "ll_red_nf.h"
// include basic definitions
#include "groebner_defs.h"
BEGIN_NAMESPACE_PBORIGB
// groebner_alg.h
MonomialSet recursively_insert(MonomialSet::navigator p,
idx_type idx, MonomialSet mset);
class LLReductor:
public MonomialSet {
typedef MonomialSet base;
typedef LLReductor self;
public:
LLReductor(const BoolePolyRing& ring): base(ring.one()) {}
template <class Type>
LLReductor(const Type& value): base(value) { PBORI_ASSERT(!isZero()); }
bool isCompatible(const PolyEntry& entry) {
PBORI_ASSERT (!isZero());
return (entry.leadDeg == 1) &&
(*(entry.p.navigation()) == entry.lead.firstIndex() ) &&
(!expBegin()->reducibleBy(entry.lead.firstIndex()));
}
Polynomial update(const PolyEntry& entry) {
return (isCompatible(entry)? insert(entry): entry.p);
}
private:
self& operator=(const self& rhs) {
return static_cast<self&>(static_cast<base&>(*this) = rhs);
}
Polynomial insert(const PolyEntry& entry) {
Polynomial poly = ll_red_nf(entry.p, *this);
PBORI_ASSERT(poly.lead() == entry.lead);
operator=(recursively_insert(poly.navigation().elseBranch(),
entry.lead.firstIndex(),
ll_red_nf(*this, poly.set())));
return poly;
}
};
END_NAMESPACE_PBORIGB
#endif /* polybori_groebner_LLReductor_h_ */
polybori::BoolePolynomial::navigation
navigator navigation() const
Navigate through structure.
Definition: BoolePolynomial.h:441
polybori::BoolePolynomial::lead
monom_type lead() const
Get leading term.
Definition: BoolePolynomial.cc:225
polybori::groebner::PolyEntryBase::leadDeg
deg_type leadDeg
Definition: PolyEntryBase.h:59
polybori::groebner::PolyEntryBase::p
Polynomial p
Definition: PolyEntryBase.h:54
END_NAMESPACE_PBORIGB
#define END_NAMESPACE_PBORIGB
Definition: groebner_defs.h:16
polybori::groebner::LLReductor::LLReductor
LLReductor(const Type &value)
Construct copy or MonomialSet.
Definition: LLReductor.h:45
polybori::BoolePolynomial::set
set_type set() const
Get corresponding subset of of the powerset over all variables.
Definition: BoolePolynomial.h:464
polybori::BoolePolyRing
This class reinterprets decicion diagram managers as Boolean polynomial rings, adds an ordering and v...
Definition: BoolePolyRing.h:40
ll_red_nf.h
polybori::BooleMonomial::firstIndex
idx_type firstIndex() const
Definition: BooleMonomial.h:230
BEGIN_NAMESPACE_PBORIGB
#define BEGIN_NAMESPACE_PBORIGB
Definition: groebner_defs.h:15
polybori::CCuddNavigator::elseBranch
self elseBranch() const
Increment in else direction.
Definition: CCuddNavigator.h:98
polybori::groebner::PolyEntry
This class defines PolyEntry.
Definition: PolyEntry.h:32
polybori::BoolePolynomial
This class wraps the underlying decicion diagram type and defines the necessary operations.
Definition: BoolePolynomial.h:85
polybori::groebner::MonomialSet
polybori::BooleSet MonomialSet
Definition: groebner_defs.h:45
groebner_defs.h
polybori::CCuddDDFacade< BoolePolyRing, BooleSet >
polybori::groebner::recursively_insert
MonomialSet recursively_insert(MonomialSet::navigator p, idx_type idx, MonomialSet mset)
Definition: groebner_alg.cc:368
polybori::groebner::ll_red_nf
Polynomial ll_red_nf(const Polynomial &p, const BooleSet &reductors)
Definition: ll_red_nf.h:63
PBORI_ASSERT
#define PBORI_ASSERT(arg)
Definition: pbori_defs.h:118
polybori::groebner::LLReductor::LLReductor
LLReductor(const BoolePolyRing &ring)
Construct reductor from Ring.
Definition: LLReductor.h:41
insert
Accessing .insert()
polybori::groebner::idx_type
polybori::CTypes::idx_type idx_type
Definition: groebner_defs.h:44
polybori::groebner::PolyEntryBase::lead
Monomial lead
Definition: PolyEntryBase.h:55
polybori::BooleSet
Definition: BooleSet.h:57
polybori::groebner::LLReductor::update
Polynomial update(const PolyEntry &entry)
Insert polynomial if compatible, return updated polynomial.
Definition: LLReductor.h:58
polybori::groebner::LLReductor::isCompatible
bool isCompatible(const PolyEntry &entry)
Test whether polynomial is a compatible reductor element.
Definition: LLReductor.h:49
polybori::groebner::LLReductor
This class defines LLReductor.
Definition: LLReductor.h:34