38namespace Gecode {
namespace Int {
namespace Sequence {
40 template<
class View,
class Val>
43 int q0,
int l0,
int u0)
45 vvsamax(home,
x,s0,q0), vvsamin(home,
x,s0,q0), ac(home),
48 bool assigned =
false;
49 for (
int i=x.size(); i--; ) {
50 if (undecided(x[i],s))
51 x[i].subscribe(home,*new (home) SupportAdvisor<View>(home,*this,ac,i));
58 template<
class View,
class Val>
62 vvsamax(), vvsamin(), tofail(
p.tofail) {
69 template<
class View,
class Val>
74 if (
ES_NOFIX == vvsamin.advise(home,
x,s,q,
a.i,d) ) {
80 x[
a.i].cancel(home,
a);
89 if ((status ==
ES_FAILED) && disabled()) {
97 template<
class View,
class Val>
104 return sizeof(*this);
107 template<
class View,
class Val>
112 int* upper =
r.alloc<
int>(
x.size()+1);
113 int* lower =
r.alloc<
int>(
x.size()+1);
116 for (
int j=0; j<
x.size(); j++ ) {
117 upper[j+1] = upper[j];
118 lower[j+1] = lower[j];
124 if ( j+1 >= q && (q -
l < lower[j+1] - lower[j+1-q] || upper[j+1] - upper[j+1-q] >
u) ) {
131 template<
class View,
class Val>
143 template<
class View,
class Val>
149 template<
class View,
class Val>
155 template<
class View,
class Val>
158 for (
int i=
x.size(); i--; )
165 template<
class View,
class Val>
174 for (
int i=
x.size(); i--; )
union Gecode::@603::NNF::@65 u
Union depending on nodetype t.
int p
Number of positive literals for node type.
struct Gecode::@603::NNF::@65::@67 a
For atomic nodes.
Base-class for both propagators and branchers.
virtual size_t dispose(Space &home)
Delete actor and return its size.
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.
Sequence propagator for array of integers
virtual void reschedule(Space &home)
Schedule function.
ExecStatus advise(Space &home, Advisor &_a, const Delta &d)
Advise function.
static ExecStatus post(Home home, ViewArray< View > &x, Val s, int q, int l, int u)
Post propagator for.
virtual Actor * copy(Space &home)
Perform copying during cloning.
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
static ExecStatus check(ViewArray< View > &x, Val s, int q, int l, int u)
Check for consistency.
virtual size_t dispose(Space &home)
Delete propagator and return its size.
virtual PropCost cost(const Space &home, const ModEventDelta &med) const
Cost function.
Sequence(Space &home, Sequence &p)
Constructor for cloning p.
Class for advising the propagator.
void update(Space &home, ViewValSupportArray< View, Val, iss > &x)
Cloning.
static PropCost cubic(PropCost::Mod m, unsigned int n)
Cubic complexity for modifier m and size measure n.
Base-class for propagators.
bool assigned(void) const
Test whether view is assigned.
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)
void ignore(Actor &a, ActorProperty p, bool duplicate=false)
Ignore actor property.
int ModEventDelta
Modification event deltas.
#define GECODE_ES_CHECK(es)
Check whether execution status es is failed or subsumed, and forward failure or subsumption.
@ AP_DISPOSE
Actor must always be disposed.
bool excludes(const View &x, int s)
Test whether all values of view x are excluded from s.
bool includes(const View &x, int s)
Test whether all values of view x are included in s.
bool undecided(const View &x, int s)
Test whether no decision on inclusion or exclusion of values of view x in s can be made.
const Gecode::ModEvent ME_INT_BND
Domain operation has changed the minimum or maximum of the domain.
const Gecode::ModEvent ME_INT_VAL
Domain operation has resulted in a value (assigned variable)
Gecode toplevel namespace
Post propagator for SetVar SetOpType SetVar SetRelType r
@ 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.
Post propagator for SetVar x