RelatedTermsBase.h
Go to the documentation of this file.
// -*- c++ -*-
//*****************************************************************************
//*****************************************************************************
#ifndef polybori_groebner_RelatedTermsBase_h_
#define polybori_groebner_RelatedTermsBase_h_
#include "minimal_elements.h"
#include <polybori/ring/CMemberFunctionTraits.h>
#include "BoundedDivisorsOf.h"
// include basic definitions
#include "groebner_defs.h"
BEGIN_NAMESPACE_PBORIGB
class RelatedTermsBase {
public:
RelatedTermsBase(const BoolePolyRing& ring):
m_lead(ring), m_ignorable(ring), m_ext_prod_terms(ring),
m_related(ring), m_divisors_of(ring, ring) { }
RelatedTermsBase(const Monomial& lead, const MonomialSet& terms,
const MonomialSet& ignorable, const MonomialSet& significant):
m_lead(lead), m_ignorable(ignorable), m_ext_prod_terms(lead.ring()),
m_related(lead.ring()), m_divisors_of(lead, significant) {
init(significant, unrelated_terms(significant));
}
const MonomialSet& related_terms() const { return m_related; }
const BoundedDivisorsOf& divisors_of() const { return m_divisors_of; }
MonomialSet factors(const MonomialSet& terms) const {
return minimal_elements_divided(critical_terms_base(terms), m_lead,
m_ext_prod_terms);
}
MonomialSet critical_terms_base(const MonomialSet& terms) const {
return mod_mon_set(m_related.intersect(terms), m_ignorable);
}
MonomialSet unrelated_terms(const MonomialSet& terms) const {
return std::accumulate(m_lead.begin(), m_lead.end(), terms,
member_function_operator(&MonomialSet::subset0) );
}
private:
void init(const MonomialSet& significant, const MonomialSet& unrelated) {
PBORI_ASSERT(!m_ignorable.owns(m_lead) && !significant.ownsOne());
m_related = significant.diff(unrelated);
m_ext_prod_terms = m_ignorable.existAbstract(m_lead).diff(unrelated);
}
Monomial m_lead;
MonomialSet m_ignorable;
MonomialSet m_ext_prod_terms; // Contains terms of @c m_ignorable related to
// @c m_lead with its variables substituted by 1
MonomialSet m_related;
BoundedDivisorsOf m_divisors_of;
};
END_NAMESPACE_PBORIGB
#endif /* polybori_groebner_RelatedTermsBase_h_ */
polybori::groebner::RelatedTermsBase::unrelated_terms
MonomialSet unrelated_terms(const MonomialSet &terms) const
Extract terms not owning variables of current generator's leading term.
Definition: RelatedTermsBase.h:67
CMemberFunctionTraits.h
END_NAMESPACE_PBORIGB
#define END_NAMESPACE_PBORIGB
Definition: groebner_defs.h:16
polybori::BooleSet::existAbstract
self existAbstract(const term_type &rhs) const
Definition: BooleSet.cc:252
BoundedDivisorsOf.h
polybori::BoolePolyRing
This class reinterprets decicion diagram managers as Boolean polynomial rings, adds an ordering and v...
Definition: BoolePolyRing.h:40
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::groebner::minimal_elements_divided
MonomialSet minimal_elements_divided(MonomialSet m, Monomial lm, MonomialSet mod)
Definition: minimal_elements.h:430
polybori::groebner::mod_mon_set
MonomialSet mod_mon_set(const MonomialSet &as, const MonomialSet &vs)
Definition: nf.cc:855
polybori::groebner::RelatedTermsBase
This class deals as a base of RelatedTerns.
Definition: RelatedTermsBase.h:32
PBORI_ASSERT
#define PBORI_ASSERT(arg)
Definition: pbori_defs.h:118
polybori::groebner::BoundedDivisorsOf
This class defines defines a function for computing a bounded variant of MononmialSet's divisorsOf...
Definition: BoundedDivisorsOf.h:42
polybori::member_function_operator
MemberFunctionOperator< MemberFct > member_function_operator(MemberFct func)
Definition: CMemberFunctionTraits.h:83
polybori::groebner::RelatedTermsBase::related_terms
const MonomialSet & related_terms() const
finally get the related terms
Definition: RelatedTermsBase.h:50
polybori::BooleSet::ownsOne
bool_type ownsOne() const
Test whether the empty set is included.
Definition: BooleSet.h:211
polybori::groebner::RelatedTermsBase::divisors_of
const BoundedDivisorsOf & divisors_of() const
Get parameterized functional.
Definition: RelatedTermsBase.h:53
minimal_elements.h
polybori::groebner::RelatedTermsBase::critical_terms_base
MonomialSet critical_terms_base(const MonomialSet &terms) const
Related elements in terms modulo the ignorable elements.
Definition: RelatedTermsBase.h:62
polybori::groebner::RelatedTermsBase::RelatedTermsBase
RelatedTermsBase(const BoolePolyRing &ring)
Empty set of terms.
Definition: RelatedTermsBase.h:36
polybori::groebner::RelatedTermsBase::factors
MonomialSet factors(const MonomialSet &terms) const
Minimal related elements from terms, with lead's variables set to 1.
Definition: RelatedTermsBase.h:56
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::groebner::RelatedTermsBase::RelatedTermsBase
RelatedTermsBase(const Monomial &lead, const MonomialSet &terms, const MonomialSet &ignorable, const MonomialSet &significant)
Nontrivial constructor.
Definition: RelatedTermsBase.h:41