%Test whether \a x is solutionin
| 64 | } |
| 65 | /// %Test whether \a x is solutionin |
| 66 | virtual bool solution(const Assignment& x) const { |
| 67 | for (int i=0; i< (x.size() - q + 1); i++ ) { |
| 68 | int total = 0; |
| 69 | for (int j=i; j < i + q; j++ ) { |
| 70 | if (s.in(x[j])) |
| 71 | total++; |
| 72 | if (total > u) |
| 73 | return false; |
| 74 | } |
| 75 | if ( total < l ) |
| 76 | return false; |
| 77 | } |
| 78 | return true; |
| 79 | } |
| 80 | }; |
| 81 | |
| 82 |