| 145 | } |
| 146 | |
| 147 | CellListResult CellList::getNeighboursForIndex(const int idx) const |
| 148 | { |
| 149 | double x = this->positions(idx, 0); |
| 150 | double y = this->positions(idx, 1); |
| 151 | double z = this->positions(idx, 2); |
| 152 | CellListResult result = this->getNeighboursForPosition(x, y, z); |
| 153 | |
| 154 | // Remove self from neighbours |
| 155 | for (int i=0; i < result.indices.size(); ++i) { |
| 156 | if (result.indices[i] == idx) { |
| 157 | result.indices.erase(result.indices.begin() + i); |
| 158 | result.distances.erase(result.distances.begin() + i); |
| 159 | result.distancesSquared.erase(result.distancesSquared.begin() + i); |
| 160 | break; |
| 161 | } |
| 162 | } |
| 163 | return result; |
| 164 | } |
no test coverage detected