16 #ifndef polybori_groebner_PolyEntryVector_h_
17 #define polybori_groebner_PolyEntryVector_h_
29 typedef std::vector<PolyEntry> data_type;
40 bool empty()
const {
return m_data.empty(); }
48 template <
class KeyType>
50 return operator()(rhs);
68 m_data(), m_indices() {}
72 m_data.push_back(element);
75 if(m_indices.checked(back().lead) != (
size_type)-1)
76 throw std::runtime_error(
"leading terms not unique when appending to PolyEntryVector");
78 m_indices.insert(back(), size() - 1);
82 template <
class KeyType>
84 return m_data[index(key)];
88 template <
class KeyType>
90 return reference(m_data[index(rhs)], m_indices);
94 template <
class KeyType,
class Type>
95 void exchange(
const KeyType& key,
const Type& rhs) { operator()(key) = rhs; }
98 template <
class KeyType>
102 template <
class KeyType>
104 return m_indices.checked(key);
107 template <
class KeyType>
109 return operator[](key).p;