Go to the documentation of this file.
43 namespace Test {
namespace Float {
46 namespace Arithmetic {
61 return eq(
x[0] *
x[1],
x[2]);
80 return eq(
x[0] *
x[1],
x[2]);
106 return eq(
x[0] *
x[0],
x[1]);
122 return eq(
x[0] *
x[0],
x[1]);
148 return eq(
x[0] *
x[1],
x[0]);
164 return eq(
x[0] *
x[1],
x[1]);
180 return eq(
x[0] *
x[0],
x[0]);
196 return eq(
x[0] /
x[1],
x[2]);
215 return eq(
x[0] /
x[1],
x[2]);
241 return eq(
x[0] *
x[0],
x[1]);
260 return eq(
x[0] *
x[0],
x[1]);
286 return eq(
x[0] *
x[0],
x[0]);
443 if ((
n == 0) || (
x[0].
max() < 0.0))
465 if ((
n == 0) || (
x[0].
max() < 0.0))
471 if ((
n == 0) || (
x[0].
max() < 0))
496 if ((
n == 0) || (
x[0].
max() < 0))
720 m[0]=
x[0]; m[1]=
x[1]; m[2]=
x[2];
741 m[0]=
x[0]; m[1]=
x[1]; m[2]=
x[2];
759 m[0]=
x[0]; m[1]=
x[1]; m[2]=
x[2];
780 m[0]=
x[0]; m[1]=
x[1]; m[2]=
x[2];
MinXYX min_xyx_c("C", c, step)
SqrXY(const std::string &s, const Gecode::FloatVal &d, Gecode::FloatNum st)
Create and register test.
Test for binary minimum constraint with shared variables
virtual void post(Gecode::Space &home, Gecode::FloatVarArray &x)
Post constraint on x.
MultXXY mult_xxy_c("C", c, step)
PowXX(const std::string &s, const Gecode::FloatVal &d, unsigned int _n, Gecode::FloatNum st)
Create and register test.
void pow(Home home, FloatVar x0, int n, FloatVar x1)
Post propagator for for $n\geq 0$.
Gecode::FloatVal dom
Domain of variables.
MinXYY min_xyy_b("B", b, step)
virtual void post(Gecode::Space &home, Gecode::FloatVarArray &x)
Post constraint on x.
SqrXYSol(const std::string &s, const Gecode::FloatVal &d, Gecode::FloatNum st)
Create and register test.
const Gecode::FloatNum step
NRootXX nroot_xx_b_2("B", b, 3, step)
MaxXXX max_xxx_c("C", c, step)
MaxXYZ max_xyz_c("C", c, step)
virtual void post(Gecode::Space &home, Gecode::FloatVarArray &x)
Post constraint on x.
MultXYZ mult_xyz_c("C", c, step)
Test for binary maximum constraint with shared variables
MaxNary(void)
Create and register test.
void min(Home home, const IntVarArgs &x, IntVar y, IntPropLevel ipl)
Post propagator for .
static MaybeType eq(Gecode::FloatVal x, Gecode::FloatVal y)
Whether x and y are equal.
void max(Home home, FloatVar x0, FloatVar x1, FloatVar x2)
Post propagator for .
Test for squaring constraint with shared variables
MaxXXX max_xxx_b("B", b, step)
MultXXY(const std::string &s, const Gecode::FloatVal &d, Gecode::FloatNum st)
Create and register test.
MultXYZSol mult_xyz_sol_a("A", a, step)
virtual void post(Gecode::Space &home, Gecode::FloatVarArray &x)
Post constraint on x.
MaxXYX(const std::string &s, const Gecode::FloatVal &d, Gecode::FloatNum st)
Create and register test.
NRootXX nroot_xx_c_2("C", c, 3, step)
SqrXY sqr_xy_a("A", a, step)
AbsXX(const std::string &s, const Gecode::FloatVal &d, Gecode::FloatNum st)
Create and register test.
virtual void post(Gecode::Space &home, Gecode::FloatVarArray &x)
Post constraint on x.
virtual bool extendAssignement(Assignment &x) const
Extend assignment x.
MinXXX min_xxx_a("A", a, step)
virtual MaybeType solution(const Assignment &x) const
Test whether x is solution
PowXY pow_xy_c_1("C", c, 2, step)
virtual bool extendAssignement(Assignment &x) const
Extend assignment x.
PowXX pow_xx_c_3("C", c, 0, step)
SqrXYSol sqr_xy_sol_b("B", b, step)
DivSol div_sol_b("B", b, step)
Test for multiplication constraint
virtual MaybeType solution(const Assignment &x) const
Test whether x is solution
Test for binary minimum constraint with shared variables
Test for nroot constraint with shared variables
PowXY pow_xy_a_2("A", a, 3, step)
void pow(Home home, IntVar x0, int n, IntVar x1, IntPropLevel ipl)
Post propagator for .
Test for multiplication constraint with shared variables
MaxXXY max_xxy_c("C", c, step)
MinXXY min_xxy_c("C", c, step)
MultXYZ mult_xyz_b("B", b, step)
AbsXX abs_xx_c("C", c, step)
DivSol(const std::string &s, const Gecode::FloatVal &d, Gecode::FloatNum st)
Create and register test.
PowXY pow_xy_b_1("B", b, 2, step)
void sqr(Home home, FloatVar x0, FloatVar x1)
Post propagator for .
virtual void post(Gecode::Space &home, Gecode::FloatVarArray &x)
Post constraint on x.
Test for pow constraint with shared variables
MinNaryShared(void)
Create and register test.
PowXY(const std::string &s, const Gecode::FloatVal &d, unsigned int _n, Gecode::FloatNum st)
Create and register test.
MinXXY min_xxy_a("A", a, step)
NRootXX(const std::string &s, const Gecode::FloatVal &d, unsigned int _n, Gecode::FloatNum st)
Create and register test.
NRootXY nroot_xy_b_2("B", b, 3, step)
MinXYZ min_xyz_a("A", a, step)
NRootXX nroot_xx_a_2("A", a, 3, step)
MinXYY(const std::string &s, const Gecode::FloatVal &d, Gecode::FloatNum st)
Create and register test.
MinXYX min_xyx_a("A", a, step)
NRootXYSol nroot_xy_sol_c_3("C", c, 0, step)
Test for square root constraint
SqrXY sqr_xy_b("B", b, step)
virtual MaybeType solution(const Assignment &x) const
Test whether x is solution
PowXYSol pow_xy_sol_b_2("B", b, 3, step)
Gecode::FloatVal a(-8, 5)
PowXY pow_xy_b_3("B", b, 0, step)
MultXYX mult_xyx_b("B", b, step)
DivSol div_sol_c("C", c, step)
Test for binary maximum constraint
MaxXYY max_xyy_a("A", a, step)
SqrtXX(const std::string &s, const Gecode::FloatVal &d, Gecode::FloatNum st)
Create and register test.
SqrtXYSol sqrt_xy_sol_b("B", b, step)
DivSol div_sol_a("A", a, step)
MultXXX mult_xxx_a("A", a, step)
virtual MaybeType solution(const Assignment &x) const
Test whether x is solution
virtual void post(Gecode::Space &home, Gecode::FloatVarArray &x)
Post constraint on x.
MinXYX(const std::string &s, const Gecode::FloatVal &d, Gecode::FloatNum st)
Create and register test.
AbsXX abs_xx_a("A", a, step)
MinXXX(const std::string &s, const Gecode::FloatVal &d, Gecode::FloatNum st)
Create and register test.
NRootXY nroot_xy_b_1("B", b, 2, step)
virtual void post(Gecode::Space &home, Gecode::FloatVarArray &x)
Post constraint on x.
virtual MaybeType solution(const Assignment &x) const
Test whether x is solution
MultXYX(const std::string &s, const Gecode::FloatVal &d, Gecode::FloatNum st)
Create and register test.
virtual void post(Gecode::Space &home, Gecode::FloatVarArray &x)
Post constraint on x.
MultXYX mult_xyx_c("C", c, step)
virtual void post(Gecode::Space &home, Gecode::FloatVarArray &x)
Post constraint on x.
Test for n-ary maximum constraint
MultXYY mult_xyy_b("B", b, step)
MultXYY mult_xyy_c("C", c, step)
PowXX pow_xx_c_1("C", c, 2, step)
virtual MaybeType solution(const Assignment &x) const
Test whether x is solution
NRootXY nroot_xy_a_3("A", a, 0, step)
virtual void post(Gecode::Space &home, Gecode::FloatVarArray &x)
Post constraint on x.
Test for absolute value constraint
void div(Home home, FloatVar x0, FloatVar x1, FloatVar x2)
Post propagator for .
Test for multiplication constraint with shared variables
NRootXX nroot_xx_b_3("B", b, 0, step)
virtual MaybeType solution(const Assignment &x) const
Test whether x is solution
MinXXY min_xxy_b("B", b, step)
Test for binary minimum constraint with shared variables
virtual MaybeType solution(const Assignment &x) const
Test whether x is solution
virtual void post(Gecode::Space &home, Gecode::FloatVarArray &x)
Post constraint on x.
virtual void post(Gecode::Space &home, Gecode::FloatVarArray &x)
Post constraint on x.
virtual MaybeType solution(const Assignment &x) const
Test whether x is solution
PowXX pow_xx_b_3("B", b, 0, step)
NRootXYSol nroot_xy_sol_c_1("C", c, 2, step)
MaxXYZ max_xyz_a("A", a, step)
MultXXY mult_xxy_a("A", a, step)
virtual MaybeType solution(const Assignment &x) const
Test whether x is solution
MinXXX min_xxx_c("C", c, step)
virtual void post(Gecode::Space &home, Gecode::FloatVarArray &x)
Post constraint on x.
NRootXY(const std::string &s, const Gecode::FloatVal &d, unsigned int _n, Gecode::FloatNum st)
Create and register test.
PowXY pow_xy_c_2("C", c, 3, step)
virtual void post(Gecode::Space &home, Gecode::FloatVarArray &x)
Post constraint on x.
MaxXYY max_xyy_b("B", b, step)
Node * x
Pointer to corresponding Boolean expression node.
PowXYSol(const std::string &s, const Gecode::FloatVal &d, unsigned int _n, Gecode::FloatNum st)
Create and register test.
MaxXYZ(const std::string &s, const Gecode::FloatVal &d, Gecode::FloatNum st)
Create and register test.
virtual MaybeType solution(const Assignment &x) const
Test whether x is solution
virtual MaybeType solution(const Assignment &x) const
Test whether x is solution
Test for n-ary minimmum constraint with shared variables
virtual MaybeType solution(const Assignment &x) const
Test whether x is solution
PowXX pow_xx_b_2("B", b, 3, step)
MaxNaryShared(void)
Create and register test.
void nroot(Home home, FloatVar x0, int n, FloatVar x1)
Post propagator for for $n\geq 0$.
MultXYY(const std::string &s, const Gecode::FloatVal &d, Gecode::FloatNum st)
Create and register test.
MinXYZ min_xyz_c("C", c, step)
virtual void post(Gecode::Space &home, Gecode::FloatVarArray &x)
Post constraint on x.
MinXYZ(const std::string &s, const Gecode::FloatVal &d, Gecode::FloatNum st)
Create and register test.
Test for square root constraint with shared variables
NRootXYSol nroot_xy_sol_a_2("A", a, 3, step)
bool flip(void)
Flip a coin and return true or false randomly.
virtual MaybeType solution(const Assignment &x) const
Test whether x is solution
PowXX pow_xx_c_2("C", c, 3, step)
Test for multiplication constraint when solution is ensured
virtual bool extendAssignement(Assignment &x) const
Extend assignment x.
Test for binary maximum constraint with shared variables
Test for squaring constraint where solution is ensured
NRootXYSol(const std::string &s, const Gecode::FloatVal &d, unsigned int _n, Gecode::FloatNum st)
Create and register test.
void sqrt(Home home, FloatVar x0, FloatVar x1)
Post propagator for .
AbsXY(const std::string &s, const Gecode::FloatVal &d, Gecode::FloatNum st)
Create and register test.
virtual void post(Gecode::Space &home, Gecode::FloatVarArray &x)
Post constraint on x.
PowXY pow_xy_a_1("A", a, 2, step)
double FloatNum
Floating point number base type.
NRootXY nroot_xy_a_2("A", a, 3, step)
Test for division constraint when solution is ensured
virtual bool extendAssignement(Assignment &x) const
Extend assignment x.
virtual MaybeType solution(const Assignment &x) const
Test whether x is solution
virtual void post(Gecode::Space &home, Gecode::FloatVarArray &x)
Post constraint on x.
virtual MaybeType solution(const Assignment &x) const
Test whether x is solution
MultXXYSol mult_xxy_sol_b("B", b, step)
virtual void post(Gecode::Space &home, Gecode::FloatVarArray &x)
Post constraint on x.
MinXYY min_xyy_a("A", a, step)
AbsXX abs_xx_b("B", b, step)
virtual MaybeType solution(const Assignment &x) const
Test whether x is solution
MaxXXY max_xxy_a("A", a, step)
bool subset(const FloatVal &x, const FloatVal &y)
PowXY pow_xy_b_2("B", b, 3, step)
virtual MaybeType solution(const Assignment &x) const
Test whether x is solution
SqrXYSol sqr_xy_sol_a("A", a, step)
void mult(Home home, FloatVar x0, FloatVar x1, FloatVar x2)
Post propagator for .
virtual void post(Gecode::Space &home, Gecode::FloatVarArray &x)
Post constraint on x.
SqrtXYSol sqrt_xy_sol_a("A", a, step)
Test for absolute value constraint with shared variables
virtual MaybeType solution(const Assignment &x) const
Test whether x is solution
virtual void post(Gecode::Space &home, Gecode::FloatVarArray &x)
Post constraint on x.
virtual MaybeType solution(const Assignment &x) const
Test whether x is solution
Test for binary minimum constraint
virtual void post(Gecode::Space &home, Gecode::FloatVarArray &x)
Post constraint on x.
SqrXX sqr_xx_a("A", a, step)
MultXXYSol mult_xxy_sol_a("A", a, step)
virtual void post(Gecode::Space &home, Gecode::FloatVarArray &x)
Post constraint on x.
Test for pow constraint where solution is ensured
Gecode::FloatVal b(9, 12)
NRootXY nroot_xy_c_3("C", c, 0, step)
PowXY pow_xy_c_3("C", c, 0, step)
virtual MaybeType solution(const Assignment &x) const
Test whether x is solution
void sqr(Home home, IntVar x0, IntVar x1, IntPropLevel ipl)
Post propagator for .
MaxXYX max_xyx_b("B", b, step)
Test for n-ary maximum constraint with shared variables
NRootXY nroot_xy_c_1("C", c, 2, step)
MultXYZSol mult_xyz_sol_c("C", c, step)
virtual void post(Gecode::Space &home, Gecode::FloatVarArray &x)
Post constraint on x.
AbsXY abs_xy_a("A", a, step)
SqrtXYSol(const std::string &s, const Gecode::FloatVal &d, Gecode::FloatNum st)
Create and register test.
MultXYZ(const std::string &s, const Gecode::FloatVal &d, Gecode::FloatNum st)
Create and register test.
PowXYSol pow_xy_sol_a_2("A", a, 3, step)
SqrtXY sqrt_xy_b("B", b, step)
NRootXX nroot_xx_a_1("A", a, 2, step)
void abs(Home home, FloatVar x0, FloatVar x1)
Post propagator for .
PowXX pow_xx_a_2("A", a, 3, step)
MultXYZSol(const std::string &s, const Gecode::FloatVal &d, Gecode::FloatNum st)
Create and register test.
MaxXYY max_xyy_c("C", c, step)
virtual MaybeType solution(const Assignment &x) const
Test whether x is solution
MultXXX mult_xxx_c("C", c, step)
MaxXXX max_xxx_a("A", a, step)
NRootXYSol nroot_xy_sol_a_3("A", a, 0, step)
NRootXY nroot_xy_c_2("C", c, 3, step)
SqrtXY sqrt_xy_a("A", a, step)
MaxXYY(const std::string &s, const Gecode::FloatVal &d, Gecode::FloatNum st)
Create and register test.
SqrtXX sqrt_xx_a("A", a, step)
virtual void post(Gecode::Space &home, Gecode::FloatVarArray &x)
Post constraint on x.
virtual MaybeType solution(const Assignment &x) const
Test whether x is solution
virtual MaybeType solution(const Assignment &x) const
Test whether x is solution
virtual MaybeType solution(const Assignment &x) const
Test whether x is solution
void rel(Home home, FloatVar x0, FloatRelType frt, FloatVal n)
Propagates .
NRootXYSol nroot_xy_sol_a_1("A", a, 2, step)
virtual void post(Gecode::Space &home, Gecode::FloatVarArray &x)
Post constraint on x.
Test for n-ary minimmum constraint
Test for binary maximum constraint with shared variables
void abs(Home home, IntVar x0, IntVar x1, IntPropLevel ipl)
Post propagator for .
SqrtXX sqrt_xx_c("C", c, step)
virtual void post(Gecode::Space &home, Gecode::FloatVarArray &x)
Post constraint on x.
Test for multiplication constraint with shared variables
static MaybeType cmp(Gecode::FloatVal x, Gecode::FloatRelType r, Gecode::FloatVal y)
Compare x and y with respect to r.
PowXYSol pow_xy_sol_b_3("B", b, 0, step)
virtual void post(Gecode::Space &home, Gecode::FloatVarArray &x)
Post constraint on x.
virtual void post(Gecode::Space &home, Gecode::FloatVarArray &x)
Post constraint on x.
virtual MaybeType solution(const Assignment &x) const
Test whether x is solution
PowXYSol pow_xy_sol_a_3("A", a, 0, step)
PowXY pow_xy_a_3("A", a, 0, step)
@ FRT_GQ
Greater or equal ( )
MaxXXY max_xxy_b("B", b, step)
void nroot(Home home, IntVar x0, int n, IntVar x1, IntPropLevel ipl)
Post propagator for .
SqrtXYSol sqrt_xy_sol_c("C", c, step)
MinNary(void)
Create and register test.
MinXYX min_xyx_b("B", b, step)
virtual MaybeType solution(const Assignment &x) const
Test whether x is solution
MinXYY min_xyy_c("C", c, step)
MultXXX mult_xxx_b("B", b, step)
virtual void post(Gecode::Space &home, Gecode::FloatVarArray &x)
Post constraint on x.
PowXX pow_xx_a_3("A", a, 0, step)
AbsXY abs_xy_c("C", c, step)
Test for square root constraint where solution is ensured
virtual void post(Gecode::Space &home, Gecode::FloatVarArray &x)
Post constraint on x.
static std::string str(Gecode::FloatRelType frt)
Map float relation to string.
NRootXX nroot_xx_a_3("A", a, 0, step)
NRootXY nroot_xy_b_3("B", b, 0, step)
NRootXYSol nroot_xy_sol_c_2("C", c, 3, step)
NRootXYSol nroot_xy_sol_b_3("B", b, 0, step)
MultXXYSol mult_xxy_sol_c("C", c, step)
SqrXX sqr_xx_c("C", c, step)
NRootXX nroot_xx_b_1("B", b, 2, step)
PowXYSol pow_xy_sol_b_1("B", b, 2, step)
PowXYSol pow_xy_sol_c_2("C", c, 3, step)
NRootXYSol nroot_xy_sol_b_2("B", b, 3, step)
virtual MaybeType solution(const Assignment &x) const
Test whether x is solution
virtual void post(Gecode::Space &home, Gecode::FloatVarArray &x)
Post constraint on x.
MaybeType
Type for comparisons and solutions.
virtual MaybeType solution(const Assignment &x) const
Test whether x is solution
MaxXYX max_xyx_a("A", a, step)
Test for binary minimum constraint with shared variables
void max(Home home, const IntVarArgs &x, IntVar y, IntPropLevel ipl)
Post propagator for .
SqrXX sqr_xx_b("B", b, step)
virtual MaybeType solution(const Assignment &x) const
Test whether x is solution
Test for nroot constraint
SqrtXX sqrt_xx_b("B", b, step)
Test for multiplication constraint with shared variables
SqrtXY sqrt_xy_c("C", c, step)
Test for division constraint
Base class for assignments
virtual bool extendAssignement(Assignment &x) const
Extend assignment x.
PowXYSol pow_xy_sol_c_3("C", c, 0, step)
MultXXY mult_xxy_b("B", b, step)
virtual void post(Gecode::Space &home, Gecode::FloatVarArray &x)
Post constraint on x.
virtual bool extendAssignement(Assignment &x) const
Extend assignment x.
NRootXY nroot_xy_a_1("A", a, 2, step)
Test for binary maximum constraint with shared variables
NRootXX nroot_xx_c_1("C", c, 2, step)
void min(Home home, FloatVar x0, FloatVar x1, FloatVar x2)
Post propagator for .
virtual MaybeType solution(const Assignment &x) const
Test whether x is solution
Test for multiplication constraint with shared variables when solution is ensured
virtual MaybeType solution(const Assignment &x) const
Test whether x is solution
Gecode::FloatVal c(-8, 8)
MultXYZSol mult_xyz_sol_b("B", b, step)
MultXXX(const std::string &s, const Gecode::FloatVal &d, Gecode::FloatNum st)
Create and register test.
NRootXYSol nroot_xy_sol_b_1("B", b, 2, step)
NRootXX nroot_xx_c_3("C", c, 0, step)
virtual MaybeType solution(const Assignment &x) const
Test whether x is solution
Test for squaring constraint
virtual void post(Gecode::Space &home, Gecode::FloatVarArray &x)
Post constraint on x.
MinXXY(const std::string &s, const Gecode::FloatVal &d, Gecode::FloatNum st)
Create and register test.
int n
Number of negative literals for node type.
Test for nroot constraint where solution is ensured
PowXX pow_xx_a_1("A", a, 2, step)
SqrtXY(const std::string &s, const Gecode::FloatVal &d, Gecode::FloatNum st)
Create and register test.
MultXYX mult_xyx_a("A", a, step)
PowXYSol pow_xy_sol_c_1("C", c, 2, step)
MaxXYX max_xyx_c("C", c, step)
MultXXYSol(const std::string &s, const Gecode::FloatVal &d, Gecode::FloatNum st)
Create and register test.
AbsXY abs_xy_b("B", b, step)
MinXXX min_xxx_b("B", b, step)
virtual MaybeType solution(const Assignment &x) const
Test whether x is solution
virtual void post(Gecode::Space &home, Gecode::FloatVarArray &x)
Post constraint on x.
SqrXY sqr_xy_c("C", c, step)
virtual MaybeType solution(const Assignment &x) const
Test whether x is solution
PowXX pow_xx_b_1("B", b, 2, step)
MinXYZ min_xyz_b("B", b, step)
MaxXYZ max_xyz_b("B", b, step)
MultXYY mult_xyy_a("A", a, step)
SqrXYSol sqr_xy_sol_c("C", c, step)
virtual MaybeType solution(const Assignment &x) const
Test whether x is solution
virtual void post(Gecode::Space &home, Gecode::FloatVarArray &x)
Post constraint on x.
virtual void post(Gecode::Space &home, Gecode::FloatVarArray &x)
Post constraint on x.
MaxXXX(const std::string &s, const Gecode::FloatVal &d, Gecode::FloatNum st)
Create and register test.
Div(const std::string &s, const Gecode::FloatVal &d, Gecode::FloatNum st)
Create and register test.
MaxXXY(const std::string &s, const Gecode::FloatVal &d, Gecode::FloatNum st)
Create and register test.
void sqrt(Home home, IntVar x0, IntVar x1, IntPropLevel ipl)
Post propagator for .
PowXYSol pow_xy_sol_a_1("A", a, 2, step)
virtual MaybeType solution(const Assignment &x) const
Test whether x is solution
virtual bool extendAssignement(Assignment &x) const
Extend assignment x.
SqrXX(const std::string &s, const Gecode::FloatVal &d, Gecode::FloatNum st)
Create and register test.
MultXYZ mult_xyz_a("A", a, step)