transcendental.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, 2005
* 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 "test/float.hh"
#include <gecode/minimodel.hh>
#ifdef GECODE_HAS_MPFR
#include <cmath>
#include <algorithm>
namespace Test { namespace Float {
namespace Transcendental {
class ExpXY : public Test {
public:
ExpXY(const std::string& s, const Gecode::FloatVal& d, Gecode::FloatNum st)
: Test("Transcendental::Exp::XY::"+s,2,d,st,CPLT_ASSIGNMENT,false) {}
virtual MaybeType solution(const Assignment& x) const {
return eq(exp(x[0]), x[1]);
}
virtual void post(Gecode::Space& home, Gecode::FloatVarArray& x) {
if (flip())
Gecode::exp(home, x[0], x[1]);
else
Gecode::rel(home, exp(x[0]) == x[1]);
}
};
class ExpXYSol : public Test {
public:
ExpXYSol(const std::string& s, const Gecode::FloatVal& d, Gecode::FloatNum st)
: Test("Transcendental::Exp::XY::Sol::"+s,2,d,st,EXTEND_ASSIGNMENT,false) {}
virtual MaybeType solution(const Assignment& x) const {
return eq(exp(x[0]), x[1]);
}
virtual bool extendAssignement(Assignment& x) const {
Gecode::FloatVal d = exp(x[0]);
if (Gecode::Float::subset(d, dom)) {
x.set(1, d);
return true;
} else {
return false;
}
}
virtual void post(Gecode::Space& home, Gecode::FloatVarArray& x) {
Gecode::exp(home, x[0], x[1]);
}
};
class ExpXX : public Test {
public:
ExpXX(const std::string& s, const Gecode::FloatVal& d, Gecode::FloatNum st)
: Test("Transcendental::Exp::XX::"+s,1,d,st,CPLT_ASSIGNMENT,false) {}
virtual MaybeType solution(const Assignment& x) const {
return eq(exp(x[0]), x[0]);
}
virtual void post(Gecode::Space& home, Gecode::FloatVarArray& x) {
Gecode::exp(home, x[0], x[0]);
}
};
class LogXY : public Test {
public:
LogXY(const std::string& s, const Gecode::FloatVal& d, Gecode::FloatNum st)
: Test("Transcendental::Log::XY::"+s,2,d,st,CPLT_ASSIGNMENT,false) {}
virtual MaybeType solution(const Assignment& x) const {
if (x[0].max() < 0.0)
return MT_FALSE;
return eq(log(x[0]), x[1]);
}
virtual void post(Gecode::Space& home, Gecode::FloatVarArray& x) {
if (flip())
Gecode::log(home, x[0], x[1]);
else
Gecode::rel(home, log(x[0]) == x[1]);
}
};
class LogXYSol : public Test {
public:
LogXYSol(const std::string& s, const Gecode::FloatVal& d, Gecode::FloatNum st)
: Test("Transcendental::Log::XY::Sol::"+s,2,d,st,EXTEND_ASSIGNMENT,false) {}
virtual MaybeType solution(const Assignment& x) const {
if (x[0].max() < 0.0)
return MT_FALSE;
return eq(log(x[0]), x[1]);
}
virtual bool extendAssignement(Assignment& x) const {
if (x[0].max() < 0.0) return false;
Gecode::FloatVal d = log(x[0]);
if (Gecode::Float::subset(d, dom)) {
x.set(1, d);
return true;
} else {
return false;
}
}
virtual void post(Gecode::Space& home, Gecode::FloatVarArray& x) {
Gecode::log(home, x[0], x[1]);
}
};
class LogXX : public Test {
public:
LogXX(const std::string& s, const Gecode::FloatVal& d, Gecode::FloatNum st)
: Test("Transcendental::Log::XX::"+s,1,d,st,CPLT_ASSIGNMENT,false) {}
virtual MaybeType solution(const Assignment& x) const {
if (x[0].max() < 0.0)
return MT_FALSE;
return eq(log(x[0]), x[0]);
}
virtual void post(Gecode::Space& home, Gecode::FloatVarArray& x) {
Gecode::log(home, x[0], x[0]);
}
};
class LogNXY : public Test {
Gecode::FloatNum base;
public:
LogNXY(const std::string& s, const Gecode::FloatVal& d, Gecode::FloatNum _base, Gecode::FloatNum st)
: Test("Transcendental::Log::N::"+str(_base)+"::XY::"+s,2,d,st,CPLT_ASSIGNMENT,false), base(_base) {}
virtual MaybeType solution(const Assignment& x) const {
if ((x[0].max() <= 0.0) || (base <= 0.0))
return MT_FALSE;
return eq(log(x[0]) / log(base), x[1]);
}
virtual void post(Gecode::Space& home, Gecode::FloatVarArray& x) {
Gecode::log(home, base, x[0], x[1]);
}
};
class LogNXYSol : public Test {
Gecode::FloatNum base;
public:
LogNXYSol(const std::string& s, const Gecode::FloatVal& d, Gecode::FloatNum _base, Gecode::FloatNum st)
: Test("Transcendental::Log::N::"+str(_base)+"::XY::Sol::"+s,2,d,st,EXTEND_ASSIGNMENT,false), base(_base) {}
virtual MaybeType solution(const Assignment& x) const {
if ((x[0].max() <= 0.0) || (base <= 0.0))
return MT_FALSE;
return eq(log(x[0]) / log(base), x[1]);
}
virtual bool extendAssignement(Assignment& x) const {
if ((x[0].max() <= 0.0) || (base <= 0.0))
return false;
Gecode::FloatVal d = log(x[0])/log(base);
if (Gecode::Float::subset(d, dom)) {
x.set(1, d);
return true;
} else {
return false;
}
}
virtual void post(Gecode::Space& home, Gecode::FloatVarArray& x) {
Gecode::log(home, base, x[0], x[1]);
}
};
class LogNXX : public Test {
Gecode::FloatNum base;
public:
LogNXX(const std::string& s, const Gecode::FloatVal& d, Gecode::FloatNum _base, Gecode::FloatNum st)
: Test("Transcendental::Log::N::"+str(_base)+"::XX::"+s,1,d,st,CPLT_ASSIGNMENT,false), base(_base) {}
virtual MaybeType solution(const Assignment& x) const {
if ((x[0].max() <= 0.0) || (base <= 0.0))
return MT_FALSE;
return eq(log(x[0]) / log(base), x[0]);
}
virtual void post(Gecode::Space& home, Gecode::FloatVarArray& x) {
Gecode::log(home, base, x[0], x[0]);
}
};
class PowXY : public Test {
Gecode::FloatNum base;
public:
PowXY(const std::string& s, const Gecode::FloatVal& d, Gecode::FloatNum _base, Gecode::FloatNum st)
: Test("Transcendental::Pow::N::"+str(_base)+"::XY::"+s,2,d,st,CPLT_ASSIGNMENT,false), base(_base) {}
virtual MaybeType solution(const Assignment& x) const {
if (base <= 0.0)
return MT_FALSE;
return eq(exp(x[0] * log(base)), x[1]);
}
virtual void post(Gecode::Space& home, Gecode::FloatVarArray& x) {
Gecode::pow(home, base, x[0], x[1]);
}
};
class PowXYSol : public Test {
Gecode::FloatNum base;
public:
PowXYSol(const std::string& s, const Gecode::FloatVal& d, Gecode::FloatNum _base, Gecode::FloatNum st)
: Test("Transcendental::Pow::N::"+str(_base)+"::XY::Sol::"+s,2,d,st,EXTEND_ASSIGNMENT,false), base(_base) {}
virtual MaybeType solution(const Assignment& x) const {
if (base <= 0.0)
return MT_FALSE;
return eq(exp(x[0] * log(base)), x[1]);
}
virtual bool extendAssignement(Assignment& x) const {
if (base <= 0.0) return false;
Gecode::FloatVal d = exp(x[0]*log(base));
if (Gecode::Float::subset(d, dom)) {
x.set(1, d);
return true;
} else {
return false;
}
}
virtual void post(Gecode::Space& home, Gecode::FloatVarArray& x) {
Gecode::pow(home, base, x[0], x[1]);
}
};
class PowXX : public Test {
Gecode::FloatNum base;
public:
PowXX(const std::string& s, const Gecode::FloatVal& d, Gecode::FloatNum _base, Gecode::FloatNum st)
: Test("Transcendental::Pow::N::"+str(_base)+"::XX::"+s,1,d,st,CPLT_ASSIGNMENT,false), base(_base) {}
virtual MaybeType solution(const Assignment& x) const {
if ((x[0].max() <= 0.0) || (base <= 0.0))
return MT_FALSE;
return eq(exp(x[0] * log(base)), x[0]);
}
virtual void post(Gecode::Space& home, Gecode::FloatVarArray& x) {
Gecode::pow(home, base, x[0], x[0]);
}
};
const Gecode::FloatNum step = 0.15;
const Gecode::FloatNum step2 = 2*step;
Gecode::FloatVal a(-8,5);
Gecode::FloatVal b(9,12);
Gecode::FloatVal c(-8,8);
ExpXY exp_xy_a("A",a,step);
ExpXY exp_xy_b("B",b,step);
ExpXY exp_xy_c("C",c,step);
ExpXYSol exp_xy_sol_a("A",a,step);
ExpXYSol exp_xy_sol_b("B",b,step);
ExpXYSol exp_xy_sol_c("C",c,step);
ExpXX exp_xx_a("A",a,step);
ExpXX exp_xx_b("B",b,step);
ExpXX exp_xx_c("C",c,step);
LogXY log_xy_a("A",a,step);
LogXY log_xy_b("B",b,step);
LogXY log_xy_c("C",c,step);
LogXYSol log_xy_sol_a("A",a,step);
LogXYSol log_xy_sol_b("B",b,step);
LogXYSol log_xy_sol_c("C",c,step);
LogXX log_xx_a("A",a,step);
LogXX log_xx_b("B",b,step);
LogXX log_xx_c("C",c,step);
LogNXY logn_xy_a_1("A",a,-1.5,step);
LogNXY logn_xy_b_1("B",b,-1.5,step);
LogNXY logn_xy_c_1("C",c,-1.5,step);
LogNXYSol logn_xy_sol_a_1("A",a,-1.5,step);
LogNXYSol logn_xy_sol_b_1("B",b,-1.5,step);
LogNXYSol logn_xy_sol_c_1("C",c,-1.5,step);
LogNXX logn_xx_a_1("A",a,-1.5,step);
LogNXX logn_xx_b_1("B",b,-1.5,step);
LogNXX logn_xx_c_1("C",c,-1.5,step);
LogNXY logn_xy_a_2("A",a,1.5,step);
LogNXY logn_xy_b_2("B",b,1.5,step);
LogNXY logn_xy_c_2("C",c,1.5,step);
LogNXYSol logn_xy_sol_a_2("A",a,1.5,step);
LogNXYSol logn_xy_sol_b_2("B",b,1.5,step);
LogNXYSol logn_xy_sol_c_2("C",c,1.5,step);
LogNXX logn_xx_a_2("A",a,1.5,step);
LogNXX logn_xx_b_2("B",b,1.5,step);
LogNXX logn_xx_c_2("C",c,1.5,step);
LogNXY logn_xy_a_3("A",a,0,step);
LogNXY logn_xy_b_3("B",b,0,step);
LogNXY logn_xy_c_3("C",c,0,step);
LogNXYSol logn_xy_sol_a_3("A",a,0,step);
LogNXYSol logn_xy_sol_b_3("B",b,0,step);
LogNXYSol logn_xy_sol_c_3("C",c,0,step);
LogNXX logn_xx_a_3("A",a,0,step);
LogNXX logn_xx_b_3("B",b,0,step);
LogNXX logn_xx_c_3("C",c,0,step);
PowXY pow_xy_a_1("A",a,-1.5,step);
PowXY pow_xy_b_1("B",b,-1.5,step);
PowXY pow_xy_c_1("C",c,-1.5,step);
PowXYSol pow_xy_sol_a_1("A",a,-1.5,step);
PowXYSol pow_xy_sol_b_1("B",b,-1.5,step);
PowXYSol pow_xy_sol_c_1("C",c,-1.5,step);
PowXX pow_xx_a_1("A",a,-1.5,step);
PowXX pow_xx_b_1("B",b,-1.5,step);
PowXX pow_xx_c_1("C",c,-1.5,step);
PowXY pow_xy_a_2("A",a,1.5,step);
PowXY pow_xy_b_2("B",b,1.5,step);
PowXY pow_xy_c_2("C",c,1.5,step);
PowXYSol pow_xy_sol_a_2("A",a,1.5,step);
PowXYSol pow_xy_sol_b_2("B",b,1.5,step);
PowXYSol pow_xy_sol_c_2("C",c,1.5,step);
PowXX pow_xx_a_2("A",a,1.5,step);
PowXX pow_xx_b_2("B",b,1.5,step);
PowXX pow_xx_c_2("C",c,1.5,step);
PowXY pow_xy_a_3("A",a,0,step);
PowXY pow_xy_b_3("B",b,0,step);
PowXY pow_xy_c_3("C",c,0,step);
PowXYSol pow_xy_sol_a_3("A",a,0,step);
PowXYSol pow_xy_sol_b_3("B",b,0,step);
PowXYSol pow_xy_sol_c_3("C",c,0,step);
PowXX pow_xx_a_3("A",a,0,step);
PowXX pow_xx_b_3("B",b,0,step);
PowXX pow_xx_c_3("C",c,0,step);
}
}}
#endif
// STATISTICS: test-float
Gecode::FloatVal
Float value type.
Definition float.hh:334
Gecode::FloatVarArray
Float variable array.
Definition float.hh:1030
Gecode::Space
Computation spaces.
Definition core.hpp:1742
Test::Float::Assignment
Base class for assignments
Definition float.hh:80
Test::Float::Assignment::set
virtual void set(int i, const Gecode::FloatVal &val)=0
Set assignment to value val for variable i.
Test::Float::Test::eq
static MaybeType eq(Gecode::FloatVal x, Gecode::FloatVal y)
Whether x and y are equal.
Definition float.hpp:268
Test::Float::Test::str
static std::string str(Gecode::FloatRelType frt)
Map float relation to string.
Definition float.hpp:194
Test::Float::Test::flip
bool flip(void)
Flip a coin and return true or false randomly.
Definition float.hpp:273
Test::Float::Test::dom
Gecode::FloatVal dom
Domain of variables.
Definition float.hh:249
Test::Float::Transcendental::ExpXX
Test for exponent constraint with shared variables
Definition transcendental.cpp:95
Test::Float::Transcendental::ExpXX::post
virtual void post(Gecode::Space &home, Gecode::FloatVarArray &x)
Post constraint on x.
Definition transcendental.cpp:105
Test::Float::Transcendental::ExpXX::solution
virtual MaybeType solution(const Assignment &x) const
Test whether x is solution
Definition transcendental.cpp:101
Test::Float::Transcendental::ExpXX::ExpXX
ExpXX(const std::string &s, const Gecode::FloatVal &d, Gecode::FloatNum st)
Create and register test.
Definition transcendental.cpp:98
Test::Float::Transcendental::ExpXYSol
Test for exponent constraint where solution is ensured
Definition transcendental.cpp:69
Test::Float::Transcendental::ExpXYSol::ExpXYSol
ExpXYSol(const std::string &s, const Gecode::FloatVal &d, Gecode::FloatNum st)
Create and register test.
Definition transcendental.cpp:72
Test::Float::Transcendental::ExpXYSol::post
virtual void post(Gecode::Space &home, Gecode::FloatVarArray &x)
Post constraint on x.
Definition transcendental.cpp:89
Test::Float::Transcendental::ExpXYSol::extendAssignement
virtual bool extendAssignement(Assignment &x) const
Extend assignment x.
Definition transcendental.cpp:79
Test::Float::Transcendental::ExpXYSol::solution
virtual MaybeType solution(const Assignment &x) const
Test whether x is solution
Definition transcendental.cpp:75
Test::Float::Transcendental::ExpXY
Test for exponent constraint
Definition transcendental.cpp:50
Test::Float::Transcendental::ExpXY::solution
virtual MaybeType solution(const Assignment &x) const
Test whether x is solution
Definition transcendental.cpp:56
Test::Float::Transcendental::ExpXY::post
virtual void post(Gecode::Space &home, Gecode::FloatVarArray &x)
Post constraint on x.
Definition transcendental.cpp:60
Test::Float::Transcendental::ExpXY::ExpXY
ExpXY(const std::string &s, const Gecode::FloatVal &d, Gecode::FloatNum st)
Create and register test.
Definition transcendental.cpp:53
Test::Float::Transcendental::LogNXX
Test for logarithm base n constraint with shared variables
Definition transcendental.cpp:229
Test::Float::Transcendental::LogNXX::post
virtual void post(Gecode::Space &home, Gecode::FloatVarArray &x)
Post constraint on x.
Definition transcendental.cpp:242
Test::Float::Transcendental::LogNXX::LogNXX
LogNXX(const std::string &s, const Gecode::FloatVal &d, Gecode::FloatNum _base, Gecode::FloatNum st)
Create and register test.
Definition transcendental.cpp:233
Test::Float::Transcendental::LogNXX::solution
virtual MaybeType solution(const Assignment &x) const
Test whether x is solution
Definition transcendental.cpp:236
Test::Float::Transcendental::LogNXYSol
Test for logarithm base n constraint where solution is ensured
Definition transcendental.cpp:198
Test::Float::Transcendental::LogNXYSol::solution
virtual MaybeType solution(const Assignment &x) const
Test whether x is solution
Definition transcendental.cpp:205
Test::Float::Transcendental::LogNXYSol::LogNXYSol
LogNXYSol(const std::string &s, const Gecode::FloatVal &d, Gecode::FloatNum _base, Gecode::FloatNum st)
Create and register test.
Definition transcendental.cpp:202
Test::Float::Transcendental::LogNXYSol::post
virtual void post(Gecode::Space &home, Gecode::FloatVarArray &x)
Post constraint on x.
Definition transcendental.cpp:223
Test::Float::Transcendental::LogNXYSol::extendAssignement
virtual bool extendAssignement(Assignment &x) const
Extend assignment x.
Definition transcendental.cpp:211
Test::Float::Transcendental::LogNXY
Test for logarithm base n constraint
Definition transcendental.cpp:179
Test::Float::Transcendental::LogNXY::post
virtual void post(Gecode::Space &home, Gecode::FloatVarArray &x)
Post constraint on x.
Definition transcendental.cpp:192
Test::Float::Transcendental::LogNXY::LogNXY
LogNXY(const std::string &s, const Gecode::FloatVal &d, Gecode::FloatNum _base, Gecode::FloatNum st)
Create and register test.
Definition transcendental.cpp:183
Test::Float::Transcendental::LogNXY::solution
virtual MaybeType solution(const Assignment &x) const
Test whether x is solution
Definition transcendental.cpp:186
Test::Float::Transcendental::LogXX
Test for logarithm constraint with shared variables
Definition transcendental.cpp:161
Test::Float::Transcendental::LogXX::LogXX
LogXX(const std::string &s, const Gecode::FloatVal &d, Gecode::FloatNum st)
Create and register test.
Definition transcendental.cpp:164
Test::Float::Transcendental::LogXX::post
virtual void post(Gecode::Space &home, Gecode::FloatVarArray &x)
Post constraint on x.
Definition transcendental.cpp:173
Test::Float::Transcendental::LogXX::solution
virtual MaybeType solution(const Assignment &x) const
Test whether x is solution
Definition transcendental.cpp:167
Test::Float::Transcendental::LogXYSol
Test for logarithm constraint where solution is ensured
Definition transcendental.cpp:132
Test::Float::Transcendental::LogXYSol::solution
virtual MaybeType solution(const Assignment &x) const
Test whether x is solution
Definition transcendental.cpp:138
Test::Float::Transcendental::LogXYSol::extendAssignement
virtual bool extendAssignement(Assignment &x) const
Extend assignment x.
Definition transcendental.cpp:144
Test::Float::Transcendental::LogXYSol::LogXYSol
LogXYSol(const std::string &s, const Gecode::FloatVal &d, Gecode::FloatNum st)
Create and register test.
Definition transcendental.cpp:135
Test::Float::Transcendental::LogXYSol::post
virtual void post(Gecode::Space &home, Gecode::FloatVarArray &x)
Post constraint on x.
Definition transcendental.cpp:155
Test::Float::Transcendental::LogXY
Test for logarithm constraint
Definition transcendental.cpp:111
Test::Float::Transcendental::LogXY::solution
virtual MaybeType solution(const Assignment &x) const
Test whether x is solution
Definition transcendental.cpp:117
Test::Float::Transcendental::LogXY::post
virtual void post(Gecode::Space &home, Gecode::FloatVarArray &x)
Post constraint on x.
Definition transcendental.cpp:123
Test::Float::Transcendental::LogXY::LogXY
LogXY(const std::string &s, const Gecode::FloatVal &d, Gecode::FloatNum st)
Create and register test.
Definition transcendental.cpp:114
Test::Float::Transcendental::PowXX
Test for pow exponent n constraint with shared variables
Definition transcendental.cpp:297
Test::Float::Transcendental::PowXX::solution
virtual MaybeType solution(const Assignment &x) const
Test whether x is solution
Definition transcendental.cpp:304
Test::Float::Transcendental::PowXX::PowXX
PowXX(const std::string &s, const Gecode::FloatVal &d, Gecode::FloatNum _base, Gecode::FloatNum st)
Create and register test.
Definition transcendental.cpp:301
Test::Float::Transcendental::PowXX::post
virtual void post(Gecode::Space &home, Gecode::FloatVarArray &x)
Post constraint on x.
Definition transcendental.cpp:310
Test::Float::Transcendental::PowXYSol
Test for pow exponent n constraint where solution is ensured
Definition transcendental.cpp:267
Test::Float::Transcendental::PowXYSol::PowXYSol
PowXYSol(const std::string &s, const Gecode::FloatVal &d, Gecode::FloatNum _base, Gecode::FloatNum st)
Create and register test.
Definition transcendental.cpp:271
Test::Float::Transcendental::PowXYSol::post
virtual void post(Gecode::Space &home, Gecode::FloatVarArray &x)
Post constraint on x.
Definition transcendental.cpp:291
Test::Float::Transcendental::PowXYSol::solution
virtual MaybeType solution(const Assignment &x) const
Test whether x is solution
Definition transcendental.cpp:274
Test::Float::Transcendental::PowXYSol::extendAssignement
virtual bool extendAssignement(Assignment &x) const
Extend assignment x.
Definition transcendental.cpp:280
Test::Float::Transcendental::PowXY
Test for pow exponent n constraint
Definition transcendental.cpp:248
Test::Float::Transcendental::PowXY::post
virtual void post(Gecode::Space &home, Gecode::FloatVarArray &x)
Post constraint on x.
Definition transcendental.cpp:261
Test::Float::Transcendental::PowXY::PowXY
PowXY(const std::string &s, const Gecode::FloatVal &d, Gecode::FloatNum _base, Gecode::FloatNum st)
Create and register test.
Definition transcendental.cpp:252
Test::Float::Transcendental::PowXY::solution
virtual MaybeType solution(const Assignment &x) const
Test whether x is solution
Definition transcendental.cpp:255
Gecode::rel
void rel(Home home, FloatVar x0, FloatRelType frt, FloatVar x1)
Post propagator for .
Definition rel.cpp:68
Gecode::FloatNum
double FloatNum
Floating point number base type.
Definition float.hh:106
minimodel.hh
Gecode::Float::subset
bool subset(const FloatVal &x, const FloatVal &y)
Definition val.hpp:490
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::pow
void pow(Home home, FloatVar x0, int n, FloatVar x1)
Post propagator for for $n\geq 0$.
Definition arithmetic.cpp:109
Test::Float::Transcendental
Tests for transcendental constraints
Definition transcendental.cpp:47
Test::Float::Transcendental::logn_xy_sol_b_1
LogNXYSol logn_xy_sol_b_1("B", b,-1.5, step)
Test::Float::Transcendental::logn_xy_sol_c_1
LogNXYSol logn_xy_sol_c_1("C", c,-1.5, step)
Test::Float::Transcendental::pow_xx_b_3
PowXX pow_xx_b_3("B", b, 0, step)
Test::Float::Transcendental::logn_xx_b_1
LogNXX logn_xx_b_1("B", b,-1.5, step)
Test::Float::Transcendental::exp_xy_sol_a
ExpXYSol exp_xy_sol_a("A", a, step)
Test::Float::Transcendental::logn_xy_a_2
LogNXY logn_xy_a_2("A", a, 1.5, step)
Test::Float::Transcendental::log_xy_c
LogXY log_xy_c("C", c, step)
Test::Float::Transcendental::exp_xy_b
ExpXY exp_xy_b("B", b, step)
Test::Float::Transcendental::pow_xy_a_2
PowXY pow_xy_a_2("A", a, 1.5, step)
Test::Float::Transcendental::pow_xx_b_2
PowXX pow_xx_b_2("B", b, 1.5, step)
Test::Float::Transcendental::logn_xy_sol_b_3
LogNXYSol logn_xy_sol_b_3("B", b, 0, step)
Test::Float::Transcendental::log_xy_sol_c
LogXYSol log_xy_sol_c("C", c, step)
Test::Float::Transcendental::pow_xx_c_2
PowXX pow_xx_c_2("C", c, 1.5, step)
Test::Float::Transcendental::pow_xy_sol_a_1
PowXYSol pow_xy_sol_a_1("A", a,-1.5, step)
Test::Float::Transcendental::exp_xy_sol_c
ExpXYSol exp_xy_sol_c("C", c, step)
Test::Float::Transcendental::logn_xy_b_3
LogNXY logn_xy_b_3("B", b, 0, step)
Test::Float::Transcendental::pow_xy_a_1
PowXY pow_xy_a_1("A", a,-1.5, step)
Test::Float::Transcendental::logn_xy_a_3
LogNXY logn_xy_a_3("A", a, 0, step)
Test::Float::Transcendental::exp_xx_c
ExpXX exp_xx_c("C", c, step)
Test::Float::Transcendental::exp_xx_b
ExpXX exp_xx_b("B", b, step)
Test::Float::Transcendental::log_xy_b
LogXY log_xy_b("B", b, step)
Test::Float::Transcendental::logn_xy_sol_a_3
LogNXYSol logn_xy_sol_a_3("A", a, 0, step)
Test::Float::Transcendental::pow_xy_b_3
PowXY pow_xy_b_3("B", b, 0, step)
Test::Float::Transcendental::logn_xx_a_2
LogNXX logn_xx_a_2("A", a, 1.5, step)
Test::Float::Transcendental::log_xy_sol_a
LogXYSol log_xy_sol_a("A", a, step)
Test::Float::Transcendental::exp_xx_a
ExpXX exp_xx_a("A", a, step)
Test::Float::Transcendental::logn_xy_sol_b_2
LogNXYSol logn_xy_sol_b_2("B", b, 1.5, step)
Test::Float::Transcendental::logn_xy_c_1
LogNXY logn_xy_c_1("C", c,-1.5, step)
Test::Float::Transcendental::pow_xy_sol_c_1
PowXYSol pow_xy_sol_c_1("C", c,-1.5, step)
Test::Float::Transcendental::pow_xy_sol_c_2
PowXYSol pow_xy_sol_c_2("C", c, 1.5, step)
Test::Float::Transcendental::logn_xy_b_2
LogNXY logn_xy_b_2("B", b, 1.5, step)
Test::Float::Transcendental::logn_xy_c_3
LogNXY logn_xy_c_3("C", c, 0, step)
Test::Float::Transcendental::pow_xy_b_1
PowXY pow_xy_b_1("B", b,-1.5, step)
Test::Float::Transcendental::logn_xy_b_1
LogNXY logn_xy_b_1("B", b,-1.5, step)
Test::Float::Transcendental::pow_xy_sol_c_3
PowXYSol pow_xy_sol_c_3("C", c, 0, step)
Test::Float::Transcendental::pow_xy_sol_b_2
PowXYSol pow_xy_sol_b_2("B", b, 1.5, step)
Test::Float::Transcendental::logn_xx_c_1
LogNXX logn_xx_c_1("C", c,-1.5, step)
Test::Float::Transcendental::pow_xy_c_3
PowXY pow_xy_c_3("C", c, 0, step)
Test::Float::Transcendental::exp_xy_sol_b
ExpXYSol exp_xy_sol_b("B", b, step)
Test::Float::Transcendental::log_xx_b
LogXX log_xx_b("B", b, step)
Test::Float::Transcendental::pow_xx_c_1
PowXX pow_xx_c_1("C", c,-1.5, step)
Test::Float::Transcendental::logn_xx_c_2
LogNXX logn_xx_c_2("C", c, 1.5, step)
Test::Float::Transcendental::logn_xy_sol_a_1
LogNXYSol logn_xy_sol_a_1("A", a,-1.5, step)
Test::Float::Transcendental::logn_xy_sol_a_2
LogNXYSol logn_xy_sol_a_2("A", a, 1.5, step)
Test::Float::Transcendental::logn_xy_sol_c_2
LogNXYSol logn_xy_sol_c_2("C", c, 1.5, step)
Test::Float::Transcendental::pow_xx_b_1
PowXX pow_xx_b_1("B", b,-1.5, step)
Test::Float::Transcendental::pow_xy_sol_a_2
PowXYSol pow_xy_sol_a_2("A", a, 1.5, step)
Test::Float::Transcendental::logn_xx_b_2
LogNXX logn_xx_b_2("B", b, 1.5, step)
Test::Float::Transcendental::logn_xy_c_2
LogNXY logn_xy_c_2("C", c, 1.5, step)
Test::Float::Transcendental::logn_xy_sol_c_3
LogNXYSol logn_xy_sol_c_3("C", c, 0, step)
Test::Float::Transcendental::logn_xx_c_3
LogNXX logn_xx_c_3("C", c, 0, step)
Test::Float::Transcendental::pow_xx_a_2
PowXX pow_xx_a_2("A", a, 1.5, step)
Test::Float::Transcendental::logn_xx_a_1
LogNXX logn_xx_a_1("A", a,-1.5, step)
Test::Float::Transcendental::exp_xy_c
ExpXY exp_xy_c("C", c, step)
Test::Float::Transcendental::pow_xy_b_2
PowXY pow_xy_b_2("B", b, 1.5, step)
Test::Float::Transcendental::pow_xy_sol_a_3
PowXYSol pow_xy_sol_a_3("A", a, 0, step)
Test::Float::Transcendental::logn_xx_a_3
LogNXX logn_xx_a_3("A", a, 0, step)
Test::Float::Transcendental::pow_xy_sol_b_3
PowXYSol pow_xy_sol_b_3("B", b, 0, step)
Test::Float::Transcendental::c
Gecode::FloatVal c(-8, 8)
Test::Float::Transcendental::pow_xx_a_1
PowXX pow_xx_a_1("A", a,-1.5, step)
Test::Float::Transcendental::logn_xy_a_1
LogNXY logn_xy_a_1("A", a,-1.5, step)
Test::Float::Transcendental::a
Gecode::FloatVal a(-8, 5)
Test::Float::Transcendental::pow_xx_c_3
PowXX pow_xx_c_3("C", c, 0, step)
Test::Float::Transcendental::pow_xy_c_2
PowXY pow_xy_c_2("C", c, 1.5, step)
Test::Float::Transcendental::logn_xx_b_3
LogNXX logn_xx_b_3("B", b, 0, step)
Test::Float::Transcendental::b
Gecode::FloatVal b(9, 12)
Test::Float::Transcendental::step2
const Gecode::FloatNum step2
Definition transcendental.cpp:316
Test::Float::Transcendental::log_xy_sol_b
LogXYSol log_xy_sol_b("B", b, step)
Test::Float::Transcendental::log_xx_c
LogXX log_xx_c("C", c, step)
Test::Float::Transcendental::pow_xy_c_1
PowXY pow_xy_c_1("C", c,-1.5, step)
Test::Float::Transcendental::pow_xy_sol_b_1
PowXYSol pow_xy_sol_b_1("B", b,-1.5, step)
Test::Float::Transcendental::step
const Gecode::FloatNum step
Definition transcendental.cpp:315
Test::Float::Transcendental::exp_xy_a
ExpXY exp_xy_a("A", a, step)
Test::Float::Transcendental::log_xx_a
LogXX log_xx_a("A", a, step)
Test::Float::Transcendental::pow_xy_a_3
PowXY pow_xy_a_3("A", a, 0, step)
Test::Float::Transcendental::log_xy_a
LogXY log_xy_a("A", a, step)
Test::Float::Transcendental::pow_xx_a_3
PowXX pow_xx_a_3("A", a, 0, step)
Test::Float
Testing domain floats.
Definition float.cpp:43
Test::Float::EXTEND_ASSIGNMENT
@ EXTEND_ASSIGNMENT
Definition float.hh:64
Test::Float::CPLT_ASSIGNMENT
@ CPLT_ASSIGNMENT
Definition float.hh:62
Test::Float::MaybeType
MaybeType
Type for comparisons and solutions.
Definition float.hh:51
Test::Float::MT_FALSE
@ MT_FALSE
Definition float.hh:52
Test
General test support.
Definition afc.cpp:39
float.hh