26size_t const SymFnc::sfinfoWidth = 12;
32vector<string> SymFnc::parameterInfo()
const
53 string statisticsLine,
60 if (((
size_t)atoi(s.at(0).c_str()) !=
ec + 1) &&
61 ((
size_t)atoi(s.at(1).c_str()) !=
index + 1))
63 throw runtime_error(
"ERROR: Inconsistent scaling statistics.\n");
65 Gmin = atof(s.at(2).c_str());
66 Gmax = atof(s.at(3).c_str());
67 Gmean = atof(s.at(4).c_str());
71 Gsigma = atof(s.at(5).c_str());
100#ifndef N2P2_NO_SF_CACHE
103 return vector<string>();
108 string cacheIdentifier)
115 size_t ne = atoi(
split(
id)[0].c_str());
116 identifiersPerElement.at(ne).push_back(
id);
119 if (identifiersPerElement.at(element).at(current) != cacheIdentifier)
121 throw runtime_error(
strpr(
"ERROR: Cache identifiers do no match:\n"
125 identifiersPerElement.at(element)
126 .at(current).c_str(),
127 cacheIdentifier.c_str()));
137 elementMap (elementMap),
163#ifndef N2P2_NO_SF_CACHE
181 return value -
Gmean;
209 return value +
Gmean;
227 return strpr(
"%4zu %9.2E %9.2E %9.2E %9.2E %9.2E %5.2f %5.2f %d\n",
243 pf[
"index"] = make_pair(
"%4zu" ,
string(4,
' '));
244 pf[
"ec"] = make_pair(
"%2s" ,
string(2,
' '));
245 pf[
"type"] = make_pair(
"%2zu" ,
string(2,
' '));
246 pf[
"subtype"] = make_pair(
"%4s" ,
string(4,
' '));
247 pf[
"e1"] = make_pair(
"%2s" ,
string(2,
' '));
248 pf[
"e2"] = make_pair(
"%2s" ,
string(2,
' '));
249 pf[
"eta"] = make_pair(
"%9.3E" ,
string(9,
' '));
250 pf[
"rs/rl"] = make_pair(
"%10.3E",
string(10,
' '));
251 pf[
"rc"] = make_pair(
"%10.3E",
string(10,
' '));
252 pf[
"angleLeft"] = make_pair(
"%6.1f" ,
string(6,
' '));
253 pf[
"angleRight"] = make_pair(
"%6.1f" ,
string(6,
' '));
254 pf[
"lambda"] = make_pair(
"%2.0f" ,
string(2,
' '));
255 pf[
"zeta"] = make_pair(
"%4.1f" ,
string(4,
' '));
256 pf[
"alpha"] = make_pair(
"%4.2f" ,
string(4,
' '));
257 pf[
"lineNumber"] = make_pair(
"%5zu" ,
string(5,
' '));
266 po.push_back(
"index" );
268 po.push_back(
"type" );
269 po.push_back(
"subtype" );
272 po.push_back(
"eta" );
273 po.push_back(
"rs/rl" );
275 po.push_back(
"angleLeft" );
276 po.push_back(
"angleRight");
277 po.push_back(
"lambda" );
278 po.push_back(
"zeta" );
279 po.push_back(
"alpha" );
280 po.push_back(
"lineNumber");
289 for (PrintOrder::const_iterator it =
printOrder.begin();
304 if (s.size () > 0) s.resize (s.size () - 1);
std::size_t size() const
Get element map size.
ScalingType
List of available scaling types.
double convLength
Data set normalization length conversion factor.
static PrintFormat const printFormat
Map of parameter format strings and empty strings.
std::map< std::string, std::pair< std::string, std::string > > PrintFormat
void addCacheIndex(std::size_t element, std::size_t cacheIndex, std::string cacheIdentifier)
Add one cache index for given neighbor element and check identifier.
double Gmean
Mean unscaled symmetry function value.
std::size_t type
Symmetry function type.
virtual std::vector< std::string > getCacheIdentifiers() const
Get unique cache identifiers.
double Gmax
Maximum unscaled symmetry function value.
std::set< std::string > parameters
Set with symmetry function parameter IDs (lookup for printing).
static PrintOrder const printOrder
Vector of parameters in order of printing.
std::size_t index
Symmetry function index (per element).
double scalingFactor
Scaling factor.
ScalingType scalingType
Symmetry function scaling type used by this symmetry function.
void setScalingType(ScalingType scalingType, std::string statisticsLine, double Smin, double Smax)
Set symmetry function scaling type.
std::vector< std::string > PrintOrder
std::vector< std::vector< std::size_t > > cacheIndices
Cache indices for each element.
SymFnc(std::size_t type, ElementMap const &)
Constructor, initializes type.
double Smin
Minimum for scaling range.
double unscale(double value) const
Undo symmetry function scaling and/or centering.
ElementMap elementMap
Copy of element map.
double Smax
Maximum for scaling range.
double scale(double value) const
Apply symmetry function scaling and/or centering.
double Gsigma
Sigma of unscaled symmetry function values.
double Gmin
Minimum unscaled symmetry function value.
std::vector< std::size_t > indexPerElement
Per-element index for derivative memory in Atom::Neighbor::dGdr arrays.
std::size_t ec
Element index of center atom.
static std::size_t const sfinfoWidth
Width of the SFINFO parameter description field (see parameterInfo()).
static PrintFormat const initializePrintFormat()
Initialize static print format map for all possible parameters.
std::string scalingLine() const
Get string with scaling information.
std::size_t lineNumber
Line number.
std::string getPrintFormat() const
Generate format string for symmetry function parameter printing.
static PrintOrder const initializePrintOrder()
Initialize static print order vector for all possible parameters.
string pad(string const &input, size_t num, char fill, bool right)
string strpr(const char *format,...)
String version of printf function.
vector< string > split(string const &input, char delimiter)
Split string at each delimiter.
string reduce(string const &line, string const &whitespace, string const &fill)
Replace multiple whitespaces with fill.
V const & safeFind(std::map< K, V > const &stdMap, typename std::map< K, V >::key_type const &key)
Safely access map entry.