38 #ifdef GECODE_HAS_FLOAT_VARS 40 namespace Gecode {
namespace MiniModel {
55 #ifdef GECODE_HAS_MPFR 89 y = result(home,ret,x);
98 y = result(home,ret, a[0].
post(home));
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);
114 y = result(home,ret);
120 y = result(home,ret,a[0].
post(home));
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);
136 y = result(home,ret);
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);
165 y = result(home,ret,x0);
167 y = result(home,ret,x0);
169 y = result(home,ret);
170 div(home, x0, x1, y);
181 y = result(home,ret);
191 y = result(home,ret,x);
193 y = result(home,ret);
204 y = result(home,ret,x);
206 y = result(home,ret);
207 pow(home, x, aInt, y);
217 y = result(home,ret,x);
219 y = result(home,ret);
220 nroot(home, x, aInt, y);
224 #ifdef GECODE_HAS_MPFR 230 y = result(home,ret,x);
232 y = result(home,ret);
241 y = result(home,ret);
249 y = result(home,ret);
257 y = result(home,ret);
265 y = result(home,ret);
273 y = result(home,ret);
281 y = result(home,ret);
289 y = result(home,ret);
300 if ((t == ANLFE_MIN && frt ==
FRT_GQ) ||
301 (t == ANLFE_MAX && frt ==
FRT_LQ)) {
305 rel(home, x, frt, c);
307 rel(home,
post(home,NULL), frt, c);
312 rel(home,
post(home,NULL), frt, c, b);
319 dynamic_cast<ArithNonLinFloatExpr*>(e.
nlfe())->t == t;
328 using namespace MiniModel;
331 ArithNonLinFloatExpr* ae =
339 using namespace MiniModel;
342 n +=
static_cast<ArithNonLinFloatExpr*
>(e0.
nlfe())->n;
346 n += static_cast<ArithNonLinFloatExpr*>(e1.
nlfe())->n;
349 ArithNonLinFloatExpr* ae =
353 ArithNonLinFloatExpr* e0e =
static_cast<ArithNonLinFloatExpr*
>(e0.
nlfe());
354 for (; i<e0e->n; i++)
355 ae->
a[i] = e0e->a[i];
360 ArithNonLinFloatExpr* e1e =
static_cast<ArithNonLinFloatExpr*
>(e1.
nlfe());
362 for (; i<curN+e1e->n; i++)
363 ae->
a[i] = e1e->a[i-curN];
372 using namespace MiniModel;
373 ArithNonLinFloatExpr* ae =
375 for (
int i=x.
size();
i--;)
382 using namespace MiniModel;
385 n +=
static_cast<ArithNonLinFloatExpr*
>(e0.
nlfe())->n;
389 n += static_cast<ArithNonLinFloatExpr*>(e1.
nlfe())->n;
392 ArithNonLinFloatExpr* ae =
396 ArithNonLinFloatExpr* e0e =
static_cast<ArithNonLinFloatExpr*
>(e0.
nlfe());
397 for (; i<e0e->n; i++)
398 ae->
a[i] = e0e->a[i];
403 ArithNonLinFloatExpr* e1e =
static_cast<ArithNonLinFloatExpr*
>(e1.
nlfe());
405 for (; i<curN+e1e->n; i++)
406 ae->
a[i] = e1e->a[i-curN];
415 using namespace MiniModel;
416 ArithNonLinFloatExpr* ae =
418 for (
int i=x.
size();
i--;)
425 using namespace MiniModel;
426 ArithNonLinFloatExpr* ae =
435 using namespace MiniModel;
436 ArithNonLinFloatExpr* ae =
445 using namespace MiniModel;
446 ArithNonLinFloatExpr* ae =
455 using namespace MiniModel;
456 ArithNonLinFloatExpr* ae =
465 using namespace MiniModel;
466 ArithNonLinFloatExpr* ae =
475 using namespace MiniModel;
476 ArithNonLinFloatExpr* ae =
484 using namespace MiniModel;
485 ArithNonLinFloatExpr* ae =
493 using namespace MiniModel;
494 ArithNonLinFloatExpr* ae =
502 using namespace MiniModel;
503 ArithNonLinFloatExpr* ae =
509 #ifdef GECODE_HAS_MPFR 513 using namespace MiniModel;
514 ArithNonLinFloatExpr* ae =
522 using namespace MiniModel;
523 ArithNonLinFloatExpr* ae =
531 using namespace MiniModel;
532 ArithNonLinFloatExpr* ae =
540 using namespace MiniModel;
541 ArithNonLinFloatExpr* ae =
549 using namespace MiniModel;
550 ArithNonLinFloatExpr* ae =
558 using namespace MiniModel;
559 ArithNonLinFloatExpr* ae =
567 using namespace MiniModel;
568 ArithNonLinFloatExpr* ae =
576 using namespace MiniModel;
577 ArithNonLinFloatExpr* ae =
void mult(Home home, FloatVar x0, FloatVar x1, FloatVar x2)
Post propagator for .
int size(void) const
Return size of array (number of elements)
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 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 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.
Gecode::FloatVal c(-8, 8)
int n
Number of negative literals for node type.
Base class for non-linear float expressions.
Gecode::IntArgs i({1, 2, 3, 4})
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::@593::NNF::@62::@63 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.
struct Gecode::@593::NNF::@62::@64 a
For atomic nodes.
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.
void post(Home home, FloatRelType frt) const
Post propagator.
virtual void post(Home home, FloatRelType frt, FloatVal c, BoolVar b) const
Post reified expression to be in relation frt with c.