40 namespace Gecode {
namespace MiniModel {
89 y = result(home,ret,
x);
98 y = result(home,ret,
a[0].
post(home, icl));
100 IntVar x0 =
a[0].post(home, icl);
101 IntVar x1 =
a[1].post(home, icl);
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, icl);
114 y = result(home,ret);
115 min(home,
x, y, icl);
120 y = result(home,ret,
a[0].
post(home, icl));
122 IntVar x0 =
a[0].post(home, icl);
123 IntVar x1 =
a[1].post(home, icl);
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, icl);
136 y = result(home,ret);
137 max(home,
x, y, icl);
143 IntVar x0 =
a[0].post(home, icl);
144 IntVar x1 =
a[1].post(home, icl);
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, icl);
162 IntVar x0 =
a[0].post(home, icl);
163 IntVar x1 =
a[1].post(home, icl);
166 y = result(home,ret,x0);
168 y = result(home,ret,x0);
170 y = result(home,ret);
171 div(home, x0, x1, y, icl);
178 IntVar x0 =
a[0].post(home, icl);
179 IntVar x1 =
a[1].post(home, icl);
180 y = result(home,ret);
181 mod(home, x0, x1, y, icl);
188 if (
x.assigned() && ((
x.val() == 0) || (
x.val() == 1)))
191 y = result(home,ret);
192 sqr(home,
x, y, icl);
200 if (
x.assigned() && ((
x.val() == 0) || (
x.val() == 1)))
201 y = result(home,ret,
x);
203 y = result(home,ret);
204 sqrt(home,
x, y, icl);
212 if (
x.assigned() && (aInt > 0) &&
213 ((
x.val() == 0) || (
x.val() == 1)))
216 y = result(home,ret);
217 pow(home,
x, aInt, y, icl);
225 if (
x.assigned() && (aInt > 0) &&
226 ((
x.val() == 0) || (
x.val() == 1)))
227 y = result(home,ret,
x);
229 y = result(home,ret);
230 nroot(home,
x, aInt, y, icl);
238 y = result(home,ret,
a[z.
val()].post(home, icl));
242 for (
int i=
n-1;
i--;) {
243 x[
i] =
a[
i].post(home, icl);
247 y = result(home,ret);
250 for (
int i=
n-1;
i--;)
263 IntVar x0 =
a[0].post(home, icl);
264 IntVar x1 =
a[1].post(home, icl);
265 y = result(home,ret);
266 ite(home,
c, x0, x1, y, icl);
281 rel(home,
x, irt,
c);
283 rel(home,
post(home,NULL,icl), irt,
c);
288 rel(home,
post(home,NULL,icl), irt,
c,
b);
294 dynamic_cast<ArithNonLinIntExpr*>(e.
nle()) != NULL &&
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.
ArithNonLinIntExprType
The expression type.
int n
Size of variable array.
~ArithNonLinIntExpr(void)
Destructor.
IntConLevel
Consistency levels for integer propagators.
void mult(Home home, FloatVar x0, FloatVar x1, FloatVar x2)
Post propagator for .
void mod(Home home, IntVar x0, IntVar x1, IntVar x2, IntConLevel icl)
Post propagator for .
void post(Home home, Term *t, int n, FloatRelType frt, FloatVal c)
Post propagator for linear constraint over floats.
FloatVal operator *(const FloatVal &x, const FloatVal &y)
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\geq 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\geq 0$.
struct Gecode::@511::NNF::@54::@55 b
For binary nodes (and, or, eqv)
Base class for non-linear expressions over integer variables.
int aInt
Integer argument (used in nroot for example)
Non-linear arithmetic expressions over integer variables.
Heap heap
The single global heap.
bool hasType(const LinFloatExpr &e, ArithNonLinFloatExpr::ArithNonLinFloatExprType t)
Check if e is of type t.
Gecode::FloatVal c(-8, 8)
virtual IntVar post(Home home, IntVar *ret, IntConLevel icl) const
Post expression.
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 .
virtual void post(Home home, IntRelType irt, int c, BoolVar b, IntConLevel icl) const
Post reified expression to be in relation irt with c.
void element(Home home, IntSharedArray c, IntVar x0, IntVar x1, IntConLevel)
Post domain consistent propagator for .
Passing integer variables.
void ite(Home home, BoolVar b, IntVar x, IntVar y, IntVar z, IntConLevel icl)
Post propagator for if-then-else constraint.
Passing integer arguments.
struct Gecode::@511::NNF::@54::@56 a
For atomic nodes.
Boolean integer variables.
void min(Home home, FloatVar x0, FloatVar x1, FloatVar x2)
Post propagator for .
int max(void) const
Return maximum of domain.
void div(Home home, FloatVar x0, FloatVar x1, FloatVar x2)
Post propagator for .
void free(T *b, long unsigned int n)
Delete n objects starting at b.
Node * x
Pointer to corresponding Boolean expression node.
Linear expressions over integer variables.
int min(void) const
Return minimum of domain.
virtual void post(Home home, IntRelType irt, int c, IntConLevel icl) const
Post expression to be in relation irt with c.
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.
#define GECODE_MINIMODEL_EXPORT
ArithNonLinIntExpr(ArithNonLinIntExprType t0, int n0, int a0)
Constructor.
LinIntExpr operator %(const LinIntExpr &e0, const LinIntExpr &e1)
Return expression for .
Gecode toplevel namespace
Home class for posting propagators
#define GECODE_NEVER
Assert that this command is never executed.