OPAL (Object Oriented Parallel Accelerator Library)  2021.1.99
OPAL
ProbeReader.h
Go to the documentation of this file.
1 //
2 // Class ProbeReader
3 // Implements a parser and value extractor for Probe loss files.
4 //
5 // Copyright (c) 2010 - 2013, Yves Ineichen, ETH Zürich
6 // All rights reserved
7 //
8 // Implemented as part of the PhD thesis
9 // "Toward massively parallel multi-objective optimization with application to
10 // particle accelerators" (https://doi.org/10.3929/ethz-a-009792359)
11 //
12 // This file is part of OPAL.
13 //
14 // OPAL is free software: you can redistribute it and/or modify
15 // it under the terms of the GNU General Public License as published by
16 // the Free Software Foundation, either version 3 of the License, or
17 // (at your option) any later version.
18 //
19 // You should have received a copy of the GNU General Public License
20 // along with OPAL. If not, see <https://www.gnu.org/licenses/>.
21 //
22 #ifndef __PROBEREADER_H__
23 #define __PROBEREADER_H__
24 
25 #include <string>
26 #include <vector>
27 #include <map>
28 
29 class ProbeReader {
30 
31 public:
32  explicit ProbeReader(std::string filename);
33 
34  ~ProbeReader();
35 
36  void parseFile();
37 
38  void getVariableValue(int id, std::string varname, double& sim_value);
39 
40 private:
42  std::string filename_m;
43 
46 
48  int nRows_m;
49 
50  std::map<std::string, int> columnNamesToID_m;
51  std::vector< std::vector<double> > data_m;
52 
53 };
54 
55 #endif
std::string filename_m
Probe loss filename.
Definition: ProbeReader.h:42
int nColumns_m
Number of variables.
Definition: ProbeReader.h:45
std::vector< std::vector< double > > data_m
Definition: ProbeReader.h:51
void getVariableValue(int id, std::string varname, double &sim_value)
int nRows_m
Number of values per variable.
Definition: ProbeReader.h:48
void parseFile()
Definition: ProbeReader.cpp:40
ProbeReader(std::string filename)
Definition: ProbeReader.cpp:29
std::map< std::string, int > columnNamesToID_m
Definition: ProbeReader.h:50