Per-pairtype length scale in Angstrom. Length = conf.n_pt; element [k] is the prior length scale for pairtype k.
75 {
76 const Index_t n_pt = conf_.n_pt;
77 Eigen::VectorXd ls =
78 Eigen::VectorXd::Constant(n_pt, default_fallback_angstrom_());
79
80
81
82
83 const Eigen::Index n_types = conf_.pairtype.rows();
84 std::vector<int> type_to_Z(static_cast<std::size_t>(n_types), -1);
85 const auto& types = conf_.type.size() == conf_.atomicNrs.size()
86 ? conf_.type
87 : conf_.atoms_mov.type;
88 const Eigen::Index count =
89 std::min(types.size(), conf_.atomicNrs.size());
90 for (Eigen::Index atom = 0; atom < count; ++atom) {
91 const auto type = static_cast<Eigen::Index>(types.data()[atom]);
92 if (type < 0 || type >= n_types) continue;
93 if (type_to_Z[type] == -1)
94 type_to_Z[type] = conf_.atomicNrs.data()[atom];
95 }
96
97
98
99
100 for (
Index_t k = 0; k < n_pt; ++k) {
101 for (Eigen::Index ti = 0;
102 ti < n_types && ls(k) == default_fallback_angstrom_(); ++ti) {
103 for (Eigen::Index tj = 0; tj < n_types; ++tj) {
104 if (conf_.pairtype(ti, tj) != static_cast<int>(k)) continue;
105 const int Za = type_to_Z[static_cast<std::size_t>(ti)];
106 const int Zb = type_to_Z[static_cast<std::size_t>(tj)];
107 if (Za <= 0 || Zb <= 0) continue;
109 break;
110 }
111 }
112 }
113 return ls;
114 }