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_ */
deg_type ecart() const
Definition: PolyEntry.h:54
Polynomial p
Definition: PolyEntryBase.h:54
#define END_NAMESPACE_PBORIGB
Definition: groebner_defs.h:16
int deg_type
Definition: groebner_defs.h:42
self & operator=(const self &rhs)
Definition: PolyEntry.h:44
bool should_propagate(const PolyEntry &e)
Definition: PolyEntry.h:75
#define BEGIN_NAMESPACE_PBORIGB
Definition: groebner_defs.h:15
This class defines PolyEntry.
Definition: PolyEntry.h:32
deg_type deg
Definition: PolyEntryBase.h:58
This class wraps the underlying decicion diagram type and defines the necessary operations.
Definition: BoolePolynomial.h:85
bool propagatableBy(const PolyEntry &other) const
Definition: PolyEntry.h:62
This class defines the base of PolyEntry.
Definition: PolyEntryBase.h:29
bool isSingleton() const
Definition: PolyEntry.h:67
Exponent leadExp
Definition: PolyEntryBase.h:60
self & operator=(const Polynomial &rhs)
Definition: PolyEntry.h:48
bool operator==(const self &other) const
Definition: PolyEntry.h:42
PolyEntry(const Polynomial &p)
Definition: PolyEntry.h:40
len_type length
Definition: PolyEntryBase.h:57
void markVariablePairsCalculated()
Definition: PolyEntry.h:58