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);
203 y = result(home,ret,x);
205 y = result(home,ret);
206 pow(home, x, aInt, y);
215 y = result(home,ret,x);
217 y = result(home,ret);
218 nroot(home, x, aInt, y);
222 #ifdef GECODE_HAS_MPFR 228 y = result(home,ret,x);
230 y = result(home,ret);
239 y = result(home,ret);
247 y = result(home,ret);
255 y = result(home,ret);
263 y = result(home,ret);
271 y = result(home,ret);
279 y = result(home,ret);
287 y = result(home,ret);
298 if ((t == ANLFE_MIN && frt ==
FRT_GQ) ||
299 (t == ANLFE_MAX && frt ==
FRT_LQ)) {
303 rel(home, x, frt, c);
305 rel(home,
post(home,NULL), frt, c);
310 rel(home,
post(home,NULL), frt, c, b);
317 dynamic_cast<ArithNonLinFloatExpr*>(e.
nlfe())->t == t;
326 using namespace MiniModel;
329 ArithNonLinFloatExpr* ae =
337 using namespace MiniModel;
340 n +=
static_cast<ArithNonLinFloatExpr*
>(e0.
nlfe())->n;
344 n += static_cast<ArithNonLinFloatExpr*>(e1.
nlfe())->n;
347 ArithNonLinFloatExpr* ae =
351 ArithNonLinFloatExpr* e0e =
static_cast<ArithNonLinFloatExpr*
>(e0.
nlfe());
352 for (; i<e0e->n; i++)
353 ae->
a[i] = e0e->a[i];
358 ArithNonLinFloatExpr* e1e =
static_cast<ArithNonLinFloatExpr*
>(e1.
nlfe());
360 for (; i<curN+e1e->n; i++)
361 ae->
a[i] = e1e->a[i-curN];
370 using namespace MiniModel;
371 ArithNonLinFloatExpr* ae =
373 for (
int i=x.
size();
i--;)
380 using namespace MiniModel;
383 n +=
static_cast<ArithNonLinFloatExpr*
>(e0.
nlfe())->n;
387 n += static_cast<ArithNonLinFloatExpr*>(e1.
nlfe())->n;
390 ArithNonLinFloatExpr* ae =
394 ArithNonLinFloatExpr* e0e =
static_cast<ArithNonLinFloatExpr*
>(e0.
nlfe());
395 for (; i<e0e->n; i++)
396 ae->
a[i] = e0e->a[i];
401 ArithNonLinFloatExpr* e1e =
static_cast<ArithNonLinFloatExpr*
>(e1.
nlfe());
403 for (; i<curN+e1e->n; i++)
404 ae->
a[i] = e1e->a[i-curN];
413 using namespace MiniModel;
414 ArithNonLinFloatExpr* ae =
416 for (
int i=x.
size();
i--;)
423 using namespace MiniModel;
424 ArithNonLinFloatExpr* ae =
433 using namespace MiniModel;
434 ArithNonLinFloatExpr* ae =
443 using namespace MiniModel;
444 ArithNonLinFloatExpr* ae =
453 using namespace MiniModel;
454 ArithNonLinFloatExpr* ae =
463 using namespace MiniModel;
464 ArithNonLinFloatExpr* ae =
473 using namespace MiniModel;
474 ArithNonLinFloatExpr* ae =
482 using namespace MiniModel;
483 ArithNonLinFloatExpr* ae =
491 using namespace MiniModel;
492 ArithNonLinFloatExpr* ae =
500 using namespace MiniModel;
501 ArithNonLinFloatExpr* ae =
507 #ifdef GECODE_HAS_MPFR 511 using namespace MiniModel;
512 ArithNonLinFloatExpr* ae =
520 using namespace MiniModel;
521 ArithNonLinFloatExpr* ae =
529 using namespace MiniModel;
530 ArithNonLinFloatExpr* ae =
538 using namespace MiniModel;
539 ArithNonLinFloatExpr* ae =
547 using namespace MiniModel;
548 ArithNonLinFloatExpr* ae =
556 using namespace MiniModel;
557 ArithNonLinFloatExpr* ae =
565 using namespace MiniModel;
566 ArithNonLinFloatExpr* ae =
574 using namespace MiniModel;
575 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)
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 .
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 .
struct Gecode::@585::NNF::@62::@63 b
For binary nodes (and, or, eqv)
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.
struct Gecode::@585::NNF::@62::@64 a
For atomic nodes.
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.
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.