struct ring::RingSearchIndex#
Overview#
Inverted index from an atom to the rings that contain it. More…
#include <src/include/internal/topo_bulk.hpp>
struct RingSearchIndex {
// fields
std::vector<std::vector<int>> ringsContainingAtom;
std::vector<int, seams::FilledByTeam<int>> ringOff;
std::vector<int, seams::FilledByTeam<int>> ringCol;
std::vector<int> atomRank;
std::vector<std::array<int, 3>> ringShift;
// methods
int atomCount() const;
};
Detailed Documentation#
Inverted index from an atom to the rings that contain it.
The cage searches repeatedly ask which rings a given atom belongs to. Answering that by scanning every ring makes the searches quadratic in the ring count. One pass over the ring network answers it in constant time thereafter, and the ring indices in each row stay ascending, which is the order the searches previously visited them in.
findHC visits rings in the order of a key that does not use absolute coordinates: the sorted atom indices, then the unwrapped shift of the cycle. findDDC reports a maximum set of cages under the same key, so the cage count is independent of the order in which rings are claimed and does not change when the frame is translated.
Fields#
std::vector<int, seams::FilledByTeam<int>> ringOff
Same rows as ringsContainingAtom, packed. ringCol[ringOff[a] .. ringOff[a+1]) is the ascending ring list of atom a. Empty when the index was not built.
std::vector<std::array<int, 3>> ringShift
Summed minimum-image bond lattice images of each ring, the negative of ringWindings. Empty if no box was supplied.
Methods#
int atomCount() const
Atoms the packed rows cover.