MCPcopy Create free account
hub / github.com/bgrimstad/splinter / getTableX

Method getTableX

src/datatable.cpp:169–195  ·  view source on GitHub ↗

* Get table of samples x-values, * i.e. table[i][j] is the value of variable i at sample j */

Source from the content-addressed store, hash-verified

167 * i.e. table[i][j] is the value of variable i at sample j
168 */
169std::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
198std::vector<double> DataTable::getVectorY() const

Callers 1

computeKnotVectorsMethod · 0.80

Calls 2

getNumSamplesFunction · 0.85
getXMethod · 0.80

Tested by

no test coverage detected