.. index:: pair: struct; aux::InverseDistanceCache .. _doxid-structaux_1_1_inverse_distance_cache: struct aux::InverseDistanceCache ================================ .. toctree:: :hidden: Overview ~~~~~~~~ Methods to calculate distances between atoms. :ref:`More...` .. ref-code-block:: cpp :class: doxyrest-overview-code-block #include struct InverseDistanceCache { // fields std::vector> :target:`invr_x1`; std::vector> :target:`invr_x2`; std::vector<:ref:`gpr::Index_t`> :target:`pair_types`; :ref:`gpr::Coord` :target:`x1_cached`; :ref:`gpr::Coord` :target:`x2_cached`; double :target:`cell_cached`[9] = {0., 0., 0., 0., 0., 0., 0., 0., 0.}; Eigen::Index :target:`n1` = 0; Eigen::Index :target:`n2` = 0; Eigen::Index :target:`n_mov` = 0; Eigen::Index :target:`n_fro` = 0; bool :target:`valid` = false; // methods void :target:`clear`(); bool :ref:`matches`(const :ref:`gpr::Coord`& x1, const :ref:`gpr::Coord`& x2, const double cell[9]) const; }; .. _details-structaux_1_1_inverse_distance_cache: Detailed Documentation ~~~~~~~~~~~~~~~~~~~~~~ Methods to calculate distances between atoms. Cache for raw inverse interatomic distances. During hyperparameter optimization, atomic positions are fixed while lengthscales change every iteration. This cache stores the position- dependent 1/r_ij values so that dist_at() only needs to recompute the lengthscale-weighted sum on subsequent calls. Cache layout: invr_x1[pair_idx][n] = 1/r_ij for configuration n in x1 invr_x2[pair_idx][m] = 1/r_ij for configuration m in x2 pair_types[pair_idx] = pairtype index for this atom pair Moving-moving pairs come first (triangular: j < i), then moving-frozen. Methods ------- .. index:: pair: function; matches .. _doxid-structaux_1_1_inverse_distance_cache_1a06b42a938c3867d82b6125e206f7d022: .. ref-code-block:: cpp :class: doxyrest-title-code-block bool matches(const :ref:`gpr::Coord`& x1, const :ref:`gpr::Coord`& x2, const double cell[9]) const Whether the cache describes exactly this pair of coordinate sets.