| 116 | |
| 117 | |
| 118 | void |
| 119 | NeighborhoodSearch::increase_point_set_size(unsigned int index, Real const* x, std::size_t size) |
| 120 | { |
| 121 | PointSet& point_set = m_point_sets[index]; |
| 122 | std::size_t old_size = point_set.n_points(); |
| 123 | |
| 124 | // Insert new entries. |
| 125 | for (unsigned int i = static_cast<unsigned int>(old_size); i < point_set.n_points(); i++) |
| 126 | { |
| 127 | HashKey key = cell_index(point_set.point(i)); |
| 128 | point_set.m_keys[i] = point_set.m_old_keys[i] = key; |
| 129 | auto it = m_map.find(key); |
| 130 | if (it == m_map.end()) |
| 131 | { |
| 132 | m_entries.push_back({{ index, i }}); |
| 133 | m_map[key] = static_cast<unsigned int>(m_entries.size() - 1); |
| 134 | } |
| 135 | else |
| 136 | { |
| 137 | m_entries[it->second].add({ index, i }); |
| 138 | } |
| 139 | } |
| 140 | |
| 141 | point_set.resize(x, size); |
| 142 | |
| 143 | } |
| 144 | |
| 145 | void |
| 146 | NeighborhoodSearch::find_neighbors() |