PolyBoRi
PairE.h
Go to the documentation of this file.
1 // -*- c++ -*-
2 //*****************************************************************************
14 //*****************************************************************************
15 
16 #ifndef polybori_groebner_PairE_h_
17 #define polybori_groebner_PairE_h_
18 
19 // include basic definitions
20 #include "groebner_defs.h"
21 
23 
28 class PairE{
29 private:
30  int type;
31 public:
32  int getType() const{
33  return type;
34  }
37  //three sorts of pairs
38  //x*poly, poly, i,j
40  Exponent lm; //must not be the real lm, can be lm of syzygy or something else
41 
42  PairE(const PairE& rhs):
43  type(rhs.getType()), wlen(rhs.wlen), sugar(rhs.sugar),
44  data(rhs.data), lm(rhs.lm) {}
45 
46 
48  return data->extract(v);
49  }
50  PairE(int i, int j, const PolyEntryVector &v):
51  type(IJ_PAIR),
52  wlen(v[i].weightedLength+v[j].weightedLength-2),
53  data(new IJPairData(i,j)),
54  lm(v[i].leadExp+v[j].leadExp) {
55  sugar=lm.deg()+std::max(v[i].ecart(),v[j].ecart());
56  }
57 
58  PairE(int i, idx_type v, const PolyEntryVector &gen,int type):
59  wlen(gen[i].weightedLength+gen[i].length),
60  sugar(gen[i].deg+1),
61  data(new VariablePairData(i,v)),
62  // sugar(gen[i].lmDeg+1),///@only do that because of bad criteria impl
63 
64  lm(gen[i].leadExp) {
66  this->type=type;
67  if (gen[i].leadExp==gen[i].usedVariables)
68  sugar=gen[i].deg;
69  if (gen[i].tailVariables.deg()<gen[i].deg)
70  sugar=gen[i].deg;
71  }
72 
73  PairE(const Polynomial& delayed):
74  type(DELAYED_PAIR), wlen(delayed.eliminationLength()),
75  sugar(delayed.deg()),
76  data(new PolyPairData(delayed)),
77  //lm(delayed.lead()),
78  lm(delayed.leadExp()) { }
79 
80  const PolyPairData& delayedPair() const {
81  PBORI_ASSERT(type == DELAYED_PAIR);
82  return *static_cast<const PolyPairData*>(data.get());
83  }
84 
85  const IJPairData& ijPair() const {
86  PBORI_ASSERT(type == IJ_PAIR);
87  return *static_cast<const IJPairData*>(data.get());
88  }
89 
90  const VariablePairData& variablePair() const {
91  return *static_cast<const VariablePairData*>(data.get());
92  }
93 };
94 
96 
97 #endif /* polybori_PairE_h_ */
boost::shared_ptr< PairData > pair_data_ptr
Definition: PairLS.h:25
const IJPairData & ijPair() const
Definition: PairE.h:85
This class is just a wrapper for using variables for storing indices as interim data structure for Bo...
Definition: BooleExponent.h:34
Definition: PolyEntryVector.h:28
#define END_NAMESPACE_PBORIGB
Definition: groebner_defs.h:16
Definition: PairLS.h:29
int deg_type
Definition: groebner_defs.h:42
This class defines IJPairData.
Definition: IJPairData.h:28
This class defines VariablePairData.
Definition: VariablePairData.h:28
Exponent lm
Definition: PairE.h:40
#define BEGIN_NAMESPACE_PBORIGB
Definition: groebner_defs.h:15
This class defines PairE.
Definition: PairE.h:28
This class defines PolyPairData.
Definition: PolyPairData.h:28
const VariablePairData & variablePair() const
Definition: PairE.h:90
This class wraps the underlying decicion diagram type and defines the necessary operations.
Definition: BoolePolynomial.h:85
Definition: PairLS.h:28
wlen_type wlen
Definition: PairE.h:35
deg_type sugar
Definition: PairE.h:36
int getType() const
Definition: PairE.h:32
#define PBORI_ASSERT(arg)
Definition: pbori_defs.h:118
PairE(int i, int j, const PolyEntryVector &v)
Definition: PairE.h:50
const PolyPairData & delayedPair() const
Definition: PairE.h:80
long wlen_type
Definition: groebner_defs.h:39
pair_data_ptr data
Definition: PairE.h:39
Polynomial extract(const PolyEntryVector &v) const
Definition: PairE.h:47
polybori::CTypes::idx_type idx_type
Definition: groebner_defs.h:44
PairE(const Polynomial &delayed)
Definition: PairE.h:73
PairE(const PairE &rhs)
Definition: PairE.h:42
PairE(int i, idx_type v, const PolyEntryVector &gen, int type)
Definition: PairE.h:58
Definition: PairLS.h:30
deg_type deg() const
Degree of the corresponding monomial.
Definition: BooleExponent.h:118