42 namespace Test {
namespace Int {
45 namespace MiniModelArithmetic {
57 :
Test(
"MiniModel::Mult::"+s,3,d) {
62 double d0 =
static_cast<double>(x[0]);
63 double d1 =
static_cast<double>(x[1]);
64 double d2 =
static_cast<double>(x[2]);
79 :
Test(
"MiniModel::Div::"+s,3,d) {
84 return (x[1] != 0) && (x[0] / x[1] == x[2]);
98 :
Test(
"MiniModel::Mod::"+s,3,d) {
103 return (x[1] != 0) && (x[0] % x[1] == x[2]);
117 :
Test(
"MiniModel::Plus::"+s,3,d) {
122 double d0 =
static_cast<double>(x[0]);
123 double d1 =
static_cast<double>(x[1]);
124 double d2 =
static_cast<double>(x[2]);
141 :
Test(
"MiniModel::Minus::"+s,3,d) {
146 double d0 =
static_cast<double>(x[0]);
147 double d1 =
static_cast<double>(x[1]);
148 double d2 =
static_cast<double>(x[2]);
165 :
Test(
"MiniModel::Sqr::"+s,2,d) {
170 double d0 =
static_cast<double>(x[0]);
171 double d1 =
static_cast<double>(x[1]);
186 :
Test(
"MiniModel::Sqrt::"+s,2,d) {
191 double d0 =
static_cast<double>(x[0]);
192 double d1 =
static_cast<double>(x[1]);
193 return (d0 >= 0) && (d0 >= d1*
d1) && (d0 < (d1+1)*(d1+1));
207 :
Test(
"MiniModel::Abs::"+
str(icl)+
"::"+s,
213 double d0 =
static_cast<double>(x[0]);
214 double d1 =
static_cast<double>(x[1]);
215 return (d0<0.0 ? -d0 : d0) ==
d1;
229 :
Test(
"MiniModel::Min::Bin::"+s,3,d) {
248 :
Test(
"MiniModel::Max::Bin::"+s,3,d) {
277 m[0]=x[0]; m[1]=x[1]; m[2]=x[2];
297 m[0]=x[0]; m[1]=x[1]; m[2]=x[2];
virtual void post(Gecode::Space &home, Gecode::IntVarArray &x)
Post constraint on x.
Test for subtraction constraint
IntConLevel
Consistency levels for integer propagators.
Abs abs_bnd_med("B", d2, Gecode::ICL_BND)
Plus(const std::string &s, const Gecode::IntSet &d)
Create and register test.
virtual void post(Gecode::Space &home, Gecode::IntVarArray &x)
Post constraint on x.
const FloatNum max
Largest allowed float value.
Abs(const std::string &s, const Gecode::IntSet &d, Gecode::IntConLevel icl)
Create and register test.
Abs abs_dom_med("B", d2, Gecode::ICL_DOM)
virtual void post(Gecode::Space &home, Gecode::IntVarArray &x)
Post constraint on x.
void abs(Home home, FloatVar x0, FloatVar x1)
Post propagator for .
Test for addition constraint
virtual bool solution(const Assignment &x) const
Test whether x is solution
virtual bool solution(const Assignment &x) const
Test whether x is solution
virtual bool solution(const Assignment &x) const
Test whether x is solution
Mod(const std::string &s, const Gecode::IntSet &d)
Create and register test.
const int max
Largest allowed integer value.
const int min
Smallest allowed integer value.
static std::string str(Gecode::ExtensionalPropKind epk)
Map extensional propagation kind to string.
virtual bool solution(const Assignment &x) const
Test whether x is solution
Abs abs_bnd_min("C", d3, Gecode::ICL_BND)
const FloatNum min
Smallest allowed float value.
Test for multiplication constraint
Test for binary minimum constraint
virtual void post(Gecode::Space &home, Gecode::IntVarArray &x)
Post constraint on x.
Test for n-ary minimmum constraint
Gecode::IntConLevel icl
Consistency level.
virtual void post(Gecode::Space &home, Gecode::IntVarArray &x)
Post constraint on x.
virtual bool solution(const Assignment &x) const
Test whether x is solution
virtual bool solution(const Assignment &x) const
Test whether x is solution
Test for division constraint
void sqr(Home home, FloatVar x0, FloatVar x1)
Post propagator for .
virtual bool solution(const Assignment &x) const
Test whether x is solution
void sqrt(Home home, FloatVar x0, FloatVar x1)
Post propagator for .
Test for division constraint
virtual void post(Gecode::Space &home, Gecode::IntVarArray &x)
Post constraint on x.
virtual bool solution(const Assignment &x) const
Test whether x is solution
Max(const std::string &s, const Gecode::IntSet &d)
Create and register test.
Passing integer variables.
bool testfix
Whether to perform fixpoint test.
virtual void post(Gecode::Space &home, Gecode::IntVarArray &x)
Post constraint on x.
BoolVar expr(Home home, const BoolExpr &e, IntConLevel icl)
Post Boolean expression and return its value.
virtual bool solution(const Assignment &x) const
Test whether x is solution
Node * x
Pointer to corresponding Boolean expression node.
Abs abs_dom_max("A", d1, Gecode::ICL_DOM)
virtual void post(Gecode::Space &home, Gecode::IntVarArray &x)
Post constraint on x.
virtual bool solution(const Assignment &x) const
Test whether x is solution
Base class for assignments
void rel(Home home, FloatVar x0, FloatRelType frt, FloatVal n)
Propagates .
Minus(const std::string &s, const Gecode::IntSet &d)
Create and register test.
virtual bool solution(const Assignment &x) const
Test whether x is solution
virtual void post(Gecode::Space &home, Gecode::IntVarArray &x)
Post constraint on x.
MinNary(void)
Create and register test.
Mult(const std::string &s, const Gecode::IntSet &d)
Create and register test.
MaxNary(void)
Create and register test.
Bounds propagation or consistency.
Gecode toplevel namespace
Abs abs_bnd_max("A", d1, Gecode::ICL_BND)
virtual void post(Gecode::Space &home, Gecode::IntVarArray &x)
Post constraint on x.
Test for absolute value constraint
virtual bool solution(const Assignment &x) const
Test whether x is solution
Abs abs_dom_min("C", d3, Gecode::ICL_DOM)
Sqrt(const std::string &s, const Gecode::IntSet &d)
Create and register test.
virtual void post(Gecode::Space &home, Gecode::IntVarArray &x)
Post constraint on x.
Test for binary maximum constraint
Div(const std::string &s, const Gecode::IntSet &d)
Create and register test.
Test for n-ary maximum constraint
Domain propagation or consistency.
Sqr(const std::string &s, const Gecode::IntSet &d)
Create and register test.
virtual void post(Gecode::Space &home, Gecode::IntVarArray &x)
Post constraint on x.
Min(const std::string &s, const Gecode::IntSet &d)
Create and register test.