40 #ifndef __GECODE_TEST_SET_HH__
41 #define __GECODE_TEST_SET_HH__
86 : dv(d0), cur(cur0), i(1) {
107 }
while (! (i & cur) && i<cur);
181 assert((i>=0) && (i<n));
189 int size(
void)
const {
return n; }
298 :
Base(
"Set::"+s), arity(a), lub(d), reified(
r), withInt(w) {}
308 virtual bool run(
void);
317 static std::string
str(
int i);
void removeFromLub(int v, int i, const SetAssignment &a)
Remove value v from the upper bound of x[i].
virtual void post(Gecode::Space &, Gecode::SetVarArray &, Gecode::IntVarArray &, Gecode::Reify)
Post reified propagator.
void operator++(void)
Move to next subset.
void cardinality(int i, int cmin, int cmax)
Perform cardinality tell operation on x[i].
Iterator for Boolean operation types.
CountableSetRanges(const Gecode::IntSet &d, int cur)
Initialize with set d0 and bit-pattern cur0.
SetRelType
Common relation types for sets.
int size(void) const
Return arity.
Iterator for set relation types.
void operator++(void)
Move to next value.
Gecode::Reify r
Reification information.
void log(Home home, FloatVar x0, FloatVar x1)
Post propagator for .
Gecode::SetVarArray x
Set variables to be tested.
void assign(const SetAssignment &a)
Assign all variables to values in a.
int val(void) const
Return current subset.
bool operator()(void) const
Test whether all assignments have been iterated.
static std::string str(Gecode::SetRelType srt)
Map set relation to string.
CountableSet(void)
Default constructor.
SetOpType
Common operations for sets.
CountableSetRanges(void)
Default constructor.
int operator[](int i) const
Return value for variable i.
SetAssignment(int n, const Gecode::IntSet &d, int i=0)
Initialize with n set variables, initial bound d and i int variables.
SetTest(const std::string &s, int a, const Gecode::IntSet &d, bool r=false, int w=0)
Constructor.
void init(const Gecode::IntSet &d, int cur)
Initialize with set d0 and bit-pattern cur0.
SetRelTypes(void)
Initialize iterator.
bool reified
Whether the test is for a reified propagator.
void rel(int i, Gecode::SetRelType srt, const Gecode::IntSet &is)
Perform set tell operation on x[i].
Gecode::SetOpType sot(void) const
Return current operation type.
Gecode::IntArgs i(4, 1, 2, 3, 4)
SetOpTypes(void)
Initialize iterator.
int n
Number of negative literals for node type.
bool assigned(void) const
Test whether all variables are assigned.
bool operator()(void) const
Check if still subsets left.
IntRelType
Relation types for integers.
const Test::Int::Assignment & ints(void) const
Return assignment for integer variables.
void init(I &i)
Initialize with value iterator i.
bool operator()(void) const
Test whether iterator is done.
void operator++(void)
Increment to next operation type.
void post(void)
Post propagator.
bool failed(void)
Compute a fixpoint and check for failure.
Range iterator from value iterator.
Reification specification.
Base class for all tests to be run
virtual bool run(void)
Perform test.
Gecode::IntSet lub
The common superset for all domains.
int val(void) const
Return current value.
CountableSetValues(void)
Default constructor.
Value iterator producing subsets of an IntSet.
Passing integer arguments.
virtual Gecode::Space * copy(bool share)
Faked copy function.
Gecode::IntSet d
Initial domain.
SetTestSpace(int n, Gecode::IntSet &d0, int i, SetTest *t, bool log=true)
Create test space without reification.
bool prune(const SetAssignment &a)
Perform random pruning.
int intval(void) const
Return value for first integer variable.
int withInt
How many integer variables to iterate.
void addToGlb(int v, int i, const SetAssignment &a)
Remove value v from the lower bound of x[i].
FakeSpace(void)
Faked constructor.
bool operator()(void) const
Test if finished.
Node * x
Pointer to corresponding Boolean expression node.
virtual void post(Gecode::Space &home, Gecode::SetVarArray &x, Gecode::IntVarArray &y)=0
Post propagator.
Base class for tests with set constraints
Generate all set assignments.
void operator++(void)
Move to next assignment.
bool fixprob(void)
Perform fixpoint computation.
Base class for assignments
bool operator()(void) const
Test whether iterator is done.
Gecode::IntVarArray y
Int variables to be tested.
~SetAssignment(void)
Destructor.
Value iterator for integer sets.
Range iterator producing subsets of an IntSet.
int withInt
How many integer variables are used by the test.
CountableSetValues(const Gecode::IntSet &d0, int cur0)
Initialize with set d0 and bit-pattern cur0.
int val(void) const
Return current value.
Gecode::SetRelType srt(void) const
Return current relation type.
void init(const Gecode::IntSet &d0, int cur0)
Initialize with set d0 and bit-pattern cur0.
std::basic_ostream< Char, Traits > & operator<<(std::basic_ostream< Char, Traits > &os, const FloatView &x)
Print float variable view.
virtual bool solution(const SetAssignment &) const =0
Check for solution.
SetTest * test
The test currently run.
Space for executing set tests.
Iterate all subsets of a given set.
ReifyMode
Mode for reification.
struct Gecode::@518::NNF::@57::@59 a
For atomic nodes.
Generate all assignments.
virtual Gecode::Space * copy(bool share)
Copy space during cloning.
void operator++(void)
Increment to next relation type.
void init(const Gecode::IntSet &s)
Initialize with set s.