Go to the documentation of this file.
38 namespace Gecode {
namespace Int {
namespace Linear {
63 class ResultIter :
public ViewValues<IntView> {
73 void operator ++(
void);
189 SupportSet::ResultIter::operator ++(
void) {
192 }
while (ViewValues<IntView>::operator ()() && s.supported(
p));
205 ResultIter
i(*
this,
x);
206 return x.minus_v(home,
i);
222 int a0,
const IntView& x0, Val l0, Val u0) {
223 a=a0;
x=x0;
l=l0;
u=u0;
234 return s.tell(home,
x);
246 if (
d +
static_cast<Val
>(
a)*
x.max() <
u)
251 while (
d +
static_cast<Val
>(
a)*
i.max() <
u) {
259 while (
d +
static_cast<Val
>(
a)*
c <
u) {
263 d +=
static_cast<Val
>(
a) *
c;
270 Val
v =
static_cast<Val
>(
a) *
c;
284 c =
i.min();
v =
static_cast<Val
>(
a) *
c;
303 if (
d +
static_cast<Val
>(
a)*
x.min() <
u)
308 while (
d +
static_cast<Val
>(
a)*
i.min() <
u) {
316 while (
d +
static_cast<Val
>(
a)*
c <
u) {
320 d +=
static_cast<Val
>(
a) *
c;
327 Val
v =
static_cast<Val
>(
a) *
c;
341 c =
i.max();
v =
static_cast<Val
>(
a) *
c;
357 template<
class Val,
class View>
364 template<
class Val,
class View>
373 template<
class Val,
class View>
378 template<
class Val,
class View>
384 template<
class Val,
class View>
393 template<
class Val,
class View>
397 ExecStatus es = prop_bnd<Val,View,View>(home,med,*
this,
x,
y,
c);
417 for (
int j=m; j--; ) {
418 yp[j].
init(
r,-
y[j].scale(),
y[j].base(),
l,
u);
419 l +=
y[j].max();
u +=
y[j].min();
421 for (
int i=
n;
i--; ) {
423 l -=
x[
i].min();
u -=
x[
i].max();
436 if (!xp[
i].reset(
d))
goto prev_i;
442 if (!yp[j].reset(
d))
goto prev_j;
448 for (
int is=
n; is--; ) xp[is].support();
449 for (
int js=m; js--; ) yp[js].support();
454 if (yp[j-1].adjust(
d))
goto next_j;
460 if (xp[
i-1].adjust(
d))
goto next_i;
467 for (
int i=
n;
i--; ) {
472 for (
int j=m; j--; ) {
Post propagator for SetVar x
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
Post propagator for SetVar SetOpType SetVar y
void init(A &a, unsigned int s, bool setbits=false)
Initialize for s bits and allocator a (only after default constructor)
void set(unsigned int i)
Set bit i.
bool reset(Val &d)
Reset iterator to beginning and adjust.
ExecStatus ES_SUBSUMED(Propagator &p)
const Gecode::ModEvent ME_INT_FAILED
Domain operation has resulted in failure.
bool assigned(View x, int v)
Whether x is assigned to value v.
Range iterator for ranges of integer variable implementation.
Backward iterator for ranges of integer variable implementations.
Support-based iterator for negative view.
Base-class for n-ary linear propagators.
const Gecode::ModEvent ME_INT_NONE
Domain operation has not changed domain.
Gecode::IntArgs i(4, 1, 2, 3, 4)
Value iterator for integer views.
bool adjust(Val &d)
Adjust.
static PropCost linear(PropCost::Mod m, unsigned int n)
Linear complexity for modifier pcm and size measure n.
Base-class for both propagators and branchers.
void support(unsigned int i)
Record that there is support at position i.
union Gecode::@579::NNF::@61 u
Union depending on nodetype t.
BitSetStatus status(void) const
Return status of bitset.
int a
Integer coefficient for view.
Val u
Upper bound information for value.
static ExecStatus post(Home home, ViewArray< View > &x, ViewArray< View > &y, Val c)
Post propagator for .
void init(Region &r, unsigned int n)
Initialize support set with cardinality n.
Gecode toplevel namespace
bool reset(Val &d)
Reset iterator to beginning and adjust.
Base-class for support-based iterator.
#define GECODE_ES_CHECK(es)
Check whether execution status es is failed or subsumed, and forward failure or subsumption.
VarImp * varimp(void) const
Return variable implementation of variable.
SupportSet s
Set of support for values in x.
Home class for posting propagators
struct Gecode::@579::NNF::@61::@63 a
For atomic nodes.
Support-based iterator for positive view.
Post propagator for SetVar SetOpType SetVar SetRelType r
void operator++(void)
Move iterator to next value (if possible)
Propagator for domain consistent n-ary linear equality
#define GECODE_NEVER
Assert that this command is never executed.
int ModEvent
Type for modification events.
SupportSet(void)
Default constructor.
bool get(unsigned int i) const
Access value at bit i.
Val l
Lower bound information for value.
@ ES_FIX
Propagation has computed fixpoint.
Integer view for integer variables.
ModEvent tell(Space &home)
Tell back new variable domain according to support found.
bool supported(unsigned int i) const
Check whether position.
void support(void)
Record value at current position as supported.
Set for support information
virtual Actor * copy(Space &home, bool share)
Create copy during cloning.
#define GECODE_ME_CHECK(me)
Check whether modification event me is failed, and forward failure.
Gecode::FloatVal c(-8, 8)
unsigned int p
Position of current value.
@ BSS_SOME
Some but not all bits set.
int n
Number of negative literals for node type.
ExecStatus ES_FIX_PARTIAL(Propagator &p, const ModEventDelta &med)
Propagator p has computed partial fixpoint
DomEq(Space &home, bool share, DomEq &p)
Constructor for cloning p.
const Gecode::PropCond PC_INT_DOM
Propagate when domain changes.
int ModEventDelta
Modification event deltas.
void init(Region &r, int a, const IntView &x, Val l, Val u)
Initialize view.
const Gecode::ModEvent ME_INT_DOM
Domain operation has changed the domain.
bool adjust(Val &d)
Adjust.
@ ES_OK
Execution is okay.
int p
Number of positive literals for node type.
ModEvent tell(Space &home, IntView &x) const
Perform tell according to recorded support information on.
virtual PropCost cost(const Space &home, const ModEventDelta &med) const
Cost function.
static PropCost crazy(PropCost::Mod m, unsigned int n)
Exponential complexity for modifier m and size measure n.