LexHelper.h
Go to the documentation of this file.
// -*- c++ -*-
//*****************************************************************************
//*****************************************************************************
#ifndef polybori_groebner_LexHelper_h_
#define polybori_groebner_LexHelper_h_
// include basic definitions
#include "groebner_defs.h"
#include "IsEcart0Predicate.h"
#include "ReductionStrategy.h"
#include "nf.h"
BEGIN_NAMESPACE_PBORIGB
class LexHelper{
public:
static bool irreducible_lead(const Monomial& m, const ReductionStrategy& strat){
if (strat.optRedTailDegGrowth) return PBORINAME::groebner::irreducible_lead(m,strat);
else{
BooleSet ms=strat.leadingTerms.intersect(m.divisors());
if (ms.isZero())
return true;
else {
return std::find_if(ms.expBegin(),ms.expEnd(),IsEcart0Predicate(strat))==ms.expEnd();
}
}
}
static Polynomial::const_iterator begin(const Polynomial & p){
return p.begin();
}
static Polynomial::const_iterator end(const Polynomial & p){
return p.end();
}
static Polynomial nf(const ReductionStrategy& strat, const Polynomial& p, const Monomial& m){
//return nf3_lexbuckets(strat,p,m);
if (strat.optRedTailDegGrowth) return nf3(strat,p,m);
else return nf3_no_deg_growth(strat,p,m);
}
typedef Polynomial::const_iterator iterator_type;
const static bool isDegreeOrder=false;
const static bool isLexicographicalOrder=true;
static bool knowRestIsIrreducible(const iterator_type& it, const ReductionStrategy & strat){
if ( (it.deg()>0) && (it.firstIndex()>strat.reducibleUntil))
return true;
else return false;
}
static Polynomial sum_range(std::vector<Monomial>& vec,const iterator_type&
it, const iterator_type& end, Polynomial init){
if (vec.size()==1) return vec[0];
if (it!=end)
return term_accumulate(it,end, init);
else return init;
}
};
END_NAMESPACE_PBORIGB
#endif /* polybori_LexHelper_h_ */
IsEcart0Predicate.h
polybori::groebner::LexHelper::iterator_type
Polynomial::const_iterator iterator_type
Definition: LexHelper.h:56
polybori::groebner::LexHelper::begin
static Polynomial::const_iterator begin(const Polynomial &p)
Definition: LexHelper.h:45
END_NAMESPACE_PBORIGB
#define END_NAMESPACE_PBORIGB
Definition: groebner_defs.h:16
polybori::BoolePolynomial::end
const_iterator end() const
Finish of iteration over monomials.
Definition: BoolePolynomial.cc:531
polybori::groebner::ReductionOptions::reducibleUntil
idx_type reducibleUntil
Definition: ReductionOptions.h:40
polybori::BoolePolynomial::begin
const_iterator begin() const
Start of iteration over monomials.
Definition: BoolePolynomial.cc:523
polybori::groebner::LexHelper::sum_range
static Polynomial sum_range(std::vector< Monomial > &vec, const iterator_type &it, const iterator_type &end, Polynomial init)
Definition: LexHelper.h:65
polybori::BooleSet::expEnd
exp_iterator expEnd() const
Finish of iteration over exponent vectors.
Definition: BooleSet.cc:109
polybori::groebner::irreducible_lead
bool irreducible_lead(Monomial lm, const ReductionStrategy &strat)
Definition: ReductionStrategy.h:107
BEGIN_NAMESPACE_PBORIGB
#define BEGIN_NAMESPACE_PBORIGB
Definition: groebner_defs.h:15
polybori::BooleSet::expBegin
exp_iterator expBegin() const
Start of iteration over exponent vectors.
Definition: BooleSet.cc:101
polybori::groebner::LexHelper::end
static Polynomial::const_iterator end(const Polynomial &p)
Definition: LexHelper.h:48
polybori::BoolePolynomial
This class wraps the underlying decicion diagram type and defines the necessary operations.
Definition: BoolePolynomial.h:85
polybori::groebner::LexHelper
This class defines LexHelper.
Definition: LexHelper.h:31
nf.h
groebner_defs.h
polybori::CCuddDDFacade::isZero
bool isZero() const
Test whether diagram represents the empty set.
Definition: CCuddDDFacade.h:244
polybori::BooleMonomial::divisors
set_type divisors() const
Divisors of the monomial.
Definition: BooleMonomial.h:154
polybori::groebner::IsEcart0Predicate
This class defines IsEcart0Predicate.
Definition: IsEcart0Predicate.h:29
polybori::groebner::LexHelper::knowRestIsIrreducible
static bool knowRestIsIrreducible(const iterator_type &it, const ReductionStrategy &strat)
Definition: LexHelper.h:59
polybori::groebner::LexHelper::irreducible_lead
static bool irreducible_lead(const Monomial &m, const ReductionStrategy &strat)
Definition: LexHelper.h:33
polybori::CGenericIter
Definition: BoolePolynomial.h:70
polybori::groebner::ReductionOptions::optRedTailDegGrowth
bool optRedTailDegGrowth
Definition: ReductionOptions.h:38
ReductionStrategy.h
polybori::groebner::ReductionTerms::leadingTerms
LeadingTerms leadingTerms
Definition: ReductionTerms.h:51
polybori::groebner::LexHelper::nf
static Polynomial nf(const ReductionStrategy &strat, const Polynomial &p, const Monomial &m)
Definition: LexHelper.h:51
polybori::groebner::nf3_no_deg_growth
Polynomial nf3_no_deg_growth(const ReductionStrategy &strat, Polynomial p, Monomial rest_lead)
Definition: nf.cc:125
polybori::BooleSet
Definition: BooleSet.h:57
polybori::groebner::ReductionStrategy
This class defines ReductionStrategy.
Definition: ReductionStrategy.h:34
polybori::term_accumulate
ValueType term_accumulate(UpperIterator ustart, UpperIterator ufinish, NaviType navi, LowerIterator lstart, LowerIterator lfinish, ValueType init)
Definition: pbori_algorithms.h:128
polybori::BooleMonomial
This class is just a wrapper for using variables from cudd's decicion diagram.
Definition: BooleMonomial.h:50
polybori::groebner::nf3
Polynomial nf3(const ReductionStrategy &strat, Polynomial p, Monomial rest_lead)
Definition: nf.cc:64