40 namespace Test {
namespace Float {
47 for (
int i=a.
size();
i--; )
72 :
Test(
"Linear::Float::"+
73 str(frt0)+
"::"+s+
"::"+
str(c0)+
"::" 76 a(a0), frt(frt0), c(c0) {
85 for (
int i=x.
size();
i--; )
90 for (
int i=x.
size();
i--; )
133 :
Test(
"Linear::Var::"+
145 for (
int i=a.
size();
i--; )
147 switch (
cmp(e, frt, x[a.
size()])) {
150 for (
int i=a.
size();
i--; )
213 const FloatVal av2[4] = {1.0,1.0,1.0,1.0};
214 const FloatVal av3[4] = {1.0,-1.0,-1.0,1.0};
215 const FloatVal av4[4] = {2.0,3.0,5.0,7.0};
216 const FloatVal av5[4] = {-2.0,3.0,-5.0,7.0};
218 for (
int i=1;
i<=4;
i++) {
Gecode::FloatNum step
Step for going to next solution.
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.
void linear(Home home, const FloatVarArgs &x, FloatRelType frt, FloatVal c)
Post propagator for .
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
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.
Post propagator for SetVar SetOpType SetVar y
Node * x
Pointer to corresponding Boolean expression node.
struct Gecode::@585::NNF::@62::@64 a
For atomic nodes.
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