28 std::vector<std::vector<double>> vecVec;
29 std::map<double, double> QvsR;
30 std::map<double, double> QvsDR;
31 std::map<double, double> QvsDQ;
34 while (std::getline(fin, line)) {
40 vecVec.push_back(rowVec);
47 size_t nrows = vecVec.size();
49 throw std::runtime_error(
"No numerical values found");
50 size_t ncols = vecVec[0].size();
52 throw std::runtime_error(
"Minimum 2 columns required");
55 for (
size_t row = 0; row < nrows; row++) {
56 if (vecVec[row].size() != ncols)
57 throw std::runtime_error(
"The number of columns varies among the rows");
58 double Q = vecVec[row][0];
63 QvsR[Q] = vecVec[row][1];
68 QvsR[Q] = vecVec[row][1];
69 QvsDR[Q] = vecVec[row][2];
73 QvsR[Q] = vecVec[row][1];
74 QvsDR[Q] = vecVec[row][2];
75 QvsDQ[Q] = vecVec[row][3];
80 std::vector<double> qVec;
81 std::vector<double> rVec;
82 for (
auto it = QvsR.begin(); it != QvsR.end(); ++it) {
85 qVec.push_back(it->first);
86 rVec.push_back(it->second);
Defines a few helper functions.
Defines OutputDataReadReflectometry.
Defines and implements templated class OutputData.
Defines class PointwiseAxis.
OutputData< double > * readOutputData(std::istream &input_stream)
void addAxis(const IAxis &new_axis)
void setRawDataVector(const std::vector< T > &data_vector)
Sets new values to raw data vector.
Axis containing arbitrary (non-equidistant) coordinate values.
std::string trim(const std::string &str, const std::string &whitespace=" \t")
Cuts any of the chars given in whitespace from start and end of str.