34 namespace Gecode {
namespace Int {
namespace Linear {
59 class ResultIter :
public ViewValues<IntView> {
69 void operator ++(
void);
185 SupportSet::ResultIter::operator ++(
void) {
194 switch (bs.status()) {
201 ResultIter
i(*
this,x);
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>
395 return home.ES_FIX_PARTIAL(*
this,View::med(
ME_INT_DOM));
413 for (
int j=m; j--; ) {
415 l +=
y[j].max(); u +=
y[j].min();
417 for (
int i=n;
i--; ) {
432 if (!xp[i].reset(d))
goto prev_i;
438 if (!yp[j].reset(d))
goto prev_j;
444 for (
int is=n; is--; ) xp[is].support();
445 for (
int 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=n;
i--; ) {
468 for (
int j=m; j--; ) {
bool reset(Val &d)
Reset iterator to beginning and adjust.
Val u
Upper bound information for value.
unsigned int p
Position of current value.
SupportSet(void)
Default constructor.
Some but not all bits set.
static PropCost linear(PropCost::Mod m, unsigned int n)
Linear complexity for modifier pcm and size measure n.
ViewArray< View > y
Array of negative views.
ExecStatus ES_SUBSUMED(Propagator &p)
T * alloc(long unsigned int n)
Allocate block of n objects of type T from region.
Propagator for domain consistent n-ary linear equality
bool adjust(Val &d)
Adjust.
int ModEvent
Type for modification events.
void varimp(VarImpType *y)
Set variable implementation to y.
unsigned int size(void) const
Return size (cardinality) of domain.
Val l
Lower bound information for value.
Set for support information
Value iterator for integer views.
Base-class for n-ary linear propagators.
Propagation has computed fixpoint.
SupportSet s
Set of support for values in x.
bool reset(Val &d)
Reset iterator to beginning and adjust.
Base-class for both propagators and branchers.
ModEvent minus_v(Space &home, I &i, bool depends=true)
Remove from domain the values described by i.
void operator++(void)
Move iterator to next value (if possible)
ViewArray< View > x
Array of positive views.
const Gecode::ModEvent ME_INT_FAILED
Domain operation has resulted in failure.
#define GECODE_ES_CHECK(es)
Check whether execution status es is failed or subsumed, and forward failure or subsumption.
Gecode::FloatVal c(-8, 8)
Base-class for support-based iterator.
int p
Number of positive literals for node type.
Gecode::IntArgs i(4, 1, 2, 3, 4)
int n
Number of negative literals for node type.
ModEventDelta med
A set of modification events (used during propagation)
Range iterator for ranges of integer variable implementation.
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
const Gecode::PropCond PC_INT_DOM
Propagate when domain changes.
Backward iterator for ranges of integer variable implementations.
int min(void) const
Return minimum of domain.
ModEvent tell(Space &home)
Tell back new variable domain according to support found.
Support-based iterator for negative view.
union Gecode::@585::NNF::@62 u
Union depending on nodetype t.
ModEvent tell(Space &home, IntView &x) const
Perform tell according to recorded support information on.
#define GECODE_ME_CHECK(me)
Check whether modification event me is failed, and forward failure.
void support(unsigned int i)
Record that there is support at position i.
static ExecStatus post(Home home, ViewArray< View > &x, ViewArray< View > &y, Val c)
Post propagator for .
Post propagator for SetVar SetOpType SetVar SetRelType r
DomEq(Space &home, DomEq &p)
Constructor for cloning p.
Integer view for integer variables.
void init(Region &r, unsigned int n)
Initialize support set with cardinality n.
Post propagator for SetVar SetOpType SetVar y
const double base
Base for geometric restart sequence.
struct Gecode::@585::NNF::@62::@64 a
For atomic nodes.
virtual PropCost cost(const Space &home, const ModEventDelta &med) const
Cost function.
const Gecode::ModEvent ME_INT_DOM
Domain operation has changed the domain.
bool assigned(View x, int v)
Whether x is assigned to value v.
int a
Integer coefficient for view.
static PropCost crazy(PropCost::Mod m, unsigned int n)
Exponential complexity for modifier m and size measure n.
bool supported(unsigned int i) const
Check whether position.
void init(Region &r, int a, const IntView &x, Val l, Val u)
Initialize view.
Post propagator for SetVar x
Support-based iterator for positive view.
virtual Actor * copy(Space &home)
Create copy during cloning.
void support(void)
Record value at current position as supported.
Gecode toplevel namespace
int max(void) const
Return maximum of domain.
int ModEventDelta
Modification event deltas.
Home class for posting propagators
#define GECODE_NEVER
Assert that this command is never executed.
const Gecode::ModEvent ME_INT_NONE
Domain operation has not changed domain.
bool adjust(Val &d)
Adjust.