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 
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_ */