96 :
n(0),
t(0),
s(region.alloc<int>(n_max)) {}
140 return s[(i <
p) ? i : i+1];
155 for (
int i=
bs.size();
i--; )
163 bs.update(home,p.
bs);
171 return sizeof(*this);
174 template<
class SizeSet>
177 if ((a <= 0) || (b >= s.
total()))
182 while (sc + s[n-kp] < a) {
187 int sa=0, sb = s[n-kp];
188 while ((sa < a) && (sb <= b)) {
194 while (sa + sc >= a) {
197 sb += s[n-kp] - s[n-kp-k-1];
201 ap = sa + sc; bp = sb;
205 template<
class SizeSet>
209 return nosum(s, a, b, ap, bp);
int * s
Array of sizes (will have more elements)
void update(Space &home, VarImpView< Var > &y)
Update this view to be a clone of view y.
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.
Item combining bin and size information.
ViewArray< Item > bs
Items with bin and size.
int t
Total size of all items.
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.
int size(void) const
Return size of item.
Base-class for derived views.
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.
int total(void) const
Return total size.
bool operator<(const Item &i, const Item &j)
For sorting according to size.
int card(void) const
Return cardinality of set (number of entries)
const Gecode::PropCond PC_INT_DOM
Propagate when domain changes.
size_t size
The size of the propagator (used during subsumption)
void add(int s)
Add new size s.
Item(void)
Default constructor.
bool before(const Item &i, const Item &j)
Test whether one item is before another.
struct Gecode::@585::NNF::@62::@63 b
For binary nodes (and, or, eqv)
Integer view for integer variables.
virtual size_t dispose(Space &home)
Destructor.
struct Gecode::@585::NNF::@62::@64 a
For atomic nodes.
virtual size_t dispose(Space &home)
Delete actor and return its size.
IntView bin(void) const
Return bin of item.
bool same(const Item &i, const Item &j)
Whether two items are the same.
int operator[](int i) const
Return size of item i.
int t
Total size of the set.
void minus(int s)
Discard size s.
IntView x
View from which this view is derived.
Gecode toplevel namespace
int operator[](int i) const
Return size of item i.
int total(void) const
Return total size.
Home class for posting propagators
void update(Space &home, Item &i)
Update item during cloning.