trigonometric.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 Trigonometric {
class SinXY : public Test {
public:
SinXY(const std::string& s, const Gecode::FloatVal& d, Gecode::FloatNum st)
: Test("Trigonometric::Sin::XY::"+s,2,d,st,CPLT_ASSIGNMENT,false) {}
virtual MaybeType solution(const Assignment& x) const {
return eq(sin(x[0]), x[1]);
}
virtual void post(Gecode::Space& home, Gecode::FloatVarArray& x) {
if (flip())
Gecode::sin(home, x[0], x[1]);
else
Gecode::rel(home, sin(x[0]) == x[1]);
}
};
class SinXYSol : public Test {
public:
SinXYSol(const std::string& s, const Gecode::FloatVal& d, Gecode::FloatNum st)
: Test("Trigonometric::Sin::XY::Sol::"+s,2,d,st,EXTEND_ASSIGNMENT,false) {}
virtual MaybeType solution(const Assignment& x) const {
return eq(sin(x[0]), x[1]);
}
virtual bool extendAssignement(Assignment& x) const {
Gecode::FloatVal d = sin(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::sin(home, x[0], x[1]);
}
};
class SinXX : public Test {
public:
SinXX(const std::string& s, const Gecode::FloatVal& d, Gecode::FloatNum st)
: Test("Trigonometric::Sin::XX::"+s,1,d,st,CPLT_ASSIGNMENT,false) {}
virtual MaybeType solution(const Assignment& x) const {
return eq(sin(x[0]), x[0]);
}
virtual void post(Gecode::Space& home, Gecode::FloatVarArray& x) {
Gecode::sin(home, x[0], x[0]);
}
};
class CosXY : public Test {
public:
CosXY(const std::string& s, const Gecode::FloatVal& d, Gecode::FloatNum st)
: Test("Trigonometric::Cos::XY::"+s,2,d,st,CPLT_ASSIGNMENT,false) {}
virtual MaybeType solution(const Assignment& x) const {
return eq(cos(x[0]), x[1]);
}
virtual void post(Gecode::Space& home, Gecode::FloatVarArray& x) {
if (flip())
Gecode::cos(home, x[0], x[1]);
else
Gecode::rel(home, cos(x[0]) == x[1]);
}
};
class CosXYSol : public Test {
public:
CosXYSol(const std::string& s, const Gecode::FloatVal& d, Gecode::FloatNum st)
: Test("Trigonometric::Cos::XY::Sol::"+s,2,d,st,EXTEND_ASSIGNMENT,false) {}
virtual MaybeType solution(const Assignment& x) const {
return eq(cos(x[0]), x[1]);
}
virtual bool extendAssignement(Assignment& x) const {
Gecode::FloatVal d = cos(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::cos(home, x[0], x[1]);
}
};
class CosXX : public Test {
public:
CosXX(const std::string& s, const Gecode::FloatVal& d, Gecode::FloatNum st)
: Test("Trigonometric::Cos::XX::"+s,1,d,st,CPLT_ASSIGNMENT,false) {}
virtual MaybeType solution(const Assignment& x) const {
return eq(cos(x[0]), x[0]);
}
virtual void post(Gecode::Space& home, Gecode::FloatVarArray& x) {
Gecode::cos(home, x[0], x[0]);
}
};
class TanXY : public Test {
public:
TanXY(const std::string& s, const Gecode::FloatVal& d, Gecode::FloatNum st)
: Test("Trigonometric::Tan::XY::"+s,2,d,st,CPLT_ASSIGNMENT,false) {}
virtual MaybeType solution(const Assignment& x) const {
return eq(tan(x[0]), x[1]);
}
virtual void post(Gecode::Space& home, Gecode::FloatVarArray& x) {
if (flip())
Gecode::tan(home, x[0], x[1]);
else
Gecode::rel(home, tan(x[0]) == x[1]);
}
};
class TanXYSol : public Test {
public:
TanXYSol(const std::string& s, const Gecode::FloatVal& d, Gecode::FloatNum st)
: Test("Trigonometric::Tan::XY::Sol::"+s,2,d,st,EXTEND_ASSIGNMENT,false) {}
virtual MaybeType solution(const Assignment& x) const {
return eq(tan(x[0]), x[1]);
}
virtual bool extendAssignement(Assignment& x) const {
Gecode::FloatVal d = tan(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::tan(home, x[0], x[1]);
}
};
class TanXX : public Test {
public:
TanXX(const std::string& s, const Gecode::FloatVal& d, Gecode::FloatNum st)
: Test("Trigonometric::Tan::XX::"+s,1,d,st,CPLT_ASSIGNMENT,false) {}
virtual MaybeType solution(const Assignment& x) const {
return eq(tan(x[0]), x[0]);
}
virtual void post(Gecode::Space& home, Gecode::FloatVarArray& x) {
Gecode::tan(home, x[0], x[0]);
}
};
class ASinXY : public Test {
public:
ASinXY(const std::string& s, const Gecode::FloatVal& d, Gecode::FloatNum st)
: Test("Trigonometric::ASin::XY::"+s,2,d,st,CPLT_ASSIGNMENT,false) {}
virtual MaybeType solution(const Assignment& x) const {
if ((x[0].min() > 1.0) || (x[0].max() < -1.0))
return MT_FALSE;
return eq(asin(x[0]), x[1]);
}
virtual void post(Gecode::Space& home, Gecode::FloatVarArray& x) {
if (flip())
Gecode::asin(home, x[0], x[1]);
else
Gecode::rel(home, asin(x[0]) == x[1]);
}
};
class ASinXYSol : public Test {
public:
ASinXYSol(const std::string& s, const Gecode::FloatVal& d, Gecode::FloatNum st)
: Test("Trigonometric::ASin::XY::Sol::"+s,2,d,st,EXTEND_ASSIGNMENT,false) {}
virtual MaybeType solution(const Assignment& x) const {
if ((x[0].min() > 1.0) || (x[0].max() < -1.0))
return MT_FALSE;
return eq(asin(x[0]), x[1]);
}
virtual bool extendAssignement(Assignment& x) const {
if ((x[0].min() > 1.0) || (x[0].max() < -1.0))
return false;
Gecode::FloatVal d = asin(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::asin(home, x[0], x[1]);
}
};
class ASinXX : public Test {
public:
ASinXX(const std::string& s, const Gecode::FloatVal& d, Gecode::FloatNum st)
: Test("Trigonometric::ASin::XX::"+s,1,d,st,CPLT_ASSIGNMENT,false) {}
virtual MaybeType solution(const Assignment& x) const {
if ((x[0].min() > 1.0) || (x[0].max() < -1.0))
return MT_FALSE;
return eq(asin(x[0]), x[0]);
}
virtual void post(Gecode::Space& home, Gecode::FloatVarArray& x) {
Gecode::asin(home, x[0], x[0]);
}
};
class ACosXY : public Test {
public:
ACosXY(const std::string& s, const Gecode::FloatVal& d, Gecode::FloatNum st)
: Test("Trigonometric::ACos::XY::"+s,2,d,st,CPLT_ASSIGNMENT,false) {}
virtual MaybeType solution(const Assignment& x) const {
if ((x[0].min() > 1.0) || (x[0].max() < -1.0))
return MT_FALSE;
return eq(acos(x[0]), x[1]);
}
virtual void post(Gecode::Space& home, Gecode::FloatVarArray& x) {
if (flip())
Gecode::acos(home, x[0], x[1]);
else
Gecode::rel(home, acos(x[0]) == x[1]);
}
};
class ACosXYSol : public Test {
public:
ACosXYSol(const std::string& s, const Gecode::FloatVal& d, Gecode::FloatNum st)
: Test("Trigonometric::ACos::XY::Sol::"+s,2,d,st,EXTEND_ASSIGNMENT,false) {}
virtual MaybeType solution(const Assignment& x) const {
if ((x[0].min() > 1.0) || (x[0].max() < -1.0))
return MT_FALSE;
return eq(acos(x[0]), x[1]);
}
virtual bool extendAssignement(Assignment& x) const {
if ((x[0].min() > 1.0) || (x[0].max() < -1.0))
return false;
Gecode::FloatVal d = acos(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::acos(home, x[0], x[1]);
}
};
class ACosXX : public Test {
public:
ACosXX(const std::string& s, const Gecode::FloatVal& d, Gecode::FloatNum st)
: Test("Trigonometric::ACos::XX::"+s,1,d,st,CPLT_ASSIGNMENT,false) {}
virtual MaybeType solution(const Assignment& x) const {
if ((x[0].min() > 1.0) || (x[0].max() < -1.0))
return MT_FALSE;
return eq(acos(x[0]), x[0]);
}
virtual void post(Gecode::Space& home, Gecode::FloatVarArray& x) {
Gecode::acos(home, x[0], x[0]);
}
};
class ATanXY : public Test {
public:
ATanXY(const std::string& s, const Gecode::FloatVal& d, Gecode::FloatNum st)
: Test("Trigonometric::ATan::XY::"+s,2,d,st,CPLT_ASSIGNMENT,false) {}
virtual MaybeType solution(const Assignment& x) const {
return eq(atan(x[0]), x[1]);
}
virtual void post(Gecode::Space& home, Gecode::FloatVarArray& x) {
if (flip())
Gecode::atan(home, x[0], x[1]);
else
Gecode::rel(home, atan(x[0]) == x[1]);
}
};
class ATanXYSol : public Test {
public:
ATanXYSol(const std::string& s, const Gecode::FloatVal& d, Gecode::FloatNum st)
: Test("Trigonometric::ATan::XY::Sol::"+s,2,d,st,EXTEND_ASSIGNMENT,false) {}
virtual MaybeType solution(const Assignment& x) const {
return eq(atan(x[0]), x[1]);
}
virtual bool extendAssignement(Assignment& x) const {
Gecode::FloatVal d = atan(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::atan(home, x[0], x[1]);
}
};
class ATanXX : public Test {
public:
ATanXX(const std::string& s, const Gecode::FloatVal& d, Gecode::FloatNum st)
: Test("Trigonometric::ATan::XX::"+s,1,d,st,CPLT_ASSIGNMENT,false) {}
virtual MaybeType solution(const Assignment& x) const {
return eq(atan(x[0]), x[0]);
}
virtual void post(Gecode::Space& home, Gecode::FloatVarArray& x) {
Gecode::atan(home, 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);
SinXY sin_xy_a("A",a,step);
SinXY sin_xy_b("B",b,step);
SinXY sin_xy_c("C",c,step);
SinXYSol sin_xy_sol_a("A",a,step);
SinXYSol sin_xy_sol_b("B",b,step);
SinXYSol sin_xy_sol_c("C",c,step);
SinXX sin_xx_a("A",a,step);
SinXX sin_xx_b("B",b,step);
SinXX sin_xx_c("C",c,step);
CosXY cos_xy_a("A",a,step);
CosXY cos_xy_b("B",b,step);
CosXY cos_xy_c("C",c,step);
CosXYSol cos_xy_sol_a("A",a,step);
CosXYSol cos_xy_sol_b("B",b,step);
CosXYSol cos_xy_sol_c("C",c,step);
CosXX cos_xx_a("A",a,step);
CosXX cos_xx_b("B",b,step);
CosXX cos_xx_c("C",c,step);
TanXY tan_xy_a("A",a,step);
TanXY tan_xy_b("B",b,step);
TanXY tan_xy_c("C",c,step);
TanXYSol tan_xy_sol_a("A",a,step);
TanXYSol tan_xy_sol_b("B",b,step);
TanXYSol tan_xy_sol_c("C",c,step);
TanXX tan_xx_a("A",a,step);
TanXX tan_xx_b("B",b,step);
TanXX tan_xx_c("C",c,step);
ASinXY asin_xy_a("A",a,step);
ASinXY asin_xy_b("B",b,step);
ASinXY asin_xy_c("C",c,step);
ASinXYSol asin_xy_sol_a("A",a,step);
ASinXYSol asin_xy_sol_b("B",b,step);
ASinXYSol asin_xy_sol_c("C",c,step);
ASinXX asin_xx_a("A",a,step);
ASinXX asin_xx_b("B",b,step);
ASinXX asin_xx_c("C",c,step);
ACosXY acos_xy_a("A",a,step);
ACosXY acos_xy_b("B",b,step);
ACosXY acos_xy_c("C",c,step);
ACosXYSol acos_xy_sol_a("A",a,step);
ACosXYSol acos_xy_sol_b("B",b,step);
ACosXYSol acos_xy_sol_c("C",c,step);
ACosXX acos_xx_a("A",a,step);
ACosXX acos_xx_b("B",b,step);
ACosXX acos_xx_c("C",c,step);
ATanXY atan_xy_a("A",a,step);
ATanXY atan_xy_b("B",b,step);
ATanXY atan_xy_c("C",c,step);
ATanXYSol atan_xy_sol_a("A",a,step);
ATanXYSol atan_xy_sol_b("B",b,step);
ATanXYSol atan_xy_sol_c("C",c,step);
ATanXX atan_xx_a("A",a,step);
ATanXX atan_xx_b("B",b,step);
ATanXX atan_xx_c("C",c,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::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::Trigonometric::ACosXX
Test for acosinus constraint with shared variables
Definition trigonometric.cpp:353
Test::Float::Trigonometric::ACosXX::post
virtual void post(Gecode::Space &home, Gecode::FloatVarArray &x)
Post constraint on x.
Definition trigonometric.cpp:365
Test::Float::Trigonometric::ACosXX::solution
virtual MaybeType solution(const Assignment &x) const
Test whether x is solution
Definition trigonometric.cpp:359
Test::Float::Trigonometric::ACosXX::ACosXX
ACosXX(const std::string &s, const Gecode::FloatVal &d, Gecode::FloatNum st)
Create and register test.
Definition trigonometric.cpp:356
Test::Float::Trigonometric::ACosXYSol
Test for acosinus constraint where solution is ensured
Definition trigonometric.cpp:323
Test::Float::Trigonometric::ACosXYSol::post
virtual void post(Gecode::Space &home, Gecode::FloatVarArray &x)
Post constraint on x.
Definition trigonometric.cpp:347
Test::Float::Trigonometric::ACosXYSol::ACosXYSol
ACosXYSol(const std::string &s, const Gecode::FloatVal &d, Gecode::FloatNum st)
Create and register test.
Definition trigonometric.cpp:326
Test::Float::Trigonometric::ACosXYSol::solution
virtual MaybeType solution(const Assignment &x) const
Test whether x is solution
Definition trigonometric.cpp:329
Test::Float::Trigonometric::ACosXYSol::extendAssignement
virtual bool extendAssignement(Assignment &x) const
Extend assignment x.
Definition trigonometric.cpp:335
Test::Float::Trigonometric::ACosXY
Test for acosinus constraint
Definition trigonometric.cpp:302
Test::Float::Trigonometric::ACosXY::ACosXY
ACosXY(const std::string &s, const Gecode::FloatVal &d, Gecode::FloatNum st)
Create and register test.
Definition trigonometric.cpp:305
Test::Float::Trigonometric::ACosXY::post
virtual void post(Gecode::Space &home, Gecode::FloatVarArray &x)
Post constraint on x.
Definition trigonometric.cpp:314
Test::Float::Trigonometric::ACosXY::solution
virtual MaybeType solution(const Assignment &x) const
Test whether x is solution
Definition trigonometric.cpp:308
Test::Float::Trigonometric::ASinXX
Test for asinus constraint with shared variables
Definition trigonometric.cpp:284
Test::Float::Trigonometric::ASinXX::post
virtual void post(Gecode::Space &home, Gecode::FloatVarArray &x)
Post constraint on x.
Definition trigonometric.cpp:296
Test::Float::Trigonometric::ASinXX::ASinXX
ASinXX(const std::string &s, const Gecode::FloatVal &d, Gecode::FloatNum st)
Create and register test.
Definition trigonometric.cpp:287
Test::Float::Trigonometric::ASinXX::solution
virtual MaybeType solution(const Assignment &x) const
Test whether x is solution
Definition trigonometric.cpp:290
Test::Float::Trigonometric::ASinXYSol
Test for asinus constraint where solution is ensured
Definition trigonometric.cpp:254
Test::Float::Trigonometric::ASinXYSol::ASinXYSol
ASinXYSol(const std::string &s, const Gecode::FloatVal &d, Gecode::FloatNum st)
Create and register test.
Definition trigonometric.cpp:257
Test::Float::Trigonometric::ASinXYSol::post
virtual void post(Gecode::Space &home, Gecode::FloatVarArray &x)
Post constraint on x.
Definition trigonometric.cpp:278
Test::Float::Trigonometric::ASinXYSol::solution
virtual MaybeType solution(const Assignment &x) const
Test whether x is solution
Definition trigonometric.cpp:260
Test::Float::Trigonometric::ASinXYSol::extendAssignement
virtual bool extendAssignement(Assignment &x) const
Extend assignment x.
Definition trigonometric.cpp:266
Test::Float::Trigonometric::ASinXY
Test for asinus constraint
Definition trigonometric.cpp:233
Test::Float::Trigonometric::ASinXY::solution
virtual MaybeType solution(const Assignment &x) const
Test whether x is solution
Definition trigonometric.cpp:239
Test::Float::Trigonometric::ASinXY::ASinXY
ASinXY(const std::string &s, const Gecode::FloatVal &d, Gecode::FloatNum st)
Create and register test.
Definition trigonometric.cpp:236
Test::Float::Trigonometric::ASinXY::post
virtual void post(Gecode::Space &home, Gecode::FloatVarArray &x)
Post constraint on x.
Definition trigonometric.cpp:245
Test::Float::Trigonometric::ATanXX
Test for atangent constraint with shared variables
Definition trigonometric.cpp:416
Test::Float::Trigonometric::ATanXX::post
virtual void post(Gecode::Space &home, Gecode::FloatVarArray &x)
Post constraint on x.
Definition trigonometric.cpp:426
Test::Float::Trigonometric::ATanXX::solution
virtual MaybeType solution(const Assignment &x) const
Test whether x is solution
Definition trigonometric.cpp:422
Test::Float::Trigonometric::ATanXX::ATanXX
ATanXX(const std::string &s, const Gecode::FloatVal &d, Gecode::FloatNum st)
Create and register test.
Definition trigonometric.cpp:419
Test::Float::Trigonometric::ATanXYSol
Test for atangent constraint where solution is ensured
Definition trigonometric.cpp:390
Test::Float::Trigonometric::ATanXYSol::solution
virtual MaybeType solution(const Assignment &x) const
Test whether x is solution
Definition trigonometric.cpp:396
Test::Float::Trigonometric::ATanXYSol::post
virtual void post(Gecode::Space &home, Gecode::FloatVarArray &x)
Post constraint on x.
Definition trigonometric.cpp:410
Test::Float::Trigonometric::ATanXYSol::extendAssignement
virtual bool extendAssignement(Assignment &x) const
Extend assignment x.
Definition trigonometric.cpp:400
Test::Float::Trigonometric::ATanXYSol::ATanXYSol
ATanXYSol(const std::string &s, const Gecode::FloatVal &d, Gecode::FloatNum st)
Create and register test.
Definition trigonometric.cpp:393
Test::Float::Trigonometric::ATanXY
Test for atangent constraint
Definition trigonometric.cpp:371
Test::Float::Trigonometric::ATanXY::ATanXY
ATanXY(const std::string &s, const Gecode::FloatVal &d, Gecode::FloatNum st)
Create and register test.
Definition trigonometric.cpp:374
Test::Float::Trigonometric::ATanXY::solution
virtual MaybeType solution(const Assignment &x) const
Test whether x is solution
Definition trigonometric.cpp:377
Test::Float::Trigonometric::ATanXY::post
virtual void post(Gecode::Space &home, Gecode::FloatVarArray &x)
Post constraint on x.
Definition trigonometric.cpp:381
Test::Float::Trigonometric::CosXX
Test for cosinus constraint with shared variables
Definition trigonometric.cpp:156
Test::Float::Trigonometric::CosXX::CosXX
CosXX(const std::string &s, const Gecode::FloatVal &d, Gecode::FloatNum st)
Create and register test.
Definition trigonometric.cpp:159
Test::Float::Trigonometric::CosXX::solution
virtual MaybeType solution(const Assignment &x) const
Test whether x is solution
Definition trigonometric.cpp:162
Test::Float::Trigonometric::CosXX::post
virtual void post(Gecode::Space &home, Gecode::FloatVarArray &x)
Post constraint on x.
Definition trigonometric.cpp:166
Test::Float::Trigonometric::CosXYSol
Test for cosinus constraint where solution is ensured
Definition trigonometric.cpp:130
Test::Float::Trigonometric::CosXYSol::solution
virtual MaybeType solution(const Assignment &x) const
Test whether x is solution
Definition trigonometric.cpp:136
Test::Float::Trigonometric::CosXYSol::CosXYSol
CosXYSol(const std::string &s, const Gecode::FloatVal &d, Gecode::FloatNum st)
Create and register test.
Definition trigonometric.cpp:133
Test::Float::Trigonometric::CosXYSol::post
virtual void post(Gecode::Space &home, Gecode::FloatVarArray &x)
Post constraint on x.
Definition trigonometric.cpp:150
Test::Float::Trigonometric::CosXYSol::extendAssignement
virtual bool extendAssignement(Assignment &x) const
Extend assignment x.
Definition trigonometric.cpp:140
Test::Float::Trigonometric::CosXY
Test for cosinus constraint
Definition trigonometric.cpp:111
Test::Float::Trigonometric::CosXY::CosXY
CosXY(const std::string &s, const Gecode::FloatVal &d, Gecode::FloatNum st)
Create and register test.
Definition trigonometric.cpp:114
Test::Float::Trigonometric::CosXY::post
virtual void post(Gecode::Space &home, Gecode::FloatVarArray &x)
Post constraint on x.
Definition trigonometric.cpp:121
Test::Float::Trigonometric::CosXY::solution
virtual MaybeType solution(const Assignment &x) const
Test whether x is solution
Definition trigonometric.cpp:117
Test::Float::Trigonometric::SinXX
Test for sinus constraint with shared variables
Definition trigonometric.cpp:95
Test::Float::Trigonometric::SinXX::post
virtual void post(Gecode::Space &home, Gecode::FloatVarArray &x)
Post constraint on x.
Definition trigonometric.cpp:105
Test::Float::Trigonometric::SinXX::SinXX
SinXX(const std::string &s, const Gecode::FloatVal &d, Gecode::FloatNum st)
Create and register test.
Definition trigonometric.cpp:98
Test::Float::Trigonometric::SinXX::solution
virtual MaybeType solution(const Assignment &x) const
Test whether x is solution
Definition trigonometric.cpp:101
Test::Float::Trigonometric::SinXYSol
Test for sinus constraint where solution is ensured
Definition trigonometric.cpp:69
Test::Float::Trigonometric::SinXYSol::solution
virtual MaybeType solution(const Assignment &x) const
Test whether x is solution
Definition trigonometric.cpp:75
Test::Float::Trigonometric::SinXYSol::extendAssignement
virtual bool extendAssignement(Assignment &x) const
Extend assignment x.
Definition trigonometric.cpp:79
Test::Float::Trigonometric::SinXYSol::post
virtual void post(Gecode::Space &home, Gecode::FloatVarArray &x)
Post constraint on x.
Definition trigonometric.cpp:89
Test::Float::Trigonometric::SinXYSol::SinXYSol
SinXYSol(const std::string &s, const Gecode::FloatVal &d, Gecode::FloatNum st)
Create and register test.
Definition trigonometric.cpp:72
Test::Float::Trigonometric::SinXY
Test for sinus constraint
Definition trigonometric.cpp:50
Test::Float::Trigonometric::SinXY::solution
virtual MaybeType solution(const Assignment &x) const
Test whether x is solution
Definition trigonometric.cpp:56
Test::Float::Trigonometric::SinXY::post
virtual void post(Gecode::Space &home, Gecode::FloatVarArray &x)
Post constraint on x.
Definition trigonometric.cpp:60
Test::Float::Trigonometric::SinXY::SinXY
SinXY(const std::string &s, const Gecode::FloatVal &d, Gecode::FloatNum st)
Create and register test.
Definition trigonometric.cpp:53
Test::Float::Trigonometric::TanXX
Test for tangent constraint with shared variables
Definition trigonometric.cpp:217
Test::Float::Trigonometric::TanXX::post
virtual void post(Gecode::Space &home, Gecode::FloatVarArray &x)
Post constraint on x.
Definition trigonometric.cpp:227
Test::Float::Trigonometric::TanXX::solution
virtual MaybeType solution(const Assignment &x) const
Test whether x is solution
Definition trigonometric.cpp:223
Test::Float::Trigonometric::TanXX::TanXX
TanXX(const std::string &s, const Gecode::FloatVal &d, Gecode::FloatNum st)
Create and register test.
Definition trigonometric.cpp:220
Test::Float::Trigonometric::TanXYSol
Test for tangent constraint where solution is ensured
Definition trigonometric.cpp:191
Test::Float::Trigonometric::TanXYSol::extendAssignement
virtual bool extendAssignement(Assignment &x) const
Extend assignment x.
Definition trigonometric.cpp:201
Test::Float::Trigonometric::TanXYSol::TanXYSol
TanXYSol(const std::string &s, const Gecode::FloatVal &d, Gecode::FloatNum st)
Create and register test.
Definition trigonometric.cpp:194
Test::Float::Trigonometric::TanXYSol::solution
virtual MaybeType solution(const Assignment &x) const
Test whether x is solution
Definition trigonometric.cpp:197
Test::Float::Trigonometric::TanXYSol::post
virtual void post(Gecode::Space &home, Gecode::FloatVarArray &x)
Post constraint on x.
Definition trigonometric.cpp:211
Test::Float::Trigonometric::TanXY
Test for tangent constraint
Definition trigonometric.cpp:172
Test::Float::Trigonometric::TanXY::solution
virtual MaybeType solution(const Assignment &x) const
Test whether x is solution
Definition trigonometric.cpp:178
Test::Float::Trigonometric::TanXY::post
virtual void post(Gecode::Space &home, Gecode::FloatVarArray &x)
Post constraint on x.
Definition trigonometric.cpp:182
Test::Float::Trigonometric::TanXY::TanXY
TanXY(const std::string &s, const Gecode::FloatVal &d, Gecode::FloatNum st)
Create and register test.
Definition trigonometric.cpp:175
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::sin
void sin(Home home, FloatVar x0, FloatVar x1)
Post propagator for .
Definition trigonometric.cpp:52
Gecode::cos
void cos(Home home, FloatVar x0, FloatVar x1)
Post propagator for .
Definition trigonometric.cpp:66
Gecode::acos
void acos(Home home, FloatVar x0, FloatVar x1)
Post propagator for .
Definition trigonometric.cpp:59
Gecode::atan
void atan(Home home, FloatVar x0, FloatVar x1)
Post propagator for .
Definition trigonometric.cpp:73
Gecode::asin
void asin(Home home, FloatVar x0, FloatVar x1)
Post propagator for .
Definition trigonometric.cpp:45
Gecode::tan
void tan(Home home, FloatVar x0, FloatVar x1)
Post propagator for .
Definition trigonometric.cpp:80
Test::Float::Trigonometric
Tests for trigonometric constraints
Definition trigonometric.cpp:47
Test::Float::Trigonometric::tan_xx_c
TanXX tan_xx_c("C", c, step)
Test::Float::Trigonometric::acos_xy_sol_c
ACosXYSol acos_xy_sol_c("C", c, step)
Test::Float::Trigonometric::cos_xy_sol_a
CosXYSol cos_xy_sol_a("A", a, step)
Test::Float::Trigonometric::asin_xx_b
ASinXX asin_xx_b("B", b, step)
Test::Float::Trigonometric::cos_xy_a
CosXY cos_xy_a("A", a, step)
Test::Float::Trigonometric::acos_xx_b
ACosXX acos_xx_b("B", b, step)
Test::Float::Trigonometric::cos_xx_a
CosXX cos_xx_a("A", a, step)
Test::Float::Trigonometric::cos_xy_sol_b
CosXYSol cos_xy_sol_b("B", b, step)
Test::Float::Trigonometric::atan_xy_sol_b
ATanXYSol atan_xy_sol_b("B", b, step)
Test::Float::Trigonometric::tan_xy_sol_b
TanXYSol tan_xy_sol_b("B", b, step)
Test::Float::Trigonometric::c
Gecode::FloatVal c(-8, 8)
Test::Float::Trigonometric::acos_xy_c
ACosXY acos_xy_c("C", c, step)
Test::Float::Trigonometric::sin_xy_sol_c
SinXYSol sin_xy_sol_c("C", c, step)
Test::Float::Trigonometric::tan_xy_a
TanXY tan_xy_a("A", a, step)
Test::Float::Trigonometric::sin_xy_c
SinXY sin_xy_c("C", c, step)
Test::Float::Trigonometric::atan_xy_c
ATanXY atan_xy_c("C", c, step)
Test::Float::Trigonometric::sin_xy_a
SinXY sin_xy_a("A", a, step)
Test::Float::Trigonometric::atan_xx_c
ATanXX atan_xx_c("C", c, step)
Test::Float::Trigonometric::tan_xy_sol_a
TanXYSol tan_xy_sol_a("A", a, step)
Test::Float::Trigonometric::tan_xy_sol_c
TanXYSol tan_xy_sol_c("C", c, step)
Test::Float::Trigonometric::cos_xx_b
CosXX cos_xx_b("B", b, step)
Test::Float::Trigonometric::atan_xy_sol_c
ATanXYSol atan_xy_sol_c("C", c, step)
Test::Float::Trigonometric::sin_xy_sol_b
SinXYSol sin_xy_sol_b("B", b, step)
Test::Float::Trigonometric::cos_xy_sol_c
CosXYSol cos_xy_sol_c("C", c, step)
Test::Float::Trigonometric::sin_xx_c
SinXX sin_xx_c("C", c, step)
Test::Float::Trigonometric::cos_xy_b
CosXY cos_xy_b("B", b, step)
Test::Float::Trigonometric::a
Gecode::FloatVal a(-8, 5)
Test::Float::Trigonometric::tan_xx_a
TanXX tan_xx_a("A", a, step)
Test::Float::Trigonometric::acos_xy_sol_b
ACosXYSol acos_xy_sol_b("B", b, step)
Test::Float::Trigonometric::sin_xy_b
SinXY sin_xy_b("B", b, step)
Test::Float::Trigonometric::step2
const Gecode::FloatNum step2
Definition trigonometric.cpp:432
Test::Float::Trigonometric::atan_xy_b
ATanXY atan_xy_b("B", b, step)
Test::Float::Trigonometric::asin_xx_a
ASinXX asin_xx_a("A", a, step)
Test::Float::Trigonometric::asin_xy_sol_a
ASinXYSol asin_xy_sol_a("A", a, step)
Test::Float::Trigonometric::acos_xy_a
ACosXY acos_xy_a("A", a, step)
Test::Float::Trigonometric::atan_xy_sol_a
ATanXYSol atan_xy_sol_a("A", a, step)
Test::Float::Trigonometric::tan_xy_c
TanXY tan_xy_c("C", c, step)
Test::Float::Trigonometric::cos_xx_c
CosXX cos_xx_c("C", c, step)
Test::Float::Trigonometric::acos_xy_sol_a
ACosXYSol acos_xy_sol_a("A", a, step)
Test::Float::Trigonometric::sin_xx_a
SinXX sin_xx_a("A", a, step)
Test::Float::Trigonometric::tan_xy_b
TanXY tan_xy_b("B", b, step)
Test::Float::Trigonometric::sin_xx_b
SinXX sin_xx_b("B", b, step)
Test::Float::Trigonometric::asin_xy_c
ASinXY asin_xy_c("C", c, step)
Test::Float::Trigonometric::tan_xx_b
TanXX tan_xx_b("B", b, step)
Test::Float::Trigonometric::step
const Gecode::FloatNum step
Definition trigonometric.cpp:431
Test::Float::Trigonometric::acos_xx_c
ACosXX acos_xx_c("C", c, step)
Test::Float::Trigonometric::asin_xx_c
ASinXX asin_xx_c("C", c, step)
Test::Float::Trigonometric::acos_xy_b
ACosXY acos_xy_b("B", b, step)
Test::Float::Trigonometric::asin_xy_sol_b
ASinXYSol asin_xy_sol_b("B", b, step)
Test::Float::Trigonometric::b
Gecode::FloatVal b(9, 12)
Test::Float::Trigonometric::atan_xx_b
ATanXX atan_xx_b("B", b, step)
Test::Float::Trigonometric::acos_xx_a
ACosXX acos_xx_a("A", a, step)
Test::Float::Trigonometric::sin_xy_sol_a
SinXYSol sin_xy_sol_a("A", a, step)
Test::Float::Trigonometric::asin_xy_b
ASinXY asin_xy_b("B", b, step)
Test::Float::Trigonometric::asin_xy_sol_c
ASinXYSol asin_xy_sol_c("C", c, step)
Test::Float::Trigonometric::cos_xy_c
CosXY cos_xy_c("C", c, step)
Test::Float::Trigonometric::atan_xx_a
ATanXX atan_xx_a("A", a, step)
Test::Float::Trigonometric::asin_xy_a
ASinXY asin_xy_a("A", a, step)
Test::Float::Trigonometric::atan_xy_a
ATanXY atan_xy_a("A", a, 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