40 namespace Gecode {
namespace Int {
namespace Arithmetic {
42 template<
class VA,
class VB,
bool tiebreak>
50 template<
class VA,
class VB,
bool tiebreak>
56 }
else if (y.assigned()) {
58 while (x[max].idx < y.val())
60 assert(x[max].idx == y.val());
64 x[
i].view,x[max].view)));
68 x[
i].view,x[max].view)));
69 for (
int i=max+1;
i<x.
size();
i++)
71 x[
i].view,x[max].view)));
78 template<
class VA,
class VB,
bool tiebreak>
86 template<
class VA,
class VB,
bool tiebreak>
92 template<
class VA,
class VB,
bool tiebreak>
98 template<
class VA,
class VB,
bool tiebreak>
105 template<
class VA,
class VB,
bool tiebreak>
115 int l =
x[0].view.min();
116 int u =
x[0].view.max();
118 if (l <
x[
i].view.min()) {
119 p =
x[
i].idx; l =
x[
i].view.min();
121 if (u <
x[
i].view.max())
137 while ((i <
x.
size()) && iy()) {
138 if (
x[i].idx == iy.
val()) {
139 if (
x[i].view.max() <
l) {
147 assert(
x[i].idx < iy.
val());
148 if (
x[i].view.max() <
l) {
157 if (
x[i].view.max() <
l) {
164 if (static_cast<unsigned int>(n) ==
y.size())
181 while (
x[max].idx <
y.val())
183 assert(
x[max].idx ==
y.val());
187 x[
i].view,
x[max].view)));
191 x[
i].view,
x[max].view)));
194 x[
i].view,
x[max].view)));
203 while (
x[i].idx <
y.min())
209 if (
x[i].idx == iy.
val()) {
213 assert(
x[i].idx < iy.
val());
224 while ((i <
x.
size()) && (
x[i].idx <
y.min())) {
229 while ((i <
x.
size()) && (
x[i].idx <
y.min())) {
233 assert(
x[i].idx ==
y.min());
239 while ((i <
x.
size()) && iy()) {
240 if (
x[i].idx == iy.val()) {
243 assert(
x[i].idx < iy.val());
248 while (i <
x.
size()) {
249 assert(
x[i].idx >
y.max());
257 template<
class VA,
class VB,
bool tiebreak>
263 return sizeof(*this);
static ExecStatus post(Home home, IdxViewArray< VA > &x, VB y)
Post propagator .
static PropCost linear(PropCost::Mod m, unsigned int n)
Linear complexity for modifier pcm and size measure n.
ExecStatus ES_SUBSUMED(Propagator &p)
const FloatNum max
Largest allowed float value.
T * alloc(long unsigned int n)
Allocate block of n objects of type T from region.
Value iterator for array of integers
void max(Home home, FloatVar x0, FloatVar x1, FloatVar x2)
Post propagator for .
Base-class for propagators.
void update(Space &home, IdxViewArray< View > &x)
Cloning.
VB y
Position of maximum view (maximal argument)
Value iterator for integer views.
Propagation has computed fixpoint.
int val(void) const
Return current value.
Base-class for both propagators and branchers.
unsigned int id(void) const
Return propagator id.
#define GECODE_ES_CHECK(es)
Check whether execution status es is failed or subsumed, and forward failure or subsumption.
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.
Execution has resulted in failure.
void cancel(Space &home, Propagator &p, PropCond pc)
const Gecode::PropCond PC_INT_BND
Propagate when minimum or maximum of a view changes.
Less or equal propagator.
const Gecode::PropCond PC_INT_DOM
Propagate when domain changes.
virtual void reschedule(Space &home)
Schedule function.
union Gecode::@585::NNF::@62 u
Union depending on nodetype t.
virtual size_t dispose(Space &home)
Delete propagator and return its size.
Argument maximum propagator.
int size(void) const
Return the current size.
virtual Actor * copy(Space &home)
Copy propagator during cloning.
#define GECODE_ME_CHECK(me)
Check whether modification event me is failed, and forward failure.
virtual PropCost cost(const Space &home, const ModEventDelta &med) const
Cost function.
Post propagator for SetVar SetOpType SetVar SetRelType r
TieBreak< VarBranch > tiebreak(VarBranch a, VarBranch b)
Combine variable selection criteria a and b for tie-breaking.
void reschedule(Space &home, Propagator &p, PropCond pc)
Schedule propagator p.
Post propagator for SetVar SetOpType SetVar y
virtual size_t dispose(Space &home)
Delete actor and return its size.
void subscribe(Space &home, Propagator &p, PropCond pc, bool process=true)
IdxViewArray< VA > x
Map of index and views.
Post propagator for SetVar x
Propagation has not computed fixpoint.
ArgMax(Space &home, ArgMax &p)
Constructor for cloning p.
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
Gecode toplevel namespace
int ModEventDelta
Modification event deltas.
Home class for posting propagators