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);
546 printf(
"%sScalar<double>:\n", indent.c_str());
548 printf(
"%s (none)\n", indent.c_str());
551 printf(
"%s key = %s\tvalue = %e\n", indent.c_str(), p->first.c_str(), p->second);
555 printf(
"%sScalar<int>:\n", indent.c_str());
557 printf(
"%s (none)\n", indent.c_str());
559 for (map<string, int>::const_iterator p =
m_map_int.begin(); p !=
m_map_int.end(); ++p) {
560 printf(
"%s key = %s\tvalue = %d\n", indent.c_str(), p->first.c_str(), p->second);
564 printf(
"%sScalar<string>:\n", indent.c_str());
566 printf(
"%s (none)\n", indent.c_str());
569 printf(
"%s key = %s\tvalue = %s\n", indent.c_str(), p->first.c_str(), p->second.c_str());
573 printf(
"%sVector<double>:\n", indent.c_str());
575 printf(
"%s (none)\n", indent.c_str());
578 printf(
"%s key = %s\tvalue = [ \n", indent.c_str(), p->first.c_str());
579 for (
size_t i = 0; i < p->second.size(); ++i) {
580 printf(
"%e, ", p->second[i]);
586 printf(
"%sVector<int>:\n", indent.c_str());
588 printf(
"%s (none)\n", indent.c_str());
591 printf(
"%s key = %s\tvalue = [ \n", indent.c_str(), p->first.c_str());
592 for (
size_t i = 0; i < p->second.size(); ++i) {
593 printf(
"%d, ", p->second[i]);
599 printf(
"%sVector<string>:\n", indent.c_str());
601 printf(
"%s (none)\n", indent.c_str());
604 printf(
"%s key = %s\tvalue = [ ", indent.c_str(), p->first.c_str());
605 for (
size_t i = 0; i < p->second.size(); ++i) {
606 printf(
"%s, ", p->second[i].c_str());
612 printf(
"%sParameters:\n", indent.c_str());
614 printf(
"%s (none)\n", indent.c_str());
617 printf(
"%s key = %s, value:\n", indent.c_str(), p->first.c_str());
618 p->second.print(indent +
" ");
map< string, vector< string > > m_map_string_vector
void set_Parameters(const string &key, const Parameters &value)
Parameters get_Parameters(const string &key) const
int fetch_bool(const string &key, bool &value) const
int fetch_double_vector(const string &key, vector< double > &value) const
int convert_to_int(const string &) const
void set_int_vector(const string &key, const vector< int > &value)
void set_int(const string &key, const int value)
static const std::string class_name
bool get_bool(const string &key) const
int fetch_double(const string &key, double &value) const
bool find_bool(const string &key) const
bool find_unsigned_long(const string &key) const
void Register_int(const string &key, const int defvalue)
bool find_int_vector(const string &key) const
int get_int(const string &key) const
double convert_to_double(const string &) const
void Register_double_vector(const string &key, const vector< double > &defvalue)
int fetch_string(const string &key, string &value) const
void Register_Parameters(const string &key, const Parameters &defvalue)
void set_string(const string &key, const string &value)
Bridge::VerboseLevel m_vlevel
void set_bool(const string &key, const bool value)
unsigned long get_unsigned_long(const string &key) const
double get_double(const string &key) const
int fetch_int(const string &key, int &value) const
void set_VerboseLevel(const Bridge::VerboseLevel value)
bool find_Parameters(const string &key) const
EvalExpr class for algebraic expression in parameter strings.
Common parameter class: provides parameters as singleton.
void print(const string &indent="") const
Bridge::VerboseLevel get_VerboseLevel() const
void Register_double(const string &key, const double defvalue)
void Register_int_vector(const string &key, const vector< int > &defvalue)
map< string, Parameters > m_map_parameters
bool is_set(const string &key) const
bool find_double(const string &key) const
void crucial(const char *format,...)
bool find_int(const string &key) const
void set_double_vector(const string &key, const vector< double > &value)
void Register_string(const string &key, const string &defvalue)
map< string, double > m_map_double
map< string, string > m_map_string
void set_double(const string &key, const double value)
void Register_string_vector(const string &key, const vector< string > &defvalue)
int fetch_string_vector(const string &key, vector< string > &value) const
map< string, vector< double > > m_map_double_vector
vector< double > get_double_vector(const string &key) const
vector< string > get_string_vector(const string &key) const
bool find_string(const string &key) const
map< string, int > m_map_int
map< string, vector< int > > m_map_int_vector
int fetch_unsigned_long(const string &key, unsigned long &value) const
string get_string(const string &key) const
int fetch_int_vector(const string &key, vector< int > &value) const
bool convert_to_bool(const string &) const
vector< int > get_int_vector(const string &key) const
bool find_double_vector(const string &key) const
bool find_string_vector(const string &key) const
int fetch_VerboseLevel(Bridge::VerboseLevel &value) const
void set_string_vector(const string &key, const vector< string > &value)