16 #ifndef polybori_groebner_PolyEntryIndices_h_
17 #define polybori_groebner_PolyEntryIndices_h_
45 lm2Index(), exp2Index() {}
50 lm2Index[entry.
lead] = rhs;
57 lm2Index_map_type::iterator lm_pos = lm2Index.find(key);
59 lm2Index[entry.
lead] = lm_pos->second;
60 exp2Index[entry.
leadExp] = lm_pos->second;
61 lm2Index.erase(lm_pos);
62 exp2Index.erase(exp2Index.find(key.
exp()));
67 template <
class KeyType>
69 return get(key, uncheck());
73 template <
class KeyType>
75 return get(key, check());
81 template <
class CheckType>
84 template <
class CheckType>
86 return get(exp2Index, key, dummy);
89 template <
class CheckType>
91 return get(lm2Index, key, dummy);
94 template <
class CheckType>
96 return get(lm2Index, key.lead, dummy);
99 template <
class MapType,
class KeyType>
100 data_type get(
const MapType& map,
const KeyType& key, check)
const {
102 typename MapType::const_iterator result(map.find(key));
104 if (result == map.end())
108 return result->second;
111 template <
class MapType,
class KeyType>
112 data_type get(
const MapType& map,
const KeyType& key, uncheck)
const {
114 typename MapType::const_iterator result(map.find(key));
116 return result->second;