PolyBoRi
PolyEntry.h
Go to the documentation of this file.
1 // -*- c++ -*-
2 //*****************************************************************************
14 //*****************************************************************************
15 
16 #ifndef polybori_groebner_PolyEntry_h_
17 #define polybori_groebner_PolyEntry_h_
18 
19 #include "LiteralFactorization.h"
20 #include "PolyEntryBase.h"
21 
22 // include basic definitions
23 #include "groebner_defs.h"
24 
26 
27 
32 class PolyEntry:
33  public PolyEntryBase {
34  PolyEntry(); /* never use this one! */
35 
36  typedef PolyEntry self;
37  typedef PolyEntryBase base;
38 
39 public:
40  PolyEntry(const Polynomial &p): base(p) {}
41 
42  bool operator==(const self& other) const { return p == other.p; }
43 
44  self& operator=(const self& rhs) {
45  return static_cast<self&>(base::operator=(rhs));
46  }
47 
48  self& operator=(const Polynomial& rhs) {
49  p = rhs;
50  recomputeInformation();
51  return *this;
52  }
53 
54  deg_type ecart() const{ return deg-leadDeg; }
55 
56  void recomputeInformation();
57 
59  vPairCalculated.insert(leadExp.begin(), leadExp.end());
60  }
61 
62  bool propagatableBy(const PolyEntry& other) const {
63  return minimal && (deg <= 2) && (length > 1) && (p != other.p) &&
64  tailVariables.reducibleBy(other.leadExp);
65  }
66 
67  bool isSingleton() const { return length == 1; }
68 };
69 
70 
71 
72 
73 
74 inline bool
76  return ( (e.length == 1) && (e.deg > 0) && (e.deg < 4) ) ||
77  ( (e.length == 2) && (e.ecart() == 0) && (e.deg < 3) );
78 
79 }
80 
82 
83 #endif /* polybori_PolyEntry_h_ */