42 #ifdef GECODE_HAS_FLOAT_VARS 44 namespace Gecode {
namespace MiniModel {
59 #ifdef GECODE_HAS_MPFR 93 y = result(home,ret,
x);
102 y = result(home,ret,
a[0].
post(home));
107 y = result(home,ret,x0);
108 else if (x1.
max() <= x0.
min())
109 y = result(home,ret,x1);
111 y = result(home,ret);
112 min(home, x0, x1,
y);
118 y = result(home,ret);
124 y = result(home,ret,
a[0].
post(home));
129 y = result(home,ret,x1);
130 else if (x1.
max() <= x0.
min())
131 y = result(home,ret,x0);
133 y = result(home,ret);
134 max(home, x0, x1,
y);
140 y = result(home,ret);
150 y = result(home,ret,x0);
152 y = result(home,ret,x1);
154 y = result(home,ret,x1);
156 y = result(home,ret,x0);
158 y = result(home,ret);
159 mult(home, x0, x1,
y);
169 y = result(home,ret,x0);
171 y = result(home,ret,x0);
173 y = result(home,ret);
174 div(home, x0, x1,
y);
182 if (
x.
assigned() && ((
x.val() == 0.0) || (
x.val() == 1.0)))
185 y = result(home,ret);
194 if (
x.
assigned() && ((
x.val() == 0.0) || (
x.val() == 1.0)))
195 y = result(home,ret,
x);
197 y = result(home,ret);
206 if (
x.
assigned() && ((
x.val() == 0.0) || (
x.val() == 1.0)))
207 y = result(home,ret,
x);
209 y = result(home,ret);
210 pow(home,
x, aInt,
y);
218 if (
x.
assigned() && ((
x.val() == 0.0) || (
x.val() == 1.0)))
219 y = result(home,ret,
x);
221 y = result(home,ret);
226 #ifdef GECODE_HAS_MPFR 232 y = result(home,ret,
x);
234 y = result(home,ret);
243 y = result(home,ret);
251 y = result(home,ret);
259 y = result(home,ret);
267 y = result(home,ret);
275 y = result(home,ret);
283 y = result(home,ret);
291 y = result(home,ret);
302 if ((
t == ANLFE_MIN && frt ==
FRT_GQ) ||
303 (
t == ANLFE_MAX && frt ==
FRT_LQ)) {
307 rel(home,
x, frt,
c);
320 dynamic_cast<ArithNonLinFloatExpr*>(e.
nlfe()) != NULL &&
321 dynamic_cast<ArithNonLinFloatExpr*>(e.
nlfe())->
t ==
t;
330 using namespace MiniModel;
333 ArithNonLinFloatExpr* ae =
341 using namespace MiniModel;
344 n += static_cast<ArithNonLinFloatExpr*>(e0.
nlfe())->
n;
348 n += static_cast<ArithNonLinFloatExpr*>(e1.
nlfe())->
n;
351 ArithNonLinFloatExpr* ae =
355 ArithNonLinFloatExpr* e0e = static_cast<ArithNonLinFloatExpr*>(e0.
nlfe());
356 for (;
i<e0e->
n;
i++)
357 ae->
a[
i] = e0e->a[
i];
362 ArithNonLinFloatExpr* e1e = static_cast<ArithNonLinFloatExpr*>(e1.
nlfe());
364 for (;
i<curN+e1e->
n;
i++)
365 ae->
a[
i] = e1e->a[
i-curN];
374 using namespace MiniModel;
375 ArithNonLinFloatExpr* ae =
377 for (
int i=
x.size();
i--;)
384 using namespace MiniModel;
387 n += static_cast<ArithNonLinFloatExpr*>(e0.
nlfe())->
n;
391 n += static_cast<ArithNonLinFloatExpr*>(e1.
nlfe())->
n;
394 ArithNonLinFloatExpr* ae =
398 ArithNonLinFloatExpr* e0e = static_cast<ArithNonLinFloatExpr*>(e0.
nlfe());
399 for (;
i<e0e->
n;
i++)
400 ae->
a[
i] = e0e->a[
i];
405 ArithNonLinFloatExpr* e1e = static_cast<ArithNonLinFloatExpr*>(e1.
nlfe());
407 for (;
i<curN+e1e->
n;
i++)
408 ae->
a[
i] = e1e->a[
i-curN];
417 using namespace MiniModel;
418 ArithNonLinFloatExpr* ae =
420 for (
int i=
x.size();
i--;)
427 using namespace MiniModel;
428 ArithNonLinFloatExpr* ae =
437 using namespace MiniModel;
438 ArithNonLinFloatExpr* ae =
447 using namespace MiniModel;
448 ArithNonLinFloatExpr* ae =
457 using namespace MiniModel;
458 ArithNonLinFloatExpr* ae =
467 using namespace MiniModel;
468 ArithNonLinFloatExpr* ae =
477 using namespace MiniModel;
478 ArithNonLinFloatExpr* ae =
486 using namespace MiniModel;
487 ArithNonLinFloatExpr* ae =
495 using namespace MiniModel;
496 ArithNonLinFloatExpr* ae =
504 using namespace MiniModel;
505 ArithNonLinFloatExpr* ae =
511 #ifdef GECODE_HAS_MPFR 515 using namespace MiniModel;
516 ArithNonLinFloatExpr* ae =
524 using namespace MiniModel;
525 ArithNonLinFloatExpr* ae =
533 using namespace MiniModel;
534 ArithNonLinFloatExpr* ae =
542 using namespace MiniModel;
543 ArithNonLinFloatExpr* ae =
551 using namespace MiniModel;
552 ArithNonLinFloatExpr* ae =
560 using namespace MiniModel;
561 ArithNonLinFloatExpr* ae =
569 using namespace MiniModel;
570 ArithNonLinFloatExpr* ae =
578 using namespace MiniModel;
579 ArithNonLinFloatExpr* ae =
void mult(Home home, FloatVar x0, FloatVar x1, FloatVar x2)
Post propagator for .
ArithNonLinFloatExprType
The expression type.
ArithNonLinFloatExpr(ArithNonLinFloatExprType t0, int n0, int a0)
void log(Home home, FloatVar x0, FloatVar x1)
Post propagator for .
FloatVal operator/(const FloatVal &x, const FloatVal &y)
FloatNum max(void) const
Return maximum of domain.
void max(Home home, FloatVar x0, FloatVar x1, FloatVar x2)
Post propagator for .
void abs(Home home, FloatVar x0, FloatVar x1)
Post propagator for .
ArithNonLinFloatExpr(ArithNonLinFloatExprType t0, int n0)
Constructors.
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$.
int aInt
Integer argument (used in nroot for example)
void pow(Home home, FloatVar x0, int n, FloatVar x1)
Post propagator for for $n\geq 0$.
Non-linear float arithmetic expressions.
Multiplication expression.
FloatVal val(void) const
Return assigned value.
Logarithm root expression.
bool hasType(const LinFloatExpr &e, ArithNonLinFloatExpr::ArithNonLinFloatExprType t)
Check if e is of type t.
FloatNum min(void) const
Return minimum of domain.
struct Gecode::@579::NNF::@61::@63 a
For atomic nodes.
Gecode::FloatVal c(-8, 8)
Gecode::IntArgs i(4, 1, 2, 3, 4)
int n
Number of negative literals for node type.
Base class for non-linear float expressions.
void sqr(Home home, FloatVar x0, FloatVar x1)
Post propagator for .
FloatRelType
Relation types for floats.
virtual void post(Home home, FloatRelType frt, FloatVal c) const
Post expression to be in relation frt with c.
void sqrt(Home home, FloatVar x0, FloatVar x1)
Post propagator for .
struct Gecode::@579::NNF::@61::@62 b
For binary nodes (and, or, eqv)
Absolute value expression.
void asin(Home home, FloatVar x0, FloatVar x1)
Post propagator for .
Boolean integer variables.
LinFloatExpr * a
Expressions.
void min(Home home, FloatVar x0, FloatVar x1, FloatVar x2)
Post propagator for .
void cos(Home home, FloatVar x0, FloatVar x1)
Post propagator for .
virtual FloatVar post(Home home, FloatVar *ret) const
Post expression.
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.
void tan(Home home, FloatVar x0, FloatVar x1)
Post propagator for .
~ArithNonLinFloatExpr(void)
Destructor.
Heap heap
The single global heap.
void rel(Home home, FloatVar x0, FloatRelType frt, FloatVal n)
Propagates .
Post propagator for SetVar x
#define GECODE_MINIMODEL_EXPORT
Gecode toplevel namespace
void sin(Home home, FloatVar x0, FloatVar x1)
Post propagator for .
NonLinFloatExpr * nlfe(void) const
Return non-linear expression inside, or NULL if not non-linear.
void acos(Home home, FloatVar x0, FloatVar x1)
Post propagator for .
void exp(Home home, FloatVar x0, FloatVar x1)
Post propagator for .
Home class for posting propagators
#define GECODE_NEVER
Assert that this command is never executed.
void atan(Home home, FloatVar x0, FloatVar x1)
Post propagator for .
int n
Size of variable array.
TFE post(PropagatorGroup g)
Only post functions (but not propagators) from g are considered.
virtual void post(Home home, FloatRelType frt, FloatVal c, BoolVar b) const
Post reified expression to be in relation frt with c.