40 namespace Gecode {
namespace MiniModel {
89 y = result(home,ret,
x);
98 y = result(home,ret,
a[0].
post(home, ipl));
100 IntVar x0 =
a[0].post(home, ipl);
101 IntVar x1 =
a[1].post(home, ipl);
103 y = result(home,ret,x0);
104 else if (x1.
max() <= x0.
min())
105 y = result(home,ret,x1);
107 y = result(home,ret);
108 min(home, x0, x1,
y, ipl);
114 y = result(home,ret);
115 min(home,
x,
y, ipl);
120 y = result(home,ret,
a[0].
post(home, ipl));
122 IntVar x0 =
a[0].post(home, ipl);
123 IntVar x1 =
a[1].post(home, ipl);
125 y = result(home,ret,x1);
126 else if (x1.
max() <= x0.
min())
127 y = result(home,ret,x0);
129 y = result(home,ret);
130 max(home, x0, x1,
y, ipl);
136 y = result(home,ret);
137 max(home,
x,
y, ipl);
143 IntVar x0 =
a[0].post(home, ipl);
144 IntVar x1 =
a[1].post(home, ipl);
146 y = result(home,ret,x0);
148 y = result(home,ret,x1);
150 y = result(home,ret,x1);
152 y = result(home,ret,x0);
154 y = result(home,ret);
155 mult(home, x0, x1,
y, ipl);
162 IntVar x0 =
a[0].post(home, ipl);
163 IntVar x1 =
a[1].post(home, ipl);
166 y = result(home,ret,x0);
168 y = result(home,ret,x0);
170 y = result(home,ret);
171 div(home, x0, x1,
y, ipl);
178 IntVar x0 =
a[0].post(home, ipl);
179 IntVar x1 =
a[1].post(home, ipl);
180 y = result(home,ret);
181 mod(home, x0, x1,
y, ipl);
188 if (
x.
assigned() && ((
x.val() == 0) || (
x.val() == 1)))
189 y = result(home,ret,
x);
191 y = result(home,ret);
192 sqr(home,
x,
y, ipl);
200 if (
x.
assigned() && ((
x.val() == 0) || (
x.val() == 1)))
201 y = result(home,ret,
x);
203 y = result(home,ret);
213 ((
x.val() == 0) || (
x.val() == 1)))
214 y = result(home,ret,
x);
216 y = result(home,ret);
217 pow(home,
x, aInt,
y, ipl);
226 ((
x.val() == 0) || (
x.val() == 1)))
227 y = result(home,ret,
x);
229 y = result(home,ret);
238 y = result(home,ret,
a[
z.val()].post(home, ipl));
242 for (
int i=
n-1;
i--;) {
243 x[
i] =
a[
i].post(home, ipl);
247 y = result(home,ret);
250 for (
int i=
n-1;
i--;)
263 IntVar x0 =
a[0].post(home, ipl);
264 IntVar x1 =
a[1].post(home, ipl);
265 y = result(home,ret);
266 ite(home,
c, x0, x1,
y, ipl);
281 rel(home,
x, irt,
c);
283 rel(home,
post(home,NULL,ipl), irt,
c);
288 rel(home,
post(home,NULL,ipl), irt,
c,
b);
295 dynamic_cast<ArithNonLinIntExpr*>(e.
nle())->
t ==
t;
304 using namespace MiniModel;
307 ArithNonLinIntExpr* ae =
315 using namespace MiniModel;
318 n +=
static_cast<ArithNonLinIntExpr*
>(e0.
nle())->
n;
322 n += static_cast<ArithNonLinIntExpr*>(e1.
nle())->
n;
325 ArithNonLinIntExpr* ae =
329 ArithNonLinIntExpr* e0e =
static_cast<ArithNonLinIntExpr*
>(e0.
nle());
330 for (;
i<e0e->
n;
i++)
331 ae->
a[
i] = e0e->a[
i];
336 ArithNonLinIntExpr* e1e =
static_cast<ArithNonLinIntExpr*
>(e1.
nle());
338 for (;
i<curN+e1e->
n;
i++)
339 ae->
a[
i] = e1e->a[
i-curN];
348 using namespace MiniModel;
351 n +=
static_cast<ArithNonLinIntExpr*
>(e0.
nle())->
n;
355 n += static_cast<ArithNonLinIntExpr*>(e1.
nle())->
n;
358 ArithNonLinIntExpr* ae =
362 ArithNonLinIntExpr* e0e =
static_cast<ArithNonLinIntExpr*
>(e0.
nle());
363 for (;
i<e0e->
n;
i++)
364 ae->
a[
i] = e0e->a[
i];
369 ArithNonLinIntExpr* e1e =
static_cast<ArithNonLinIntExpr*
>(e1.
nle());
371 for (;
i<curN+e1e->
n;
i++)
372 ae->
a[
i] = e1e->a[
i-curN];
381 using namespace MiniModel;
382 ArithNonLinIntExpr* ae =
384 for (
int i=
x.size();
i--;)
391 using namespace MiniModel;
392 ArithNonLinIntExpr* ae =
394 for (
int i=
x.size();
i--;)
401 using namespace MiniModel;
402 ArithNonLinIntExpr* ae =
411 using namespace MiniModel;
412 ArithNonLinIntExpr* ae =
420 using namespace MiniModel;
421 ArithNonLinIntExpr* ae =
429 using namespace MiniModel;
430 ArithNonLinIntExpr* ae =
438 using namespace MiniModel;
439 ArithNonLinIntExpr* ae =
447 using namespace MiniModel;
448 ArithNonLinIntExpr* ae =
457 using namespace MiniModel;
458 ArithNonLinIntExpr* ae =
467 using namespace MiniModel;
468 ArithNonLinIntExpr* ae =
470 for (
int i=
x.size();
i--;)
478 using namespace MiniModel;
479 ArithNonLinIntExpr* ae =
481 for (
int i=
x.size();
i--;)
489 using namespace MiniModel;
490 ArithNonLinIntExpr* ae =
Multiplication expression.
void mod(Home home, IntVar x0, IntVar x1, IntVar x2, IntPropLevel ipl)
Post propagator for .
ArithNonLinIntExprType
The expression type.
int n
Size of variable array.
~ArithNonLinIntExpr(void)
Destructor.
void mult(Home home, FloatVar x0, FloatVar x1, FloatVar x2)
Post propagator for .
virtual void post(Home home, IntRelType irt, int c, BoolVar b, IntPropLevel ipl) const
Post reified expression to be in relation irt with c.
FloatVal operator/(const FloatVal &x, const FloatVal &y)
void max(Home home, FloatVar x0, FloatVar x1, FloatVar x2)
Post propagator for .
void abs(Home home, FloatVar x0, FloatVar x1)
Post propagator for .
bool assigned(void) const
Test whether view is assigned.
void nroot(Home home, FloatVar x0, int n, FloatVar x1)
Post propagator for for $n 0$.
ArithNonLinIntExpr(ArithNonLinIntExprType t0, int n0, const BoolExpr &b0)
Constructor.
void pow(Home home, FloatVar x0, int n, FloatVar x1)
Post propagator for for $n 0$.
Base class for non-linear expressions over integer variables.
virtual IntVar post(Home home, IntVar *ret, IntPropLevel ipl) const
Post expression.
int aInt
Integer argument (used in nroot for example)
Non-linear arithmetic expressions over integer variables.
virtual void post(Home home, IntRelType irt, int c, IntPropLevel ipl) const
Post expression to be in relation irt with c.
bool hasType(const LinFloatExpr &e, ArithNonLinFloatExpr::ArithNonLinFloatExprType t)
Check if e is of type t.
struct Gecode::@579::NNF::@61::@63 a
For atomic nodes.
Gecode::FloatVal c(-8, 8)
Absolute value expression.
Gecode::IntArgs i(4, 1, 2, 3, 4)
int n
Number of negative literals for node type.
BoolExpr b
Boolean expression argument (used in ite for example)
IntRelType
Relation types for integers.
LinIntExpr * a
Expressions.
ArithNonLinIntExpr(ArithNonLinIntExprType t0, int n0)
Constructor.
void sqr(Home home, FloatVar x0, FloatVar x1)
Post propagator for .
int val(void) const
Return assigned value.
void sqrt(Home home, FloatVar x0, FloatVar x1)
Post propagator for .
struct Gecode::@579::NNF::@61::@62 b
For binary nodes (and, or, eqv)
Post propagator for SetVar SetOpType SetVar SetRelType SetVar z
Passing integer variables.
Passing integer arguments.
Boolean integer variables.
void min(Home home, FloatVar x0, FloatVar x1, FloatVar x2)
Post propagator for .
int max(void) const
Return maximum of domain.
IntPropLevel
Propagation levels for integer propagators.
Post propagator for SetVar SetOpType SetVar y
void div(Home home, FloatVar x0, FloatVar x1, FloatVar x2)
Post propagator for .
FloatVal operator*(const FloatVal &x, const FloatVal &y)
void free(T *b, long unsigned int n)
Delete n objects starting at b.
Linear expressions over integer variables.
int min(void) const
Return minimum of domain.
Heap heap
The single global heap.
bool assigned(View x, int v)
Whether x is assigned to value v.
void rel(Home home, FloatVar x0, FloatRelType frt, FloatVal n)
Propagates .
NonLinIntExpr * nle(void) const
Return non-linear expression inside, or NULL if not non-linear.
Post propagator for SetVar x
LinIntExpr operator%(const LinIntExpr &e0, const LinIntExpr &e1)
Return expression for .
#define GECODE_MINIMODEL_EXPORT
ArithNonLinIntExpr(ArithNonLinIntExprType t0, int n0, int a0)
Constructor.
Gecode toplevel namespace
Home class for posting propagators
#define GECODE_NEVER
Assert that this command is never executed.
void ite(Home home, BoolVar b, FloatVar x, FloatVar y, FloatVar z)
Post propagator for if-then-else constraint.
void element(Home home, IntSharedArray c, IntVar x0, IntVar x1, IntPropLevel)
Post domain consistent propagator for .
TFE post(PropagatorGroup g)
Only post functions (but not propagators) from g are considered.