|
| bool | eqv (void) const |
| | Test whether equivalence as reification mode is supported.
|
| bool | imp (void) const |
| | Test whether implication as reification mode is supported.
|
| bool | pmi (void) const |
| | Test whether reverse implication as reification mode is supported.
|
| | Test (const std::string &p, const std::string &s, int a, const Gecode::IntSet &d, bool r=false, Gecode::IntPropLevel i=Gecode::IPL_DEF) |
| | Constructor.
|
| | Test (TestTags tags, const std::string &p, const std::string &s, int a, const Gecode::IntSet &d, bool r=false, Gecode::IntPropLevel i=Gecode::IPL_DEF) |
| | Construct and register a test with explicitly assigned tags.
|
| | Test (const std::string &s, int a, const Gecode::IntSet &d, bool r=false, Gecode::IntPropLevel i=Gecode::IPL_DEF) |
| | Constructor.
|
| | Test (TestTags tags, const std::string &s, int a, const Gecode::IntSet &d, bool r=false, Gecode::IntPropLevel i=Gecode::IPL_DEF) |
| | Construct and register a test with explicitly assigned tags.
|
| | Test (const std::string &p, const std::string &s, int a, int min, int max, bool r=false, Gecode::IntPropLevel i=Gecode::IPL_DEF) |
| | Constructor.
|
| | Test (TestTags tags, const std::string &p, const std::string &s, int a, int min, int max, bool r=false, Gecode::IntPropLevel i=Gecode::IPL_DEF) |
| | Construct and register a test with explicitly assigned tags.
|
| | Test (const std::string &s, int a, int min, int max, bool r=false, Gecode::IntPropLevel i=Gecode::IPL_DEF) |
| | Constructor.
|
| | Test (TestTags tags, const std::string &s, int a, int min, int max, bool r=false, Gecode::IntPropLevel i=Gecode::IPL_DEF) |
| | Construct and register a test with explicitly assigned tags.
|
| virtual Assignment * | assignment (void) const |
| | Create the assignment generator (complete by default).
|
| virtual bool | solution (const Assignment &) const =0 |
| | Check for solution.
|
| virtual bool | ignore (const Assignment &) const |
| | Whether to ignore assignment for reification.
|
| virtual void | post (Gecode::Space &home, Gecode::IntVarArray &x)=0 |
| | Post constraint.
|
| virtual void | post (Gecode::Space &home, Gecode::IntVarArray &x, Gecode::Reify r) |
| | Post reified constraint.
|
| virtual bool | run (void) |
| | Perform test.
|
Base class for tests with integer constraints
Override solution() with an independent predicate over complete assignments and post() with the propagator's public posting function. The harness compares them while exercising propagation, cloning, pruning, and search. Register a test with static lifetime:
public:
EqualityTest() : ::
Test::
Int::
Test(
"Package::Equality", 2, 0, 1) {}
bool solution(const ::Test::Int::Assignment& a)
const override {
return a[0] == a[1];
}
}
} equality_test;
int main(
int argc,
char* argv[]) {
}
int run_registered_tests(int argc, char *argv[])
Run the tests in the process-wide registry.
Base class for tests with integer constraints
virtual void post(Gecode::Space &home, Gecode::IntVarArray &x)=0
Post constraint.
virtual bool solution(const Assignment &) const =0
Check for solution.
int main(int argc, char *argv[])
void rel(Home home, FloatVar x0, FloatRelType frt, FloatVar x1)
Post propagator for .
Testing finite domain integers.
All test variables start with the constructor's common domain. For per-variable restrictions, post them with the constraint and include them in solution(). Use the complete assignment generator when checking the full relation.
IPL_DOM initializes contest to CTL_DOMAIN; other levels initialize it to CTL_NONE. Set contest to CTL_BOUNDS_D or CTL_BOUNDS_Z only when the propagator promises that consistency. For reified constraints, enable reification in the constructor and override the reified post().
- See also
- Test::run_registered_tests
Definition at line 270 of file int.hh.