| 164 | /// Check whether event \a e is valid |
| 165 | template<class C> |
| 166 | bool valid(std::vector<Event> e, C comp) { |
| 167 | std::sort(e.begin(), e.end()); |
| 168 | unsigned int i = 0; |
| 169 | int p = 0; |
| 170 | int h = 0; |
| 171 | int n = 0; |
| 172 | while (i < e.size()) { |
| 173 | p = e[i].p; |
| 174 | while (i < e.size() && e[i].p == p) { |
| 175 | h += e[i].h; |
| 176 | n += (e[i].start ? +1 : -1); |
| 177 | ++i; |
| 178 | } |
| 179 | if (n && !comp(h)) |
| 180 | return false; |
| 181 | } |
| 182 | return true; |
| 183 | } |
| 184 | |
| 185 | /// %Test for cumulatives constraint |
| 186 | class Cumulatives : public Test { |
no test coverage detected