| 206 | } |
| 207 | |
| 208 | DataTable 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 | |
| 225 | DataTable operator-(const DataTable &lhs, const DataTable &rhs) |
| 226 | { |