| 136 | */ |
| 137 | template<class Card> |
| 138 | forceinline bool |
| 139 | card_consistent(ViewArray<IntView>& x, ViewArray<Card>& k) { |
| 140 | int smin = 0; |
| 141 | int smax = 0; |
| 142 | for (int i = k.size(); i--; ) { |
| 143 | smax += k[i].max(); |
| 144 | smin += k[i].min(); |
| 145 | } |
| 146 | // Consistent if number of variables within cardinality bounds |
| 147 | return (smin <= x.size()) && (x.size() <= smax); |
| 148 | } |
| 149 | |
| 150 | /** |
| 151 | * \brief Maps domain bounds to their position in hall[].bounds. |