MCPcopy Create free account
hub / github.com/Gecode/gecode / card_consistent

Function card_consistent

gecode/int/gcc/bnd-sup.hpp:138–148  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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.

Callers

nothing calls this directly

Calls 3

sizeMethod · 0.45
maxMethod · 0.45
minMethod · 0.45

Tested by

no test coverage detected