Go to the documentation of this file.
34 namespace Gecode {
namespace Int {
namespace Linear {
59 class ResultIter :
public ViewValues<IntView> {
69 void operator ++(
void);
185 SupportSet::ResultIter::operator ++(
void) {
188 }
while (ViewValues<IntView>::operator ()() && s.supported(
p));
201 ResultIter
i(*
this,
x);
202 return x.minus_v(home,
i);
218 int a0,
const IntView& x0, Val l0, Val u0) {
219 a=a0;
x=x0;
l=l0;
u=u0;
230 return s.tell(home,
x);
242 if (
d +
static_cast<Val
>(
a)*
x.max() <
u)
247 while (
d +
static_cast<Val
>(
a)*
i.max() <
u) {
255 while (
d +
static_cast<Val
>(
a)*
c <
u) {
259 d +=
static_cast<Val
>(
a) *
c;
266 Val
v =
static_cast<Val
>(
a) *
c;
280 c =
i.min();
v =
static_cast<Val
>(
a) *
c;
299 if (
d +
static_cast<Val
>(
a)*
x.min() <
u)
304 while (
d +
static_cast<Val
>(
a)*
i.min() <
u) {
312 while (
d +
static_cast<Val
>(
a)*
c <
u) {
316 d +=
static_cast<Val
>(
a) *
c;
323 Val
v =
static_cast<Val
>(
a) *
c;
337 c =
i.max();
v =
static_cast<Val
>(
a) *
c;
353 template<
class Val,
class View>
360 template<
class Val,
class View>
369 template<
class Val,
class View>
374 template<
class Val,
class View>
380 template<
class Val,
class View>
389 template<
class Val,
class View>
393 ExecStatus es = prop_bnd<Val,View,View>(home,med,*
this,
x,
y,
c);
413 for (
int j=m; j--; ) {
414 yp[j].
init(
r,-
y[j].scale(),
y[j].base(),
l,
u);
415 l +=
y[j].max();
u +=
y[j].min();
417 for (
int i=
n;
i--; ) {
419 l -=
x[
i].min();
u -=
x[
i].max();
432 if (!xp[
i].reset(
d))
goto prev_i;
438 if (!yp[j].reset(
d))
goto prev_j;
444 for (
int is=0; is<
n; is++) xp[is].support();
445 for (
int js=0; js<m; js++) yp[js].support();
450 if (yp[j-1].adjust(
d))
goto next_j;
456 if (xp[
i-1].adjust(
d))
goto next_i;
463 for (
int i=0;
i<
n;
i++) {
468 for (
int j=0; 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.
virtual Actor * copy(Space &home)
Create copy during cloning.
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.
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.
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.
union Gecode::@602::NNF::@65 u
Union depending on nodetype t.
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
DomEq(Space &home, DomEq &p)
Constructor for cloning p.
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.
struct Gecode::@602::NNF::@65::@67 a
For atomic nodes.
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
#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
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.
Gecode::IntArgs i({1, 2, 3, 4})
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.