44 namespace Test {
namespace Float {
51 for (
int i=a.
size();
i--; )
62 class FloatFloat :
public Test {
76 :
Test(
"Linear::Float::"+
77 str(frt0)+
"::"+s+
"::"+
str(c0)+
"::"
80 a(a0),
frt(frt0),
c(c0) {
81 using namespace Gecode;
89 for (
int i=x.
size();
i--; )
94 for (
int i=x.
size();
i--; )
137 :
Test(
"Linear::Var::"+
141 using namespace Gecode;
199 using namespace Gecode;
216 const FloatVal av2[4] = {1.0,1.0,1.0,1.0};
217 const FloatVal av3[4] = {1.0,-1.0,-1.0,1.0};
218 const FloatVal av4[4] = {2.0,3.0,5.0,7.0};
219 const FloatVal av5[4] = {-2.0,3.0,-5.0,7.0};
221 for (
int i=1;
i<=4;
i++) {
virtual MaybeType solution(const Assignment &x) const
Test whether x is solution
Gecode::FloatNum step
Step for going to next solution.
void linear(Home home, const FloatVarArgs &x, FloatRelType frt, FloatNum c)
Post propagator for .
Test linear relation over float variables
bool one(const Gecode::FloatValArgs &a)
Check whether has only one coefficients.
int size(void) const
Return size of array (number of elements)
Gecode::FloatValArgs a
Coefficients.
Base class for tests with float constraints
FloatFloat(const std::string &s, const Gecode::FloatVal &d, const Gecode::FloatValArgs &a0, Gecode::FloatRelType frt0, Gecode::FloatNum c0, Gecode::FloatNum st)
Create and register test.
Create(void)
Perform creation and registration.
bool testfix
Whether to perform fixpoint test.
static MaybeType cmp(Gecode::FloatVal x, Gecode::FloatRelType r, Gecode::FloatVal y)
Compare x and y with respect to r.
bool testsubsumed
Whether to test for subsumption.
static std::string str(Gecode::FloatRelType frt)
Map float relation to string.
Gecode::FloatRelType frt
Float relation type to propagate.
Gecode::FloatNum c
Result.
Iterator for float relation types.
Gecode::IntArgs i(4, 1, 2, 3, 4)
int n
Number of negative literals for node type.
FloatVar(const std::string &s, const Gecode::FloatVal &d, const Gecode::FloatValArgs &a0, Gecode::FloatRelType frt0, Gecode::FloatNum st)
Create and register test.
FloatRelType
Relation types for floats.
unsigned int size(I &i)
Size of all ranges of range iterator i.
Reification specification.
struct Gecode::@519::NNF::@60::@62 a
For atomic nodes.
Help class to create and register tests.
virtual void post(Gecode::Space &home, Gecode::FloatVarArray &x)
Post constraint on x.
Node * x
Pointer to corresponding Boolean expression node.
virtual void post(Gecode::Space &home, Gecode::FloatVarArray &x, Gecode::Reify r)
Post reified constraint on x for r.
virtual void post(Gecode::Space &home, Gecode::FloatVarArray &x, Gecode::Reify r)
Post reified constraint on x for r.
Gecode::FloatValArgs a
Coefficients.
MaybeType
Type for comparisons and solutions.
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.
int size(void) const
Return number of variables.
bool reified
Does the constraint also exist as reified constraint.
double FloatNum
Floating point number base type.
#define GECODE_NEVER
Assert that this command is never executed.
Gecode::FloatRelType frt
Float relation type to propagate.
Base class for assignments