100 :
n(0),
t(0), s(region.alloc<int>(n_max)) {}
103 t += s0;
s[
n++] = s0;
144 return s[(i <
p) ? i : i+1];
159 for (
int i=
bs.size();
i--; )
166 l.update(home,shared,p.
l);
167 bs.update(home,shared,p.
bs);
175 return sizeof(*this);
178 template<
class SizeSet>
181 if ((a <= 0) || (b >= s.
total()))
186 while (sc + s[n-kp] < a) {
191 int sa=0, sb = s[n-kp];
192 while ((sa < a) && (sb <= b)) {
198 while (sa + sc >= a) {
201 sb += s[n-kp] - s[n-kp-k-1];
205 ap = sa + sc; bp = sb;
209 template<
class SizeSet>
213 return nosum(s, a, b, ap, bp);
int * s
Array of sizes (will have more elements)
int card(void) const
Return cardinality of set (number of entries)
int p
Position of discarded item.
SizeSetMinusOne(void)
Default constructor.
bool nosum(const SizeSet &s, int a, int b, int &ap, int &bp)
Detect non-existence of sums in a .. b.
IntView bin(void) const
Return bin of item.
Item combining bin and size information.
int size(void) const
Return size of item.
ViewArray< Item > bs
Items with bin and size.
int t
Total size of all items.
int operator[](int i) const
Return size of item i.
int card(void) const
Return cardinality of set (number of entries)
Base-class for propagators.
int n
Number of size entries in the set.
Pack(Home home, ViewArray< OffsetView > &l, ViewArray< Item > &bs)
Constructor for posting.
ViewArray< OffsetView > l
Views for load of bins.
Base-class for derived views.
void update(Space &home, bool share, Item &i)
Update item during cloning.
SizeSet(void)
Default constructor.
int p
Number of positive literals for node type.
Gecode::IntArgs i(4, 1, 2, 3, 4)
int n
Number of negative literals for node type.
const Gecode::PropCond PC_INT_BND
Propagate when minimum or maximum of a view changes.
bool operator<(const Item &i, const Item &j)
For sorting according to size.
const Gecode::PropCond PC_INT_DOM
Propagate when domain changes.
size_t size
The size of the propagator (used during subsumption)
int operator[](int i) const
Return size of item i.
void add(int s)
Add new size s.
void update(Space &home, bool share, VarImpView< Var > &y)
Update this view to be a clone of view y.
Item(void)
Default constructor.
bool before(const Item &i, const Item &j)
Test whether one item is before another.
Integer view for integer variables.
virtual size_t dispose(Space &home)
Destructor.
virtual size_t dispose(Space &home)
Delete actor and return its size.
bool same(const Item &i, const Item &j)
Whether two items are the same.
int t
Total size of the set.
void minus(int s)
Discard size s.
IntView x
View from which this view is derived.
bool shared(const ConstView< ViewA > &, const ConstView< ViewB > &)
Test whether views share same variable.
struct Gecode::@518::NNF::@57::@58 b
For binary nodes (and, or, eqv)
Gecode toplevel namespace
Home class for posting propagators
int total(void) const
Return total size.
int total(void) const
Return total size.
struct Gecode::@518::NNF::@57::@59 a
For atomic nodes.