| 158 | |
| 159 | template<class I, class J> |
| 160 | bool |
| 161 | sol(I& i, J& j) const { |
| 162 | switch (srt) { |
| 163 | case SRT_EQ: return Iter::Ranges::equal(i,j); |
| 164 | case SRT_NQ: return !Iter::Ranges::equal(i,j); |
| 165 | case SRT_SUB: return Iter::Ranges::subset(i,j); |
| 166 | case SRT_SUP: return Iter::Ranges::subset(j,i); |
| 167 | case SRT_DISJ: |
| 168 | { |
| 169 | Gecode::Iter::Ranges::Inter<I,J> inter(i,j); |
| 170 | return !inter(); |
| 171 | } |
| 172 | case SRT_CMPL: |
| 173 | { |
| 174 | Gecode::Set::RangesCompl<J> jc(j); |
| 175 | return Iter::Ranges::equal(i,jc); |
| 176 | } |
| 177 | default: GECODE_NEVER; |
| 178 | } |
| 179 | GECODE_NEVER; |
| 180 | return false; |
| 181 | } |
| 182 | |
| 183 | public: |
| 184 | /// Create and register test |