HasTRepOrExtendedProductCriterion.h
Go to the documentation of this file.
// -*- c++ -*-
//*****************************************************************************
//*****************************************************************************
#ifndef polybori_groebner_HasTRepOrExtendedProductCriterion_h_
#define polybori_groebner_HasTRepOrExtendedProductCriterion_h_
// include basic definitions
#include "groebner_defs.h"
#include "GroebnerStrategy.h"
BEGIN_NAMESPACE_PBORIGB
inline bool
extended_product_criterion(const PolyEntry& m, const PolyEntry& m2){
//BooleMonomial m;
bool res=(m.lead.GCD(m2.lead).deg()==common_literal_factors_deg(m.literal_factors, m2.literal_factors));
//if (res)
// cout<<"EXTENDED PRODUCT_CRIT";
return res;
}
class HasTRepOrExtendedProductCriterion{
public:
GroebnerStrategy* strat;
int j;
HasTRepOrExtendedProductCriterion(GroebnerStrategy& strat, int j){
this->strat=&strat;
this->j=j;
}
bool operator() (const Monomial &m){
int i = strat->generators.index(m);
if (strat->pairs.status.hasTRep(i,j))
return true;
if (extended_product_criterion(const_cast<const GroebnerStrategy*>(strat)->generators[i],const_cast<const GroebnerStrategy*>(strat)->generators[j])){
strat->pairs.status.setToHasTRep(i,j);
strat->extendedProductCriterions++;
return true;
}
return false;
}
bool operator() (const Exponent &m){
int i;
i=strat->generators.index(m);
if (strat->pairs.status.hasTRep(i,j))
return true;
if (extended_product_criterion(const_cast<const GroebnerStrategy*>(strat)->generators[i],const_cast<const GroebnerStrategy*>(strat)->generators[j])){
strat->pairs.status.setToHasTRep(i,j);
strat->extendedProductCriterions++;
return true;
}
return false;
}
};
END_NAMESPACE_PBORIGB
#endif /* polybori_HasTRepOrExtendedProductCriterion_h_ */
polybori::BooleMonomial::deg
deg_type deg() const
Degree of the monomial.
Definition: BooleMonomial.h:146
polybori::groebner::common_literal_factors_deg
deg_type common_literal_factors_deg(const LiteralFactorization &a, const LiteralFactorization &b)
Definition: LiteralFactorization.cc:319
polybori::BooleExponent
This class is just a wrapper for using variables for storing indices as interim data structure for Bo...
Definition: BooleExponent.h:34
polybori::BooleMonomial::GCD
self GCD(const self &) const
Compute the greatest common divisor.
Definition: BooleMonomial.cc:169
polybori::groebner::PolyEntryVector::index
size_type index(const KeyType &key) const
Retrieve index associated to key.
Definition: PolyEntryVector.h:99
END_NAMESPACE_PBORIGB
#define END_NAMESPACE_PBORIGB
Definition: groebner_defs.h:16
polybori::groebner::HasTRepOrExtendedProductCriterion
This class defines HasTRepOrExtendedProductCriterion.
Definition: HasTRepOrExtendedProductCriterion.h:42
polybori::groebner::HasTRepOrExtendedProductCriterion::HasTRepOrExtendedProductCriterion
HasTRepOrExtendedProductCriterion(GroebnerStrategy &strat, int j)
Definition: HasTRepOrExtendedProductCriterion.h:46
BEGIN_NAMESPACE_PBORIGB
#define BEGIN_NAMESPACE_PBORIGB
Definition: groebner_defs.h:15
polybori::groebner::PolyEntry
This class defines PolyEntry.
Definition: PolyEntry.h:32
polybori::groebner::PairManager::status
PairStatusSet status
Definition: PairManager.h:75
polybori::groebner::GroebnerStrategy::generators
ReductionStrategy generators
Definition: GroebnerStrategy.h:204
groebner_defs.h
polybori::groebner::HasTRepOrExtendedProductCriterion::j
int j
Definition: HasTRepOrExtendedProductCriterion.h:45
polybori::groebner::PolyEntryBase::literal_factors
LiteralFactorization literal_factors
Definition: PolyEntryBase.h:53
polybori::groebner::GroebnerStrategy
This class defines GroebnerStrategy.
Definition: GroebnerStrategy.h:41
polybori::groebner::PairStatusSet::setToHasTRep
void setToHasTRep(int ia, int ja)
Definition: PairStatusSet.h:39
polybori::groebner::PairStatusSet::hasTRep
bool hasTRep(int ia, int ja) const
Definition: PairStatusSet.h:33
polybori::groebner::PairManagerFacade::pairs
PairManagerWithStrategy< strategy_type > pairs
For compatibility reasons make this a public member.
Definition: PairManagerFacade.h:95
polybori::groebner::GroebnerStrategy::extendedProductCriterions
int extendedProductCriterions
Definition: GroebnerStrategy.h:215
polybori::groebner::PolyEntryBase::lead
Monomial lead
Definition: PolyEntryBase.h:55
polybori::groebner::extended_product_criterion
bool extended_product_criterion(const PolyEntry &m, const PolyEntry &m2)
Definition: HasTRepOrExtendedProductCriterion.h:27
GroebnerStrategy.h
polybori::BooleMonomial
This class is just a wrapper for using variables from cudd's decicion diagram.
Definition: BooleMonomial.h:50
polybori::groebner::HasTRepOrExtendedProductCriterion::strat
GroebnerStrategy * strat
Definition: HasTRepOrExtendedProductCriterion.h:44