15 #include <initializer_list>
61 template <
typename value_t>
65 using InputElement =
typename std::pair<GeometryIdentifier, value_t>;
66 using Iterator =
typename std::vector<value_t>::const_iterator;
67 using Size =
typename std::vector<value_t>::size_type;
122 "Incompatible GeometryIdentifier hierarchy");
125 "Incompatible GeometryIdentifier hierarchy");
128 "Incompatible GeometryIdentifier hierarchy");
131 "Incompatible GeometryIdentifier hierarchy");
146 if (
id.sensitive() != 0
u) {
148 return allSet.setExtra(0
u).value();
150 if (
id.approach() != 0
u) {
151 return allSet.setExtra(0
u).setSensitive(0
u).value();
154 return allSet.setExtra(0
u).setSensitive(0
u).setApproach(0
u).value();
156 if (
id.boundary() != 0
u) {
157 return allSet.setExtra(0
u)
163 if (
id.volume() != 0
u) {
164 return allSet.setExtra(0
u)
181 return (lhs & mask) == (rhs &
mask);
184 template <
typename iterator_t>
191 template <
typename iterator_t>
197 template <
typename value_t>
199 std::vector<InputElement> elements) {
200 sortAndCheckDuplicates(elements.begin(), elements.end());
201 fill(elements.begin(), elements.end());
204 template <
typename value_t>
206 std::initializer_list<InputElement> elements)
210 template <
typename value_t>
211 template <
typename iterator_t>
216 return lhs.first <
rhs.first;
219 auto dup = std::adjacent_find(beg, end, [](
const auto&
lhs,
const auto&
rhs) {
220 return lhs.first ==
rhs.first;
223 throw std::invalid_argument(
"Input elements contain duplicates");
227 template <
typename value_t>
228 template <
typename iterator_t>
238 for (; beg !=
end; ++beg) {
239 m_ids.push_back(beg->first.value());
240 m_masks.push_back(makeLeadingLevelsMask(beg->first.value()));
241 m_values.push_back(
std::move(beg->second));
245 template <
typename value_t>
248 assert((m_ids.size() == m_values.size()) and
249 "Inconsistent container state: #ids != # values");
250 assert((m_masks.size() == m_values.size()) and
251 "Inconsistent container state: #masks != #values");
257 const auto it = std::upper_bound(m_ids.begin(), m_ids.end(),
id.value());
279 if (not equalWithinMask(
id.
value(), m_ids[i], makeHighestLevelMask())) {
291 if (equalWithinMask(
id.
value(), m_ids[i], m_masks[i])) {