PairE.h
Go to the documentation of this file.
// -*- c++ -*-
//*****************************************************************************
//*****************************************************************************
#ifndef polybori_groebner_PairE_h_
#define polybori_groebner_PairE_h_
// include basic definitions
#include "groebner_defs.h"
BEGIN_NAMESPACE_PBORIGB
class PairE{
private:
int type;
public:
int getType() const{
return type;
}
wlen_type wlen;
deg_type sugar;
//three sorts of pairs
//x*poly, poly, i,j
pair_data_ptr data;
Exponent lm; //must not be the real lm, can be lm of syzygy or something else
PairE(const PairE& rhs):
type(rhs.getType()), wlen(rhs.wlen), sugar(rhs.sugar),
data(rhs.data), lm(rhs.lm) {}
Polynomial extract(const PolyEntryVector& v) const {
return data->extract(v);
}
PairE(int i, int j, const PolyEntryVector &v):
type(IJ_PAIR),
wlen(v[i].weightedLength+v[j].weightedLength-2),
data(new IJPairData(i,j)),
lm(v[i].leadExp+v[j].leadExp) {
sugar=lm.deg()+std::max(v[i].ecart(),v[j].ecart());
}
PairE(int i, idx_type v, const PolyEntryVector &gen,int type):
wlen(gen[i].weightedLength+gen[i].length),
sugar(gen[i].deg+1),
data(new VariablePairData(i,v)),
// sugar(gen[i].lmDeg+1),///@only do that because of bad criteria impl
lm(gen[i].leadExp) {
PBORI_ASSERT(type==VARIABLE_PAIR);
this->type=type;
if (gen[i].leadExp==gen[i].usedVariables)
sugar=gen[i].deg;
if (gen[i].tailVariables.deg()<gen[i].deg)
sugar=gen[i].deg;
}
PairE(const Polynomial& delayed):
type(DELAYED_PAIR), wlen(delayed.eliminationLength()),
sugar(delayed.deg()),
data(new PolyPairData(delayed)),
//lm(delayed.lead()),
lm(delayed.leadExp()) { }
const PolyPairData& delayedPair() const {
PBORI_ASSERT(type == DELAYED_PAIR);
return *static_cast<const PolyPairData*>(data.get());
}
const IJPairData& ijPair() const {
PBORI_ASSERT(type == IJ_PAIR);
return *static_cast<const IJPairData*>(data.get());
}
const VariablePairData& variablePair() const {
return *static_cast<const VariablePairData*>(data.get());
}
};
END_NAMESPACE_PBORIGB
#endif /* polybori_PairE_h_ */
polybori::groebner::pair_data_ptr
boost::shared_ptr< PairData > pair_data_ptr
Definition: PairLS.h:25
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::PolyEntryVector
Definition: PolyEntryVector.h:28
END_NAMESPACE_PBORIGB
#define END_NAMESPACE_PBORIGB
Definition: groebner_defs.h:16
polybori::groebner::IJ_PAIR
Definition: PairLS.h:29
polybori::groebner::deg_type
int deg_type
Definition: groebner_defs.h:42
polybori::groebner::IJPairData
This class defines IJPairData.
Definition: IJPairData.h:28
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::PolyPairData
This class defines PolyPairData.
Definition: PolyPairData.h:28
polybori::groebner::PairE::variablePair
const VariablePairData & variablePair() const
Definition: PairE.h:90
polybori::BoolePolynomial
This class wraps the underlying decicion diagram type and defines the necessary operations.
Definition: BoolePolynomial.h:85
polybori::groebner::VARIABLE_PAIR
Definition: PairLS.h:28
groebner_defs.h
polybori::groebner::PairE::wlen
wlen_type wlen
Definition: PairE.h:35
polybori::groebner::PairE::sugar
deg_type sugar
Definition: PairE.h:36
polybori::groebner::PairE::getType
int getType() const
Definition: PairE.h:32
PBORI_ASSERT
#define PBORI_ASSERT(arg)
Definition: pbori_defs.h:118
polybori::groebner::PairE::PairE
PairE(int i, int j, const PolyEntryVector &v)
Definition: PairE.h:50
polybori::groebner::PairE::delayedPair
const PolyPairData & delayedPair() const
Definition: PairE.h:80
polybori::groebner::wlen_type
long wlen_type
Definition: groebner_defs.h:39
polybori::groebner::PairE::data
pair_data_ptr data
Definition: PairE.h:39
polybori::groebner::PairE::extract
Polynomial extract(const PolyEntryVector &v) const
Definition: PairE.h:47
polybori::groebner::idx_type
polybori::CTypes::idx_type idx_type
Definition: groebner_defs.h:44
polybori::groebner::PairE::PairE
PairE(const Polynomial &delayed)
Definition: PairE.h:73
polybori::groebner::PairE::PairE
PairE(const PairE &rhs)
Definition: PairE.h:42
polybori::groebner::PairE::PairE
PairE(int i, idx_type v, const PolyEntryVector &gen, int type)
Definition: PairE.h:58
polybori::groebner::DELAYED_PAIR
Definition: PairLS.h:30
polybori::BooleExponent::deg
deg_type deg() const
Degree of the corresponding monomial.
Definition: BooleExponent.h:118