CheckChainCriterion.h
Go to the documentation of this file.
// -*- c++ -*-
//*****************************************************************************
//*****************************************************************************
#ifndef polybori_groebner_CheckChainCriterion_h_
#define polybori_groebner_CheckChainCriterion_h_
// include basic definitions
#include "groebner_defs.h"
BEGIN_NAMESPACE_PBORIGB
template <class StrategyType>
class CheckChainCriterion {
public:
typedef StrategyType strategy_type;
CheckChainCriterion(strategy_type& strategy, PairStatusSet& status):
m_strategy(strategy), m_status(status) {}
bool operator()(const Pair& current) {
switch (current.getType()) {
case IJ_PAIR: return compute(current.ijPair(), current.lm);
case VARIABLE_PAIR: return compute(current.variablePair());
}
return false;
}
protected:
bool compute(const IJPairData& ij, const Exponent& exp) {
return m_status.hasTRep(ij.i, ij.j) ||
checkPairCriteria(exp, ij.i, ij.j);
}
bool compute(const VariablePairData& vp) {
return m_strategy.checkVariableCriteria(vp.i, vp.v);
}
bool checkPairCriteria(const Exponent& exp, int i, int j) {
if (m_strategy.checkPairCriteria(exp, i, j)) {
m_status.setToHasTRep(i, j);
return true;
}
return false;
}
private:
strategy_type& m_strategy;
PairStatusSet& m_status;
};
END_NAMESPACE_PBORIGB
#endif /* polybori_groebner_CheckChainCriterion_h_ */
polybori::groebner::PairE::ijPair
const IJPairData & ijPair() const
Definition: PairE.h:85
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::groebner::VariablePairData::v
idx_type v
Definition: VariablePairData.h:31
END_NAMESPACE_PBORIGB
#define END_NAMESPACE_PBORIGB
Definition: groebner_defs.h:16
polybori::groebner::IJ_PAIR
Definition: PairLS.h:29
polybori::groebner::IJPairData
This class defines IJPairData.
Definition: IJPairData.h:28
polybori::groebner::CheckChainCriterion::compute
bool compute(const VariablePairData &vp)
Definition: CheckChainCriterion.h:52
polybori::groebner::VariablePairData::i
int i
Definition: VariablePairData.h:30
polybori::groebner::VariablePairData
This class defines VariablePairData.
Definition: VariablePairData.h:28
polybori::groebner::PairE::lm
Exponent lm
Definition: PairE.h:40
BEGIN_NAMESPACE_PBORIGB
#define BEGIN_NAMESPACE_PBORIGB
Definition: groebner_defs.h:15
polybori::groebner::PairE
This class defines PairE.
Definition: PairE.h:28
polybori::groebner::PairE::variablePair
const VariablePairData & variablePair() const
Definition: PairE.h:90
polybori::groebner::VARIABLE_PAIR
Definition: PairLS.h:28
polybori::groebner::CheckChainCriterion
This class defines CheckChainCriterion.
Definition: CheckChainCriterion.h:30
groebner_defs.h
polybori::groebner::PairE::getType
int getType() const
Definition: PairE.h:32
polybori::groebner::CheckChainCriterion::checkPairCriteria
bool checkPairCriteria(const Exponent &exp, int i, int j)
Definition: CheckChainCriterion.h:56
polybori::groebner::IJPairData::i
int i
Definition: IJPairData.h:30
polybori::groebner::CheckChainCriterion::compute
bool compute(const IJPairData &ij, const Exponent &exp)
Definition: CheckChainCriterion.h:47
polybori::groebner::CheckChainCriterion::operator()
bool operator()(const Pair &current)
Clean up current and return whether it has a T-representation.
Definition: CheckChainCriterion.h:38
polybori::groebner::PairStatusSet
This class defines PairStatusSet.
Definition: PairStatusSet.h:30
polybori::groebner::CheckChainCriterion::CheckChainCriterion
CheckChainCriterion(strategy_type &strategy, PairStatusSet &status)
Definition: CheckChainCriterion.h:34
polybori::groebner::CheckChainCriterion::strategy_type
StrategyType strategy_type
Definition: CheckChainCriterion.h:32
polybori::groebner::IJPairData::j
int j
Definition: IJPairData.h:31