Go to the documentation of this file.
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);
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 =
~ArithNonLinFloatExpr(void)
Destructor.
void pow(Home home, FloatVar x0, int n, FloatVar x1)
Post propagator for for $n\geq 0$.
Post propagator for SetVar x
@ ANLFE_SQRT
Square root expression.
Post propagator for SetVar SetOpType SetVar y
void max(Home home, FloatVar x0, FloatVar x1, FloatVar x2)
Post propagator for .
ArithNonLinFloatExpr(ArithNonLinFloatExprType t0, int n0)
Constructors.
FloatVal val(void) const
Return assigned value.
void log(Home home, FloatVar x0, FloatVar x1)
Post propagator for .
void sqr(Home home, FloatVar x0, FloatVar x1)
Post propagator for .
Gecode::IntArgs i(4, 1, 2, 3, 4)
void sin(Home home, FloatVar x0, FloatVar x1)
Post propagator for .
virtual void post(Home home, FloatRelType frt, FloatVal c) const
Post expression to be in relation frt with c.
FloatRelType
Relation types for floats.
@ ANLFE_LOG
Logarithm root expression.
bool assigned(void) const
Test whether view is assigned.
@ ANLFE_EXP
Exponential expression.
FloatNum max(void) const
Return maximum of domain.
void acos(Home home, FloatVar x0, FloatVar x1)
Post propagator for .
@ ANLFE_POW
Pow expression.
void div(Home home, FloatVar x0, FloatVar x1, FloatVar x2)
Post propagator for .
@ ANLFE_SQR
Square expression.
Gecode toplevel namespace
FloatVal operator*(const FloatVal &x, const FloatVal &y)
ArithNonLinFloatExprType
The expression type.
NonLinFloatExpr * nlfe(void) const
Return non-linear expression inside, or NULL if not non-linear.
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)
int n
Size of variable array.
void sqrt(Home home, FloatVar x0, FloatVar x1)
Post propagator for .
Boolean integer variables.
void tan(Home home, FloatVar x0, FloatVar x1)
Post propagator for .
TFE post(PropagatorGroup g)
Only post functions (but not propagators) from g are considered.
void mult(Home home, FloatVar x0, FloatVar x1, FloatVar x2)
Post propagator for .
FloatNum min(void) const
Return minimum of domain.
FloatVal operator/(const FloatVal &x, const FloatVal &y)
virtual void post(Home home, FloatRelType frt, FloatVal c, BoolVar b) const
Post reified expression to be in relation frt with c.
@ ANLFE_ABS
Absolute value expression.
@ FRT_LQ
Less or equal ( )
virtual FloatVar post(Home home, FloatVar *ret) const
Post expression.
#define GECODE_NEVER
Assert that this command is never executed.
ArithNonLinFloatExpr(ArithNonLinFloatExprType t0, int n0, int a0)
void abs(Home home, FloatVar x0, FloatVar x1)
Post propagator for .
Heap heap
The single global heap.
@ ANLFE_MAX
Maximum expression.
int aInt
Integer argument (used in nroot for example)
@ ANLFE_DIV
Division expression.
void rel(Home home, FloatVar x0, FloatRelType frt, FloatVal n)
Propagates .
@ FRT_GQ
Greater or equal ( )
void free(T *b, long unsigned int n)
Delete n objects starting at b.
Non-linear float arithmetic expressions.
#define GECODE_MINIMODEL_EXPORT
LinFloatExpr * a
Expressions.
@ ANLFE_MIN
Minimum expression.
Base class for non-linear float expressions.
bool hasType(const LinFloatExpr &e, ArithNonLinFloatExpr::ArithNonLinFloatExprType t)
Check if e is of type t.
@ ANLFE_MULT
Multiplication expression.
void asin(Home home, FloatVar x0, FloatVar x1)
Post propagator for .
void min(Home home, FloatVar x0, FloatVar x1, FloatVar x2)
Post propagator for .
void atan(Home home, FloatVar x0, FloatVar x1)
Post propagator for .
Gecode::FloatVal c(-8, 8)
void exp(Home home, FloatVar x0, FloatVar x1)
Post propagator for .
int n
Number of negative literals for node type.
@ ANLFE_NROOT
Nth root expression.
void cos(Home home, FloatVar x0, FloatVar x1)
Post propagator for .