48 namespace Test {
namespace Set {
62 bool in(
int i,
int x)
const {
71 :
SetTest(
"Precede::Single::"+str(s0)+
"<"+str(t0),4,ds,false),
76 for (
int i = 0 ; i <
n ; i++) {
77 if (!in(s,x[i]) && in(t,x[i]))
79 if (in(s,x[i]) && !in(t,x[i]))
98 bool in(
int i,
int x)
const {
106 :
SetTest(
"Precede::Multi::"+str(c0),4,ds,false), c(c0) {}
109 for (
int j=0; j<c.
size()-1; j++)
110 for (
int i=0; i<x.
size(); i++) {
111 if (!in(c[j],x[i]) && in(c[j+1],x[i]))
113 if (in(c[j],x[i]) && !in(c[j+1],x[i]))
int size(void) const
Return arity.
Range iterator for singleton range.
virtual bool solution(const SetAssignment &x) const
Test whether x is solution
int size(void) const
Return size of array (number of elements)
Multi(const Gecode::IntArgs &c0)
Create and register test.
Multi _c(Gecode::IntArgs(3, 1, 2, 3))
Single(int s0, int t0)
Create and register test.
Gecode::FloatVal c(-8, 8)
Gecode::IntArgs i(4, 1, 2, 3, 4)
int n
Number of negative literals for node type.
virtual void post(Gecode::Space &home, Gecode::SetVarArray &x, Gecode::IntVarArray &)
Post constraint on x.
Multi _d(Gecode::IntArgs(3, 3, 2, 1))
void precede(Home home, const IntVarArgs &x, int s, int t, IntConLevel)
Post propagator that s precedes t in x.
Passing integer arguments.
Node * x
Pointer to corresponding Boolean expression node.
Test for single value precedence constraint
Base class for tests with set constraints
Generate all set assignments.
Multi _e(Gecode::IntArgs(4, 4, 2, 3, 1))
Range iterator producing subsets of an IntSet.
bool subset(I &i, J &j)
Check whether range iterator i is subset of range iterator j.
Gecode toplevel namespace
virtual bool solution(const SetAssignment &x) const
Test whether x is solution
virtual void post(Gecode::Space &home, Gecode::SetVarArray &x, Gecode::IntVarArray &)
Post constraint on x.
Test for multiple value precedence constraint