40namespace 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::"+
134 str(frt0)+
"::"+s+
"::"+
str(a0.size()),
145 for (
int i=
a.
size(); i--; )
150 for (
int i=
a.
size(); i--; )
206 (void)
new FloatFloat(
"11",f1,a1,frts.frt(),0.0,step);
207 (void)
new FloatVar(
"11",f1,a1,frts.frt(),step);
208 (void)
new FloatFloat(
"21",f2,a1,frts.frt(),0.0,step);
209 (void)
new FloatVar(
"21",f2,a1,frts.frt(),step);
210 (void)
new FloatFloat(
"31",f3,a1,frts.frt(),1.0,step);
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++) {
224 (void)
new FloatFloat(
"12",f1,a2,frts.frt(),0.0,step);
225 (void)
new FloatFloat(
"13",f1,a3,frts.frt(),0.0,step);
226 (void)
new FloatFloat(
"14",f1,a4,frts.frt(),0.0,step);
227 (void)
new FloatFloat(
"15",f1,a5,frts.frt(),0.0,step);
228 (void)
new FloatFloat(
"22",f2,a2,frts.frt(),0.0,step);
229 (void)
new FloatFloat(
"23",f2,a3,frts.frt(),0.0,step);
230 (void)
new FloatFloat(
"24",f2,a4,frts.frt(),0.0,step);
231 (void)
new FloatFloat(
"25",f2,a5,frts.frt(),0.0,step);
232 (void)
new FloatFloat(
"32",f3,a2,frts.frt(),1.0,step);
234 (void)
new FloatVar(
"12",f1,a2,frts.frt(),step);
235 (void)
new FloatVar(
"13",f1,a3,frts.frt(),step);
236 (void)
new FloatVar(
"14",f1,a4,frts.frt(),step);
237 (void)
new FloatVar(
"15",f1,a5,frts.frt(),step);
238 (void)
new FloatVar(
"22",f2,a2,frts.frt(),step);
239 (void)
new FloatVar(
"23",f2,a3,frts.frt(),step);
240 (void)
new FloatVar(
"24",f2,a4,frts.frt(),step);
241 (void)
new FloatVar(
"25",f2,a5,frts.frt(),step);
int n
Number of negative literals for node type.
struct Gecode::@603::NNF::@65::@67 a
For atomic nodes.
Node * x
Pointer to corresponding Boolean expression node.
int size(void) const
Return size of array (number of elements)
Reification specification.
Base class for assignments
Iterator for float relation types.
Help class to create and register tests.
Create(void)
Perform creation and registration.
Test linear relation over float variables
virtual MaybeType solution(const Assignment &x) const
Test whether x is solution
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.
virtual void post(Gecode::Space &home, Gecode::FloatVarArray &x)
Post constraint on x.
virtual void post(Gecode::Space &home, Gecode::FloatVarArray &x, Gecode::Reify r)
Post reified constraint on x for r.
Gecode::FloatRelType frt
Float relation type to propagate.
Gecode::FloatValArgs a
Coefficients.
Gecode::FloatNum c
Result.
Test linear relation over float variables
Gecode::FloatRelType frt
Float relation type to propagate.
virtual void post(Gecode::Space &home, Gecode::FloatVarArray &x)
Post constraint on x.
virtual MaybeType solution(const Assignment &x) const
Test whether x is solution
virtual void post(Gecode::Space &home, Gecode::FloatVarArray &x, Gecode::Reify r)
Post reified constraint on x for r.
Gecode::FloatValArgs a
Coefficients.
FloatVar(const std::string &s, const Gecode::FloatVal &d, const Gecode::FloatValArgs &a0, Gecode::FloatRelType frt0, Gecode::FloatNum st)
Create and register 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.
bool testfix
Whether to perform fixpoint test.
static std::string str(Gecode::FloatRelType frt)
Map float relation to string.
bool reified
Does the constraint also exist as reified constraint.
void linear(Home home, const FloatVarArgs &x, FloatRelType frt, FloatVal c)
Post propagator for .
double FloatNum
Floating point number base type.
FloatRelType
Relation types for floats.
Gecode toplevel namespace
bool one(const Gecode::FloatValArgs &a)
Check whether has only one coefficients.
MaybeType
Type for comparisons and solutions.
#define GECODE_NEVER
Assert that this command is never executed.