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));
322 :
Base(
"Set::"+s), arity(
a), lub(
d), reified(
r), withInt(w),
333 virtual bool run(
void);
342 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.
bool disabled
Whether to perform full tests for disabled propagators.
CountableSetRanges(const Gecode::IntSet &d, int cur)
Initialize with set d0 and bit-pattern cur0.
void disable(void)
Disable propagators in space and compute fixpoint (make all idle)
SetRelType
Common relation types for sets.
Iterator for set relation types.
bool testsubsumed
Whether to check for subsumption.
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 enable(void)
Enable propagators in space.
void assign(const SetAssignment &a)
Assign all variables to values in a.
static std::string str(Gecode::SetRelType srt)
Map set relation to string.
CountableSet(void)
Default constructor.
bool same(SetTestSpace &c)
Check whether propagation is the same as in c.
int val(void) const
Return current subset.
bool operator()(void) const
Test if finished.
SetOpType
Common operations for sets.
CountableSetRanges(void)
Default constructor.
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.
int val(void) const
Return current value.
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.
bool operator()(void) const
Test whether iterator is done.
struct Gecode::@579::NNF::@61::@63 a
For atomic nodes.
void rel(int i, Gecode::SetRelType srt, const Gecode::IntSet &is)
Perform set tell operation on x[i].
Gecode::IntArgs i(4, 1, 2, 3, 4)
SetOpTypes(void)
Initialize iterator.
int n
Number of negative literals for node type.
IntRelType
Relation types for integers.
void init(I &i)
Initialize with value iterator i.
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.
struct Gecode::@579::NNF::@61::@62 b
For binary nodes (and, or, eqv)
Base class for all tests to be run
virtual bool run(void)
Perform test.
Gecode::IntSet lub
The common superset for all domains.
const Test::Int::Assignment & ints(void) const
Return assignment for integer variables.
CountableSetValues(void)
Default constructor.
Value iterator producing subsets of an IntSet.
bool assigned(void) const
Test whether all variables are assigned.
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.
Gecode::SetOpType sot(void) const
Return current operation type.
bool prune(const SetAssignment &a)
Perform random pruning.
int val(void) const
Return current value.
unsigned int propagators(void)
Return the number of propagators.
Post propagator for SetVar SetOpType SetVar y
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].
bool disabled(const SetAssignment &a, SetTestSpace &c)
Prune values also in a space c with disabled propagators, but not those in assignment a.
FakeSpace(void)
Faked constructor.
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.
bool subsumed(bool b)
Check for subsumption if b is true.
~SetAssignment(void)
Destructor.
struct Gecode::Space::@56::@58 c
Data available only during copying.
Value iterator for integer sets.
Range iterator producing subsets of an IntSet.
int withInt
How many integer variables are used by the test.
Post propagator for SetVar x
CountableSetValues(const Gecode::IntSet &d0, int cur0)
Initialize with set d0 and bit-pattern cur0.
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.
bool operator()(void) const
Test whether all assignments have been iterated.
int size(void) const
Return arity.
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.
int intval(void) const
Return value for first integer variable.
int operator[](int i) const
Return value for variable i.
bool operator()(void) const
Check if still subsets left.
Gecode::SetRelType srt(void) const
Return current relation type.
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.