int-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>
*
* Copyright:
* Christian Schulte, 2006
*
* 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>
namespace Gecode { namespace MiniModel {
class GECODE_MINIMODEL_EXPORT ArithNonLinIntExpr : public NonLinIntExpr {
public:
enum ArithNonLinIntExprType {
ANLE_ABS,
ANLE_MIN,
ANLE_MAX,
ANLE_MULT,
ANLE_DIV,
ANLE_MOD,
ANLE_SQR,
ANLE_SQRT,
ANLE_POW,
ANLE_NROOT,
ANLE_ELMNT,
ANLE_ITE
} t;
LinIntExpr* a;
int n;
int aInt;
BoolExpr b;
ArithNonLinIntExpr(ArithNonLinIntExprType t0, int n0)
: t(t0), a(heap.alloc<LinIntExpr>(n0)), n(n0) {}
ArithNonLinIntExpr(ArithNonLinIntExprType t0, int n0, int a0)
: t(t0), a(heap.alloc<LinIntExpr>(n0)), n(n0), aInt(a0) {}
ArithNonLinIntExpr(ArithNonLinIntExprType t0, int n0, const BoolExpr& b0)
: t(t0), a(heap.alloc<LinIntExpr>(n0)), n(n0), b(b0) {}
~ArithNonLinIntExpr(void) {
heap.free<LinIntExpr>(a,n);
}
virtual IntVar post(Home home, IntVar* ret,
const IntPropLevels& ipls) const {
IntVar y;
switch (t) {
case ANLE_ABS:
{
IntVar x = a[0].post(home, ipls);
if (x.min() >= 0)
y = result(home,ret,x);
else {
y = result(home,ret);
abs(home, x, y, ipls.abs());
}
}
break;
case ANLE_MIN:
if (n==1) {
y = result(home,ret, a[0].post(home, ipls));
} else if (n==2) {
IntVar x0 = a[0].post(home, ipls);
IntVar x1 = a[1].post(home, ipls);
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, ipls.min2());
}
} else {
IntVarArgs x(n);
for (int i=n; i--;)
x[i] = a[i].post(home, ipls);
y = result(home,ret);
min(home, x, y, ipls.min());
}
break;
case ANLE_MAX:
if (n==1) {
y = result(home,ret,a[0].post(home, ipls));
} else if (n==2) {
IntVar x0 = a[0].post(home, ipls);
IntVar x1 = a[1].post(home, ipls);
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, ipls.max2());
}
} else {
IntVarArgs x(n);
for (int i=n; i--;)
x[i] = a[i].post(home, ipls);
y = result(home,ret);
max(home, x, y, ipls.max());
}
break;
case ANLE_MULT:
{
assert(n == 2);
IntVar x0 = a[0].post(home, ipls);
IntVar x1 = a[1].post(home, ipls);
if (x0.assigned() && (x0.val() == 0))
y = result(home,ret,x0);
else if (x0.assigned() && (x0.val() == 1))
y = result(home,ret,x1);
else if (x1.assigned() && (x1.val() == 0))
y = result(home,ret,x1);
else if (x1.assigned() && (x1.val() == 1))
y = result(home,ret,x0);
else {
y = result(home,ret);
mult(home, x0, x1, y, ipls.mult());
}
}
break;
case ANLE_DIV:
{
assert(n == 2);
IntVar x0 = a[0].post(home, ipls);
IntVar x1 = a[1].post(home, ipls);
rel(home, x1, IRT_NQ, 0);
if (x1.assigned() && (x1.val() == 1))
y = result(home,ret,x0);
else if (x0.assigned() && (x0.val() == 0))
y = result(home,ret,x0);
else {
y = result(home,ret);
div(home, x0, x1, y, ipls.div());
}
}
break;
case ANLE_MOD:
{
assert(n == 2);
IntVar x0 = a[0].post(home, ipls);
IntVar x1 = a[1].post(home, ipls);
y = result(home,ret);
mod(home, x0, x1, y, ipls.mod());
}
break;
case ANLE_SQR:
{
assert(n == 1);
IntVar x = a[0].post(home, ipls);
if (x.assigned() && ((x.val() == 0) || (x.val() == 1)))
y = result(home,ret,x);
else {
y = result(home,ret);
sqr(home, x, y, ipls.sqr());
}
}
break;
case ANLE_SQRT:
{
assert(n == 1);
IntVar x = a[0].post(home, ipls);
if (x.assigned() && ((x.val() == 0) || (x.val() == 1)))
y = result(home,ret,x);
else {
y = result(home,ret);
sqrt(home, x, y, ipls.sqrt());
}
}
break;
case ANLE_POW:
{
assert(n == 1);
IntVar x = a[0].post(home, ipls);
if (x.assigned() && (aInt > 0) &&
((x.val() == 0) || (x.val() == 1)))
y = result(home,ret,x);
else {
y = result(home,ret);
pow(home, x, aInt, y, ipls.pow());
}
}
break;
case ANLE_NROOT:
{
assert(n == 1);
IntVar x = a[0].post(home, ipls);
if (x.assigned() && (aInt > 0) &&
((x.val() == 0) || (x.val() == 1)))
y = result(home,ret,x);
else {
y = result(home,ret);
nroot(home, x, aInt, y, ipls.nroot());
}
}
break;
case ANLE_ELMNT:
{
IntVar z = a[n-1].post(home, ipls);
if (z.assigned() && z.val() >= 0 && z.val() < n-1) {
y = result(home,ret,a[z.val()].post(home, ipls));
} else {
IntVarArgs x(n-1);
bool assigned = true;
for (int i=n-1; i--;) {
x[i] = a[i].post(home, ipls);
if (!x[i].assigned())
assigned = false;
}
y = result(home,ret);
if (assigned) {
IntArgs xa(n-1);
for (int i=n-1; i--;)
xa[i] = x[i].val();
element(home, xa, z, y, ipls.element());
} else {
element(home, x, z, y, ipls.element());
}
}
}
break;
case ANLE_ITE:
{
assert(n == 2);
BoolVar c = b.expr(home, ipls);
IntVar x0 = a[0].post(home, ipls);
IntVar x1 = a[1].post(home, ipls);
y = result(home,ret);
ite(home, c, x0, x1, y, ipls.ite());
}
break;
default:
GECODE_NEVER;
}
return y;
}
virtual void post(Home home, IntRelType irt, int c,
const IntPropLevels& ipls) const {
if ((t == ANLE_MIN && (irt == IRT_GQ || irt == IRT_GR)) ||
(t == ANLE_MAX && (irt == IRT_LQ || irt == IRT_LE)) ) {
IntVarArgs x(n);
for (int i=n; i--;)
x[i] = a[i].post(home, ipls);
rel(home, x, irt, c);
} else {
rel(home, post(home,nullptr,ipls), irt, c);
}
}
virtual void post(Home home, IntRelType irt, int c, BoolVar b,
const IntPropLevels& ipls) const {
rel(home, post(home,nullptr,ipls), irt, c, b);
}
};
bool hasType(const LinIntExpr& e, ArithNonLinIntExpr::ArithNonLinIntExprType t) {
return e.nle() &&
dynamic_cast<ArithNonLinIntExpr*>(e.nle()) != nullptr &&
dynamic_cast<ArithNonLinIntExpr*>(e.nle())->t == t;
}
}}
namespace Gecode {
LinIntExpr
abs(const LinIntExpr& e) {
using namespace MiniModel;
if (hasType(e, ArithNonLinIntExpr::ANLE_ABS))
return e;
ArithNonLinIntExpr* ae =
new ArithNonLinIntExpr(ArithNonLinIntExpr::ANLE_ABS,1);
ae->a[0] = e;
return LinIntExpr(ae);
}
LinIntExpr
min(const LinIntExpr& e0, const LinIntExpr& e1) {
using namespace MiniModel;
int n = 0;
if (hasType(e0, ArithNonLinIntExpr::ANLE_MIN))
n += static_cast<ArithNonLinIntExpr*>(e0.nle())->n;
else
n += 1;
if (hasType(e1, ArithNonLinIntExpr::ANLE_MIN))
n += static_cast<ArithNonLinIntExpr*>(e1.nle())->n;
else
n += 1;
ArithNonLinIntExpr* ae =
new ArithNonLinIntExpr(ArithNonLinIntExpr::ANLE_MIN,n);
int i=0;
if (hasType(e0, ArithNonLinIntExpr::ANLE_MIN)) {
ArithNonLinIntExpr* e0e = static_cast<ArithNonLinIntExpr*>(e0.nle());
for (; i<e0e->n; i++)
ae->a[i] = e0e->a[i];
} else {
ae->a[i++] = e0;
}
if (hasType(e1, ArithNonLinIntExpr::ANLE_MIN)) {
ArithNonLinIntExpr* e1e = static_cast<ArithNonLinIntExpr*>(e1.nle());
int curN = i;
for (; i<curN+e1e->n; i++)
ae->a[i] = e1e->a[i-curN];
} else {
ae->a[i++] = e1;
}
return LinIntExpr(ae);
}
LinIntExpr
max(const LinIntExpr& e0, const LinIntExpr& e1) {
using namespace MiniModel;
int n = 0;
if (hasType(e0, ArithNonLinIntExpr::ANLE_MAX))
n += static_cast<ArithNonLinIntExpr*>(e0.nle())->n;
else
n += 1;
if (hasType(e1, ArithNonLinIntExpr::ANLE_MAX))
n += static_cast<ArithNonLinIntExpr*>(e1.nle())->n;
else
n += 1;
ArithNonLinIntExpr* ae =
new ArithNonLinIntExpr(ArithNonLinIntExpr::ANLE_MAX,n);
int i=0;
if (hasType(e0, ArithNonLinIntExpr::ANLE_MAX)) {
ArithNonLinIntExpr* e0e = static_cast<ArithNonLinIntExpr*>(e0.nle());
for (; i<e0e->n; i++)
ae->a[i] = e0e->a[i];
} else {
ae->a[i++] = e0;
}
if (hasType(e1, ArithNonLinIntExpr::ANLE_MAX)) {
ArithNonLinIntExpr* e1e = static_cast<ArithNonLinIntExpr*>(e1.nle());
int curN = i;
for (; i<curN+e1e->n; i++)
ae->a[i] = e1e->a[i-curN];
} else {
ae->a[i++] = e1;
}
return LinIntExpr(ae);
}
LinIntExpr
min(const IntVarArgs& x) {
using namespace MiniModel;
ArithNonLinIntExpr* ae =
new ArithNonLinIntExpr(ArithNonLinIntExpr::ANLE_MIN,x.size());
for (int i=x.size(); i--;)
ae->a[i] = x[i];
return LinIntExpr(ae);
}
LinIntExpr
max(const IntVarArgs& x) {
using namespace MiniModel;
ArithNonLinIntExpr* ae =
new ArithNonLinIntExpr(ArithNonLinIntExpr::ANLE_MAX,x.size());
for (int i=x.size(); i--;)
ae->a[i] = x[i];
return LinIntExpr(ae);
}
LinIntExpr
operator *(const LinIntExpr& e0, const LinIntExpr& e1) {
using namespace MiniModel;
ArithNonLinIntExpr* ae =
new ArithNonLinIntExpr(ArithNonLinIntExpr::ANLE_MULT,2);
ae->a[0] = e0;
ae->a[1] = e1;
return LinIntExpr(ae);
}
LinIntExpr
sqr(const LinIntExpr& e) {
using namespace MiniModel;
ArithNonLinIntExpr* ae =
new ArithNonLinIntExpr(ArithNonLinIntExpr::ANLE_SQR,1);
ae->a[0] = e;
return LinIntExpr(ae);
}
LinIntExpr
sqrt(const LinIntExpr& e) {
using namespace MiniModel;
ArithNonLinIntExpr* ae =
new ArithNonLinIntExpr(ArithNonLinIntExpr::ANLE_SQRT,1);
ae->a[0] = e;
return LinIntExpr(ae);
}
LinIntExpr
pow(const LinIntExpr& e, int n) {
using namespace MiniModel;
ArithNonLinIntExpr* ae =
new ArithNonLinIntExpr(ArithNonLinIntExpr::ANLE_POW,1,n);
ae->a[0] = e;
return LinIntExpr(ae);
}
LinIntExpr
nroot(const LinIntExpr& e, int n) {
using namespace MiniModel;
ArithNonLinIntExpr* ae =
new ArithNonLinIntExpr(ArithNonLinIntExpr::ANLE_NROOT,1,n);
ae->a[0] = e;
return LinIntExpr(ae);
}
LinIntExpr
operator /(const LinIntExpr& e0, const LinIntExpr& e1) {
using namespace MiniModel;
ArithNonLinIntExpr* ae =
new ArithNonLinIntExpr(ArithNonLinIntExpr::ANLE_DIV,2);
ae->a[0] = e0;
ae->a[1] = e1;
return LinIntExpr(ae);
}
LinIntExpr
operator %(const LinIntExpr& e0, const LinIntExpr& e1) {
using namespace MiniModel;
ArithNonLinIntExpr* ae =
new ArithNonLinIntExpr(ArithNonLinIntExpr::ANLE_MOD,2);
ae->a[0] = e0;
ae->a[1] = e1;
return LinIntExpr(ae);
}
LinIntExpr
element(const IntVarArgs& x, const LinIntExpr& e) {
using namespace MiniModel;
ArithNonLinIntExpr* ae =
new ArithNonLinIntExpr(ArithNonLinIntExpr::ANLE_ELMNT,x.size()+1);
for (int i=x.size(); i--;)
ae->a[i] = x[i];
ae->a[x.size()] = e;
return LinIntExpr(ae);
}
LinIntExpr
element(const IntArgs& x, const LinIntExpr& e) {
using namespace MiniModel;
ArithNonLinIntExpr* ae =
new ArithNonLinIntExpr(ArithNonLinIntExpr::ANLE_ELMNT,x.size()+1);
for (int i=x.size(); i--;)
ae->a[i] = x[i];
ae->a[x.size()] = e;
return LinIntExpr(ae);
}
LinIntExpr
ite(const BoolExpr& b, const LinIntExpr& e0, const LinIntExpr& e1) {
using namespace MiniModel;
ArithNonLinIntExpr* ae =
new ArithNonLinIntExpr(ArithNonLinIntExpr::ANLE_ITE,2,b);
ae->a[0] = e0;
ae->a[1] = e1;
return LinIntExpr(ae);
}
}
// 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::BoolExpr
Boolean expressions.
Definition minimodel.hh:1329
Gecode::BoolVar
Boolean integer variables.
Definition int.hh:512
Gecode::Home
Home class for posting propagators
Definition core.hpp:856
Gecode::IntArgs
Passing integer arguments.
Definition int.hh:628
Gecode::IntPropLevels
Class for specifying integer propagation levels used by minimodel.
Definition minimodel.hh:101
Gecode::IntPropLevels::div
IntPropLevel div(void) const
Return integer propagation level for division constraints.
Definition ipl.hpp:114
Gecode::IntPropLevels::element
IntPropLevel element(void) const
Return integer propagation level for element constraints.
Definition ipl.hpp:164
Gecode::IntPropLevels::mod
IntPropLevel mod(void) const
Return integer propagation level for modulo constraints.
Definition ipl.hpp:122
Gecode::IntPropLevels::max2
IntPropLevel max2(void) const
Return integer propagation level for binary maximum constraints.
Definition ipl.hpp:73
Gecode::IntPropLevels::ite
IntPropLevel ite(void) const
Return integer propagation level for if-then-else constraints.
Definition ipl.hpp:173
Gecode::IntPropLevels::mult
IntPropLevel mult(void) const
Return integer propagation level for multiplication constraints.
Definition ipl.hpp:106
Gecode::IntPropLevels::min
IntPropLevel min(void) const
Return integer propagation level for non-binary minimum constraints.
Definition ipl.hpp:97
Gecode::IntPropLevels::nroot
IntPropLevel nroot(void) const
Return integer propagation level for root constraints.
Definition ipl.hpp:155
Gecode::IntPropLevels::abs
IntPropLevel abs(void) const
Return integer propagation level for absolute value constraints.
Definition ipl.hpp:64
Gecode::IntPropLevels::sqrt
IntPropLevel sqrt(void) const
Return integer propagation level for square root constraints.
Definition ipl.hpp:139
Gecode::IntPropLevels::min2
IntPropLevel min2(void) const
Return integer propagation level for binary minimum constraints.
Definition ipl.hpp:89
Gecode::IntPropLevels::pow
IntPropLevel pow(void) const
Return integer propagation level for power constraints.
Definition ipl.hpp:147
Gecode::IntPropLevels::max
IntPropLevel max(void) const
Return integer propagation level for non-binary maximum constraints.
Definition ipl.hpp:81
Gecode::IntPropLevels::sqr
IntPropLevel sqr(void) const
Return integer propagation level for square constraints.
Definition ipl.hpp:131
Gecode::IntVarArgs
Passing integer variables.
Definition int.hh:656
Gecode::IntVar
Integer variables.
Definition int.hh:371
Gecode::IntVar::min
int min(void) const
Return minimum of domain.
Definition int.hpp:62
Gecode::IntVar::val
int val(void) const
Return assigned value.
Definition int.hpp:56
Gecode::IntVar::max
int max(void) const
Return maximum of domain.
Definition int.hpp:70
Gecode::LinIntExpr
Linear expressions over integer variables.
Definition minimodel.hh:245
Gecode::LinIntExpr::nle
NonLinIntExpr * nle(void) const
Return non-linear expression inside, or null if not non-linear.
Definition int-expr.cpp:359
Gecode::MiniModel::ArithNonLinIntExpr
Non-linear arithmetic expressions over integer variables.
Definition int-arith.cpp:39
Gecode::MiniModel::ArithNonLinIntExpr::post
virtual void post(Home home, IntRelType irt, int c, const IntPropLevels &ipls) const
Post expression to be in relation irt with c.
Definition int-arith.cpp:271
Gecode::MiniModel::ArithNonLinIntExpr::b
BoolExpr b
Boolean expression argument (used in ite for example).
Definition int-arith.cpp:63
Gecode::MiniModel::ArithNonLinIntExpr::ArithNonLinIntExpr
ArithNonLinIntExpr(ArithNonLinIntExprType t0, int n0)
Constructor.
Definition int-arith.cpp:65
Gecode::MiniModel::ArithNonLinIntExpr::aInt
int aInt
Integer argument (used in nroot for example).
Definition int-arith.cpp:61
Gecode::MiniModel::ArithNonLinIntExpr::~ArithNonLinIntExpr
~ArithNonLinIntExpr(void)
Destructor.
Definition int-arith.cpp:74
Gecode::MiniModel::ArithNonLinIntExpr::post
virtual void post(Home home, IntRelType irt, int c, BoolVar b, const IntPropLevels &ipls) const
Post reified expression to be in relation irt with c.
Definition int-arith.cpp:283
Gecode::MiniModel::ArithNonLinIntExpr::t
enum Gecode::MiniModel::ArithNonLinIntExpr::ArithNonLinIntExprType t
Gecode::MiniModel::ArithNonLinIntExpr::ArithNonLinIntExpr
ArithNonLinIntExpr(ArithNonLinIntExprType t0, int n0, int a0)
Constructor.
Definition int-arith.cpp:68
Gecode::MiniModel::ArithNonLinIntExpr::ArithNonLinIntExprType
ArithNonLinIntExprType
The expression type.
Definition int-arith.cpp:42
Gecode::MiniModel::ArithNonLinIntExpr::ANLE_NROOT
@ ANLE_NROOT
Nroot expression.
Definition int-arith.cpp:52
Gecode::MiniModel::ArithNonLinIntExpr::ANLE_MAX
@ ANLE_MAX
Maximum expression.
Definition int-arith.cpp:45
Gecode::MiniModel::ArithNonLinIntExpr::ANLE_ELMNT
@ ANLE_ELMNT
Element expression.
Definition int-arith.cpp:53
Gecode::MiniModel::ArithNonLinIntExpr::ANLE_MULT
@ ANLE_MULT
Multiplication expression.
Definition int-arith.cpp:46
Gecode::MiniModel::ArithNonLinIntExpr::ANLE_MOD
@ ANLE_MOD
Modulo expression.
Definition int-arith.cpp:48
Gecode::MiniModel::ArithNonLinIntExpr::ANLE_DIV
@ ANLE_DIV
Division expression.
Definition int-arith.cpp:47
Gecode::MiniModel::ArithNonLinIntExpr::ANLE_SQRT
@ ANLE_SQRT
Square root expression.
Definition int-arith.cpp:50
Gecode::MiniModel::ArithNonLinIntExpr::ANLE_MIN
@ ANLE_MIN
Minimum expression.
Definition int-arith.cpp:44
Gecode::MiniModel::ArithNonLinIntExpr::ANLE_ABS
@ ANLE_ABS
Absolute value expression.
Definition int-arith.cpp:43
Gecode::MiniModel::ArithNonLinIntExpr::ANLE_SQR
@ ANLE_SQR
Square expression.
Definition int-arith.cpp:49
Gecode::MiniModel::ArithNonLinIntExpr::ANLE_ITE
@ ANLE_ITE
If-then-else expression.
Definition int-arith.cpp:54
Gecode::MiniModel::ArithNonLinIntExpr::ANLE_POW
@ ANLE_POW
Pow expression.
Definition int-arith.cpp:51
Gecode::MiniModel::ArithNonLinIntExpr::post
virtual IntVar post(Home home, IntVar *ret, const IntPropLevels &ipls) const
Post expression.
Definition int-arith.cpp:78
Gecode::MiniModel::ArithNonLinIntExpr::a
LinIntExpr * a
Expressions.
Definition int-arith.cpp:57
Gecode::MiniModel::ArithNonLinIntExpr::ArithNonLinIntExpr
ArithNonLinIntExpr(ArithNonLinIntExprType t0, int n0, const BoolExpr &b0)
Constructor.
Definition int-arith.cpp:71
Gecode::MiniModel::ArithNonLinIntExpr::n
int n
Size of variable array.
Definition int-arith.cpp:59
Gecode::NonLinIntExpr
Base class for non-linear expressions over integer variables.
Definition minimodel.hh:215
Gecode::NonLinIntExpr::result
static IntVar result(Home home, IntVar *x)
Return fresh variable if x is null, x otherwise.
Definition int-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::ite
void ite(Home home, BoolVar b, FloatVar x, FloatVar y, FloatVar z)
Post propagator for if-then-else constraint.
Definition bool.cpp:39
Gecode::IntRelType
IntRelType
Relation types for integers.
Definition int.hh:925
Gecode::IRT_NQ
@ IRT_NQ
Disequality ( ).
Definition int.hh:927
Gecode::IRT_GQ
@ IRT_GQ
Greater or equal ( ).
Definition int.hh:930
Gecode::IRT_LE
@ IRT_LE
Less ( ).
Definition int.hh:929
Gecode::IRT_GR
@ IRT_GR
Greater ( ).
Definition int.hh:931
Gecode::IRT_LQ
@ IRT_LQ
Less or equal ( ).
Definition int.hh:928
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::mod
void mod(Home home, IntVar x0, IntVar x1, IntVar x2, IntPropLevel ipl=IPL_DEF)
Post propagator for .
Definition arithmetic.cpp:360
Gecode::sqr
void sqr(Home home, FloatVar x0, FloatVar x1)
Post propagator for .
Definition arithmetic.cpp:95
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::element
void element(Home home, IntSharedArray n, IntVar x0, IntVar x1, IntPropLevel ipl=IPL_DEF)
Post domain consistent propagator for .
Definition element.cpp:39
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::max
void max(Home home, FloatVar x0, FloatVar x1, FloatVar x2)
Post propagator for .
Definition arithmetic.cpp:49
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::operator%
LinIntExpr operator%(const LinIntExpr &x, const LinIntExpr &y)
Return expression for .
Definition int-arith.cpp:453
GECODE_NEVER
#define GECODE_NEVER
Assert that this command is never executed.
Definition macros.hpp:56