36 namespace Gecode {
namespace MiniModel {
85 y = result(home,ret,x);
94 y = result(home,ret, a[0].
post(home, ipl));
99 y = result(home,ret,x0);
100 else if (x1.
max() <= x0.
min())
101 y = result(home,ret,x1);
103 y = result(home,ret);
104 min(home, x0, x1, y, ipl);
109 x[
i] = a[
i].
post(home, ipl);
110 y = result(home,ret);
111 min(home, x, y, ipl);
116 y = result(home,ret,a[0].
post(home, ipl));
121 y = result(home,ret,x1);
122 else if (x1.
max() <= x0.
min())
123 y = result(home,ret,x0);
125 y = result(home,ret);
126 max(home, x0, x1, y, ipl);
131 x[
i] = a[
i].
post(home, ipl);
132 y = result(home,ret);
133 max(home, x, y, ipl);
142 y = result(home,ret,x0);
144 y = result(home,ret,x1);
146 y = result(home,ret,x1);
148 y = result(home,ret,x0);
150 y = result(home,ret);
151 mult(home, x0, x1, y, ipl);
162 y = result(home,ret,x0);
164 y = result(home,ret,x0);
166 y = result(home,ret);
167 div(home, x0, x1, y, ipl);
176 y = result(home,ret);
177 mod(home, x0, x1, y, ipl);
185 y = result(home,ret,x);
187 y = result(home,ret);
188 sqr(home, x, y, ipl);
197 y = result(home,ret,x);
199 y = result(home,ret);
200 sqrt(home, x, y, ipl);
209 ((x.
val() == 0) || (x.
val() == 1)))
210 y = result(home,ret,x);
212 y = result(home,ret);
213 pow(home, x, aInt, y, ipl);
222 ((x.
val() == 0) || (x.
val() == 1)))
223 y = result(home,ret,x);
225 y = result(home,ret);
226 nroot(home, x, aInt, y, ipl);
234 y = result(home,ret,a[z.
val()].
post(home, ipl));
238 for (
int i=n-1;
i--;) {
239 x[
i] = a[
i].
post(home, ipl);
243 y = result(home,ret);
246 for (
int i=n-1;
i--;)
261 y = result(home,ret);
262 ite(home, c, x0, x1, y, ipl);
272 if ( (t == ANLE_MIN && (irt ==
IRT_GQ || irt ==
IRT_GR)) ||
276 x[
i] = a[
i].
post(home, ipl);
277 rel(home, x, irt, c);
279 rel(home,
post(home,NULL,ipl), irt, c);
284 rel(home,
post(home,NULL,ipl), irt, c, b);
291 dynamic_cast<ArithNonLinIntExpr*>(e.
nle())->t == t;
300 using namespace MiniModel;
303 ArithNonLinIntExpr* ae =
311 using namespace MiniModel;
314 n +=
static_cast<ArithNonLinIntExpr*
>(e0.
nle())->n;
318 n += static_cast<ArithNonLinIntExpr*>(e1.
nle())->n;
321 ArithNonLinIntExpr* ae =
325 ArithNonLinIntExpr* e0e =
static_cast<ArithNonLinIntExpr*
>(e0.
nle());
326 for (; i<e0e->n; i++)
327 ae->
a[i] = e0e->a[i];
332 ArithNonLinIntExpr* e1e =
static_cast<ArithNonLinIntExpr*
>(e1.
nle());
334 for (; i<curN+e1e->n; i++)
335 ae->
a[i] = e1e->a[i-curN];
344 using namespace MiniModel;
347 n +=
static_cast<ArithNonLinIntExpr*
>(e0.
nle())->n;
351 n += static_cast<ArithNonLinIntExpr*>(e1.
nle())->n;
354 ArithNonLinIntExpr* ae =
358 ArithNonLinIntExpr* e0e =
static_cast<ArithNonLinIntExpr*
>(e0.
nle());
359 for (; i<e0e->n; i++)
360 ae->
a[i] = e0e->a[i];
365 ArithNonLinIntExpr* e1e =
static_cast<ArithNonLinIntExpr*
>(e1.
nle());
367 for (; i<curN+e1e->n; i++)
368 ae->
a[i] = e1e->a[i-curN];
377 using namespace MiniModel;
378 ArithNonLinIntExpr* ae =
380 for (
int i=x.
size();
i--;)
387 using namespace MiniModel;
388 ArithNonLinIntExpr* ae =
390 for (
int i=x.
size();
i--;)
397 using namespace MiniModel;
398 ArithNonLinIntExpr* ae =
407 using namespace MiniModel;
408 ArithNonLinIntExpr* ae =
416 using namespace MiniModel;
417 ArithNonLinIntExpr* ae =
425 using namespace MiniModel;
426 ArithNonLinIntExpr* ae =
434 using namespace MiniModel;
435 ArithNonLinIntExpr* ae =
443 using namespace MiniModel;
444 ArithNonLinIntExpr* ae =
453 using namespace MiniModel;
454 ArithNonLinIntExpr* ae =
463 using namespace MiniModel;
464 ArithNonLinIntExpr* ae =
466 for (
int i=x.
size();
i--;)
474 using namespace MiniModel;
475 ArithNonLinIntExpr* ae =
477 for (
int i=x.
size();
i--;)
485 using namespace MiniModel;
486 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 .
int size(void) const
Return size of array (number of elements)
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.
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 .
void post(Home home, IntRelType irt, IntPropLevel ipl) const
Post propagator.
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.
struct Gecode::@585::NNF::@62::@63 b
For binary nodes (and, or, eqv)
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.
struct Gecode::@585::NNF::@62::@64 a
For atomic nodes.
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
BoolVar expr(Home home, IntPropLevel ipl) const
Post propagators for expression.
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.