struct aux::InverseDistanceCache¶
Overview¶
Methods to calculate distances between atoms. More…
#include <Distance.h>
struct InverseDistanceCache {
// fields
std::vector<std::vector<double>> invr_x1;
std::vector<std::vector<double>> invr_x2;
std::vector<gpr::Index_t> pair_types;
Eigen::Index n1 = 0;
Eigen::Index n2 = 0;
Eigen::Index n_mov = 0;
Eigen::Index n_fro = 0;
bool valid = false;
// methods
void clear();
};
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.