62 template<
class View,
bool pos,
bool indexed>
68 assert((
_fst->min <= n) && (n <= _lst->
max));
71 assert((
_fst->min <= n) && (n <= _lst->
max));
75 assert((
_fst->min <= n) && (n <= _lst->
max));
78 assert((
_fst->min <= n) && (n <= _lst->
max));
98 template<
class View,
bool pos,
bool indexed>
108 template<
class View,
bool pos,
bool indexed>
115 template<
class View,
bool pos,
bool indexed>
121 template<
class View,
bool pos,
bool indexed>
127 template<
class View,
bool pos,
bool indexed>
133 template<
class View,
bool pos,
bool indexed>
145 template<
class Advisor>
150 template<
class Advisor>
155 template<
class Advisor>
161 template<
class Advisor>
165 (
reinterpret_cast<Advisor*
>(
s) == &a);
168 template<
class Advisor>
172 s =
reinterpret_cast<ptrdiff_t
>(&a);
179 template<
class Advisor>
185 template<
class Advisor>
196 template<
template<
class,
class>
class TablePropagator,
class View>
199 template<
class Table,
class Source>
201 return new (home) TablePropagator<View,Table>(home,source);
205 template<
template<
class,
class,
class, ReifyMode>
class TablePropagator,
209 template<
class Table,
class Source>
211 return new (home) TablePropagator<View,Table,CtrlView,rm>(home,source);
215 template<
class Factory,
class Table,
class Source>
220 if (source.table.empty())
221 return Factory::template copy<Table>(home,source);
223 const unsigned int words = source.table.words();
224 const unsigned int width = source.table.width();
225 assert((words > 0U) && (width >= words));
230 case 1U:
return Factory::template copy<TinyBitSet<1U>>(home,source);
231 case 2U:
return Factory::template copy<TinyBitSet<2U>>(home,source);
232 case 3U:
return Factory::template copy<TinyBitSet<3U>>(home,source);
233 case 4U:
return Factory::template copy<TinyBitSet<4U>>(home,source);
239 return Factory::template copy<BitSet<unsigned char>>(home,source);
243 return Factory::template copy<BitSet<unsigned char>>(home,source);
245 return Factory::template copy<BitSet<unsigned short int>>(home,source);
248 return Factory::template copy<BitSet<unsigned int>>(home,source);
257 template<
class Advisor>
264 template<
class Advisor>
274 template<
class View,
class Advisor,
class Val
idSupports,
class Table>
283 for (
int i=0; i<x.
size(); i++) {
284 table.clear_mask(mask);
285 for (ValidSupports supports(ts,i,x[i]); supports(); ++supports)
286 table.add_to_mask(supports.support(),mask);
287 table.template intersect_with_mask<false>(mask);
292 for (
int i=0; i<x.
size(); i++) {
293 if (!x[i].assigned())
303 template<
class Advisor,
class Table>
306 unsigned long long int size = 1U;
308 size *=
static_cast<unsigned long long int>
309 (advisors.advisor().view().size());
310 if (size > table.bits())
313 return size == table.ones();
316 template<
class Advisor>
322 advisors() && (n <= 3); ++advisors)
327 template<
class Support>
334 return support ==
nullptr;
336 template<
class Table>
338 table.template intersect_with_mask<true>(support);
346 return support.
empty();
348 template<
class Table>
350 table.intersect_with_mask(support);
354 template<
class Support>
360 template<
class Table,
class Support>
371 template<
class View,
bool pos>
374 assert((n > a.
fst()->max) && (n < a.
lst()->min));
379 assert(!pos || (f<=l));
382 const Range* m = f + ((l-f) >> 1);
385 }
else if (n > m->
max) {
393 assert((f->
min <= n) && (n <= f->
max));
396 if ((f <= l) && (f->
min <= n) && (n <= f->
max))
403 template<
class View,
bool pos>
409 if (!pos && (fst > lst))
414 }
else if (n >= lst->
min) {
420 if ((n < fst->
min) || (n > lst->
max))
424 }
else if (n >= lst->
min) {
432 assert((fnd->
min <= n) && (n <= fnd->
max));
436 template<
class View,
bool pos>
467 template<
class View,
bool pos>
483 template<
class View,
bool pos>
499 template<
class View,
bool pos>
505 assert(value <= support_range->
max);
517 (value <= support_range->
max));
521 if ((value <= support_range->
max) &&
529 template<
class View,
bool pos>
534 template<
class View,
bool pos>
540 template<
class View,
bool pos>
550 template<
class View,
bool pos>
554 int first_value,
int last_value0)
565 template<
class View,
bool pos>
576 template<
class View,
bool pos>
581 template<
class View,
bool pos>
584 assert((value >= support_range->min) && (value <= support_range->
max));
585 assert(support_words == support_range->supports(
n_words,value));
586 return support_words;
589 template<
class View,
bool pos>
594 template<
class View,
bool pos>
600 template<
class View,
bool pos>
607 template<
class View,
bool pos>
614 template<
class View,
bool pos>
615 template<
class Table>
619 (home,*
this,
c,
ts,table,x);
622 template<
class View,
bool pos>
623 template<
class Table>
629 template<
class View,
bool pos>
635 template<
class View,
bool pos>
642 return sizeof(*this);
645 template<
class Actor>
649 if ((actor.status.type() != Actor::StatusType::NONE) ||
650 actor.all() || actor.table.empty())
651 Actor::ViewType::schedule(home,actor,
ME_INT_DOM);
655 if (actor.table.empty())
660 typename Actor::Status touched(actor.status);
661 actor.status.propagating();
664 advisors(); ++advisors) {
665 typename Actor::CTAdvisor& advisor = advisors.advisor();
666 typename Actor::ViewType view = advisor.view();
667 if (touched.single(advisor) || view.assigned())
670 if (view.size() == 2) {
671 if (!actor.table.intersects(actor.supports(advisor,view.min())))
673 else if (!actor.table.intersects(actor.supports(advisor,view.max())))
675 if (!view.assigned())
678 int* remove = region.
alloc<
int>(view.size());
679 unsigned int n_remove = 0U;
680 int last_support = 0;
681 for (
typename Actor::ValidSupports supports(actor,advisor);
682 supports(); ++supports)
683 if (!actor.table.intersects(supports.support()))
684 remove[n_remove++] = supports.val();
686 last_support = supports.val();
688 if (n_remove == 1U) {
690 }
else if (n_remove == view.size() - 1U) {
705 assert(!actor.table.empty());
710 const Delta& delta) {
711 typename Actor::CTAdvisor& advisor =
712 static_cast<typename Actor::CTAdvisor&
>(advisor0);
713 if (actor.table.empty())
714 return actor.disabled() ?
717 typename Actor::ViewType view = advisor.view();
718 if (actor.status.type() == Actor::StatusType::PROPAGATING)
719 return view.assigned() ?
721 actor.status.touched(advisor);
723 if (view.assigned()) {
724 const auto support = actor.supports(advisor,view.val());
732 if (!view.any(delta) && (view.min(delta) == view.max(delta))) {
733 const auto support = actor.supports(advisor,view.min(delta));
735 actor.table.nand_with_mask(support);
737 }
else if (!view.any(delta) &&
738 (view.width(delta) <= view.size())) {
739 for (
typename Actor::LostSupports supports
740 (actor,advisor,view.min(delta),view.max(delta));
741 supports(); ++supports) {
742 actor.table.nand_with_mask(supports.support());
743 if (actor.table.empty())
744 return actor.disabled() ?
750 if (view.size() == 2) {
751 const auto min_support = actor.supports(advisor,view.min());
752 const auto max_support = actor.supports(advisor,view.max());
755 if (has_min && has_max)
756 actor.table.intersect_with_masks(min_support,max_support);
766 actor.table.clear_mask(mask);
767 for (
typename Actor::ValidSupports supports(actor,advisor);
768 supports(); ++supports)
769 actor.table.add_to_mask(supports.support(),mask);
770 actor.table.template intersect_with_mask<false>(mask);
774 if (actor.table.empty())
775 return actor.disabled() ?
781 template<
class Actor>
785 Actor::ViewType::schedule(home,actor,
ME_INT_DOM);
790 if (!actor.table.empty())
792 advisors(); ++advisors) {
793 typename Actor::ValidSupports supports(actor,advisors.advisor());
797 if (actor.table.empty())
800 unsigned long long product_without_largest = 1U;
801 unsigned long long largest_domain = 1U;
803 advisors(); ++advisors) {
804 const unsigned long long size = advisors.advisor().view().size();
805 if (size > largest_domain) {
806 product_without_largest *= largest_domain;
807 largest_domain = size;
809 product_without_largest *= size;
811 if (product_without_largest > actor.table.bits())
814 if (product_without_largest > actor.table.ones())
817 unsigned long long product = product_without_largest * largest_domain;
820 advisors(); ++advisors) {
821 assert(!actor.table.empty());
822 typename Actor::CTAdvisor& advisor = advisors.advisor();
823 typename Actor::ViewType view = advisor.view();
824 product /=
static_cast<unsigned long long>(view.size());
825 if ((product <= actor.table.bits()) &&
826 (product <= actor.table.ones())) {
827 int* remove = region.
alloc<
int>(view.size());
828 unsigned int n_remove = 0U;
829 for (
typename Actor::ValidSupports supports(actor,advisor);
830 supports(); ++supports)
831 if (product == actor.table.ones(supports.support()))
832 remove[n_remove++] = supports.val();
834 if (n_remove == 1U) {
841 if (actor.table.empty())
847 product *=
static_cast<unsigned long long>(view.size());
850 if (actor.table.ones() == product)
852 if (actor.table.empty() || actor.atmostone())
858 typename Actor::CTAdvisor& advisor =
859 static_cast<typename Actor::CTAdvisor&
>(advisor0);
860 if (actor.table.empty())
863 typename Actor::ViewType view = advisor.view();
865 if (view.assigned()) {
866 const auto support = actor.supports(advisor,view.val());
874 typename Actor::ValidSupports supports(actor,advisor);
881 actor.table.clear_mask(mask);
883 actor.table.add_to_mask(supports.support(),mask);
885 }
while (supports());
886 actor.table.template intersect_with_mask<false>(mask);
888 if (actor.table.empty())
894 template<
class Actor>
898 Actor::ViewType::schedule(home,actor,
ME_INT_DOM);
903 if (Actor::mode ==
RM_PMI)
908 if (actor.b.zero()) {
909 if (Actor::mode ==
RM_IMP)
915 if (actor.table.empty()) {
916 if (Actor::mode !=
RM_PMI)
920 if (actor.full(actor.table)) {
921 if (Actor::mode !=
RM_IMP)
929 typename Actor::CTAdvisor& advisor =
930 static_cast<typename Actor::CTAdvisor&
>(advisor0);
931 if (actor.table.empty() || actor.b.assigned())
934 typename Actor::ViewType view = advisor.view();
936 if (view.assigned()) {
937 const auto support = actor.supports(advisor,view.val());
945 typename Actor::ValidSupports supports(actor,advisor);
952 actor.table.clear_mask(mask);
954 actor.table.add_to_mask(supports.support(),mask);
956 }
while (supports());
957 actor.table.template intersect_with_mask<false>(mask);
959 if (actor.table.empty())
970 template<
class View,
class Table>
971 template<
class TableProp>
979 template<
class View,
class Table>
986 template<
class View,
class Table>
995 template<
class View,
class Table>
1000 assert((x.
size() > 1) && (
ts.tuples() > 1));
1004 template<
class View,
class Table>
1008 return sizeof(*this);
1010 template<
class View,
class Table>
1016 template<
class View,
class Table>
1022 template<
class View,
class Table>
1025 const Delta& delta) {
1027 (*
this,home,advisor,delta);
1032 template<
class View>
1039 for (
int i=0; i<x.
size(); i++) {
1048 switch (ts.
words()) {
1082 template<
class View,
class Table>
1083 template<
class TableProp>
1088 template<
class View,
class Table>
1095 template<
class View,
class Table>
1103 template<
class View,
class Table>
1111 template<
class View,
class Table>
1115 return sizeof(*this);
1118 template<
class View,
class Table>
1124 template<
class View,
class Table>
1130 template<
class View,
class Table>
1141 template<
class View>
1148 for (
int i=0; i<x.
size(); i++) {
1156 switch (ts.
words()) {
1190 template<
class View,
class Table,
class CtrlView, ReifyMode rm>
1191 template<
class TableProp>
1199 template<
class View,
class Table,
class CtrlView, ReifyMode rm>
1206 template<
class View,
class Table,
class CtrlView, ReifyMode rm>
1215 template<
class View,
class Table,
class CtrlView, ReifyMode rm>
1233 template<
class View,
class Table,
class CtrlView, ReifyMode rm>
1240 template<
class View,
class Table,
class CtrlView, ReifyMode rm>
1247 template<
class View,
class Table,
class CtrlView, ReifyMode rm>
1252 return sizeof(*this);
1255 template<
class View,
class Table,
class CtrlView, ReifyMode rm>
1261 template<
class View,
class Table,
class CtrlView, ReifyMode rm>
1268 template<
class View,
class Table,
class CtrlView, ReifyMode rm>
1279 template<
class View,
class CtrlView, ReifyMode rm>
1285 if (x.
size() != 0) {
1295 for (
int i=0; i<x.
size(); i++) {
1305 switch (ts.
words()) {
1338 template<
class View,
bool pos>
1464 int first_value,
int last_value0)
1514 template<
class Table>
1517 (home,*
this,
c,
ts,table,x);
1520 template<
class Table>
1521 bool full(
const Table& table)
const {
1534 return sizeof(*this);
1538 template<
class View,
class Table>
1561 template<
class TableProp>
1580 assert((x.
size() > 1) && (
ts.tuples() > 1));
1586 return sizeof(*this);
1598 const Delta& delta) {
1600 (*
this,home,advisor,delta);
1604 template<
class View>
1610 for (
int i=0; i<x.
size(); i++) {
1617 switch (ts.
words()) {
1639 template<
class View,
class Table>
1657 template<
class TableProp>
1677 return sizeof(*this);
1690 (*
this,home,advisor);
1694 template<
class View>
1700 for (
int i=0; i<x.
size(); i++) {
1707 switch (ts.
words()) {
1729 template<
class View,
class Table,
class CtrlView, ReifyMode rm>
1749 template<
class TableProp>
1797 return sizeof(*this);
1810 (*
this,home,advisor);
1814 template<
class View,
class CtrlView, ReifyMode rm>
1819 if (x.
size() != 0) {
1828 for (
int i=0; i<x.
size(); i++) {
1838 switch (ts.
words()) {
Base-class for both propagators and branchers.
virtual size_t dispose(Space &home)
Delete actor and return its size.
Class to iterate over advisors of a council.
Generic domain change information to be supplied to advisors.
Home class for posting propagators
void notice(Actor &a, ActorProperty p, bool duplicate=false)
Notice actor property.
static Actor * copy(Space &home, Source &source)
CompactAdvisorIndex(int i)
Initialize without storing i.
int _index
Variable index.
CompactAdvisorIndex(int i)
Initialize with index i.
Optional variable index stored by a compact-table advisor.
Advisor shared by compact-table support representations.
TupleSet::Range Range
Range type for supports.
const Range * _fst
First range of support data structure.
void dispose(Space &home, Council< CompactAdvisor > &c)
Dispose advisor.
const Range * lst(void) const
Return last range of support data structure.
const Range * _lst
Last range of support data structure.
const Range * fst(void) const
Return first range of support data structure.
int index(void) const
Return the variable index.
CompactAdvisor(Space &home, Propagator &p, Council< CompactAdvisor > &c, const TupleSet &ts, View x, int i)
Initialize from parameters.
void adjust(void)
Adjust supports to the current view bounds.
const CSupportWord * support_end
bool operator()(void) const
const CSupportWord * support_begin
CompressedSupport support(void) const
const Range * support_range
const CompactCompressed< View, pos > & propagator
const Range * last_support_range
LostSupports(const CompactCompressed< View, pos > &p0, CTAdvisor &a0, int first_value, int last_value0)
const TupleSet & tuple_set
CompressedSupport support(void) const
const CSupportWord * support_end
ViewRanges< View > view_ranges
ValidSupports(const CompactCompressed< View, pos > &p, CTAdvisor &a)
const CSupportWord * support_begin
const Range * support_range
ValidSupports(const TupleSet &ts0, int i0, View x)
const Range * last_support_range
bool operator()(void) const
CompactCompressed(Home home, const TupleSet &ts0)
virtual PropCost cost(const Space &, const ModEventDelta &) const
Cost function.
const unsigned int n_words
bool full(const Table &table) const
bool atmostone(void) const
TupleSet::CSupportWord CSupportWord
CompactAdvisor< View, pos, true > CTAdvisor
CompactCompressed(Space &home, CompactCompressed &p)
CompressedSupport supports(CTAdvisor &a, int n) const
void setup(Space &home, Table &table, ViewArray< View > &x)
size_t dispose(Space &home)
Delete actor and return its size.
Touched-advisor status shared by positive compact-table propagators.
ptrdiff_t s
A tagged advisor pointer or a status value.
void propagating(void)
Record that propagation is in progress.
StatusType
Type of status.
@ PROPAGATING
The propagator is currently running.
@ NONE
No view has been touched.
@ SINGLE
A single view has been touched.
@ MULTIPLE
Multiple views have been touched.
CompactStatus(StatusType t)
Initialize with status t.
void touched(Advisor &a)
Record that advisor a was touched.
void none(void)
Record that no advisor has been touched.
bool single(Advisor &a) const
Test whether only advisor a was touched.
StatusType type(void) const
Return status type.
static bool empty(const CompressedSupport &support)
static void intersect(Table &table, const CompressedSupport &support)
static bool empty(const BitSetData *support)
static void intersect(Table &table, const BitSetData *support)
int last_value
High value.
const Range * support_range
Range information.
const BitSetData * support(void) const
Return support representation.
LostSupports(const Compact< View, pos > &p, CTAdvisor &a, int first_value, int last_value)
Initialize iterator for values between first_value and last_value.
bool operator()(void) const
Whether iterator is done.
void operator++(void)
Move iterator to next value.
const unsigned int n_words
Number of words.
const BitSetData * support_words
The lost value's support.
const Range * last_support_range
Last range.
const Range * last_support_range
The last range.
ViewRanges< View > view_ranges
Range iterator.
bool operator()(void) const
Whether there are still supports left.
const BitSetData * support(void) const
Return support representation.
void operator++(void)
Move to next supports.
ValidSupports(const Compact< View, pos > &p, CTAdvisor &a)
Initialize from initialized propagator.
const BitSetData * support_words
The value's support.
int max_value
Maximal value.
void find(void)
Find a new value (only for negative case).
const unsigned int n_words
Number of words.
int val(void) const
Return supported value.
const Range * support_range
Support iterator.
Compact(Space &home, Compact &p)
Constructor for cloning p.
size_t dispose(Space &home)
Delete propagator and return its size.
TupleSet ts
The tuple set.
const BitSetData * supports(CTAdvisor &a, int n)
Return supports for value n.
CompactAdvisor< View, pos, false > CTAdvisor
Advisor for updating current table.
bool full(const Table &table) const
Check whether the table covers the whole Cartedion product.
void setup(Space &home, Table &table, ViewArray< View > &x)
Setup the actual table.
const unsigned int n_words
Number of words in supports.
virtual PropCost cost(const Space &home, const ModEventDelta &med) const
Cost function.
bool all(void) const
Whether all variables are assigned.
const Range * range(CTAdvisor &a, int n)
Find range for n.
bool atmostone(void) const
Whether at most one variable is unassigned.
TupleSet::Range Range
Range type for supports.
Council< CTAdvisor > c
The advisor council.
Compressed tuple-word support list.
bool empty(void) const
Whether support list is empty.
Shared implementation of negative compact-table propagation.
static ExecStatus propagate(Actor &actor, Space &home)
static ExecStatus advise(Actor &actor, Space &home, Advisor &advisor0)
static void reschedule(Actor &actor, Space &home)
NegCompactCompressed(Home home, ViewArray< View > &x, const TupleSet &ts)
virtual ExecStatus propagate(Space &home, const ModEventDelta &)
Propagation function.
Base::ValidSupports ValidSupports
void setup(Space &home, Table &table, ViewArray< View > &x)
virtual ExecStatus advise(Space &home, Advisor &advisor, const Delta &)
Advise function.
CompactCompressed< View, false > Base
Base::CTAdvisor CTAdvisor
virtual Actor * copy(Space &home)
Create copy.
friend class NegCompactAlgorithm
NegCompactCompressed(Space &home, TableProp &p)
virtual void reschedule(Space &home)
Schedule function.
static ExecStatus post(Home home, ViewArray< View > &x, const TupleSet &ts)
virtual size_t dispose(Space &home)
Delete actor and return its size.
Domain consistent negative extensional propagator.
virtual Actor * copy(Space &home)
Copy propagator during cloning.
virtual ExecStatus advise(Space &home, Advisor &a, const Delta &d)
Give advice to propagator.
Table table
Current table.
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
NegCompact(Space &home, TableProp &p)
Constructor for cloning p.
size_t dispose(Space &home)
Delete propagator and return its size.
virtual void reschedule(Space &home)
Schedule function.
static ExecStatus post(Home home, ViewArray< View > &x, const TupleSet &ts)
Post propagator for views x and table t.
Shared implementation of positive compact-table propagation.
static void reschedule(Actor &actor, Space &home)
static ExecStatus advise(Actor &actor, Space &home, Advisor &advisor0, const Delta &delta)
static ExecStatus propagate(Actor &actor, Space &home)
Status::StatusType StatusType
virtual Actor * copy(Space &home)
Create copy.
Base::LostSupports LostSupports
PosCompactCompressed(Space &home, TableProp &p)
CompactCompressed< View, true > Base
PosCompactCompressed(Home home, ViewArray< View > &x, const TupleSet &ts)
static ExecStatus post(Home home, ViewArray< View > &x, const TupleSet &ts)
Base::CTAdvisor CTAdvisor
void setup(Space &home, Table &table, ViewArray< View > &x)
virtual void reschedule(Space &home)
Schedule function.
friend class PosCompactAlgorithm
virtual size_t dispose(Space &home)
Delete actor and return its size.
Base::ValidSupports ValidSupports
virtual ExecStatus propagate(Space &home, const ModEventDelta &)
Propagation function.
CompactStatus< CTAdvisor > Status
virtual ExecStatus advise(Space &home, Advisor &advisor, const Delta &delta)
Advise function.
Domain consistent positive extensional propagator.
size_t dispose(Space &home)
Delete propagator and return its size.
virtual Actor * copy(Space &home)
Copy propagator during cloning.
virtual ExecStatus advise(Space &home, Advisor &a, const Delta &d)
Give advice to propagator.
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
Table table
Current table.
Status status
Propagator status.
CompactStatus< CTAdvisor > Status
Status management.
static ExecStatus post(Home home, ViewArray< View > &x, const TupleSet &ts)
Post propagator for views x and table t.
virtual void reschedule(Space &home)
Schedule function.
PosCompact(Space &home, TableProp &p)
Constructor for cloning p.
Status::StatusType StatusType
Status type.
static Actor * copy(Space &home, Source &source)
Shared implementation of reified compact-table propagation.
static ExecStatus propagate(Actor &actor, Space &home)
static ExecStatus advise(Actor &actor, Space &home, Advisor &advisor0)
static void reschedule(Actor &actor, Space &home)
virtual Actor * copy(Space &home)
Create copy.
ReCompactCompressed(Space &home, TableProp &p)
static ExecStatus post(Home home, ViewArray< View > &x, const TupleSet &ts, CtrlView b)
static ExecStatus post_neg(Home home, ViewArray< View > &x, const TupleSet &ts)
CompactCompressed< View, false > Base
virtual size_t dispose(Space &home)
Delete actor and return its size.
static ExecStatus post_pos(Home home, ViewArray< View > &x, const TupleSet &ts)
void setup(Space &home, Table &table, ViewArray< View > &x)
Base::ValidSupports ValidSupports
Base::CTAdvisor CTAdvisor
virtual ExecStatus propagate(Space &home, const ModEventDelta &)
Propagation function.
ReCompactCompressed(Home home, ViewArray< View > &x, const TupleSet &ts, CtrlView b0)
virtual ExecStatus advise(Space &home, Advisor &advisor, const Delta &)
Advise function.
friend class ReCompactAlgorithm
virtual void reschedule(Space &home)
Schedule function.
static constexpr ReifyMode mode
Domain consistent reified extensional propagator.
virtual Actor * copy(Space &home)
Copy propagator during cloning.
Table table
Current table.
ViewArray< View > y
The views (for rewriting).
virtual ExecStatus advise(Space &home, Advisor &a, const Delta &d)
Give advice to propagator.
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
ReCompact(Space &home, TableProp &p)
Constructor for cloning p.
static ExecStatus post(Home home, ViewArray< View > &x, const TupleSet &ts, CtrlView b)
Post propagator for views x and table t.
static ExecStatus post_neg(Home home, ViewArray< View > &x, const TupleSet &ts)
static ExecStatus post_pos(Home home, ViewArray< View > &x, const TupleSet &ts)
CtrlView b
Boolean control view.
virtual void reschedule(Space &home)
Schedule function.
size_t dispose(Space &home)
Delete propagator and return its size.
static bool dense_compressed_support(const TupleSet &ts, int p, int n, const TupleSet::CSupportWord *&b, const TupleSet::CSupportWord *&e)
Return compressed support words for position/value.
Range iterator for integer views.
Value iterator for array of integers
static PropCost quadratic(PropCost::Mod m, unsigned int n)
Quadratic complexity for modifier m and size measure n.
Base-class for propagators.
Propagator(Home home)
Constructor for posting.
void free(void)
Free allocate memory.
T * alloc(long unsigned int n)
Allocate block of n objects of type T from region.
Compressed support data for one tuple-word block.
const BitSetData * supports(unsigned int n_words, int n) const
Return the dense supports for value n.
Class representing a set of tuples.
int tuples(void) const
Number of tuples.
unsigned int words(void) const
Return number of required bit set words.
Gecode::Support::BitSetData BitSetData
Import bit set data type.
ViewAdvisor(Space &home, Propagator &p, Council< A > &c, View x0)
Constructor for creation.
void dispose(Space &home, Council< A > &c)
Delete advisor.
View view(void) const
Access view.
int size(void) const
Return size of array (number of elements).
ExecStatus ES_FIX_DISPOSE(Council< A > &c, A &a)
Advisor a must be disposed
ExecStatus ES_NOFIX_DISPOSE(Council< A > &c, A &a)
Advisor a must be disposed and its propagator must be run
ExecStatus ES_SUBSUMED(Propagator &p)
Propagator p is subsumed
void ignore(Actor &a, ActorProperty p, bool duplicate=false)
Ignore actor property.
int ModEventDelta
Modification event deltas.
#define GECODE_ME_CHECK(me)
Check whether modification event me is failed, and forward failure.
#define GECODE_REWRITE(prop, post)
Rewrite propagator by executing post function.
@ AP_DISPOSE
Actor must always be disposed.
ReifyMode
Mode for reification.
@ RM_IMP
Implication for reification.
@ RM_PMI
Inverse implication for reification.
PropCost compact_cost(const Council< Advisor > &council)
ExecStatus postnegcompact(Home home, ViewArray< View > &x, const TupleSet &ts)
Post function for compact table propagator.
void compact_intersect(Table &table, const Support &support)
bool compact_atmostone(const Council< Advisor > &council)
ExecStatus postposcompact(Home home, ViewArray< View > &x, const TupleSet &ts)
Post function for positive compact table propagator.
Gecode::Support::BitSetData BitSetData
Import type.
ExecStatus postrecompact(Home home, ViewArray< View > &x, const TupleSet &ts, CtrlView b)
Post function for compact table propagator.
bool compact_support_empty(const Support &support)
bool compact_all(const Council< Advisor > &council)
ExecStatus postposcompact_compressed(Home home, ViewArray< View > &x, const TupleSet &ts)
Post function for positive compact table with compressed supports.
bool compact_full(const Council< Advisor > &council, const Table &table)
Actor * compact_copy(Space &home, Source &source)
void compact_setup(Space &home, Propagator &propagator, Council< Advisor > &council, const TupleSet &ts, Table &table, ViewArray< View > &x)
ExecStatus postnegcompact_compressed(Home home, ViewArray< View > &x, const TupleSet &ts)
Post function for negative compact table with compressed supports.
ExecStatus postrecompact_compressed(Home home, ViewArray< View > &x, const TupleSet &ts, CtrlView b)
Post function for reified compact table with compressed supports.
const Gecode::ModEvent ME_INT_BND
Domain operation has changed the minimum or maximum of the domain.
const Gecode::PropCond PC_BOOL_VAL
Propagate when a view becomes assigned (single value).
const Gecode::ModEvent ME_INT_VAL
Domain operation has resulted in a value (assigned variable).
const Gecode::ModEvent ME_INT_DOM
Domain operation has changed the domain.
bool disjoint(I &i, J &j)
Check whether range iterators i and j are disjoint.
Support algorithms and datastructures
IntType u_type(unsigned int n)
Return type required to represent n.
@ IT_CHAR
char integer type
@ IT_SHRT
short integer type
Gecode toplevel namespace
void min(Home home, FloatVar x0, FloatVar x1, FloatVar x2)
Post propagator for .
void range(Home home, const IntVarArgs &x, SetVar y, SetVar z)
Post constraint .
void values(Home home, const IntVarArgs &x, IntSet y, IntPropLevel ipl=IPL_DEF)
Post constraint .
TFE post(PropagatorGroup g)
Only post functions (but not propagators) from g are considered.
TFE propagator(PropagatorGroup g)
Only propagators (but not post functions) from g are considered.
@ ES_OK
Execution is okay.
@ ES_FIX
Propagation has computed fixpoint.
@ ES_FAILED
Execution has resulted in failure.
@ ES_NOFIX
Propagation has not computed fixpoint.
void max(Home home, FloatVar x0, FloatVar x1, FloatVar x2)
Post propagator for .
int ModEvent
Type for modification events.
#define GECODE_NEVER
Assert that this command is never executed.
#define GECODE_ASSUME(p)
Assert certain property.