MCPcopy Create free account
hub / github.com/bgrimstad/splinter / operator+

Function operator+

src/datatable.cpp:208–223  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

206}
207
208DataTable operator+(const DataTable &lhs, const DataTable &rhs)
209{
210 if(lhs.getNumVariables() != rhs.getNumVariables()) {
211 throw Exception("operator+(DataTable, DataTable): trying to add two DataTable's of different dimensions!");
212 }
213
214 DataTable result;
215 for(auto it = lhs.cbegin(); it != lhs.cend(); it++) {
216 result.addSample(*it);
217 }
218 for(auto it = rhs.cbegin(); it != rhs.cend(); it++) {
219 result.addSample(*it);
220 }
221
222 return result;
223}
224
225DataTable operator-(const DataTable &lhs, const DataTable &rhs)
226{

Callers

nothing calls this directly

Calls 4

ExceptionClass · 0.85
cbeginMethod · 0.80
cendMethod · 0.80
addSampleMethod · 0.80

Tested by

no test coverage detected