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> atomRank;
    std::vector<std::array<int, 3>> ringShift;
};

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<std::array<int, 3>> ringShift

Integer minimum-image winding of each ring. Empty if no box was supplied.