44 namespace Test {
namespace Float {
51 for (
int i=a.
size();
i--; )
76 :
Test(
"Linear::Float::"+
77 str(frt0)+
"::"+s+
"::"+
str(c0)+
"::" 80 a(a0), frt(frt0), c(c0) {
89 for (
int i=x.
size();
i--; )
94 for (
int i=x.
size();
i--; )
137 :
Test(
"Linear::Var::"+
149 for (
int i=a.
size();
i--; )
151 switch (
cmp(e, frt, x[a.
size()])) {
154 for (
int i=a.
size();
i--; )
217 const FloatVal av2[4] = {1.0,1.0,1.0,1.0};
218 const FloatVal av3[4] = {1.0,-1.0,-1.0,1.0};
219 const FloatVal av4[4] = {2.0,3.0,5.0,7.0};
220 const FloatVal av5[4] = {-2.0,3.0,-5.0,7.0};
222 for (
int i=1;
i<=4;
i++) {
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
int size(void) const
Return size of array (number of elements)
Test linear relation over float variables
bool one(const Gecode::FloatValArgs &a)
Check whether has only one coefficients.
Gecode::FloatValArgs a
Coefficients.
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.
virtual MaybeType solution(const Assignment &x) const
Test whether x is solution
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.
virtual MaybeType solution(const Assignment &x) const
Test whether x is solution
struct Gecode::@554::NNF::@60::@62 a
For atomic nodes.
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.
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 void post(Gecode::Space &home, Gecode::FloatVarArray &x)
Post constraint on x.
int size(void) const
Return number of variables.
Gecode toplevel namespace
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