66 :
x0(*this, 0.0, usePow ? witness : hi),
67 x1(*this, usePow ? 0.0 : witness, usePow ? hi : witness) {
77 x0.update(*
this,s.
x0);
78 x1.update(*
this,s.
x1);
110 int mode,
bool usePow)
const {
111 if (std::fesetround(mode) != 0)
116 olog <<
"Root bound removed a solution for "
117 << (usePow ?
"pow" :
"nroot") <<
", n=" << n
118 <<
", mode=" << mode << std::endl;
123 int n,
int mode)
const {
124 if (std::fesetround(mode) != 0)
130 olog <<
"NRoot upper bound was not outward for n=" << n
131 <<
", mode=" << mode << std::endl;
137 :
Base(
"Float::Arithmetic::PositiveNRootBounds") {}
140 const int oldMode = std::fegetround();
141 const int modes[] = {
142 FE_TONEAREST, FE_DOWNWARD, FE_UPWARD, FE_TOWARDZERO
153 {std::numeric_limits<Gecode::FloatNum>::denorm_min(),
156 {std::numeric_limits<Gecode::FloatNum>::max(),
167 for (
unsigned int m=0; m<
sizeof(modes)/
sizeof(modes[0]); m++) {
168 for (
unsigned int c=0;
c<
sizeof(cases)/
sizeof(cases[0]);
c++) {
169 result =
check(cases[
c].hi,cases[
c].witness,cases[
c].n,
170 modes[m],
false) && result;
171 result =
check(cases[
c].hi,cases[
c].witness,cases[
c].n,
172 modes[m],
true) && result;
174 result =
checkBound(roundingHi,rejectedUpper,2,modes[m]) && result;
177 std::fesetround(oldMode);
192 :
x(*this,direct ? 0.0 : -1.0,direct ? 0.0 : 1.0),
216 : -
std::numeric_limits<
Gecode::FloatNum>::denorm_min(),
217 positive ?
std::numeric_limits<
Gecode::FloatNum>::denorm_min()
241 -
std::ldexp(static_cast<
Gecode::FloatNum>
242 (0x10000000000006ULL),-53),
243 -
std::ldexp(static_cast<
Gecode::FloatNum>
244 (0x10000000000004ULL),-53)),
247 (0x1000000000000aULL),-54),
249 (0x1000000000000cULL),-54)) {
271 y(*this,direct ? 0.0 : -1.0,direct ? 0.0 : 1.0) {
290 olog <<
"Pow wide base failed for n=" << n << std::endl;
296 const bool zeroRejected =
302 const bool nonZeroAccepted =
304 (nonZero->
y.
min() == 1.0) && (nonZero->
y.
max() == 1.0) &&
307 if (!zeroRejected || !nonZeroAccepted)
308 olog <<
"Pow exponent-zero semantics failed" << std::endl;
309 return zeroRejected && nonZeroAccepted;
313 (direct.
y.
min() == 0.0) && (direct.
y.
max() == 0.0) &&
315 (clone->y.min() == 0.0) && (clone->y.max() == 0.0);
318 olog <<
"Pow delayed zero failed for n=" << n << std::endl;
325 olog <<
"Pow zero result failed for n=" << n << std::endl;
332 const bool contracted =
334 (clone->x.min() == 0.0) && (clone->x.max() == 0.0);
336 const bool inconsistentRejected =
339 if (!contracted || !inconsistentRejected)
340 olog <<
"Pow zero result did not force zero base for n=" << n
341 << (direct ?
" (direct)" :
" (delayed)") << std::endl;
342 return contracted && inconsistentRejected;
347 const bool actorRetained =
349 (initial.
y.
min() == 1.0) && (initial.
y.
max() == 1.0) &&
354 const bool cloneRetained =
356 (clone->y.min() == 1.0) && (clone->y.max() == 1.0) &&
360 if (!actorRetained || !cloneRetained)
361 olog <<
"Pow adjacent exponent-zero semantics failed"
362 << (positive ?
" (positive)" :
" (negative)") << std::endl;
363 return actorRetained && cloneRetained;
371 for (
int n=0; n<=3; n++)
373 for (
int n=1; n<=3; n++) {
382 olog <<
"Pow fixpoint instance failed" << std::endl;
395 olog <<
"Pow posting did not reach a fixpoint" << std::endl;
412 :
x(*this,xl,xu),
y(*this,yl,yu),
z(*this,zl,zu) {
435 (s.
x.
min() < expectedMin) || (s.
x.
max() > expectedMax)) {
436 olog <<
"Multiplication endpoint-zero contraction failed: x="
437 << s.
x <<
", y=" << s.
y <<
", z=" << s.
z << std::endl;
444 (clone->x.min() == s.
x.
min()) && (clone->x.max() == s.
x.
max()) &&
445 (clone->y.min() == s.
y.
min()) && (clone->y.max() == s.
y.
max()) &&
446 (clone->z.min() == s.
z.
min()) && (clone->z.max() == s.
z.
max());
449 olog <<
"Multiplication endpoint-zero case was not at a fixpoint"
455 unsigned int state = 0x6d756c74U;
456 for (
unsigned int i=0; i<5000; i++) {
457 state = state * 1664525U + 1013904223U;
461 state = state * 1664525U + 1013904223U;
477 (s.
z.
min() > p) || (s.
z.
max() < p)) {
478 olog <<
"Multiplication removed supported fuzz point " << i
479 <<
": (" <<
a <<
", " <<
b <<
", " << p <<
")"
489 :
Base(
"Float::Arithmetic::MultZeroEndpoint") {}
493 result =
check(-1.0,1.0, 0.0,1.0, 0.5,1.0,
495 result =
check(-1.0,1.0,-1.0,-0.0, 0.5,1.0,
496 -1.0,-0.5) && result;
497 result =
check(-1.0,1.0, 0.0,1.0,-1.0,-0.5,
498 -1.0,-0.5) && result;
499 result =
check(-1.0,1.0,-1.0,-0.0,-1.0,-0.5,
503 MultSpace swapped(0.0,1.0,-1.0,1.0,0.5,1.0);
505 (swapped.
y.
min() >= 0.5) && result;
508 MultSpace zeroProduct(-1.0,1.0,0.0,1.0,0.0,0.0);
510 (zeroProduct.
x.
min() == -1.0) &&
511 (zeroProduct.
x.
max() == 1.0) && result;
512 MultSpace zeroFactor(0.0,0.0,-1.0,1.0,0.0,0.0);
514 (zeroFactor.
y.
min() == -1.0) &&
515 (zeroFactor.
y.
max() == 1.0) && result;
517 olog <<
"Multiplication zero or swapped regression failed"
519 return fuzz() && result;
531 return eq(x[0] * x[1], x[2]);
550 return eq(x[0] * x[1], x[2]);
576 return eq(x[0] * x[0], x[1]);
592 return eq(x[0] * x[0], x[1]);
618 return eq(x[0] * x[1], x[0]);
634 return eq(x[0] * x[1], x[1]);
650 return eq(x[0] * x[0], x[0]);
666 return eq(x[0] / x[1], x[2]);
685 return eq(x[0] / x[1], x[2]);
711 return eq(x[0] * x[0], x[1]);
730 return eq(x[0] * x[0], x[1]);
756 return eq(x[0] * x[0], x[0]);
776 return eq(sqrt(x[0]), x[1]);
800 return eq(sqrt(x[0]), x[1]);
831 return eq(sqrt(x[0]), x[0]);
849 return eq(pow(x[0],n), x[1]);
869 return eq(pow(x[0],n), x[1]);
896 return eq(pow(x[0],n), x[0]);
913 if ((n == 0) || (x[0].min() < 0.0))
915 return eq(nroot(x[0],n), x[1]);
935 if ((n == 0) || (x[0].min() < 0.0))
937 return eq(nroot(x[0],n), x[1]);
941 if ((n == 0) || (x[0].min() < 0))
966 if ((n == 0) || (x[0].min() < 0))
968 return eq(nroot(x[0],n), x[0]);
984 return eq(abs(x[0]), x[1]);
1003 return eq(abs(x[0]), x[0]);
1019 return eq(min(x[0],x[1]), x[2]);
1038 return eq(min(x[0],x[0]), x[1]);
1054 return eq(min(x[0],x[1]), x[0]);
1070 return eq(min(x[0],x[1]), x[1]);
1086 return eq(min(x[0],x[0]), x[0]);
1102 return eq(max(x[0],x[1]), x[2]);
1121 return eq(max(x[0],x[0]), x[1]);
1137 return eq(max(x[0],x[1]), x[0]);
1153 return eq(max(x[0],x[1]), x[1]);
1169 return eq(max(x[0],x[0]), x[0]);
1185 return eq(min(min(x[0],x[1]),x[2]), x[3]);
1190 m[0]=x[0]; m[1]=x[1]; m[2]=x[2];
1206 return eq(min(min(x[0],x[1]),x[2]), x[1]);
1211 m[0]=x[0]; m[1]=x[1]; m[2]=x[2];
1224 return eq(max(max(x[0],x[1]),x[2]), x[3]);
1229 m[0]=x[0]; m[1]=x[1]; m[2]=x[2];
1245 return eq(max(max(x[0],x[1]),x[2]), x[1]);
1250 m[0]=x[0]; m[1]=x[1]; m[2]=x[2];
FloatNum min(void) const
Return minimum of domain.
FloatNum max(void) const
Return maximum of domain.
static PropagatorGroup all
Group of all propagators.
Base(std::string s)
Create and register test with name s.
bool fixpoint(void)
Throw a coin whether to compute a fixpoint.
Test for absolute value constraint with shared variables
virtual MaybeType solution(const Assignment &x) const
Test whether x is solution
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.
Test for absolute value constraint
AbsXY(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 void post(Gecode::Space &home, Gecode::FloatVarArray &x)
Post constraint on x.
Test for division constraint when solution is ensured
virtual MaybeType solution(const Assignment &x) const
Test whether x is solution
virtual bool extendAssignment(Assignment &x) const
Extend assignment x.
virtual void post(Gecode::Space &home, Gecode::FloatVarArray &x)
Post constraint on x.
DivSol(const std::string &s, const Gecode::FloatVal &d, Gecode::FloatNum st)
Create and register test.
Test for division constraint
virtual void post(Gecode::Space &home, Gecode::FloatVarArray &x)
Post constraint on x.
Div(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
Test for n-ary maximum constraint with shared variables
virtual void post(Gecode::Space &home, Gecode::FloatVarArray &x)
Post constraint on x.
MaxNaryShared(void)
Create and register test.
virtual MaybeType solution(const Assignment &x) const
Test whether x is solution
Test for n-ary maximum constraint
MaxNary(void)
Create and register test.
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 maximum constraint with shared variables
MaxXXX(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 MaybeType solution(const Assignment &x) const
Test whether x is solution
Test for binary maximum constraint with shared variables
virtual void post(Gecode::Space &home, Gecode::FloatVarArray &x)
Post constraint on x.
MaxXXY(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
Test for binary maximum 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.
MaxXYX(const std::string &s, const Gecode::FloatVal &d, Gecode::FloatNum st)
Create and register test.
Test for binary maximum constraint with shared variables
virtual MaybeType solution(const Assignment &x) const
Test whether x is solution
MaxXYY(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.
Test for binary maximum constraint
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 void post(Gecode::Space &home, Gecode::FloatVarArray &x)
Post constraint on x.
Test for n-ary minimmum constraint with shared variables
MinNaryShared(void)
Create and register test.
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.
Test for n-ary minimmum constraint
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.
MinNary(void)
Create and register test.
Test for binary minimum constraint with shared variables
virtual MaybeType solution(const Assignment &x) const
Test whether x is solution
MinXXX(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.
Test for binary minimum constraint with shared variables
MinXXY(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 MaybeType solution(const Assignment &x) const
Test whether x is solution
Test for binary minimum constraint with shared variables
MinXYX(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 void post(Gecode::Space &home, Gecode::FloatVarArray &x)
Post constraint on x.
Test for binary minimum constraint with shared variables
virtual MaybeType solution(const Assignment &x) const
Test whether x is solution
MinXYY(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.
Test for binary minimum constraint
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.
MinXYZ(const std::string &s, const Gecode::FloatVal &d, Gecode::FloatNum st)
Create and register test.
Test for multiplication constraint with shared variables
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
MultXXX(const std::string &s, const Gecode::FloatVal &d, Gecode::FloatNum st)
Create and register test.
Test for multiplication constraint with shared variables when solution is ensured
virtual bool extendAssignment(Assignment &x) const
Extend assignment x.
MultXXYSol(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 void post(Gecode::Space &home, Gecode::FloatVarArray &x)
Post constraint on x.
Test for multiplication constraint with shared variables
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
MultXXY(const std::string &s, const Gecode::FloatVal &d, Gecode::FloatNum st)
Create and register test.
Test for multiplication constraint with shared variables
virtual void post(Gecode::Space &home, Gecode::FloatVarArray &x)
Post constraint on x.
MultXYX(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
Test for multiplication constraint with shared variables
MultXYY(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 void post(Gecode::Space &home, Gecode::FloatVarArray &x)
Post constraint on x.
Test for multiplication constraint when solution is ensured
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 bool extendAssignment(Assignment &x) const
Extend assignment x.
MultXYZSol(const std::string &s, const Gecode::FloatVal &d, Gecode::FloatNum st)
Create and register test.
Test for multiplication constraint
MultXYZ(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 void post(Gecode::Space &home, Gecode::FloatVarArray &x)
Post constraint on x.
Space exposing multiplication propagation at the public API.
MultSpace(Gecode::FloatNum xl, Gecode::FloatNum xu, Gecode::FloatNum yl, Gecode::FloatNum yu, Gecode::FloatNum zl, Gecode::FloatNum zu)
Post x * y = z for the supplied intervals.
virtual Gecode::Space * copy(void)
Copy space during cloning.
Gecode::FloatVar x
Factors and product.
MultSpace(MultSpace &s)
Clone constructor.
bool check(Gecode::FloatNum xl, Gecode::FloatNum xu, Gecode::FloatNum yl, Gecode::FloatNum yu, Gecode::FloatNum zl, Gecode::FloatNum zu, Gecode::FloatNum expectedMin, Gecode::FloatNum expectedMax) const
Check one endpoint-zero sign and magnitude contraction.
MultZeroEndpoint(void)
Create and register test.
virtual bool run(void)
Run sign, symmetry, signed-zero, and zero-product cases.
bool fuzz(void) const
Exercise supported points across endpoint-zero sign combinations.
Test for nroot constraint with shared variables
virtual void post(Gecode::Space &home, Gecode::FloatVarArray &x)
Post constraint on x.
NRootXX(const std::string &s, const Gecode::FloatVal &d, unsigned int _n, Gecode::FloatNum st)
Create and register test.
virtual MaybeType solution(const Assignment &x) const
Test whether x is solution
Test for nroot constraint where solution is ensured
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 bool extendAssignment(Assignment &x) const
Extend assignment x.
NRootXYSol(const std::string &s, const Gecode::FloatVal &d, unsigned int _n, Gecode::FloatNum st)
Create and register test.
Test for nroot constraint
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.
virtual MaybeType solution(const Assignment &x) const
Test whether x is solution
Space exposing the propagated NthRoot upper bound.
virtual Gecode::Space * copy(void)
Copy space during cloning.
Gecode::FloatVar source
Source and root variables.
NRootBoundSpace(NRootBoundSpace &s)
Clone constructor.
NRootBoundSpace(Gecode::FloatNum hi, int n)
Post an NthRoot constraint with an unconstrained root.
Space exercising the Pow and NthRoot propagators.
virtual Gecode::Space * copy(void)
Copy space during cloning.
RootSpace(Gecode::FloatNum hi, Gecode::FloatNum witness, int n, bool usePow)
Post an extreme Pow or NthRoot instance.
Gecode::FloatVar x0
Variables used by the propagator.
RootSpace(RootSpace &s)
Clone constructor.
bool checkBound(Gecode::FloatNum hi, Gecode::FloatNum rejected, int n, int mode) const
Check that propagation returns a genuinely outward upper bound.
bool check(Gecode::FloatNum hi, Gecode::FloatNum witness, int n, int mode, bool usePow) const
Check that a known feasible boundary value is not removed.
virtual bool run(void)
Run test under every supported IEEE-754 rounding mode.
PositiveNRootBounds(void)
Create and register test.
Space for an adjacent interval containing zero at one endpoint.
virtual Gecode::Space * copy(void)
Copy space during cloning.
Gecode::FloatVar x
Base and result variables.
AdjacentZeroSpace(AdjacentZeroSpace &s)
Clone constructor.
AdjacentZeroSpace(bool positive)
Post exponent zero on a positive or negative adjacent interval.
Space reproducing a Pow inverse-to-forward fixpoint.
virtual Gecode::Space * copy(void)
Copy space during cloning.
FixpointSpace(FixpointSpace &s)
Clone constructor.
FixpointSpace(void)
Post the fixpoint regression instance.
Gecode::FloatVar x
Base and result variables.
Space for direct and delayed assignment of the result to zero.
Gecode::FloatVar x
Base and result variables.
ZeroResultSpace(ZeroResultSpace &s)
Clone constructor.
ZeroResultSpace(int n, bool direct)
Post a power constraint with either a zero or a wide result.
virtual Gecode::Space * copy(void)
Copy space during cloning.
Space for direct and delayed assignment of the base to zero.
virtual Gecode::Space * copy(void)
Copy space during cloning.
Gecode::FloatVar x
Base and result variables.
ZeroSpace(ZeroSpace &s)
Clone constructor.
ZeroSpace(int n, bool direct)
Post a power constraint with either a zero or a wide base.
bool checkZero(int n) const
Test one exponent with direct and delayed zero assignment.
bool checkAdjacentZero(bool positive) const
Test exponent zero on an adjacent interval containing zero.
virtual bool run(void)
Run zero and fixpoint regressions.
bool checkZeroResult(int n, bool direct) const
Test that a zero result forces a zero base.
PowConsistency(void)
Create and register test.
Test for pow constraint with shared variables
virtual void post(Gecode::Space &home, Gecode::FloatVarArray &x)
Post constraint on x.
PowXX(const std::string &s, const Gecode::FloatVal &d, unsigned int _n, Gecode::FloatNum st)
Create and register test.
virtual MaybeType solution(const Assignment &x) const
Test whether x is solution
Test for pow constraint where solution is ensured
PowXYSol(const std::string &s, const Gecode::FloatVal &d, unsigned int _n, Gecode::FloatNum st)
Create and register test.
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 bool extendAssignment(Assignment &x) const
Extend assignment x.
virtual MaybeType solution(const Assignment &x) const
Test whether x is solution
PowXY(const std::string &s, const Gecode::FloatVal &d, unsigned int _n, Gecode::FloatNum st)
Create and register test.
virtual void post(Gecode::Space &home, Gecode::FloatVarArray &x)
Post constraint on x.
Test for squaring constraint with shared variables
virtual void post(Gecode::Space &home, Gecode::FloatVarArray &x)
Post constraint on x.
SqrXX(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
Test for squaring constraint where solution is ensured
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.
virtual bool extendAssignment(Assignment &x) const
Extend assignment x.
virtual MaybeType solution(const Assignment &x) const
Test whether x is solution
Test for squaring constraint
SqrXY(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 void post(Gecode::Space &home, Gecode::FloatVarArray &x)
Post constraint on x.
Test for square root constraint with shared variables
virtual void post(Gecode::Space &home, Gecode::FloatVarArray &x)
Post constraint on x.
SqrtXX(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
Test for square root constraint where solution is ensured
virtual MaybeType solution(const Assignment &x) const
Test whether x is solution
virtual bool extendAssignment(Assignment &x) const
Extend assignment x.
SqrtXYSol(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.
Test for square root constraint
virtual void post(Gecode::Space &home, Gecode::FloatVarArray &x)
Post constraint on x.
SqrtXY(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
Base class for assignments
virtual void set(int i, const Gecode::FloatVal &val)=0
Set assignment to value val for variable i.
static MaybeType eq(Gecode::FloatVal x, Gecode::FloatVal y)
Whether x and y are equal.
static MaybeType cmp(Gecode::FloatVal x, Gecode::FloatRelType r, Gecode::FloatVal y)
Compare x and y with respect to r.
static std::string str(Gecode::FloatRelType frt)
Map float relation to string.
bool flip(void)
Flip a coin and return true or false randomly.
Gecode::FloatVal dom
Domain of variables.
void rel(Home home, FloatVar x0, FloatRelType frt, FloatVar x1)
Post propagator for .
double FloatNum
Floating point number base type.
@ FRT_GQ
Greater or equal ( ).
Space(void)
Default constructor.
Space * clone(void) const
Clone space.
SpaceStatus status(StatusStatistics &stat)
Query space status.
@ SS_FAILED
Space is failed
bool subset(const FloatVal &x, const FloatVal &y)
Gecode toplevel namespace
void sqr(Home home, FloatVar x0, FloatVar x1)
Post propagator for .
void min(Home home, FloatVar x0, FloatVar x1, FloatVar x2)
Post propagator for .
void abs(Home home, FloatVar x0, FloatVar x1)
Post propagator for .
void div(Home home, FloatVar x0, FloatVar x1, FloatVar x2)
Post propagator for .
void mult(Home home, FloatVar x0, FloatVar x1, FloatVar x2)
Post propagator for .
void sqrt(Home home, FloatVar x0, FloatVar x1)
Post propagator for .
void max(Home home, FloatVar x0, FloatVar x1, FloatVar x2)
Post propagator for .
void pow(Home home, FloatVar x0, int n, FloatVar x1)
Post propagator for for .
void nroot(Home home, FloatVar x0, int n, FloatVar x1)
Post propagator for for .
Tests for arithmetic constraints
AbsXY abs_xy_b("B", b, step)
SqrtXY sqrt_xy_b("B", b, step)
MinXYX min_xyx_b("B", b, step)
MultXYY mult_xyy_b("B", b, step)
AbsXY abs_xy_a("A", a, step)
PowXX pow_xx_b_3("B", b, 0, step)
MaxXYZ max_xyz_b("B", b, step)
MinXYY min_xyy_a("A", a, step)
MultXYY mult_xyy_c("C", c, step)
NRootXX nroot_xx_b_1("B", b, 2, step)
MaxXYZ max_xyz_c("C", c, step)
MinXXY min_xxy_c("C", c, step)
NRootXX nroot_xx_b_2("B", b, 3, step)
DivSol div_sol_a("A", a, step)
SqrtXYSol sqrt_xy_sol_a("A", a, step)
NRootXYSol nroot_xy_sol_c_3("C", c, 0, step)
SqrXYSol sqr_xy_sol_b("B", b, step)
AbsXX abs_xx_c("C", c, step)
PowXX pow_xx_b_2("B", b, 3, step)
PowXYSol pow_xy_sol_b_1("B", b, 2, step)
SqrXY sqr_xy_b("B", b, step)
PowXX pow_xx_c_1("C", c, 2, step)
SqrtXYSol sqrt_xy_sol_c("C", c, step)
Gecode::FloatVal c(-8, 8)
PowXY pow_xy_b_2("B", b, 3, step)
MultXXY mult_xxy_c("C", c, step)
NRootXX nroot_xx_a_2("A", a, 3, step)
PowXYSol pow_xy_sol_c_3("C", c, 0, step)
NRootXYSol nroot_xy_sol_c_1("C", c, 2, step)
MinXYZ min_xyz_a("A", a, step)
NRootXYSol nroot_xy_sol_b_1("B", b, 2, step)
NRootXY nroot_xy_a_1("A", a, 2, step)
MaxXYX max_xyx_a("A", a, step)
MaxXYY max_xyy_a("A", a, step)
Test::Float::Arithmetic::MultZeroEndpoint mult_zero_endpoint
SqrtXX sqrt_xx_b("B", b, step)
SqrXX sqr_xx_c("C", c, step)
MinXYX min_xyx_a("A", a, step)
PowXX pow_xx_a_3("A", a, 0, step)
PowXY pow_xy_c_2("C", c, 3, step)
MultXYZ mult_xyz_b("B", b, step)
NRootXY nroot_xy_b_2("B", b, 3, step)
MultXYX mult_xyx_a("A", a, step)
MultXYZ mult_xyz_c("C", c, step)
MultXYZ mult_xyz_a("A", a, step)
MultXXX mult_xxx_c("C", c, step)
PowXYSol pow_xy_sol_a_1("A", a, 2, step)
Test::Float::Arithmetic::PositiveNRootBounds positive_nroot_bounds
MultXYZSol mult_xyz_sol_c("C", c, step)
NRootXY nroot_xy_b_3("B", b, 0, step)
MinXXX min_xxx_b("B", b, step)
MinXXY min_xxy_b("B", b, step)
NRootXY nroot_xy_c_1("C", c, 2, step)
MinXYY min_xyy_b("B", b, step)
MinXYY min_xyy_c("C", c, step)
NRootXX nroot_xx_c_3("C", c, 0, step)
NRootXY nroot_xy_c_2("C", c, 3, step)
MinXYX min_xyx_c("C", c, step)
SqrtXY sqrt_xy_c("C", c, step)
SqrXX sqr_xx_b("B", b, step)
SqrtXY sqrt_xy_a("A", a, step)
MaxXXY max_xxy_b("B", b, step)
PowXY pow_xy_b_3("B", b, 0, step)
NRootXX nroot_xx_a_3("A", a, 0, step)
SqrtXYSol sqrt_xy_sol_b("B", b, step)
Gecode::FloatVal b(9, 12)
MultXYX mult_xyx_b("B", b, step)
MaxXYZ max_xyz_a("A", a, step)
SqrXYSol sqr_xy_sol_a("A", a, step)
PowXYSol pow_xy_sol_b_2("B", b, 3, step)
NRootXYSol nroot_xy_sol_a_2("A", a, 3, step)
SqrXX sqr_xx_a("A", a, step)
PowXYSol pow_xy_sol_c_1("C", c, 2, step)
Test::Float::Arithmetic::PowConsistency pow_consistency
NRootXYSol nroot_xy_sol_b_3("B", b, 0, step)
MultXXYSol mult_xxy_sol_c("C", c, step)
MaxXYY max_xyy_b("B", b, step)
PowXY pow_xy_a_1("A", a, 2, step)
SqrtXX sqrt_xx_a("A", a, step)
MaxXXX max_xxx_c("C", c, step)
PowXY pow_xy_a_2("A", a, 3, step)
NRootXYSol nroot_xy_sol_b_2("B", b, 3, step)
Gecode::FloatVal a(-8, 5)
SqrXY sqr_xy_c("C", c, step)
MultXXYSol mult_xxy_sol_b("B", b, step)
DivSol div_sol_c("C", c, step)
PowXX pow_xx_a_2("A", a, 3, step)
DivSol div_sol_b("B", b, step)
PowXY pow_xy_c_3("C", c, 0, step)
NRootXYSol nroot_xy_sol_a_3("A", a, 0, step)
MaxXYX max_xyx_b("B", b, step)
MaxXXY max_xxy_c("C", c, step)
MaxXXX max_xxx_b("B", b, step)
PowXYSol pow_xy_sol_b_3("B", b, 0, step)
NRootXY nroot_xy_b_1("B", b, 2, step)
PowXYSol pow_xy_sol_a_2("A", a, 3, step)
MultXXY mult_xxy_b("B", b, step)
MinXXX min_xxx_c("C", c, step)
MultXYZSol mult_xyz_sol_b("B", b, step)
PowXY pow_xy_b_1("B", b, 2, step)
AbsXY abs_xy_c("C", c, step)
const Gecode::FloatNum step
MinXYZ min_xyz_b("B", b, step)
MultXYX mult_xyx_c("C", c, step)
MultXXX mult_xxx_a("A", a, step)
MinXYZ min_xyz_c("C", c, step)
NRootXX nroot_xx_b_3("B", b, 0, step)
MultXXYSol mult_xxy_sol_a("A", a, step)
MaxXYY max_xyy_c("C", c, step)
MinXXX min_xxx_a("A", a, step)
PowXY pow_xy_a_3("A", a, 0, step)
NRootXY nroot_xy_a_2("A", a, 3, step)
PowXX pow_xx_b_1("B", b, 2, step)
MultXXY mult_xxy_a("A", a, step)
AbsXX abs_xx_b("B", b, step)
NRootXYSol nroot_xy_sol_a_1("A", a, 2, step)
PowXX pow_xx_c_2("C", c, 3, step)
MinXXY min_xxy_a("A", a, step)
MultXYZSol mult_xyz_sol_a("A", a, step)
MaxXYX max_xyx_c("C", c, step)
NRootXYSol nroot_xy_sol_c_2("C", c, 3, step)
PowXY pow_xy_c_1("C", c, 2, step)
PowXYSol pow_xy_sol_a_3("A", a, 0, step)
MultXXX mult_xxx_b("B", b, step)
NRootXX nroot_xx_a_1("A", a, 2, step)
SqrXY sqr_xy_a("A", a, step)
SqrXYSol sqr_xy_sol_c("C", c, step)
NRootXX nroot_xx_c_2("C", c, 3, step)
PowXX pow_xx_c_3("C", c, 0, step)
SqrtXX sqrt_xx_c("C", c, step)
PowXYSol pow_xy_sol_c_2("C", c, 3, step)
NRootXX nroot_xx_c_1("C", c, 2, step)
MaxXXY max_xxy_a("A", a, step)
AbsXX abs_xx_a("A", a, step)
MultXYY mult_xyy_a("A", a, step)
PowXX pow_xx_a_1("A", a, 2, step)
NRootXY nroot_xy_c_3("C", c, 0, step)
MaxXXX max_xxx_a("A", a, step)
NRootXY nroot_xy_a_3("A", a, 0, step)
MaybeType
Type for comparisons and solutions.
std::ostringstream olog
Stream used for logging.