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