float-arith.cpp
Go to the documentation of this file.
/* -*- mode: C++; c-basic-offset: 2; indent-tabs-mode: nil -*- */
/*
* Main authors:
* Christian Schulte <schulte@gecode.org>
* Vincent Barichard <Vincent.Barichard@univ-angers.fr>
*
* Copyright:
* Christian Schulte, 2006
* Vincent Barichard, 2012
*
* This file is part of Gecode, the generic constraint
* development environment:
* http://www.gecode.org
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
* LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
*/
#include <gecode/minimodel.hh>
#ifdef GECODE_HAS_FLOAT_VARS
namespace Gecode { namespace MiniModel {
class GECODE_MINIMODEL_EXPORT ArithNonLinFloatExpr :
public NonLinFloatExpr {
public:
enum ArithNonLinFloatExprType {
ANLFE_ABS,
ANLFE_MIN,
ANLFE_MAX,
ANLFE_MULT,
ANLFE_DIV,
ANLFE_SQR,
ANLFE_SQRT,
#ifdef GECODE_HAS_MPFR
ANLFE_EXP,
ANLFE_LOG,
ANLFE_ASIN,
ANLFE_SIN,
ANLFE_ACOS,
ANLFE_COS,
ANLFE_ATAN,
ANLFE_TAN,
#endif
ANLFE_POW,
ANLFE_NROOT
} t;
LinFloatExpr* a;
int n;
int aInt;
ArithNonLinFloatExpr(ArithNonLinFloatExprType t0, int n0)
: t(t0), a(heap.alloc<LinFloatExpr>(n0)), n(n0), aInt(-1) {}
ArithNonLinFloatExpr(ArithNonLinFloatExprType t0, int n0, int a0)
: t(t0), a(heap.alloc<LinFloatExpr>(n0)), n(n0), aInt(a0) {}
~ArithNonLinFloatExpr(void) { heap.free<LinFloatExpr>(a,n); }
virtual FloatVar post(Home home, FloatVar* ret) const {
FloatVar y;
switch (t) {
case ANLFE_ABS:
{
FloatVar x = a[0].post(home);
if (x.min() >= 0)
y = result(home,ret,x);
else {
y = result(home,ret);
abs(home, x, y);
}
}
break;
case ANLFE_MIN:
if (n==1) {
y = result(home,ret, a[0].post(home));
} else if (n==2) {
FloatVar x0 = a[0].post(home);
FloatVar x1 = a[1].post(home);
if (x0.max() <= x1.min())
y = result(home,ret,x0);
else if (x1.max() <= x0.min())
y = result(home,ret,x1);
else {
y = result(home,ret);
min(home, x0, x1, y);
}
} else {
FloatVarArgs x(n);
for (int i=n; i--;)
x[i] = a[i].post(home);
y = result(home,ret);
min(home, x, y);
}
break;
case ANLFE_MAX:
if (n==1) {
y = result(home,ret,a[0].post(home));
} else if (n==2) {
FloatVar x0 = a[0].post(home);
FloatVar x1 = a[1].post(home);
if (x0.max() <= x1.min())
y = result(home,ret,x1);
else if (x1.max() <= x0.min())
y = result(home,ret,x0);
else {
y = result(home,ret);
max(home, x0, x1, y);
}
} else {
FloatVarArgs x(n);
for (int i=n; i--;)
x[i] = a[i].post(home);
y = result(home,ret);
max(home, x, y);
}
break;
case ANLFE_MULT:
{
assert(n == 2);
FloatVar x0 = a[0].post(home);
FloatVar x1 = a[1].post(home);
if (x0.assigned() && (x0.val() == 0.0))
y = result(home,ret,x0);
else if (x0.assigned() && (x0.val() == 1.0))
y = result(home,ret,x1);
else if (x1.assigned() && (x1.val() == 0.0))
y = result(home,ret,x1);
else if (x1.assigned() && (x1.val() == 1.0))
y = result(home,ret,x0);
else {
y = result(home,ret);
mult(home, x0, x1, y);
}
}
break;
case ANLFE_DIV:
{
assert(n == 2);
FloatVar x0 = a[0].post(home);
FloatVar x1 = a[1].post(home);
if (x1.assigned() && (x1.val() == 1.0))
y = result(home,ret,x0);
else if (x0.assigned() && (x0.val() == 0.0))
y = result(home,ret,x0);
else {
y = result(home,ret);
div(home, x0, x1, y);
}
}
break;
case ANLFE_SQR:
{
assert(n == 1);
FloatVar x = a[0].post(home);
if (x.assigned() && ((x.val() == 0.0) || (x.val() == 1.0)))
y = x;
else {
y = result(home,ret);
sqr(home, x, y);
}
}
break;
case ANLFE_SQRT:
{
assert(n == 1);
FloatVar x = a[0].post(home);
if (x.assigned() && ((x.val() == 0.0) || (x.val() == 1.0)))
y = result(home,ret,x);
else {
y = result(home,ret);
sqrt(home, x, y);
}
}
break;
case ANLFE_POW:
{
assert(n == 1);
FloatVar x = a[0].post(home);
if (x.assigned() && ((x.val() == 0.0) || (x.val() == 1.0)) &&
(aInt >= 0))
y = result(home,ret,x);
else {
y = result(home,ret);
pow(home, x, aInt, y);
}
}
break;
case ANLFE_NROOT:
{
assert(n == 1);
FloatVar x = a[0].post(home);
if (x.assigned() && ((x.val() == 0.0) || (x.val() == 1.0)) &&
(aInt >= 0))
y = result(home,ret,x);
else {
y = result(home,ret);
nroot(home, x, aInt, y);
}
}
break;
#ifdef GECODE_HAS_MPFR
case ANLFE_EXP:
{
assert(n == 1);
FloatVar x = a[0].post(home);
if (x.assigned() && (x.val() == 0.0)) {
FloatVar one(home,1.0,1.0);
y = result(home,ret,one);
} else {
y = result(home,ret);
exp(home, x, y);
}
}
break;
case ANLFE_LOG:
{
assert(n == 1);
FloatVar x = a[0].post(home);
y = result(home,ret);
log(home, x, y);
}
break;
case ANLFE_ASIN:
{
assert(n == 1);
FloatVar x = a[0].post(home);
y = result(home,ret);
asin(home, x, y);
}
break;
case ANLFE_SIN:
{
assert(n == 1);
FloatVar x = a[0].post(home);
y = result(home,ret);
sin(home, x, y);
}
break;
case ANLFE_ACOS:
{
assert(n == 1);
FloatVar x = a[0].post(home);
y = result(home,ret);
acos(home, x, y);
}
break;
case ANLFE_COS:
{
assert(n == 1);
FloatVar x = a[0].post(home);
y = result(home,ret);
cos(home, x, y);
}
break;
case ANLFE_ATAN:
{
assert(n == 1);
FloatVar x = a[0].post(home);
y = result(home,ret);
atan(home, x, y);
}
break;
case ANLFE_TAN:
{
assert(n == 1);
FloatVar x = a[0].post(home);
y = result(home,ret);
tan(home, x, y);
}
break;
#endif
default:
GECODE_NEVER;
}
return y;
}
virtual void post(Home home, FloatRelType frt, FloatVal c) const {
if ((t == ANLFE_MIN && frt == FRT_GQ) ||
(t == ANLFE_MAX && frt == FRT_LQ)) {
FloatVarArgs x(n);
for (int i=n; i--;)
x[i] = a[i].post(home);
rel(home, x, frt, c);
} else {
rel(home, post(home,nullptr), frt, c);
}
}
virtual void post(Home home, FloatRelType frt, FloatVal c,
BoolVar b) const {
rel(home, post(home,nullptr), frt, c, b);
}
};
bool hasType(const LinFloatExpr& e, ArithNonLinFloatExpr::ArithNonLinFloatExprType t) {
return e.nlfe() &&
dynamic_cast<ArithNonLinFloatExpr*>(e.nlfe()) != nullptr &&
dynamic_cast<ArithNonLinFloatExpr*>(e.nlfe())->t == t;
}
}}
namespace Gecode {
LinFloatExpr
abs(const LinFloatExpr& e) {
using namespace MiniModel;
if (hasType(e, ArithNonLinFloatExpr::ANLFE_ABS))
return e;
ArithNonLinFloatExpr* ae =
new ArithNonLinFloatExpr(ArithNonLinFloatExpr::ANLFE_ABS,1);
ae->a[0] = e;
return LinFloatExpr(ae);
}
LinFloatExpr
min(const LinFloatExpr& e0, const LinFloatExpr& e1) {
using namespace MiniModel;
int n = 0;
if (hasType(e0, ArithNonLinFloatExpr::ANLFE_MIN))
n += static_cast<ArithNonLinFloatExpr*>(e0.nlfe())->n;
else
n += 1;
if (hasType(e1, ArithNonLinFloatExpr::ANLFE_MIN))
n += static_cast<ArithNonLinFloatExpr*>(e1.nlfe())->n;
else
n += 1;
ArithNonLinFloatExpr* ae =
new ArithNonLinFloatExpr(ArithNonLinFloatExpr::ANLFE_MIN,n);
int i=0;
if (hasType(e0, ArithNonLinFloatExpr::ANLFE_MIN)) {
ArithNonLinFloatExpr* e0e = static_cast<ArithNonLinFloatExpr*>(e0.nlfe());
for (; i<e0e->n; i++)
ae->a[i] = e0e->a[i];
} else {
ae->a[i++] = e0;
}
if (hasType(e1, ArithNonLinFloatExpr::ANLFE_MIN)) {
ArithNonLinFloatExpr* e1e = static_cast<ArithNonLinFloatExpr*>(e1.nlfe());
int curN = i;
for (; i<curN+e1e->n; i++)
ae->a[i] = e1e->a[i-curN];
} else {
ae->a[i++] = e1;
}
return LinFloatExpr(ae);
}
LinFloatExpr
min(const FloatVarArgs& x) {
using namespace MiniModel;
ArithNonLinFloatExpr* ae =
new ArithNonLinFloatExpr(ArithNonLinFloatExpr::ANLFE_MIN,x.size());
for (int i=x.size(); i--;)
ae->a[i] = x[i];
return LinFloatExpr(ae);
}
LinFloatExpr
max(const LinFloatExpr& e0, const LinFloatExpr& e1) {
using namespace MiniModel;
int n = 0;
if (hasType(e0, ArithNonLinFloatExpr::ANLFE_MAX))
n += static_cast<ArithNonLinFloatExpr*>(e0.nlfe())->n;
else
n += 1;
if (hasType(e1, ArithNonLinFloatExpr::ANLFE_MAX))
n += static_cast<ArithNonLinFloatExpr*>(e1.nlfe())->n;
else
n += 1;
ArithNonLinFloatExpr* ae =
new ArithNonLinFloatExpr(ArithNonLinFloatExpr::ANLFE_MAX,n);
int i=0;
if (hasType(e0, ArithNonLinFloatExpr::ANLFE_MAX)) {
ArithNonLinFloatExpr* e0e = static_cast<ArithNonLinFloatExpr*>(e0.nlfe());
for (; i<e0e->n; i++)
ae->a[i] = e0e->a[i];
} else {
ae->a[i++] = e0;
}
if (hasType(e1, ArithNonLinFloatExpr::ANLFE_MAX)) {
ArithNonLinFloatExpr* e1e = static_cast<ArithNonLinFloatExpr*>(e1.nlfe());
int curN = i;
for (; i<curN+e1e->n; i++)
ae->a[i] = e1e->a[i-curN];
} else {
ae->a[i++] = e1;
}
return LinFloatExpr(ae);
}
LinFloatExpr
max(const FloatVarArgs& x) {
using namespace MiniModel;
ArithNonLinFloatExpr* ae =
new ArithNonLinFloatExpr(ArithNonLinFloatExpr::ANLFE_MAX,x.size());
for (int i=x.size(); i--;)
ae->a[i] = x[i];
return LinFloatExpr(ae);
}
LinFloatExpr
operator *(const FloatVar& e0, const FloatVar& e1) {
using namespace MiniModel;
ArithNonLinFloatExpr* ae =
new ArithNonLinFloatExpr(ArithNonLinFloatExpr::ANLFE_MULT,2);
ae->a[0] = e0;
ae->a[1] = e1;
return LinFloatExpr(ae);
}
LinFloatExpr
operator *(const LinFloatExpr& e0, const FloatVar& e1) {
using namespace MiniModel;
ArithNonLinFloatExpr* ae =
new ArithNonLinFloatExpr(ArithNonLinFloatExpr::ANLFE_MULT,2);
ae->a[0] = e0;
ae->a[1] = e1;
return LinFloatExpr(ae);
}
LinFloatExpr
operator *(const FloatVar& e0, const LinFloatExpr& e1) {
using namespace MiniModel;
ArithNonLinFloatExpr* ae =
new ArithNonLinFloatExpr(ArithNonLinFloatExpr::ANLFE_MULT,2);
ae->a[0] = e0;
ae->a[1] = e1;
return LinFloatExpr(ae);
}
LinFloatExpr
operator *(const LinFloatExpr& e0, const LinFloatExpr& e1) {
using namespace MiniModel;
ArithNonLinFloatExpr* ae =
new ArithNonLinFloatExpr(ArithNonLinFloatExpr::ANLFE_MULT,2);
ae->a[0] = e0;
ae->a[1] = e1;
return LinFloatExpr(ae);
}
LinFloatExpr
operator /(const LinFloatExpr& e0, const LinFloatExpr& e1) {
using namespace MiniModel;
ArithNonLinFloatExpr* ae =
new ArithNonLinFloatExpr(ArithNonLinFloatExpr::ANLFE_DIV,2);
ae->a[0] = e0;
ae->a[1] = e1;
return LinFloatExpr(ae);
}
LinFloatExpr
sqr(const LinFloatExpr& e) {
using namespace MiniModel;
ArithNonLinFloatExpr* ae =
new ArithNonLinFloatExpr(ArithNonLinFloatExpr::ANLFE_SQR,1);
ae->a[0] = e;
return LinFloatExpr(ae);
}
LinFloatExpr
sqrt(const LinFloatExpr& e) {
using namespace MiniModel;
ArithNonLinFloatExpr* ae =
new ArithNonLinFloatExpr(ArithNonLinFloatExpr::ANLFE_SQRT,1);
ae->a[0] = e;
return LinFloatExpr(ae);
}
LinFloatExpr
pow(const LinFloatExpr& e, int exp) {
using namespace MiniModel;
ArithNonLinFloatExpr* ae =
new ArithNonLinFloatExpr(ArithNonLinFloatExpr::ANLFE_POW,1,exp);
ae->a[0] = e;
return LinFloatExpr(ae);
}
LinFloatExpr
nroot(const LinFloatExpr& e, int exp) {
using namespace MiniModel;
ArithNonLinFloatExpr* ae =
new ArithNonLinFloatExpr(ArithNonLinFloatExpr::ANLFE_NROOT,1,exp);
ae->a[0] = e;
return LinFloatExpr(ae);
}
#ifdef GECODE_HAS_MPFR
LinFloatExpr
exp(const LinFloatExpr& e) {
using namespace MiniModel;
ArithNonLinFloatExpr* ae =
new ArithNonLinFloatExpr(ArithNonLinFloatExpr::ANLFE_EXP,1);
ae->a[0] = e;
return LinFloatExpr(ae);
}
LinFloatExpr
log(const LinFloatExpr& e) {
using namespace MiniModel;
ArithNonLinFloatExpr* ae =
new ArithNonLinFloatExpr(ArithNonLinFloatExpr::ANLFE_LOG,1);
ae->a[0] = e;
return LinFloatExpr(ae);
}
LinFloatExpr
asin(const LinFloatExpr& e) {
using namespace MiniModel;
ArithNonLinFloatExpr* ae =
new ArithNonLinFloatExpr(ArithNonLinFloatExpr::ANLFE_ASIN,1);
ae->a[0] = e;
return LinFloatExpr(ae);
}
LinFloatExpr
sin(const LinFloatExpr& e) {
using namespace MiniModel;
ArithNonLinFloatExpr* ae =
new ArithNonLinFloatExpr(ArithNonLinFloatExpr::ANLFE_SIN,1);
ae->a[0] = e;
return LinFloatExpr(ae);
}
LinFloatExpr
acos(const LinFloatExpr& e) {
using namespace MiniModel;
ArithNonLinFloatExpr* ae =
new ArithNonLinFloatExpr(ArithNonLinFloatExpr::ANLFE_ACOS,1);
ae->a[0] = e;
return LinFloatExpr(ae);
}
LinFloatExpr
cos(const LinFloatExpr& e) {
using namespace MiniModel;
ArithNonLinFloatExpr* ae =
new ArithNonLinFloatExpr(ArithNonLinFloatExpr::ANLFE_COS,1);
ae->a[0] = e;
return LinFloatExpr(ae);
}
LinFloatExpr
atan(const LinFloatExpr& e) {
using namespace MiniModel;
ArithNonLinFloatExpr* ae =
new ArithNonLinFloatExpr(ArithNonLinFloatExpr::ANLFE_ATAN,1);
ae->a[0] = e;
return LinFloatExpr(ae);
}
LinFloatExpr
tan(const LinFloatExpr& e) {
using namespace MiniModel;
ArithNonLinFloatExpr* ae =
new ArithNonLinFloatExpr(ArithNonLinFloatExpr::ANLFE_TAN,1);
ae->a[0] = e;
return LinFloatExpr(ae);
}
#endif
}
#endif
// STATISTICS: minimodel-any
Gecode::ArgArrayBase::a
T * a
Element array.
Definition array.hpp:544
Gecode::ArgArrayBase::n
int n
Number of elements.
Definition array.hpp:540
Gecode::ArgArrayBase::size
int size(void) const
Return size of array (number of elements).
Definition array.hpp:1607
Gecode::BoolVar
Boolean integer variables.
Definition int.hh:512
Gecode::FloatVal
Float value type.
Definition float.hh:334
Gecode::FloatVarArgs
Passing float variables.
Definition float.hh:979
Gecode::FloatVar
Float variables.
Definition float.hh:870
Gecode::FloatVar::min
FloatNum min(void) const
Return minimum of domain.
Definition float.hpp:59
Gecode::FloatVar::val
FloatVal val(void) const
Return assigned value.
Definition float.hpp:53
Gecode::FloatVar::max
FloatNum max(void) const
Return maximum of domain.
Definition float.hpp:67
Gecode::Home
Home class for posting propagators
Definition core.hpp:856
Gecode::LinFloatExpr
Float expressions
Definition minimodel.hh:822
Gecode::LinFloatExpr::nlfe
NonLinFloatExpr * nlfe(void) const
Return non-linear expression inside, or null if not non-linear.
Definition float-expr.cpp:138
Gecode::MiniModel::ArithNonLinFloatExpr
Non-linear float arithmetic expressions.
Definition float-arith.cpp:44
Gecode::MiniModel::ArithNonLinFloatExpr::post
virtual void post(Home home, FloatRelType frt, FloatVal c, BoolVar b) const
Post reified expression to be in relation frt with c.
Definition float-arith.cpp:311
Gecode::MiniModel::ArithNonLinFloatExpr::post
virtual void post(Home home, FloatRelType frt, FloatVal c) const
Post expression to be in relation frt with c.
Definition float-arith.cpp:300
Gecode::MiniModel::ArithNonLinFloatExpr::post
virtual FloatVar post(Home home, FloatVar *ret) const
Post expression.
Definition float-arith.cpp:82
Gecode::MiniModel::ArithNonLinFloatExpr::ArithNonLinFloatExpr
ArithNonLinFloatExpr(ArithNonLinFloatExprType t0, int n0)
Constructors.
Definition float-arith.cpp:75
Gecode::MiniModel::ArithNonLinFloatExpr::aInt
int aInt
Integer argument (used in nroot for example).
Definition float-arith.cpp:73
Gecode::MiniModel::ArithNonLinFloatExpr::ArithNonLinFloatExpr
ArithNonLinFloatExpr(ArithNonLinFloatExprType t0, int n0, int a0)
Definition float-arith.cpp:77
Gecode::MiniModel::ArithNonLinFloatExpr::ArithNonLinFloatExprType
ArithNonLinFloatExprType
The expression type.
Definition float-arith.cpp:47
Gecode::MiniModel::ArithNonLinFloatExpr::ANLFE_POW
@ ANLFE_POW
Pow expression.
Definition float-arith.cpp:65
Gecode::MiniModel::ArithNonLinFloatExpr::ANLFE_SQR
@ ANLFE_SQR
Square expression.
Definition float-arith.cpp:53
Gecode::MiniModel::ArithNonLinFloatExpr::ANLFE_MULT
@ ANLFE_MULT
Multiplication expression.
Definition float-arith.cpp:51
Gecode::MiniModel::ArithNonLinFloatExpr::ANLFE_DIV
@ ANLFE_DIV
Division expression.
Definition float-arith.cpp:52
Gecode::MiniModel::ArithNonLinFloatExpr::ANLFE_ABS
@ ANLFE_ABS
Absolute value expression.
Definition float-arith.cpp:48
Gecode::MiniModel::ArithNonLinFloatExpr::ANLFE_NROOT
@ ANLFE_NROOT
Nth root expression.
Definition float-arith.cpp:66
Gecode::MiniModel::ArithNonLinFloatExpr::ANLFE_LOG
@ ANLFE_LOG
Logarithm root expression.
Definition float-arith.cpp:57
Gecode::MiniModel::ArithNonLinFloatExpr::ANLFE_EXP
@ ANLFE_EXP
Exponential expression.
Definition float-arith.cpp:56
Gecode::MiniModel::ArithNonLinFloatExpr::ANLFE_SQRT
@ ANLFE_SQRT
Square root expression.
Definition float-arith.cpp:54
Gecode::MiniModel::ArithNonLinFloatExpr::ANLFE_ATAN
@ ANLFE_ATAN
expression
Definition float-arith.cpp:62
Gecode::MiniModel::ArithNonLinFloatExpr::ANLFE_TAN
@ ANLFE_TAN
expression
Definition float-arith.cpp:63
Gecode::MiniModel::ArithNonLinFloatExpr::ANLFE_SIN
@ ANLFE_SIN
expression
Definition float-arith.cpp:59
Gecode::MiniModel::ArithNonLinFloatExpr::ANLFE_MIN
@ ANLFE_MIN
Minimum expression.
Definition float-arith.cpp:49
Gecode::MiniModel::ArithNonLinFloatExpr::ANLFE_ACOS
@ ANLFE_ACOS
expression
Definition float-arith.cpp:60
Gecode::MiniModel::ArithNonLinFloatExpr::ANLFE_ASIN
@ ANLFE_ASIN
expression
Definition float-arith.cpp:58
Gecode::MiniModel::ArithNonLinFloatExpr::ANLFE_MAX
@ ANLFE_MAX
Maximum expression.
Definition float-arith.cpp:50
Gecode::MiniModel::ArithNonLinFloatExpr::ANLFE_COS
@ ANLFE_COS
expression
Definition float-arith.cpp:61
Gecode::MiniModel::ArithNonLinFloatExpr::~ArithNonLinFloatExpr
~ArithNonLinFloatExpr(void)
Destructor.
Definition float-arith.cpp:80
Gecode::MiniModel::ArithNonLinFloatExpr::a
LinFloatExpr * a
Expressions.
Definition float-arith.cpp:69
Gecode::MiniModel::ArithNonLinFloatExpr::t
enum Gecode::MiniModel::ArithNonLinFloatExpr::ArithNonLinFloatExprType t
Gecode::MiniModel::ArithNonLinFloatExpr::n
int n
Size of variable array.
Definition float-arith.cpp:71
Gecode::NonLinFloatExpr
Base class for non-linear float expressions.
Definition minimodel.hh:794
Gecode::NonLinFloatExpr::result
static FloatVar result(Home home, FloatVar *x)
Return fresh variable if x is null, x otherwise.
Definition float-expr.hpp:40
Gecode::VarImpVar::assigned
bool assigned(void) const
Test whether view is assigned.
Definition var.hpp:111
Gecode::heap
Heap heap
The single global heap.
Definition heap.cpp:44
Gecode::rel
void rel(Home home, FloatVar x0, FloatRelType frt, FloatVar x1)
Post propagator for .
Definition rel.cpp:68
Gecode::FloatRelType
FloatRelType
Relation types for floats.
Definition float.hh:1068
Gecode::FRT_LQ
@ FRT_LQ
Less or equal ( ).
Definition float.hh:1071
Gecode::FRT_GQ
@ FRT_GQ
Greater or equal ( ).
Definition float.hh:1073
minimodel.hh
GECODE_MINIMODEL_EXPORT
#define GECODE_MINIMODEL_EXPORT
Definition minimodel.hh:78
Gecode::MiniModel
Minimalistic modeling support.
Definition minimodel.hh:92
Gecode::MiniModel::hasType
bool hasType(const LinFloatExpr &e, ArithNonLinFloatExpr::ArithNonLinFloatExprType t)
Check if e is of type t.
Definition float-arith.cpp:317
Gecode
Gecode toplevel namespace
Gecode::operator/
FloatVal operator/(const FloatVal &x, const FloatVal &y)
Definition val.hpp:213
Gecode::sin
void sin(Home home, FloatVar x0, FloatVar x1)
Post propagator for .
Definition trigonometric.cpp:52
Gecode::sqr
void sqr(Home home, FloatVar x0, FloatVar x1)
Post propagator for .
Definition arithmetic.cpp:95
Gecode::cos
void cos(Home home, FloatVar x0, FloatVar x1)
Post propagator for .
Definition trigonometric.cpp:66
Gecode::min
void min(Home home, FloatVar x0, FloatVar x1, FloatVar x2)
Post propagator for .
Definition arithmetic.cpp:67
Gecode::abs
void abs(Home home, FloatVar x0, FloatVar x1)
Post propagator for .
Definition arithmetic.cpp:41
Gecode::div
void div(Home home, FloatVar x0, FloatVar x1, FloatVar x2)
Post propagator for .
Definition arithmetic.cpp:127
Gecode::mult
void mult(Home home, FloatVar x0, FloatVar x1, FloatVar x2)
Post propagator for .
Definition arithmetic.cpp:88
Gecode::sqrt
void sqrt(Home home, FloatVar x0, FloatVar x1)
Post propagator for .
Definition arithmetic.cpp:102
Gecode::acos
void acos(Home home, FloatVar x0, FloatVar x1)
Post propagator for .
Definition trigonometric.cpp:59
Gecode::log
void log(Home home, FloatVar x0, FloatVar x1)
Post propagator for .
Definition transcendental.cpp:53
Gecode::exp
void exp(Home home, FloatVar x0, FloatVar x1)
Post propagator for .
Definition transcendental.cpp:45
Gecode::atan
void atan(Home home, FloatVar x0, FloatVar x1)
Post propagator for .
Definition trigonometric.cpp:73
Gecode::max
void max(Home home, FloatVar x0, FloatVar x1, FloatVar x2)
Post propagator for .
Definition arithmetic.cpp:49
Gecode::asin
void asin(Home home, FloatVar x0, FloatVar x1)
Post propagator for .
Definition trigonometric.cpp:45
Gecode::pow
void pow(Home home, FloatVar x0, int n, FloatVar x1)
Post propagator for for $n\geq 0$.
Definition arithmetic.cpp:109
Gecode::operator*
FloatVal operator*(const FloatVal &x, const FloatVal &y)
Definition val.hpp:200
Gecode::nroot
void nroot(Home home, FloatVar x0, int n, FloatVar x1)
Post propagator for for $n\geq 0$.
Definition arithmetic.cpp:118
Gecode::tan
void tan(Home home, FloatVar x0, FloatVar x1)
Post propagator for .
Definition trigonometric.cpp:80
GECODE_NEVER
#define GECODE_NEVER
Assert that this command is never executed.
Definition macros.hpp:56