18 names =
new vector<string>;
19 values =
new vector<double>;
37 return str.substr(0, str.find(commentSymbol));
48 size_t symbolPos = equation.find(
'=');
49 if (symbolPos==string::npos)
51 cout <<
"ParameterReader::phraseEquationWithoutComments error: \"=\" symbol not found in equation assignment " << equation << endl;
54 string LHS (equation.begin(), equation.begin()+symbolPos);
55 string RHS (equation.begin()+symbolPos+1, equation.end());
66 for (
long ii=0; ii<
names->size(); ii++)
79 phraseEquationWithoutComments(removeComments(str, commentSymbol));
89 ifstream parameterFile(filename.c_str());
92 cout <<
"ParameterReader::readFromFile error: file " << filename <<
" does not exist." << endl;
96 while (!parameterFile.eof())
98 parameterFile.getline(buffer, 9999);
99 phraseOneLine(buffer);
101 parameterFile.close();
111 for (
long ii=start_from; ii<argc; ii++) phraseOneLine(argv[ii], commentSymbol);
121 return find(name)==-1 ?
false:
true;
131 long idx = find(name);
149 long idx = find(name);
154 cout <<
"ParameterReader::getVal error: parameter with name " << name <<
" not found." << endl;
166 if (
names->size()==0)
return;
167 for (
long ii=0; ii<
names->size(); ii++) cout << (*
names)[ii] <<
"=" << (*values)[ii] <<
" ";