* Get table of samples x-values, * i.e. table[i][j] is the value of variable i at sample j */
| 167 | * i.e. table[i][j] is the value of variable i at sample j |
| 168 | */ |
| 169 | std::vector< std::vector<double> > DataTable::getTableX() const |
| 170 | { |
| 171 | gridCompleteGuard(); |
| 172 | |
| 173 | // Initialize table |
| 174 | std::vector<std::vector<double>> table; |
| 175 | for (unsigned int i = 0; i < numVariables; i++) |
| 176 | { |
| 177 | std::vector<double> xi(getNumSamples(), 0.0); |
| 178 | table.push_back(xi); |
| 179 | } |
| 180 | |
| 181 | // Fill table with values |
| 182 | int i = 0; |
| 183 | for (auto &sample : samples) |
| 184 | { |
| 185 | std::vector<double> x = sample.getX(); |
| 186 | |
| 187 | for (unsigned int j = 0; j < numVariables; j++) |
| 188 | { |
| 189 | table.at(j).at(i) = x.at(j); |
| 190 | } |
| 191 | i++; |
| 192 | } |
| 193 | |
| 194 | return table; |
| 195 | } |
| 196 | |
| 197 | // Get vector of y-values |
| 198 | std::vector<double> DataTable::getVectorY() const |
no test coverage detected