MinimalLeadingTerms.h
Go to the documentation of this file.
// -*- c++ -*-
//*****************************************************************************
//*****************************************************************************
#ifndef polybori_groebner_MinimalLeadingTerms_h_
#define polybori_groebner_MinimalLeadingTerms_h_
// include basic definitions
#include "groebner_defs.h"
BEGIN_NAMESPACE_PBORIGB
class MinimalLeadingTerms:
public MonomialSet {
typedef MonomialSet base;
typedef MinimalLeadingTerms self;
public:
template <class Type>
MinimalLeadingTerms(const Type& value): base(value) { }
MonomialSet update(const Monomial& lm) {
MonomialSet divisors(divisorsOf(lm));
if(divisors.isZero())
return cleanup(lm);
return (divisors == lm.set()? lm.ring().zero(): lm.set());
}
private:
self& operator=(const self& rhs) {
return static_cast<self&>(static_cast<base&>(*this) = rhs);
}
MonomialSet cleanup(const Monomial& lm) {
MonomialSet removed(multiplesOf(lm).diff(lm.set()));
PBORI_ASSERT(removed.intersect(*this).intersect(lm.set()).isZero());
PBORI_ASSERT(assertion(lm, removed.expBegin(),removed.expEnd()));
*this = diff(removed).unite(lm.set());
return removed;
}
bool assertion(const Monomial& lm,
MonomialSet::exp_iterator start,
MonomialSet::exp_iterator finish) const {
while (start != finish) {
if ( (*start) == lm.exp() || !start->reducibleBy(lm.exp()) )
return false;
++start;
}
return true;
}
};
END_NAMESPACE_PBORIGB
#endif /* polybori_groebner_MinimalLeadingTerms_h_ */
polybori::BooleMonomial::set
set_type set() const
Get corresponding subset of of the powerset over all variables.
Definition: BooleMonomial.h:216
END_NAMESPACE_PBORIGB
#define END_NAMESPACE_PBORIGB
Definition: groebner_defs.h:16
polybori::BoolePolyRing::zero
dd_type zero() const
Get empty decision diagram.
Definition: BoolePolyRing.cc:42
BEGIN_NAMESPACE_PBORIGB
#define BEGIN_NAMESPACE_PBORIGB
Definition: groebner_defs.h:15
polybori::groebner::MonomialSet
polybori::BooleSet MonomialSet
Definition: groebner_defs.h:45
groebner_defs.h
polybori::CCuddDDFacade::isZero
bool isZero() const
Test whether diagram represents the empty set.
Definition: CCuddDDFacade.h:244
polybori::CCuddDDFacade< BoolePolyRing, BooleSet >
PBORI_ASSERT
#define PBORI_ASSERT(arg)
Definition: pbori_defs.h:118
polybori::BooleMonomial::ring
const ring_type & ring() const
Access ring, where this belongs to.
Definition: BooleMonomial.h:235
polybori::groebner::MinimalLeadingTerms
This class defines MinimalLeadingTerms.
Definition: MinimalLeadingTerms.h:29
polybori::groebner::MinimalLeadingTerms::update
MonomialSet update(const Monomial &lm)
Insert leading term and return monomials, that are not minimal (any more)
Definition: MinimalLeadingTerms.h:40
polybori::groebner::MinimalLeadingTerms::MinimalLeadingTerms
MinimalLeadingTerms(const Type &value)
Definition: MinimalLeadingTerms.h:37
polybori::BooleSet
Definition: BooleSet.h:57
polybori::BooleMonomial
This class is just a wrapper for using variables from cudd's decicion diagram.
Definition: BooleMonomial.h:50
polybori::Monomial
BooleMonomial Monomial
Definition: embed.h:53