34namespace Gecode {
namespace Int {
namespace Linear {
59 class ResultIter :
public ViewValues<IntView> {
69 void operator ++(
void);
181 ViewValues<IntView>::operator ++(); ++p;
185 SupportSet::ResultIter::operator ++(
void) {
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>
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--; ) {
418 xp[i].
init(
r,
x[i].scale(),
x[i].base(),
l,
u);
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;
462 bool assigned =
true;
463 for (
int i=0; i<
n; i++) {
465 if (!
x[i].assigned())
468 for (
int j=0; j<m; j++) {
470 if (!
y[j].assigned())
union Gecode::@603::NNF::@65 u
Union depending on nodetype t.
int p
Number of positive literals for node type.
int n
Number of negative literals for node type.
struct Gecode::@603::NNF::@65::@67 a
For atomic nodes.
Base-class for both propagators and branchers.
Home class for posting propagators
Backward iterator for ranges of integer variable implementations.
Range iterator for ranges of integer variable implementation.
Integer view for integer variables.
Propagator for domain consistent n-ary linear equality
virtual PropCost cost(const Space &home, const ModEventDelta &med) const
Cost function.
virtual Actor * copy(Space &home)
Create copy during cloning.
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
DomEq(Space &home, DomEq &p)
Constructor for cloning p.
static ExecStatus post(Home home, ViewArray< View > &x, ViewArray< View > &y, Val c)
Post propagator for .
Base-class for n-ary linear propagators.
Support-based iterator for negative view.
bool adjust(Val &d)
Adjust.
bool reset(Val &d)
Reset iterator to beginning and adjust.
Support-based iterator for positive view.
bool reset(Val &d)
Reset iterator to beginning and adjust.
bool adjust(Val &d)
Adjust.
Base-class for support-based iterator.
void init(Region &r, int a, const IntView &x, Val l, Val u)
Initialize view.
int a
Integer coefficient for view.
Val u
Upper bound information for value.
Val l
Lower bound information for value.
void support(void)
Record value at current position as supported.
unsigned int p
Position of current value.
SupportSet s
Set of support for values in x.
ModEvent tell(Space &home)
Tell back new variable domain according to support found.
Set for support information
bool supported(unsigned int i) const
Check whether position.
ModEvent tell(Space &home, IntView &x) const
Perform tell according to recorded support information on.
SupportSet(void)
Default constructor.
void support(unsigned int i)
Record that there is support at position i.
void init(Region &r, unsigned int n)
Initialize support set with cardinality n.
Value iterator for integer views.
static PropCost crazy(PropCost::Mod m, unsigned int n)
Exponential complexity for modifier m and size measure n.
static PropCost linear(PropCost::Mod m, unsigned int n)
Linear complexity for modifier pcm and size measure n.
BitSetStatus status(void) const
Return status of bitset.
void init(A &a, unsigned int s, bool setbits=false)
Initialize for s bits and allocator a (only after default constructor)
bool get(unsigned int i) const
Access value at bit i.
void set(unsigned int i)
Set bit i.
VarImp * varimp(void) const
Return variable implementation of variable.
ExecStatus ES_FIX_PARTIAL(Propagator &p, const ModEventDelta &med)
Propagator p has computed partial fixpoint
ExecStatus ES_SUBSUMED(Propagator &p)
int ModEventDelta
Modification event deltas.
#define GECODE_ME_CHECK(me)
Check whether modification event me is failed, and forward failure.
#define GECODE_ES_CHECK(es)
Check whether execution status es is failed or subsumed, and forward failure or subsumption.
ExecStatus prop_bnd(Space &home, ModEventDelta med, Propagator &p, ViewArray< P > &x, ViewArray< N > &y, Val &c)
const Gecode::ModEvent ME_INT_FAILED
Domain operation has resulted in failure.
const Gecode::PropCond PC_INT_DOM
Propagate when domain changes.
const Gecode::ModEvent ME_INT_DOM
Domain operation has changed the domain.
const Gecode::ModEvent ME_INT_NONE
Domain operation has not changed domain.
@ BSS_SOME
Some but not all bits set.
Gecode toplevel namespace
Post propagator for SetVar SetOpType SetVar SetRelType r
Post propagator for SetVar SetOpType SetVar y
@ ES_OK
Execution is okay.
@ ES_FIX
Propagation has computed fixpoint.
Post propagator for SetVar x
int ModEvent
Type for modification events.
#define GECODE_NEVER
Assert that this command is never executed.