75 for (
size_t i = 0; i < value.size(); ++i) {
95 const char integer_pattern[] =
"^[ \t]*([-+]?[0-9]+)[ \t]*$";
107 if (regcomp(®obj, integer_pattern, REG_EXTENDED | REG_NEWLINE | REG_NOSUB) != 0) {
108 vout.
crucial(
"Parameters: compilation of regular expression failed.\n");
116 bool _init = do_init();
122 if (_init && (regexec(®obj, value.c_str(), 0, NULL, 0) == 0)) {
124 vout.
crucial(
"%s: warning: irregular integer expression \"%s\".\n",
class_name.c_str(), value.c_str());
128 return atoi(value.c_str());
135 for (
size_t i = 0; i < value.size(); ++i) {
150 if ((value ==
"true") || (value ==
"TRUE") || (value ==
"True") ||
151 (value ==
"yes") || (value ==
"YES") || (value ==
"Yes") ||
155 }
else if ((value ==
"false") || (value ==
"FALSE") || (value ==
"False") ||
156 (value ==
"no") || (value ==
"NO") || (value ==
"No") ||
161 vout.
crucial(
"%s: warning: unrecognized value for boolean parameter \"%s\".\n",
class_name.c_str(), value.c_str());
177 map<string, double>::const_iterator p =
m_map_double.find(key);
182 map<string, string>::const_iterator q =
m_map_string.find(key);
194 map<string, int>::const_iterator p =
m_map_int.find(key);
199 map<string, string>::const_iterator q =
m_map_string.find(key);
211 map<string, string>::const_iterator q =
m_map_string.find(key);
213 return strtoul(q->second.c_str(), NULL, 0);
223 map<string, string>::const_iterator p =
m_map_string.find(key);
235 map<string, string>::const_iterator p =
m_map_string.find(key);
240 map<string, int>::const_iterator q =
m_map_int.find(key);
263 return vector<double>();
280 return vector<int>();
292 return vector<string>();
329 map<string, double>::const_iterator p =
m_map_double.find(key);
335 map<string, string>::const_iterator q =
m_map_string.find(key);
348 map<string, int>::const_iterator p =
m_map_int.find(key);
354 map<string, string>::const_iterator q =
m_map_string.find(key);
367 map<string, string>::const_iterator q =
m_map_string.find(key);
369 value = strtoul(q->second.c_str(), NULL, 0);
380 map<string, string>::const_iterator p =
m_map_string.find(key);
393 map<string, string>::const_iterator p =
m_map_string.find(key);
399 map<string, int>::const_iterator q =
m_map_int.find(key);
544 for (
const std::pair<string, string>& kv :
m_map_string) {
545 vout.
general(
"%s%-30s\t%s\n", indent.c_str(), (kv.first +
":").c_str(), kv.second.c_str());
549 for (
const std::pair<string, int>& kv :
m_map_int) {
550 vout.
general(
"%s%-30s\t%d\n", indent.c_str(), (kv.first +
":").c_str(), kv.second);
554 for (
const std::pair<string, double>& kv :
m_map_double) {
555 vout.
general(
"%s%-30s\t%e\n", indent.c_str(), (kv.first +
":").c_str(), kv.second);
560 vout.
general(
"%s%-30s\t%s\n", indent.c_str(), (kv.first +
":").c_str(),
to_string(kv.second).c_str());
565 vout.
general(
"%s%-30s\t%s\n", indent.c_str(), (kv.first +
":").c_str(),
to_string(kv.second).c_str());
570 vout.
general(
"%s%-30s\t%s\n", indent.c_str(), (kv.first +
":").c_str(),
to_string(kv.second).c_str());
575 vout.
general(
"%s%-30s\t\n", indent.c_str(), (kv.first +
":").c_str());
576 kv.second.print(indent +
" ");
585 printf(
"%sScalar<double>:\n", indent.c_str());
587 printf(
"%s (none)\n", indent.c_str());
590 printf(
"%s key = %s\tvalue = %e\n", indent.c_str(), p->first.c_str(), p->second);
594 printf(
"%sScalar<int>:\n", indent.c_str());
596 printf(
"%s (none)\n", indent.c_str());
598 for (map<string, int>::const_iterator p =
m_map_int.begin(); p !=
m_map_int.end(); ++p) {
599 printf(
"%s key = %s\tvalue = %d\n", indent.c_str(), p->first.c_str(), p->second);
603 printf(
"%sScalar<string>:\n", indent.c_str());
605 printf(
"%s (none)\n", indent.c_str());
608 printf(
"%s key = %s\tvalue = %s\n", indent.c_str(), p->first.c_str(), p->second.c_str());
612 printf(
"%sVector<double>:\n", indent.c_str());
614 printf(
"%s (none)\n", indent.c_str());
617 printf(
"%s key = %s\tvalue = [ \n", indent.c_str(), p->first.c_str());
618 for (
size_t i = 0; i < p->second.size(); ++i) {
619 printf(
"%e, ", p->second[i]);
625 printf(
"%sVector<int>:\n", indent.c_str());
627 printf(
"%s (none)\n", indent.c_str());
630 printf(
"%s key = %s\tvalue = [ \n", indent.c_str(), p->first.c_str());
631 for (
size_t i = 0; i < p->second.size(); ++i) {
632 printf(
"%d, ", p->second[i]);
638 printf(
"%sVector<string>:\n", indent.c_str());
640 printf(
"%s (none)\n", indent.c_str());
643 printf(
"%s key = %s\tvalue = [ ", indent.c_str(), p->first.c_str());
644 for (
size_t i = 0; i < p->second.size(); ++i) {
645 printf(
"%s, ", p->second[i].c_str());
651 printf(
"%sParameters:\n", indent.c_str());
653 printf(
"%s (none)\n", indent.c_str());
656 printf(
"%s key = %s, value:\n", indent.c_str(), p->first.c_str());
657 p->second.dump(indent +
" ");