25SymFncStatistics::Container::Container() :
29 min ( numeric_limits<double>::max()),
30 max (-numeric_limits<double>::max()),
50 min = numeric_limits<double>::max();
51 max = -numeric_limits<double>::max();
65 indexStructureEW.clear();
83 data[index].sum += value;
84 data[index].sum2 += value * value;
85 data[index].min = min(
data[index].min, value);
86 data[index].max = max(
data[index].max, value);
97 size_t indexStructure,
100 data[index].countEW++;
101 data[index].Gmin = Gmin;
102 data[index].Gmax = Gmax;
103 data[index].type = type;
104 data[index].element = element;
105 data[index].valueEW.push_back(value);
106 data[index].indexStructureEW.push_back(indexStructure);
107 data[index].indexAtomEW.push_back(indexAtom);
115 for (map<size_t, Container>::const_iterator it =
data.begin();
116 it !=
data.end(); ++it)
119 for (
size_t i = 0; i <
d.valueEW.size(); ++i)
121 vs.push_back(
strpr(
"### NNP EXTRAPOLATION WARNING ### "
122 "STRUCTURE: %6zu ATOM: %9zu ELEMENT: %2s "
123 "SYMFUNC: %4zu TYPE: %2zu VALUE: %10.3E "
124 "MIN: %10.3E MAX: %10.3E\n",
125 d.indexStructureEW[i],
143 for (map<size_t, Container>::const_iterator it =
data.begin();
144 it !=
data.end(); ++it)
146 n += it->second.countEW;
154 for (map<size_t, Container>::iterator it =
data.begin();
155 it !=
data.end(); ++it)
157 it->second.resetStatistics();
165 for (map<size_t, Container>::iterator it =
data.begin();
166 it !=
data.end(); ++it)
168 it->second.resetExtrapolationWarnings();
void clear()
Completely erase database.
std::vector< std::string > getExtrapolationWarningLines() const
Get lines with extrapolation warnings.
SymFncStatistics()
Constructor, initializes bool variables.
bool stopOnExtrapolationWarnings
Whether to raise an exception in case of extrapolation warnings.
std::map< std::size_t, Container > data
Map for all symmetry functions containing all gathered information.
void addValue(std::size_t index, double value)
Update symmetry function statistics with one value.
bool collectStatistics
Whether statistics are gathered.
void resetExtrapolationWarnings()
Reset extrapolation warnings for all symmetry functions at once.
void addExtrapolationWarning(std::size_t index, std::size_t type, double value, double Gmin, double Gmax, std::string element, std::size_t indexStructure, std::size_t indexAtom)
Add extrapolation warning entry.
std::size_t countExtrapolationWarnings() const
Count total number of extrapolation warnings.
bool collectExtrapolationWarnings
Whether extrapolation warnings are logged.
bool writeExtrapolationWarnings
Whether to write out extrapolation warnings immediately as they occur.
void resetStatistics()
Reset statistics for all symmetry functions at once.
string strpr(const char *format,...)
String version of printf function.
Struct containing statistics gathered during symmetry function calculation.
void resetStatistics()
Reset only statistics.
void resetExtrapolationWarnings()
Reset only extrapolation warnings.
void reset()
Reset all values.