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

Function operator-

src/datatable.cpp:225–241  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

223}
224
225DataTable operator-(const DataTable &lhs, const DataTable &rhs)
226{
227 if(lhs.getNumVariables() != rhs.getNumVariables()) {
228 throw Exception("operator-(DataTable, DataTable): trying to subtract two DataTable's of different dimensions!");
229 }
230
231 DataTable result;
232 auto rhsSamples = rhs.getSamples();
233 // Add all samples from lhs that are not in rhs
234 for(auto it = lhs.cbegin(); it != lhs.cend(); it++) {
235 if(rhsSamples.count(*it) == 0) {
236 result.addSample(*it);
237 }
238 }
239
240 return result;
241}
242
243} // namespace SPLINTER

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