PolyBoRi
PolyEntryReference.h
Go to the documentation of this file.
1 // -*- c++ -*-
2 //*****************************************************************************
14 //*****************************************************************************
15 
16 #ifndef polybori_groebner_PolyEntryReference_h_
17 #define polybori_groebner_PolyEntryReference_h_
18 
19 // include basic definitions
20 #include "groebner_defs.h"
21 #include <set>
22 
23 #include "PolyEntryIndices.h"
24 #include "PolyEntry.h"
25 
27 
35  typedef PolyEntryReference self;
36 
37 public:
40 
42  PolyEntryReference(value_type &entry, vector_type& parent):
43  vPairCalculated(entry.vPairCalculated), minimal(entry.minimal),
44  m_entry(entry), m_parent(parent) { }
45 
47  bool operator==(const self& rhs) const { return m_entry == rhs; }
48 
50 
52  return m_entry.markVariablePairsCalculated(); }
53 
54  bool propagatableBy(const PolyEntry& other) const {
55  return m_entry.propagatableBy(other);
56  }
57 
58  std::set<idx_type>& vPairCalculated;
59  bool& minimal;
61 
63  template <class Type>
64  self& operator=(const Type& rhs) {
65  Monomial lm(m_entry.lead);
66  m_entry = rhs;
67  m_parent.update(lm, m_entry);
68  return *this;
69  }
70 
72  const value_type& get() const { return const_cast<const value_type&>(m_entry); }
73 
75  operator const value_type&() const { return get(); }
76 
77 private:
78  value_type& m_entry;
79  vector_type& m_parent;
80 };
81 
82 
84 
85 #endif /* polybori_groebner_PolyEntryReference_h_ */
bool propagatableBy(const PolyEntry &other) const
Definition: PolyEntryReference.h:54
bool operator==(const self &rhs) const
Equality check.
Definition: PolyEntryReference.h:47
#define END_NAMESPACE_PBORIGB
Definition: groebner_defs.h:16
PolyEntryReference(value_type &entry, vector_type &parent)
Construct from plain non-constant reference.
Definition: PolyEntryReference.h:42
bool & minimal
Definition: PolyEntryReference.h:59
#define BEGIN_NAMESPACE_PBORIGB
Definition: groebner_defs.h:15
This class defines PolyEntry.
Definition: PolyEntry.h:32
self & operator=(const Type &rhs)
Assignment also triggers changes in the parent.
Definition: PolyEntryReference.h:64
This class defines PolyEntryIndices.
Definition: PolyEntryIndices.h:33
PolyEntry value_type
Definition: PolyEntryReference.h:39
PolyEntryIndices vector_type
Definition: PolyEntryReference.h:38
std::set< idx_type > & vPairCalculated
Definition: PolyEntryReference.h:58
This class is just a wrapper for using variables from cudd's decicion diagram.
Definition: BooleMonomial.h:50
This class defines PolyEntryReference.
Definition: PolyEntryReference.h:34
void markVariablePairsCalculated()
Definition: PolyEntryReference.h:51