Go to the documentation of this file.
194 template<
class VarImp>
246 static const int idx_c = VIC::idx_c;
248 static const int idx_d = VIC::idx_d;
250 static const int free_bits = VIC::free_bits;
252 unsigned int entries;
254 unsigned int free_and_bits;
257 #ifdef GECODE_HAS_CBS
258 const unsigned var_id;
273 unsigned int idx[pc_max+1];
307 void resize(
Space& home);
325 void _fail(
Space& home);
329 #ifdef GECODE_HAS_VAR_DISPOSE
342 #ifdef GECODE_HAS_CBS
343 unsigned int id(
void)
const;
383 unsigned int degree(
void)
const;
390 double afc(
void)
const;
441 unsigned int bits(
void)
const;
444 unsigned int&
bits(
void);
454 static void*
operator new(size_t,
Space&);
457 static void operator delete(
void*,
Space&);
459 static void operator delete(
void*);
616 bool empty(
void)
const;
652 virtual size_t dispose(
Space& home);
654 static void*
operator new(
size_t s,
Space& home);
656 static void operator delete(
void*
p,
Space& home);
662 static void*
operator new(
size_t s);
664 static void operator delete(
void*
p);
697 Group(
unsigned int gid0);
709 unsigned int id(
void)
const;
877 operator Space&(void);
993 unsigned int id(
void)
const;
1018 unsigned int id(
void)
const;
1088 void disable(
Space& home);
1090 void enable(
Space& home);
1190 double afc(
void)
const;
1193 #ifdef GECODE_HAS_CBS
1202 typedef std::function<void(
unsigned int prop_id,
unsigned int var_id,
1204 int val,
double dens)> SendMarginal;
1205 virtual void solndistrib(
Space& home, SendMarginal send)
const;
1213 typedef std::function<bool(
unsigned int var_id)> InDecision;
1215 virtual void domainsizesum(InDecision in,
unsigned int&
size,
1216 unsigned int& size_b)
const;
1221 unsigned int id(
void)
const;
1228 bool disabled(
void)
const;
1253 bool empty(
void)
const;
1299 bool disposed(
void)
const;
1322 static void*
operator new(
size_t s,
Space& home);
1324 static void operator delete(
void*
p,
Space& home);
1328 static void operator delete(
void*
p);
1331 static void*
operator new(
size_t s);
1368 virtual NGL* copy(
Space& home) = 0;
1371 virtual bool notice(
void)
const;
1373 virtual size_t dispose(
Space& home);
1376 bool leaf(
void)
const;
1379 NGL* next(
void)
const;
1389 static void*
operator new(
size_t s,
Space& home);
1392 static void operator delete(
void* s,
Space& home);
1394 static void operator delete(
void*
p);
1400 static void*
operator new(
size_t s);
1419 unsigned int id(
void)
const;
1425 unsigned int alternatives(
void)
const;
1430 virtual void archive(
Archive& e)
const;
1471 virtual bool status(
const Space& home)
const = 0;
1489 unsigned int a) = 0;
1514 std::ostream& o)
const;
1518 unsigned int id(
void)
const;
1591 unsigned long int n;
1599 unsigned long int ng(
void)
const;
1601 void ng(
unsigned long int n);
1627 const unsigned long int r;
1630 const unsigned long int s;
1632 const unsigned long int f;
1640 const unsigned int a;
1648 unsigned long int s,
1649 unsigned long int f,
1655 Type type(
void)
const;
1659 unsigned long int restart(
void)
const;
1662 unsigned long int solution(
void)
const;
1664 unsigned long int fail(
void)
const;
1666 const Space* last(
void)
const;
1668 const NoGoods& nogoods(
void)
const;
1672 unsigned int asset(
void)
const;
1765 #ifdef GECODE_HAS_CBS
1766 unsigned int var_id_counter;
1792 Brancher* brancher(
unsigned int id);
1801 void kill_brancher(
unsigned int id);
1804 static const unsigned reserved_bid = 0U;
1807 static const unsigned int sc_bits = 2;
1809 static const unsigned int sc_fast = 0;
1811 static const unsigned int sc_disabled = 1;
1813 static const unsigned int sc_trace = 2;
1856 void enqueue(Propagator*
p);
1861 #ifdef GECODE_HAS_VAR_DISPOSE
1867 template<
class VIC> VarImpBase* vars_d(
void)
const;
1869 template<
class VIC>
void vars_d(VarImpBase*
x);
1871 void update(ActorLink** sub);
1937 void _commit(
const Choice&
c,
unsigned int a);
1970 void _trycommit(
const Choice&
c,
unsigned int a);
1974 TraceRecorder* findtracerecorder(
void);
1977 void post(
const PostInfo&
pi);
1986 void ap_notice_dispose(Actor*
a,
bool d);
1994 void ap_ignore_dispose(Actor*
a,
bool d);
2017 virtual ~Space(
void);
2024 virtual Space* copy(
void) = 0;
2060 virtual bool master(
const MetaInfo& mi);
2087 virtual bool slave(
const MetaInfo& mi);
2106 SpaceStatus status(StatusStatistics& stat=unused_status);
2140 const Choice* choice(
void);
2152 const Choice* choice(Archive& e)
const;
2169 Space*
clone(CloneStatistics& stat=unused_clone)
const;
2205 void commit(
const Choice&
c,
unsigned int a,
2206 CommitStatistics& stat=unused_commit);
2239 void trycommit(
const Choice&
c,
unsigned int a,
2240 CommitStatistics& stat=unused_commit);
2260 NGL* ngl(
const Choice&
c,
unsigned int a);
2277 void print(
const Choice&
c,
unsigned int a, std::ostream& o)
const;
2325 ExecStatus ES_SUBSUMED_DISPOSED(Propagator&
p,
size_t s);
2385 ExecStatus ES_NOFIX_DISPOSE_FORCE(Council<A>&
c, A&
a);
2403 bool failed(
void)
const;
2408 bool stable(
void)
const;
2412 Home operator ()(Propagator&
p);
2415 Home operator ()(PropagatorGroup pg);
2417 Home operator ()(BrancherGroup bg);
2432 T* alloc(
long unsigned int n);
2440 T* alloc(
long int n);
2448 T* alloc(
unsigned int n);
2467 void free(T*
b,
long unsigned int n);
2478 void free(T*
b,
long int n);
2489 void free(T*
b,
unsigned int n);
2500 void free(T*
b,
int n);
2513 T* realloc(T*
b,
long unsigned int n,
long unsigned int m);
2526 T* realloc(T*
b,
long int n,
long int m);
2539 T* realloc(T*
b,
unsigned int n,
unsigned int m);
2552 T* realloc(T*
b,
int n,
int m);
2561 T** realloc(T**
b,
long unsigned int n,
long unsigned int m);
2570 T** realloc(T**
b,
long int n,
long int m);
2579 T** realloc(T**
b,
unsigned int n,
unsigned int m);
2588 T** realloc(T**
b,
int n,
int m);
2590 void* ralloc(
size_t s);
2592 void rfree(
void*
p,
size_t s);
2594 void* rrealloc(
void*
b,
size_t n,
size_t m);
2596 template<
size_t>
void* fl_alloc(
void);
2602 template<
size_t>
void fl_dispose(FreeList*
f, FreeList*
l);
2616 template<
class T,
typename A1>
2617 T& construct(A1
const& a1);
2623 template<
class T,
typename A1,
typename A2>
2624 T& construct(A1
const& a1, A2
const& a2);
2630 template<
class T,
typename A1,
typename A2,
typename A3>
2631 T& construct(A1
const& a1, A2
const& a2, A3
const& a3);
2637 template<
class T,
typename A1,
typename A2,
typename A3,
typename A4>
2638 T& construct(A1
const& a1, A2
const& a2, A3
const& a3, A4
const& a4);
2644 template<
class T,
typename A1,
typename A2,
typename A3,
typename A4,
typename A5>
2645 T& construct(A1
const& a1, A2
const& a2, A3
const& a3, A4
const& a4, A5
const& a5);
2650 void afc_decay(
double d);
2653 double afc_decay(
void)
const;
2678 bool operator ()(
void)
const;
2680 void operator ++(
void);
2703 bool operator ()(
void)
const;
2705 void operator ++(
void);
2724 bool operator ()(
void)
const;
2726 void operator ++(
void);
2745 bool operator ()(
void)
const;
2747 void operator ++(
void);
2808 char*
b = static_cast<char*>(
_b);
2810 char*
p = static_cast<char*>(
ralloc(m));
2823 return mm.template fl_alloc<s>(ssd.
data().
sm);
2828 mm.template fl_dispose<s>(
f,
l);
2838 T*
p = static_cast<T*>(
ralloc(
sizeof(T)*
n));
2839 for (
long unsigned int i=0;
i<
n;
i++)
2840 (
void)
new (
p+
i) T();
2847 return alloc<T>(static_cast<long unsigned int>(
n));
2852 return alloc<T>(static_cast<long unsigned int>(
n));
2858 return alloc<T>(static_cast<long unsigned int>(
n));
2864 for (
long unsigned int i=0;
i<
n;
i++)
2872 free<T>(
b,static_cast<long unsigned int>(
n));
2877 free<T>(
b,static_cast<long unsigned int>(
n));
2883 free<T>(
b,static_cast<long unsigned int>(
n));
2890 T*
p = static_cast<T*>(
ralloc(
sizeof(T)*m));
2891 for (
long unsigned int i=0;
i<
n;
i++)
2892 (
void)
new (
p+
i) T(
b[
i]);
2893 for (
long unsigned int i=
n;
i<m;
i++)
2894 (
void)
new (
p+
i) T();
2905 assert((
n >= 0) && (m >= 0));
2906 return realloc<T>(
b,static_cast<long unsigned int>(
n),
2907 static_cast<long unsigned int>(m));
2912 return realloc<T>(
b,static_cast<long unsigned int>(
n),
2913 static_cast<long unsigned int>(m));
2918 assert((
n >= 0) && (m >= 0));
2919 return realloc<T>(
b,static_cast<long unsigned int>(
n),
2920 static_cast<long unsigned int>(m));
2923 #define GECODE_KERNEL_REALLOC(T) \
2926 Space::realloc<T>(T* b, long unsigned int n, long unsigned int m) { \
2927 return static_cast<T*>(rrealloc(b,n*sizeof(T),m*sizeof(T))); \
2931 Space::realloc<T>(T* b, long int n, long int m) { \
2932 assert((n >= 0) && (m >= 0)); \
2933 return realloc<T>(b,static_cast<long unsigned int>(n), \
2934 static_cast<long unsigned int>(m)); \
2938 Space::realloc<T>(T* b, unsigned int n, unsigned int m) { \
2939 return realloc<T>(b,static_cast<long unsigned int>(n), \
2940 static_cast<long unsigned int>(m)); \
2944 Space::realloc<T>(T* b, int n, int m) { \
2945 assert((n >= 0) && (m >= 0)); \
2946 return realloc<T>(b,static_cast<long unsigned int>(n), \
2947 static_cast<long unsigned int>(m)); \
2962 #undef GECODE_KERNEL_REALLOC
2967 return static_cast<T**>(
rrealloc(
b,
n*
sizeof(T),m*
sizeof(T*)));
2972 assert((
n >= 0) && (m >= 0));
2973 return realloc<T*>(
b,static_cast<long unsigned int>(
n),
2974 static_cast<long unsigned int>(m));
2979 return realloc<T*>(
b,static_cast<long unsigned int>(
n),
2980 static_cast<long unsigned int>(m));
2985 assert((
n >= 0) && (m >= 0));
2986 return realloc<T*>(
b,static_cast<long unsigned int>(
n),
2987 static_cast<long unsigned int>(m));
2991 #ifdef GECODE_HAS_VAR_DISPOSE
2994 Space::vars_d(
void)
const {
2995 return _vars_d[VIC::idx_d];
2999 Space::vars_d(VarImpBase*
x) {
3000 _vars_d[VIC::idx_d] =
x;
3006 Actor::operator
delete(
void*) {}
3008 Actor::operator
delete(
void*,
Space&) {}
3010 Actor::operator
new(
size_t s,
Space& home) {
3011 return home.ralloc(s);
3023 return home.ralloc(s);
3028 Advisor::operator
delete(
void*) {}
3031 Advisor::operator
delete(
void*,
Space&) {}
3033 Advisor::operator
new(
size_t s,
Space& home) {
3034 return home.ralloc(s);
3038 NGL::operator
delete(
void*) {}
3042 NGL::operator
new(
size_t s,
Space& home) {
3043 return home.ralloc(s);
3071 unsigned long int s0,
3072 unsigned long int f0,
3075 :
t(RESTART),
r(r0), s(s0),
f(f0),
l(l0), ng(ng0),
a(0) {}
3079 :
t(PORTFOLIO),
r(0), s(0),
f(0),
l(NULL), ng(
NoGoods::eng),
a(a0) {}
3150 p->_next =
n;
n->_prev =
p;
3155 _next =
this; _prev =
this;
3162 this->_next =
a;
a->_prev =
this;
3163 a->_next =
n;
n->_prev =
a;
3170 a->_next =
this; this->_prev =
a;
3171 p->_next =
a;
a->_prev =
p;
3176 return _next ==
this;
3185 return static_cast<ActorLink*>(&
t);
3194 return static_cast<const ActorLink*>(&
t);
3207 return static_cast<Actor*>(&
t);
3211 Actor::cast(
const ActorLink* al) {
3215 return static_cast<const Actor*>(&
t);
3228 return const_cast<Space*>(
this)->_clone();
3253 return sizeof(*this);
3264 : s(s0),
p(p0), pg(pg0), bg(bg0) {}
3288 return Home(*
this,&
p);
3333 return static_cast<What>(
who & 3);
3339 return *reinterpret_cast<Propagator*>(
who);
3344 return *reinterpret_cast<Brancher*>(
who & ~3);
3357 : h(home), pg(home.propagatorgroup()),
3358 pid(h.ssd.data().gpi.pid()),
3360 h.pc.
p.vti.post(
pg);
3366 if (
h.pc.
p.bid_sc & Space::sc_trace)
3380 :
i(i0), g(g0),
p(p0), s(s0) {}
3406 :
b(b0),
c(c0),
a(a0) {}
3435 : g(g0), s(s0),
n(n0) {}
3459 return static_cast<Propagator*>(&
t);
3463 Propagator::cast(
const ActorLink* al) {
3467 return static_cast<const Propagator*>(&
t);
3472 return static_cast<Propagator*>(
prev());
3481 Propagator::disable(
Space& home) {
3482 home.pc.
p.bid_sc |= Space::sc_disabled;
3487 Propagator::enable(Space& home) {
3503 static_cast<
Space&>(home).ssd.data().gpi.allocate
3504 (home.propagatorgroup().gid)) {
3506 assert((u.med == 0) && (u.size == 0));
3507 static_cast<Space&>(home).pl.head(
this);
3512 : gpi_disabled(
p.gpi_disabled) {
3514 assert((u.med == 0) && (u.size == 0));
3526 return const_cast<Propagator&>(*this).gpi().afc;
3529 #ifdef GECODE_HAS_CBS
3531 Propagator::solndistrib(
Space&, SendMarginal)
const {}
3534 Propagator::domainsizesum(InDecision,
unsigned int&
size,
3535 unsigned int& size_b)
const {
3543 return const_cast<Propagator&>(*this).gpi().pid;
3564 p.u.size =
p.dispose(*
this);
3571 assert(
p.u.med != 0);
3578 assert(
p.u.med != 0);
3593 return static_cast<Brancher*>(&
t);
3597 Brancher::cast(
const ActorLink* al) {
3601 return static_cast<const Brancher*>(&
t);
3606 gid(_home.branchergroup().gid) {
3607 Space& home = static_cast<Space&>(_home);
3608 bid = home.pc.
p.bid_sc >> Space::sc_bits;
3609 home.pc.
p.bid_sc += (1 << Space::sc_bits);
3610 if ((home.pc.
p.bid_sc >> Space::sc_bits) == 0U)
3613 if (home.b_status == &static_cast<Space&>(home).bl) {
3614 home.b_status =
this;
3615 if (home.b_commit == &static_cast<Space&>(home).bl)
3616 home.b_commit =
this;
3623 : bid(
b.bid), gid(
b.gid) {
3649 b_commit = Brancher::cast(
b.next());
3651 b_status = Brancher::cast(
b.next());
3657 Space::kill(Propagator&
p) {
3664 Space::brancher(
unsigned int id) {
3681 while (b_commit != Brancher::cast(&bl))
3682 if (
id != b_commit->
id())
3683 b_commit = Brancher::cast(b_commit->next());
3686 if (b_commit == Brancher::cast(&bl)) {
3688 b_commit = Brancher::cast(bl.
next());
3689 while (b_commit != b_old)
3690 if (
id != b_commit->
id())
3691 b_commit = Brancher::cast(b_commit->next());
3709 return static_cast<LocalObject*>(&
t);
3717 return static_cast<const LocalObject*>(&
t);
3767 : bid(
b.id()), alt(
a) {}
3775 Choice::id(
void)
const {
3822 return sizeof(*this);
3842 Advisor::disposed(
void)
const {
3843 return prev() == NULL;
3847 Advisor::cast(ActorLink* al) {
3848 return static_cast<Advisor*>(al);
3852 Advisor::cast(
const ActorLink* al) {
3853 return static_cast<const Advisor*>(al);
3858 assert(!disposed());
3865 assert(!disposed());
3869 if ((
n != NULL) &&
n->disposed())
3875 return home.pc.
p.vti;
3918 while ((
a != NULL) && static_cast<A*>(
a)->disposed())
3930 while ((
a != NULL) && static_cast<A*>(
a)->disposed())
3935 if (
c.advisors != NULL) {
3937 Propagator* p_f = &static_cast<A*>(
c.advisors)->propagator();
3939 Propagator* p_t = Propagator::cast(p_f->prev());
3944 while (*a_f != NULL) {
3945 if (static_cast<A*>(*a_f)->disposed()) {
3946 *a_f = (*a_f)->next();
3949 A*
a =
new (home)
A(home,*static_cast<A*>(*a_f));
3957 a_f = (*a_f)->next_ref();
3974 if (!static_cast<A*>(
a)->disposed())
3975 static_cast<A*>(
a)->dispose(home,*
this);
3990 while ((a != NULL) && static_cast<A*>(a)->disposed())
4005 }
while ((
a != NULL) && static_cast<A*>(
a)->disposed());
4011 return *static_cast<A*>(
a);
4023 ActorLink*
c = &pc.p.queue[
p->cost(*
this,
p->u.med).ac];
4025 if (
c > pc.p.active)
4054 return ((pc.p.active < &pc.p.queue[0]) ||
4061 ap_notice_dispose(&
a,
d);
4064 pc.p.bid_sc |= sc_trace;
4067 pc.p.bid_sc |= sc_trace;
4078 ap_ignore_dispose(&
a,
d);
4094 assert((pc >= 0) && (pc < pc_max+2));
4095 return (pc == 0) ?
b.base :
b.base+
u.idx[pc-1];
4100 VarImp<VIC>::actorNonZero(
PropCond pc) {
4101 assert((pc > 0) && (pc < pc_max+2));
4102 return b.base+
u.idx[pc-1];
4108 assert((pc > 0) && (pc < pc_max+2));
4115 assert((pc > 0) && (pc < pc_max+2));
4122 #ifdef GECODE_HAS_CBS
4123 : var_id(++home.var_id_counter)
4126 #ifndef GECODE_HAS_CBS
4129 b.base = NULL; entries = 0;
4130 for (
PropCond pc=1; pc<pc_max+2; pc++)
4138 #ifdef GECODE_HAS_CBS
4142 b.base = NULL; entries = 0;
4143 for (
PropCond pc=1; pc<pc_max+2; pc++)
4148 #ifdef GECODE_HAS_CBS
4172 d += Propagator::cast(*a)->afc();
a++;
4181 ->propagator().afc();
4197 return free_and_bits;
4203 return free_and_bits;
4206 #ifdef GECODE_HAS_VAR_DISPOSE
4210 return static_cast<VarImp<VIC>*
>(home.vars_d<VIC>());
4215 VarImp<VIC>::vars_d(Space& home, VarImp<VIC>*
x) {
4216 home.vars_d<VIC>(
x);
4243 #ifdef GECODE_HAS_CBS
4248 free_and_bits =
x.free_and_bits & ((1 << free_bits) - 1);
4249 if (
x.b.base == NULL) {
4251 reg = &home.pc.
c.vars_noidx;
4254 reg = &home.pc.
c.vars_u[idx_c];
4258 entries =
x.entries;
4259 for (
PropCond pc=1; pc<pc_max+2; pc++)
4260 idx(pc) =
x.idx(pc);
4271 return static_cast<ModEvent>((med & VIC::med_mask) >> VIC::med_fst);
4277 return static_cast<ModEventDelta>(me << VIC::med_fst);
4283 return VIC::me_combine(me1,me2);
4290 if (VIC::med_update(
p.u.med,me) || force)
4300 schedule(home,*Propagator::cast(*
p),me);
4306 if (
b.base == NULL) {
4307 assert((free_and_bits >> free_bits) == 0);
4309 free_and_bits += 4 << free_bits;
4311 for (
int i=0;
i<pc_max+1;
i++)
4315 unsigned int n = degree();
4319 ActorLink** s = static_cast<ActorLink**>(home.mm.
subscriptions());
4321 ((s <=
b.base) && (
b.base < s+home.pc.
p.n_sub)) ?
4322 (
n+4) : ((
n+1)*3>>1);
4323 ActorLink** prop = home.
alloc<ActorLink*>(m);
4324 free_and_bits += (m-
n) << free_bits;
4326 Heap::copy<ActorLink*>(prop,
b.base,
n);
4327 home.
free<ActorLink*>(
b.base,
n);
4334 VarImp<VIC>::enter(Space& home, Propagator*
p,
PropCond pc) {
4335 assert(pc <= pc_max);
4337 home.pc.p.n_sub += 1;
4338 if ((free_and_bits >> free_bits) == 0)
4340 free_and_bits -= 1 << free_bits;
4343 b.base[entries] = *actorNonZero(pc_max+1);
4345 for (
PropCond j = pc_max; j > pc; j--) {
4346 *actorNonZero(j+1) = *actorNonZero(j);
4349 *actorNonZero(pc+1) = *actor(pc);
4354 ActorLink**
f = actor(pc);
4355 while (
f < (pc == pc_max+1 ?
b.base+entries : actorNonZero(pc+1)))
4367 VarImp<VIC>::enter(Space& home, Advisor*
a) {
4370 home.pc.p.n_sub += 1;
4371 if ((free_and_bits >> free_bits) == 0)
4373 free_and_bits -= 1 << free_bits;
4376 b.base[entries++] = *actorNonZero(pc_max+1);
4377 *actorNonZero(pc_max+1) =
a;
4418 assert(pc <= pc_max);
4423 while (
f < actorNonZero(pc+1))
4431 while (*
f !=
a)
f++;
4434 *
f = *(actorNonZero(pc+1)-1);
4435 for (
PropCond j = pc+1; j< pc_max+1; j++) {
4436 *(actorNonZero(j)-1) = *(actorNonZero(j+1)-1);
4439 *(actorNonZero(pc_max+1)-1) =
b.base[entries-1];
4442 free_and_bits += 1 << free_bits;
4443 home.pc.
p.n_sub -= 1;
4460 while (
f <
b.base+entries)
4468 while (*
f !=
a)
f++;
4471 *
f =
b.base[--entries];
4472 free_and_bits += 1 << free_bits;
4473 home.pc.
p.n_sub -= 1;
4479 if (
b.base != NULL) {
4488 unsigned int n_sub = degree();
4489 home.pc.
p.n_sub -= n_sub;
4490 unsigned int n = (free_and_bits >> free_bits) + n_sub;
4497 for (
PropCond pc=1; pc<pc_max+2; pc++)
4499 free_and_bits &= (1 << free_bits) - 1;
4510 ActorLink** la = actorNonZero(pc_max+1);
4521 assert(!
a->disposed());
4523 switch (
p.advise(home,*
a,
d)) {
4529 schedule(home,
p,me);
4532 schedule(home,
p,me,
true);
4538 }
while (++la < le);
4550 ActorLink** la = actorNonZero(pc_max+1);
4559 Advisor*
a = Advisor::cast(static_cast<ActorLink*>
4561 assert(!
a->disposed());
4565 }
while (++la < le);
4582 x->u.idx[0] =
u.idx[0];
4583 if (pc_max > 0 &&
sizeof(
ActorLink**) >
sizeof(
unsigned int))
4584 x->u.idx[1] =
u.idx[1];
4587 static_cast<unsigned int>(
x->actorNonZero(pc_max+1) -
x->actor(0));
4589 static_cast<unsigned int >(
x->b.base +
x->entries -
4590 x->actorNonZero(pc_max+1));
4591 unsigned int n = na + np;
4605 t[0] = p0;
t[1] = p1;
t[2] = p2;
t[3] = p3;
4606 np -= 4;
t += 4;
f += 4;
4609 ActorLink* p0 =
f[0]->prev();
4610 ActorLink* p1 =
f[1]->prev();
4611 t[0] = p0;
t[1] = p1;
4612 np -= 2;
t += 2;
f += 2;
4615 ActorLink* p0 =
f[0]->prev();
4621 ptrdiff_t m0, m1, m2, m3;
4634 na -= 4;
t += 4;
f += 4;
4644 na -= 2;
t += 2;
f += 2;
4656 VarImp<VIC>::update(Space& home, ActorLink**& sub) {
4657 VarImp<VIC>*
x =
static_cast<VarImp<VIC>*
>(home.pc.c.vars_u[idx_c]);
4659 VarImp<VIC>*
n =
x->next();
x->forward()->
update(
x,sub);
x =
n;
4669 template<
class VarImp>
4671 #ifdef GECODE_HAS_VAR_DISPOSE
4672 Space::vd[VarImp::idx_d] =
this;
4676 template<
class VarImp>
4679 VarImp*
x = static_cast<VarImp*>(_x);
4681 x->dispose(home);
x = static_cast<VarImp*>(
x->next_d());
4682 }
while (
x != NULL);
4761 return (m ==
LO) ? lo : hi;
4775 return crazy(m,static_cast<unsigned int>(
n));
4784 return cubic(m,static_cast<unsigned int>(
n));
4793 return quadratic(m,static_cast<unsigned int>(
n));
4802 return linear(m,static_cast<unsigned int>(
n));
4823 : home(home0), q(home.pc.
p.active) {
4824 while (q >= &home.pc.p.queue[0]) {
4825 if (q->
next() != q) {
4826 c = q->
next(); e = q; q--;
4832 if (!home.pl.empty()) {
4833 c = Propagator::cast(home.pl.next());
4834 e = Propagator::cast(&home.pl);
4850 while (q >= &home.pc.p.queue[0]) {
4851 if (q->next() != q) {
4852 c = q->next(); e = q; q--;
4858 if (!home.pl.empty()) {
4859 c = Propagator::cast(home.pl.next());
4860 e = Propagator::cast(&home.pl);
4869 return *Propagator::cast(
c);
4875 : home(home0), q(home.pc.
p.
active) {
4876 while (q >= &home.pc.p.queue[0]) {
4877 if (q->
next() != q) {
4878 c = q->
next(); e = q; q--;
4896 while (q >= &home.pc.p.queue[0]) {
4897 if (q->next() != q) {
4898 c = q->next(); e = q; q--;
4909 return *Propagator::cast(
c);
4915 c = Propagator::cast(home.pl.
next());
4916 e = Propagator::cast(&home.pl);
4928 return *Propagator::cast(
c);
4934 :
c(
Brancher::cast(home.bl.next())), e(&home.bl) {}
4945 return *Brancher::cast(
c);
4992 return static_cast<PropagatorGroup&>(Group::operator =(g));
5002 return id() == g.
id();
5006 return id() != g.
id();
5030 return static_cast<BrancherGroup&>(Group::operator =(g));
5040 return id() == g.
id();
5044 return id() != g.
id();
5061 : ps(const_cast<
Space&>(home)), g(g0) {
5082 : bs(const_cast<
Space&>(home)), g(g0) {
5111 template<
class T,
typename A1>
5114 T&
t = *static_cast<T*>(
ralloc(
sizeof(T)));
5118 template<
class T,
typename A1,
typename A2>
5121 T&
t = *static_cast<T*>(
ralloc(
sizeof(T)));
5125 template<
class T,
typename A1,
typename A2,
typename A3>
5128 T&
t = *static_cast<T*>(
ralloc(
sizeof(T)));
5129 new (&
t) T(a1,a2,a3);
5132 template<
class T,
typename A1,
typename A2,
typename A3,
typename A4>
5135 T&
t = *static_cast<T*>(
ralloc(
sizeof(T)));
5136 new (&
t) T(a1,a2,a3,a4);
5139 template<
class T,
typename A1,
typename A2,
typename A3,
typename A4,
typename A5>
5142 T&
t = *static_cast<T*>(
ralloc(
sizeof(T)));
5143 new (&
t) T(a1,a2,a3,a4,a5);
struct Gecode::@602::NNF::@65::@66 b
For binary nodes (and, or, eqv)
void notice(Actor &a, ActorProperty p, bool duplicate=false)
Notice actor property.
unsigned int degree(void) const
Return degree (number of subscribed propagators and advisors)
CommitStatistics(void)
Initialize.
const ModEvent ME_GEN_ASSIGNED
Generic modification event: variable is assigned a value.
void * unmark(void *p)
Return unmarked pointer for a marked pointer p.
Post propagator for SetVar x
unsigned int n_sub
Number of subscriptions.
Home operator()(Space &home)
To augment a space argument.
static PropCost record(void)
For recording information (no propagation allowed)
void * alloc(SharedMemory &sm, size_t s)
Allocate memory of size s.
void operator++(void)
Move iterator to next propagator.
Status status(void) const
Return propagator status.
void kill(Space &home)
Kill all branchers in a group.
Space is solved (no brancher left)
Advisors(const Council< A > &c)
Initialize.
PropagateTraceInfo(unsigned int i, PropagatorGroup g, const Propagator *p, Status s)
Initialize.
size_t size
The size of the propagator (used during subsumption)
#define GECODE_VTABLE_EXPORT
unsigned int id(void) const
Return propagator id.
bool nested
Whether it is used nested.
Configuration class for variable implementations without index structure.
static BrancherGroup all
Group of all branchers.
static const PropCond pc_max
Maximal propagation condition.
bool operator!=(PropagatorGroup g) const
Test whether this group is different from group g.
LocalObject * fwd(Space &home)
Return forwarding pointer.
const ViewTraceInfo & operator()(const Space &home) const
Provide access to view trace information.
void * ptrsplit(void *p, ptrdiff_t &m)
Split possibly marked pointer p into mark m and unmarked pointer.
virtual void dispose(Space &home, VarImpBase *x)
Dispose list of variable implementations starting at x.
Propagators(const Space &home, PropagatorGroup g)
Initialize.
PropagatorGroup group(void) const
Return propagator group.
ViewTraceInfo vti
View trace information.
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)
void free(T *b, long unsigned int n)
Delete n objects allocated from space heap starting at b.
void * subscriptions(void) const
Get the memory area for subscriptions.
Propagator for recording trace information.
BrancherGroup branchergroup(void) const
Return brancher group.
NGL * add(NGL *n, bool l)
Add node n and mark it as leaf l and return n.
Base class for Variable type disposer.
ModEvent fail(Space &home)
Run advisors to be run on failure and returns ME_GEN_FAILED.
Three variables, expensive.
bool stable(void) const
Return if space is stable (at fixpoint or failed)
static PropCost binary(PropCost::Mod m)
Two variables for modifier pcm.
unsigned int alternatives(void) const
Return number of alternatives.
static BrancherGroup def
Group of branchers not in any user-defined group.
StatusStatistics operator+(const StatusStatistics &s)
Return sum with s.
unsigned int size(I &i)
Size of all ranges of range iterator i.
void operator++(void)
Move iterator to next brancher.
double afc(void) const
Return accumulated failure count (plus degree)
Class to store data shared among several spaces.
void reset(void)
Reset information.
virtual ~Choice(void)
Destructor.
CloneStatistics & operator+=(const CloneStatistics &s)
Increment by statistics s.
LocalObject(Home home)
Constructor for creation.
PostInfo(Home home)
Set information.
Propagator(Home home)
Constructor for posting.
static const int idx_c
Index for update.
bool assigned(View x, int v)
Whether x is assigned to value v.
unsigned int size(Space &home) const
Return number of propagators in a group.
const PropCond PC_GEN_ASSIGNED
Propagation condition for an assigned variable.
Class to iterate over branchers of a space.
void * mark(void *p)
Return marked pointer for unmarked pointer p.
Class to iterate over advisors of a council.
Class to iterate over branchers in a group.
bool operator()(void) const
Test whether there are propagators left.
void update(Space &home, Council< A > &c)
Update during cloning (copies all advisors)
void * funmark(void *p)
Return unmarked pointer for a possibly marked pointer p.
PropagatorGroup propagatorgroup(void) const
Return propagator group.
LocalHandle(void)
Create local handle pointing to NULL object.
bool empty(void) const
Test whether council has advisor left.
Brancher(Home home)
Constructor for creation.
Space must be branched (at least one brancher left)
PropagatorGroup group(void) const
Return propagator group.
static ModEvent me_combine(ModEvent me1, ModEvent me2)
Combine modifications events me1 and me2.
bool operator()(void) const
Test whether there are propagators left.
BrancherGroup bg
A brancher group.
static const unsigned int GROUPID_ALL
Fake id for group of all actors.
Space & s
The space where the propagator is to be posted.
void commit(const Choice &c, unsigned int a, CommitStatistics &stat=unused_commit)
Commit choice c for alternative a.
static ActorLink * cast(T *a)
Static cast for a non-null pointer (to give a hint to optimizer)
PropagatorGroup g
Propagator group.
void disable(Space &home)
Disable all propagators in a group.
static const int med_fst
Start of bits for modification event delta.
void update(Space &home, LocalHandle &lh)
Updating during cloning.
Exception: too many branchers
VarImp< VIC > * fwd
Forwarding pointer.
static PropCost linear(PropCost::Mod m, unsigned int n)
Linear complexity for modifier pcm and size measure n.
const Brancher & b
Brancher.
ExecStatus ES_NOFIX_PARTIAL(Propagator &p, const ModEventDelta &med)
Propagator p has not computed partial fixpoint
unsigned int n
Number of posted propagators.
unsigned int alternative(void) const
Return alternative.
void * fmark(void *p)
Return marked pointer for p (possibly already marked)
static ModEventDelta med_combine(ModEventDelta med1, ModEventDelta med2)
Combine modification event delta med1 with med2.
Local (space-shared) object.
LocalHandle & operator=(const LocalHandle &lh)
Assignment operator.
Base-class for both propagators and branchers.
A propagator is currently executing.
static PropCost quadratic(PropCost::Mod m, unsigned int n)
Quadratic complexity for modifier m and size measure n.
void decay(double d)
Set decay factor to d.
PropagatorGroup group(void) const
Return group propagator belongs to.
unsigned int bits(void) const
Provide access to free bits.
Internal: propagator has computed partial fixpoint, do not use.
ScheduledPropagators(Space &home)
Initialize.
CloneStatistics(void)
Initialize.
Branchers(Space &home)
Initialize.
ExecStatus ES_SUBSUMED_DISPOSED(Propagator &p, size_t s)
Propagator p is subsumed
Branchers(const Space &home, BrancherGroup g)
Initialize.
unsigned int i
Propagator id.
SharedMemory sm
The shared memory area.
const bool clone
Whether engines create a clone when being initialized.
Propagator & propagator(void) const
Return propagator.
unsigned int bid_sc
Id of next brancher to be created plus status control.
Double-linked list for actors.
PropagatorGroup g
Propagator group.
Choice(const Brancher &b, const unsigned int a)
Initialize for particular brancher b and alternatives a.
Advisor forces rescheduling of propagator.
Two variables, expensive.
PropagatorGroup & operator=(const PropagatorGroup &g)
Assignment operator.
~LocalHandle(void)
Destructor.
static Group def
Group of actors not in any user-defined group.
void fl_dispose(FreeList *f, FreeList *l)
Return freelist-managed memory to freelist.
unsigned int gid
The group id.
What
What is currently executing.
~PostInfo(void)
Reset information.
struct Gecode::Space::@61::@63 c
Data available only during copying.
Propagator did not compute fixpoint.
union Gecode::@602::NNF::@65 u
Union depending on nodetype t.
Internal: propagator is subsumed, do not use.
Gecode toplevel namespace
void enable(Space &home, bool s=true)
Enable all propagators in a group.
BrancherGroup & move(Space &home, BrancherGroup g)
Move branchers from group g to this group.
Base-class for propagators.
Space * clone(CloneStatistics &stat=unused_clone) const
Clone space.
Only single variable, cheap.
double afc(void) const
Return the accumlated failure count.
No-goods recorded from restarts.
const Choice & choice(void) const
Return choice.
void operator++(void)
Move iterator to next propagator.
const Brancher & brancher(void) const
Return brancher.
Propagator & propagator(void) const
Return propagator.
Linear complexity, expensive.
Propagator * propagator(void) const
Return propagator (or NULL) for currently rewritten propagator.
IdlePropagators(Space &home)
Initialize.
void operator++(void)
Move iterator to next brancher.
void operator++(void)
Move iterator to next advisor.
static void reschedule(Space &home, Propagator &p, PropCond pc, bool assigned, ModEvent me)
Schedule propagator p.
void update(IntSet &y, Space &home, IntSet &py)
Propagator computed fixpoint.
struct Gecode::@602::NNF::@65::@67 a
For atomic nodes.
unsigned int gid
Group identifier.
Home operator()(Propagator &p)
Return a home extended by propagator to be rewritten.
void reschedule(Space &home, Propagator &p, IntSet &y)
unsigned int size(Space &home) const
Return number of branchers in a group.
A post function is executing.
unsigned int id(void) const
Return brancher id.
Generic domain change information to be supplied to advisors.
static PropagatorGroup all
Group of all propagators.
struct Gecode::Space::@61::@62 p
Data only available during propagation or branching.
Handles for local (space-shared) objects.
ActorLink * next(void) const
Home operator()(Propagator &p)
Return a home for this space with the information that p is being rewritten.
Base-class for branchers.
Commit trace information.
bool operator()(void) const
Test whether there are branchers left.
VarImp * forward(void) const
Use forward pointer if variable already copied.
Mod
Propagation cost modifier.
static bool med_update(ModEventDelta &med, ModEvent me)
Update modification even delta med by me, return true on change.
const Brancher & brancher(void) const
Return currently executing brancher.
NGL(void)
Constructor for creation.
Home class for posting propagators
VarImp(void)
Creation of static instances.
virtual size_t dispose(Space &home)
Dispose.
static PropCost cubic(PropCost::Mod m, unsigned int n)
Cubic complexity for modifier m and size measure n.
Actor must always be disposed.
void tail(ActorLink *al)
Insert al directly before this.
const ModEvent ME_GEN_NONE
Generic modification event: no modification.
static LocalObject * cast(ActorLink *al)
Static cast for a non-null pointer (to give a hint to optimizer)
Quadratic complexity, cheap.
const Propagator & propagator(void) const
Return propagator.
static PropCost unary(PropCost::Mod m)
Single variable for modifier pcm.
Post propagator for SetVar SetOpType SetVar SetRelType r
static const int med_lst
End of bits for modification event delta.
BrancherGroup & operator=(const BrancherGroup &g)
Assignment operator.
virtual ~NoGoods(void)
Destructor.
ActualCost ac
Actual cost.
T * alloc(long unsigned int n)
Allocate block of n objects of type T from space heap.
void operator++(void)
Move iterator to next propagator.
Propagator not posted as already subsumed.
Home & operator=(const Home &h)
Assignment operator.
TFE post(PropagatorGroup g)
Only post functions (but not propagators) from g are considered.
void init(void)
Initialize links (self-linked)
ModEventDelta med
A set of modification events (used during propagation)
VarImp * next(void) const
Return next copied variable.
ModEventDelta modeventdelta(void) const
Return the modification event delta.
void trycommit(const Choice &c, unsigned int a, CommitStatistics &stat=unused_commit)
If possible, commit choice c for alternative a.
bool in(Group a) const
Check whether actor group a is included in this group.
unsigned int id(void) const
Return propagator identifier.
ActorLink ** next_ref(void)
const Propagator * propagator(void) const
Return pointer to non-subsumed propagator.
unsigned int id(void) const
Return a unique id for the group.
Statistics for execution of clone
PropagatorGroup & move(Space &home, PropagatorGroup g)
Move propagators from group g to this group.
Data & data(void) const
Provide access.
void * fl_alloc(void)
Allocate from freelist-managed memory.
CommitStatistics & operator+=(const CommitStatistics &s)
Increment by statistics s.
Class to set group information when a post function is executed.
Propagator * p
A propagator (possibly) that is currently being rewritten.
Group baseclass for controlling actors.
bool advise(Space &home, ModEvent me, Delta &d)
Run advisors when variable implementation has been modified with modification event me and domain cha...
#define GECODE_KERNEL_EXPORT
Council(void)
Default constructor.
IntSet * A
Position of a piece in a square board.
const Brancher & brancher(void) const
Return propagator.
PostTraceInfo(PropagatorGroup g, Status s, unsigned int n)
Initialize.
ActorLink * active
Cost level with next propagator to be executed.
PropagatorGroup post(void) const
Return propagator group of currently executing post function.
Base class for heap allocated objects.
VarImpBase * vars_noidx
Keep variables during copying without index structure.
#define GECODE_NEVER
Assert that this command is never executed.
void reset(void)
Reset information.
LocalObject * object(void) const
Access to the local object.
Group & operator=(const Group &g)
Assignment operator.
void subscribe(Space &home, Propagator &p, PropCond pc, bool assigned, ModEvent me, bool schedule)
Subscribe propagator p with propagation condition pc.
ExecStatus prune(Space &home, ViewArray< VX > &x, ConstIntView)
static const int free_bits
Freely available bits.
void operator++(void)
Move iterator to next propagator.
int ModEvent
Type for modification events.
Propagator & propagator(void) const
Return the advisor's propagator.
Base-class for freelist-managed objects.
PropagatorGroup(void)
Constructor.
BrancherGroup(void)
Constructor.
const Propagator * p
Propagator.
VarImp< VIC > * next
During cloning, points to the next copied variable.
Only single variable, expensive.
StatusStatistics & operator+=(const StatusStatistics &s)
Increment by statistics s.
Gecode::ActorLink * advisors
A list of advisors (used during cloning)
bool operator!=(BrancherGroup g) const
Test whether this group is different from group g.
double afc_decay(void) const
Return AFC decay factor.
int PropCond
Type for propagation conditions.
ActorProperty
Actor properties.
bool operator==(PropagatorGroup g) const
Test whether this group is equal to group g.
static const unsigned int GROUPID_DEF
Pre-defined default group id.
bool operator()(void) const
Test whether there are propagators left.
Propagator & propagator(void) const
Return propagator.
bool failed(void) const
Check whether space is failed.
VarImpDisposer(void)
Constructor (registers disposer with kernel)
void fail(void)
Fail space.
static PropCost ternary(PropCost::Mod m)
Three variables for modifier pcm.
bool failed(void) const
Check whether corresponding space is failed.
bool empty(void) const
Test whether actor link is empty (points to itself)
ActualCost
The actual cost values that are used.
unsigned long int propagate
Number of propagator executions.
bool leaf(void) const
Test whether literal is a leaf.
Class to iterate over idle propagators of a space.
ActorLink * prev(void) const
Routines for double-linked list.
Status status(void) const
Return post status.
bool in(void) const
Check whether this is a real group (and not just default)
bool operator==(BrancherGroup g) const
Test whether this group is equal to group g.
Class for AFC (accumulated failure count) management.
void cancel(Space &home, Propagator &p, IntSet &y)
BrancherGroup group(void) const
Return group brancher belongs to.
Iterator over subscribed propagators.
void fail(void)
Mark space as failed.
Reserved for recording information.
unsigned int pid
Next free propagator id.
void reset(void)
Reset information.
void * rrealloc(void *b, size_t n, size_t m)
Reallocate memory block starting at b from size n to size s.
static const int idx_c
Index for cloning.
LocalObject * local
Linked list of local objects.
static PropagatorGroup def
Group of propagators not in any user-defined group.
static Group all
Group of all actors.
CommitStatistics operator+(const CommitStatistics &s)
Return sum with s.
bool operator()(void) const
Test whether there are branchers left.
StatusStatistics(void)
Initialize.
void dispose(Space &home, Council< A > &c)
Dispose the advisor.
Class to iterate over propagators of a space.
unsigned int degree(void) const
Return degree (number of subscribed propagators and advisors)
bool disabled(void) const
Whether propagator is currently disabled.
static void schedule(Space &home, Propagator &p, ModEvent me, bool force=false)
Schedule propagator p with modification event me.
Propagation has computed fixpoint.
Exponential complexity, cheap.
void rfree(void *p, size_t s)
Free memory previously allocated with alloc (might be reused later)
Advisor(Space &home, Propagator &p, Council< A > &c)
Constructor for creation.
void unlink(void)
Remove from predecessor and successor.
CommitTraceInfo(const Brancher &b, const Choice &c, unsigned int a)
Initialize.
static ModEvent me(const ModEventDelta &med)
Project modification event for this variable type from med.
static ModEvent modevent(const Delta &d)
Return modification event.
Statistics for execution of status
static const int idx_d
Index for dispose.
void reuse(void *p, size_t s)
Store for reusal, if of sufficient size for free list.
Exponential complexity, expensive.
Class for storing propagator information.
static ModEventDelta med(ModEvent me)
Translate modification event me into modification event delta.
void trace(Home home, const FloatVarArgs &x, TraceFilter tf, int te, FloatTracer &t)
Create a tracer for float variables.
Kernel::GPI::Info & gpi(void)
Provide access to global propagator information.
unsigned int id(void) const
Return brancher identifier.
void update(Space &home, VarImpVar< VarImp > &y)
Update this variable to be a clone of variable y.
static NoGoods eng
Empty no-goods.
const Propagator & propagator(void) const
Return currently executing propagator.
const ModEvent ME_GEN_FAILED
Generic modification event: failed variable.
ExecStatus ES_NOFIX_DISPOSE_FORCE(Council< A > &c, A &a)
Advisor a must be disposed and its propagator must be forcefully rescheduled
bool operator()(void) const
Test whether there advisors left.
BrancherGroup group(void) const
Return brancher group.
PropagatorGroup pg
A propagator group.
Brancher & brancher(void) const
Return propagator.
Base-class for variable implementations.
Base-class for variable implementations.
void ignore(Actor &a, ActorProperty p, bool duplicate=false)
Ignore actor property.
void * ptrjoin(void *p, ptrdiff_t m)
Join unmarked pointer p and m into marked pointer.
unsigned long int n
Number of no-goods.
virtual size_t dispose(Space &home)
Delete actor and return its size.
Home operator()(Space &home)
To augment a space argument.
void head(ActorLink *al)
Insert al directly after this.
GPI gpi
The global propagator information.
ptrdiff_t who
Encoding a tagged pointer or a tagged group id.
Post propagator for f(x \diamond_{\mathit{op}} y) \sim_r z \f$ void rel(Home home
T * realloc(T *b, long unsigned int n, long unsigned int m)
Reallocate block of n objects starting at b to m objects of type T from the space heap.
static unsigned int next
Next group id.
Gecode::FloatVal c(-8, 8)
bool copied(void) const
Is variable already copied.
void kill(Space &home)
Kill all propagators in a group.
Propagators(Space &home)
Initialize.
No-good literal recorded during search.
A & advisor(void) const
Return advisor.
void cancel(Space &home)
Cancel all subscriptions when variable implementation is assigned.
void dispose(Space &home)
Dispose council.
const PropCond PC_GEN_NONE
Propagation condition to be ignored (convenience)
friend class PropagatorGroup
A mutex for mutual exclausion among several threads.
Propagate trace information.
void subscribe(Space &home, Propagator &p, IntSet &y)
ActorLink ** base
Subscribed actors.
unsigned int idx[pc_max+1]
Indices of subscribed actors.
int n
Number of negative literals for node type.
Status
The status of a no-good literal.
Choice for performing commit
void notice(Actor &a, ActorProperty p, bool duplicate=false)
Notice actor property.
Variable implementation disposer
Execution has resulted in failure.
ExecStatus ES_FIX_PARTIAL(Propagator &p, const ModEventDelta &med)
Propagator p has computed partial fixpoint
Linear complexity, cheap.
Class to iterate over scheduled propagators of a space.
void * ralloc(size_t s)
Allocate memory on space heap.
int ModEventDelta
Modification event deltas.
Quadratic complexity, expensive.
Propagation has not computed fixpoint.
static const unsigned int GROUPID_MAX
The maximal group number.
NGL * next(void) const
Return pointer to next literal.
Propagator * fwd(void) const
Return forwarding pointer during copying.
ExecStatus ES_FIX_DISPOSE(Council< A > &c, A &a)
Advisor a must be disposed
What what(void) const
Return what is currently executing.
Gecode::IntArgs i({1, 2, 3, 4})
PropagatorGroup pg
The propagator group.
unsigned int propagators(void) const
Return number of posted propagators.
static const int idx_d
Index for disposal.
Class to iterate over propagators in a group.
Statistics for execution of commit
int p
Number of positive literals for node type.
TFE propagator(PropagatorGroup g)
Only propagators (but not post functions) from g are considered.
CloneStatistics operator+(const CloneStatistics &s)
Return sum with s.
unsigned long int ng(void) const
Return number of no-goods posted.
void other(void)
Record that nothing is known at this point.
bool operator()(void) const
Test whether there are propagators left.
#define GECODE_NOT_NULL(p)
Assert that a pointer is never NULL.
Home(Space &s, Propagator *p=NULL, PropagatorGroup pg=PropagatorGroup::def, BrancherGroup bg=BrancherGroup::def)
Initialize the home with space s and propagator p and group g.
bool marked(void *p)
Check whether p is marked.
static PropCost crazy(PropCost::Mod m, unsigned int n)
Exponential complexity for modifier m and size measure n.
Cubic complexity, expensive.
static Support::Mutex m
Mutex for protection.
static Gecode::ModEvent me_combine(ModEvent me1, ModEvent me2)
Combine modification events me1 and me2.
T & construct(void)
Construction routines.
#define GECODE_KERNEL_REALLOC(T)
void print(const Search::Statistics &stat, bool restart)
Print statistics.
unsigned int a
Alternative.
static const int med_mask
Bitmask for modification event delta.