100 std::vector<double> J2s;
101 for (
QMPair *pair : nblist) {
114 double J2 = std::log10(test);
118 if (J2s.size() < 1) {
120 " Couplings are all zero. You have not yet imported them! "
125 double MAX = *std::max_element(J2s.begin(), J2s.end());
126 double MIN = *std::min_element(J2s.begin(), J2s.end());
127 double sum = std::accumulate(J2s.begin(), J2s.end(), 0.0);
128 double AVG = sum / double(J2s.size());
129 double sq_sum = std::inner_product(J2s.begin(), J2s.end(), J2s.begin(), 0.0);
130 double STD = std::sqrt(sq_sum /
double(J2s.size()) - AVG * AVG);
135 hist.Initialize(MIN, MAX, BIN);
136 hist.ProcessRange<std::vector<double>::iterator>(J2s.begin(), J2s.end());
138 std::string comment =
139 (boost::format(
"IANALYZE: PAIR-INTEGRAL J2 HISTOGRAM \n # AVG %1$4.7f "
140 "STD %2$4.7f MIN %3$4.7f MAX %4$4.7f") %
141 AVG % STD % MIN % MAX)
143 std::string filename =
"ianalyze.ihist_" + state.
ToString() +
".out";
145 tab.
flags() = std::vector<char>(tab.
size(),
' ');
154 std::vector<double> J2s;
155 J2s.reserve(nblist.
size());
156 std::vector<double> distances;
157 distances.reserve(nblist.
size());
159 for (
QMPair *pair : nblist) {
165 double J2 = std::log10(test);
167 distances.push_back(distance);
171 double MAXR = *std::max_element(distances.begin(), distances.end());
172 double MINR = *std::min_element(distances.begin(), distances.end());
176 std::vector<std::vector<double>> rJ2;
180 for (
Index i = 0; i < pointsR; ++i) {
184 for (
Index j = 0; j <
Index(J2s.size()); ++j) {
185 if (thisMINR < distances[j] && distances[j] < thisMAXR) {
186 rJ2[i].push_back(J2s[j]);
196 for (
Index i = 0; i <
Index(rJ2.size()); i++) {
197 const std::vector<double> &vec = rJ2[i];
198 double sum = std::accumulate(vec.begin(), vec.end(), 0.0);
199 double AVG = sum / double(vec.size());
202 std::inner_product(vec.begin(), vec.end(), vec.begin(), 0.0);
203 double STD = std::sqrt(sq_sum /
double(vec.size()) - AVG * AVG);
204 tab.
set(i, thisR, AVG,
' ', STD);
206 std::string filename =
"ianalyze.ispatial_" + state.
ToString() +
".out";
207 std::string comment =
208 "# IANALYZE: SPATIAL DEPENDENCE OF log10(J2) "
209 "[r[nm],log10(J)[eV^2],error]";