Go to the documentation of this file.
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);
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 =
void pow(Home home, FloatVar x0, int n, FloatVar x1)
Post propagator for for $n\geq 0$.
Post propagator for SetVar x
IntRelType
Relation types for integers.
Post propagator for SetVar SetOpType SetVar y
ArithNonLinIntExpr(ArithNonLinIntExprType t0, int n0, int a0)
Constructor.
void max(Home home, FloatVar x0, FloatVar x1, FloatVar x2)
Post propagator for .
@ ANLE_SQR
Square expression.
int max(void) const
Return maximum of domain.
@ IRT_GQ
Greater or equal ( )
ArithNonLinIntExprType
The expression type.
Passing integer variables.
NonLinIntExpr * nle(void) const
Return non-linear expression inside, or NULL if not non-linear.
void element(Home home, IntSharedArray c, IntVar x0, IntVar x1, IntPropLevel)
Post domain consistent propagator for .
virtual IntVar post(Home home, IntVar *ret, IntPropLevel ipl) const
Post expression.
@ ANLE_ITE
If-then-else expression.
bool assigned(View x, int v)
Whether x is assigned to value v.
void sqr(Home home, FloatVar x0, FloatVar x1)
Post propagator for .
Post propagator for SetVar SetOpType SetVar SetRelType SetVar z
Gecode::IntArgs i(4, 1, 2, 3, 4)
virtual void post(Home home, IntRelType irt, int c, BoolVar b, IntPropLevel ipl) const
Post reified expression to be in relation irt with c.
Linear 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.
IntPropLevel
Propagation levels for integer propagators.
int min(void) const
Return minimum of domain.
bool assigned(void) const
Test whether view is assigned.
ArithNonLinIntExpr(ArithNonLinIntExprType t0, int n0, const BoolExpr &b0)
Constructor.
int aInt
Integer argument (used in nroot for example)
~ArithNonLinIntExpr(void)
Destructor.
@ ANLE_MAX
Maximum expression.
LinIntExpr operator%(const LinIntExpr &e0, const LinIntExpr &e1)
Return expression for .
@ ANLE_MOD
Modulo expression.
void div(Home home, FloatVar x0, FloatVar x1, FloatVar x2)
Post propagator for .
Gecode toplevel namespace
@ ANLE_ABS
Absolute value expression.
FloatVal operator*(const FloatVal &x, const FloatVal &y)
void nroot(Home home, FloatVar x0, int n, FloatVar x1)
Post propagator for for $n\geq 0$.
Home class for posting propagators
struct Gecode::@579::NNF::@61::@63 a
For atomic nodes.
struct Gecode::@579::NNF::@61::@62 b
For binary nodes (and, or, eqv)
void sqrt(Home home, FloatVar x0, FloatVar x1)
Post propagator for .
Boolean integer variables.
@ ANLE_ELMNT
Element expression.
Base class for non-linear expressions over integer variables.
TFE post(PropagatorGroup g)
Only post functions (but not propagators) from g are considered.
Non-linear arithmetic expressions over integer variables.
void mult(Home home, FloatVar x0, FloatVar x1, FloatVar x2)
Post propagator for .
FloatVal operator/(const FloatVal &x, const FloatVal &y)
#define GECODE_NEVER
Assert that this command is never executed.
void abs(Home home, FloatVar x0, FloatVar x1)
Post propagator for .
Heap heap
The single global heap.
@ ANLE_SQRT
Square root expression.
void rel(Home home, FloatVar x0, FloatRelType frt, FloatVal n)
Propagates .
LinIntExpr * a
Expressions.
void mod(Home home, IntVar x0, IntVar x1, IntVar x2, IntPropLevel ipl)
Post propagator for .
void free(T *b, long unsigned int n)
Delete n objects starting at b.
#define GECODE_MINIMODEL_EXPORT
@ ANLE_POW
Pow expression.
BoolExpr b
Boolean expression argument (used in ite for example)
bool hasType(const LinFloatExpr &e, ArithNonLinFloatExpr::ArithNonLinFloatExprType t)
Check if e is of type t.
int val(void) const
Return assigned value.
ArithNonLinIntExpr(ArithNonLinIntExprType t0, int n0)
Constructor.
void ite(Home home, BoolVar b, FloatVar x, FloatVar y, FloatVar z)
Post propagator for if-then-else constraint.
@ ANLE_DIV
Division expression.
void min(Home home, FloatVar x0, FloatVar x1, FloatVar x2)
Post propagator for .
Gecode::FloatVal c(-8, 8)
@ ANLE_MULT
Multiplication expression.
int n
Number of negative literals for node type.
@ ANLE_MIN
Minimum expression.
Passing integer arguments.
int n
Size of variable array.
@ ANLE_NROOT
Nroot expression.
@ IRT_LQ
Less or equal ( )