40 namespace Gecode {
namespace MiniModel {
89 y = result(home,ret,x);
98 y = result(home,ret, a[0].
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);
113 x[
i] = a[
i].
post(home, icl);
114 y = result(home,ret);
115 min(home, x, y, icl);
120 y = result(home,ret,a[0].
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);
135 x[
i] = a[
i].
post(home, icl);
136 y = result(home,ret);
137 max(home, x, y, 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);
166 y = result(home,ret,x0);
168 y = result(home,ret,x0);
170 y = result(home,ret);
171 div(home, x0, x1, y, icl);
180 y = result(home,ret);
181 mod(home, x0, x1, y, icl);
191 y = result(home,ret);
192 sqr(home, x, y, icl);
201 y = result(home,ret,x);
203 y = result(home,ret);
204 sqrt(home, x, y, icl);
213 ((x.
val() == 0) || (x.
val() == 1)))
216 y = result(home,ret);
217 pow(home, x, aInt, y, icl);
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--;)
265 y = result(home,ret);
266 ite(home, c, x0, x1, y, icl);
280 x[
i] = a[
i].
post(home, 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);
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.
int max(void) const
Return maximum of domain.
FloatVal operator/(const FloatVal &x, const FloatVal &y)
int size(void) const
Return size of array (number of elements)
void max(Home home, FloatVar x0, FloatVar x1, FloatVar x2)
Post propagator for .
void abs(Home home, FloatVar x0, FloatVar x1)
Post propagator for .
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 void post(Home home, IntRelType irt, int c, BoolVar b, IntConLevel icl) const
Post reified expression to be in relation irt with c.
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)
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 .
void sqrt(Home home, FloatVar x0, FloatVar x1)
Post propagator for .
void element(Home home, IntSharedArray c, IntVar x0, IntVar x1, IntConLevel)
Post domain consistent propagator for .
BoolVar expr(Home home, IntConLevel icl) const
Post propagators for expression.
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.
Boolean integer variables.
void min(Home home, FloatVar x0, FloatVar x1, FloatVar x2)
Post propagator for .
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.
Node * x
Pointer to corresponding Boolean expression node.
Linear expressions over integer variables.
bool assigned(View x, int v)
Whether x is assigned to value v.
void rel(Home home, FloatVar x0, FloatRelType frt, FloatVal n)
Propagates .
virtual void post(Home home, IntRelType irt, int c, IntConLevel icl) const
Post expression to be in relation irt with c.
NonLinIntExpr * nle(void) const
Return non-linear expression inside, or NULL if not non-linear.
int val(void) const
Return assigned value.
LinIntExpr operator%(const LinIntExpr &e0, const LinIntExpr &e1)
Return expression for .
#define GECODE_MINIMODEL_EXPORT
ArithNonLinIntExpr(ArithNonLinIntExprType t0, int n0, int a0)
Constructor.
bool assigned(void) const
Test whether view is assigned.
struct Gecode::@518::NNF::@57::@58 b
For binary nodes (and, or, eqv)
Gecode toplevel namespace
int min(void) const
Return minimum of domain.
Home class for posting propagators
#define GECODE_NEVER
Assert that this command is never executed.
struct Gecode::@518::NNF::@57::@59 a
For atomic nodes.
virtual IntVar post(Home home, IntVar *ret, IntConLevel icl) const
Post expression.
void post(Home home, IntRelType irt, IntConLevel icl) const
Post propagator.