MCPcopy Create free account
hub / github.com/SINGROUP/dscribe / getNeighboursForIndex

Method getNeighboursForIndex

dscribe/ext/celllist.cpp:147–164  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

145}
146
147CellListResult 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}

Callers 1

createMethod · 0.80

Calls 1

Tested by

no test coverage detected