36#ifndef __GECODE_TEST_SET_HH__
37#define __GECODE_TEST_SET_HH__
70 : dv(d0), cur(cur0), i(1) {
91 }
while (! (i & cur) && i<cur);
94 int val(
void)
const {
return dv.
val(); }
165 assert((i>=0) && (i<
n));
306 :
Base(
"Set::"+s), arity(
a), lub(d), reified(
r), withInt(w),
317 virtual bool run(
void);
326 static std::string
str(
int i);
struct Gecode::@603::NNF::@65::@66 b
For binary nodes (and, or, eqv)
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.
Passing integer arguments.
Value iterator for integer sets.
int val(void) const
Return current value.
Range iterator from value iterator.
void init(I &i)
Initialize with value iterator i.
Reification specification.
struct Gecode::Space::@61::@63 c
Data available only during copying.
Base class for all tests to be run
Base class for assignments
Generate all assignments.
Range iterator producing subsets of an IntSet.
void init(const Gecode::IntSet &d, int cur)
Initialize with set d0 and bit-pattern cur0.
CountableSetRanges(const Gecode::IntSet &d, int cur)
Initialize with set d0 and bit-pattern cur0.
CountableSetRanges(void)
Default constructor.
Value iterator producing subsets of an IntSet.
int val(void) const
Return current value.
void init(const Gecode::IntSet &d0, int cur0)
Initialize with set d0 and bit-pattern cur0.
bool operator()(void) const
Test if finished.
CountableSetValues(void)
Default constructor.
void operator++(void)
Move to next value.
CountableSetValues(const Gecode::IntSet &d0, int cur0)
Initialize with set d0 and bit-pattern cur0.
Iterate all subsets of a given set.
int val(void) const
Return current subset.
CountableSet(void)
Default constructor.
bool operator()(void) const
Check if still subsets left.
void init(const Gecode::IntSet &s)
Initialize with set s.
void operator++(void)
Move to next subset.
Generate all set assignments.
int intval(void) const
Return value for first integer variable.
const Test::Int::Assignment & ints(void) const
Return assignment for integer variables.
void operator++(void)
Move to next assignment.
SetAssignment(int n, const Gecode::IntSet &d, int i=0)
Initialize with n set variables, initial bound d and i int variables.
int size(void) const
Return arity.
int operator[](int i) const
Return value for variable i.
int withInt
How many integer variables to iterate.
bool operator()(void) const
Test whether all assignments have been iterated.
~SetAssignment(void)
Destructor.
Gecode::IntSet lub
The common superset for all domains.
Iterator for Boolean operation types.
SetOpTypes(void)
Initialize iterator.
Gecode::SetOpType sot(void) const
Return current operation type.
void operator++(void)
Increment to next operation type.
bool operator()(void) const
Test whether iterator is done.
Iterator for set relation types.
SetRelTypes(void)
Initialize iterator.
void operator++(void)
Increment to next relation type.
Gecode::SetRelType srt(void) const
Return current relation type.
bool operator()(void) const
Test whether iterator is done.
Space for executing set tests.
bool disabled(const SetAssignment &a, SetTestSpace &c)
Prune values also in a space c with disabled propagators, but not those in assignment a.
bool subsumed(bool b)
Check for subsumption if b is true.
void post(void)
Post propagator.
SetTest * test
The test currently run.
Gecode::SetVarArray x
Set variables to be tested.
bool assigned(void) const
Test whether all variables are assigned.
Gecode::IntSet d
Initial domain.
void removeFromLub(int v, int i, const SetAssignment &a)
Remove value v from the upper bound of x[i].
bool fixprob(void)
Perform fixpoint computation.
virtual Gecode::Space * copy(void)
Copy space during cloning.
Gecode::Reify r
Reification information.
SetTestSpace(int n, Gecode::IntSet &d0, int i, SetTest *t, bool log=true)
Create test space without reification.
Gecode::IntVarArray y
Int variables to be tested.
bool failed(void)
Compute a fixpoint and check for failure.
void disable(void)
Disable propagators in space and compute fixpoint (make all idle)
void rel(int i, Gecode::SetRelType srt, const Gecode::IntSet &is)
Perform set tell operation on x[i].
bool reified
Whether the test is for a reified propagator.
bool prune(const SetAssignment &a)
Perform random pruning.
void addToGlb(int v, int i, const SetAssignment &a)
Remove value v from the lower bound of x[i].
bool same(SetTestSpace &c)
Check whether propagation is the same as in c.
void cardinality(int i, int cmin, int cmax)
Perform cardinality tell operation on x[i].
void assign(const SetAssignment &a)
Assign all variables to values in a.
void enable(void)
Enable propagators in space.
unsigned int propagators(void)
Return the number of propagators.
int withInt
How many integer variables are used by the test.
Base class for tests with set constraints
virtual void post(Gecode::Space &home, Gecode::SetVarArray &x, Gecode::IntVarArray &y)=0
Post propagator.
static std::string str(Gecode::SetRelType srt)
Map set relation to string.
bool testsubsumed
Whether to check for subsumption.
virtual bool run(void)
Perform test.
virtual void post(Gecode::Space &, Gecode::SetVarArray &, Gecode::IntVarArray &, Gecode::Reify)
Post reified propagator.
bool disabled
Whether to perform full tests for disabled propagators.
virtual bool solution(const SetAssignment &) const =0
Check for solution.
SetTest(const std::string &s, int a, const Gecode::IntSet &d, bool r=false, int w=0)
Constructor.
IntRelType
Relation types for integers.
ReifyMode
Mode for reification.
SetOpType
Common operations for sets.
SetRelType
Common relation types for sets.
std::basic_ostream< Char, Traits > & operator<<(std::basic_ostream< Char, Traits > &os, const Dictionary &d)
Print statistics summary.