54 std::getline(probe, header,
'\n');
56 if( header.find(
"# Element\n") == std::string::npos ) {
58 "Error parsing Probe header!");
61 char *token = std::strtok(&header[0],
" ");
64 while ( token != NULL ) {
66 if ( std::string(token) ==
"Element")
67 token = std::strtok(NULL,
" ");
68 else if ( token[0] !=
')' && token[0] !=
'(' && token[0] !=
'#') {
69 std::string varname = std::string(token);
71 if ( varname.back() ==
',' )
76 token = std::strtok(NULL,
" ");
83 while ( std::getline(probe, line) ) {
87 token = std::strtok(&line[0],
" ");
90 token = std::strtok(NULL,
" ");
94 while ( token != NULL ) {
95 data_m[i++].push_back( std::atof(token) );
96 token = std::strtok(NULL,
" ");
120 "ID variable not found!");
124 for (
unsigned int i = 0; i <
data_m[col].size(); ++i) {
125 if (
data_m[col][i] ==
id ) {
133 "Appropriate value not found!");
135 sim_value =
data_m[varindex][row];
std::string filename_m
Probe loss filename.
int nColumns_m
Number of variables.
std::vector< std::vector< double > > data_m
void getVariableValue(int id, std::string varname, double &sim_value)
int nRows_m
Number of values per variable.
ProbeReader(std::string filename)
std::map< std::string, int > columnNamesToID_m