42 namespace Test {
namespace Assign {
70 : x(*this, n, 0, 1) {}
82 #ifdef GECODE_HAS_SET_VARS 91 : x(*this, n,
Gecode::IntSet::empty, d) {}
105 #ifdef GECODE_HAS_FLOAT_VARS 114 : x(*this, n, d.
min(), d.
max()) {}
155 const char* bool_assign_name[] = {
163 const int n_bool_assign =
164 sizeof(bool_assign_name)/
sizeof(
const char*);
172 :
Base(
"Int::Assign::"+s), arity(a),
dom(d) {
179 post(*root, root->
x);
205 delete s; solutions++;
207 if (solutions != 1) {
208 std::cout <<
"FAILURE" << std::endl
209 <<
"\tc_d=" << o.
c_d <<
", a_d=" << o.
a_d << std::endl
210 <<
"\t" << int_assign_name[val] << std::endl;
220 :
Base(
"Bool::Assign::"+s), arity(a) {
227 post(*root, root->
x);
230 for (
int val = n_bool_assign; val--; ) {
251 delete s; solutions++;
253 if (solutions != 1) {
254 std::cout <<
"FAILURE" << std::endl
255 <<
"\tc_d=" << o.
c_d <<
", a_d=" << o.
a_d << std::endl
256 <<
"\t" << int_assign_name[val] << std::endl;
265 #ifdef GECODE_HAS_SET_VARS 272 const char* set_assign_name[] = {
274 "SET_ASSIGN_MIN_INC",
275 "SET_ASSIGN_MIN_EXC",
276 "SET_ASSIGN_MED_INC",
277 "SET_ASSIGN_MED_EXC",
278 "SET_ASSIGN_MAX_INC",
279 "SET_ASSIGN_MAX_EXC",
280 "SET_ASSIGN_RND_INC",
281 "SET_ASSIGN_RND_EXC",
285 const int n_set_assign =
286 sizeof(set_assign_name)/
sizeof(
const char*);
302 post(*root, root->
x);
305 for (
int val = n_int_assign; val--; ) {
333 delete s; solutions++;
335 if (solutions != 1) {
336 std::cout <<
"FAILURE" << std::endl
337 <<
"\tc_d=" << o.
c_d <<
", a_d=" << o.
a_d << std::endl
338 <<
"\t" << set_assign_name[val] << std::endl;
349 #ifdef GECODE_HAS_FLOAT_VARS 356 const char* float_assign_name[] = {
364 const int n_float_assign =
365 sizeof(float_assign_name)/
sizeof(
const char*);
382 post(*root, root->
x);
385 for (
int val = n_float_assign; val--; ) {
408 delete s; solutions++;
410 if (solutions != 1) {
411 std::cout <<
"FAILURE" << std::endl
412 <<
"\tc_d=" << o.
c_d <<
", a_d=" << o.
a_d << std::endl
413 <<
"\t" << float_assign_name[val] << std::endl;
unsigned int a_d
Create a clone during recomputation if distance is greater than a_d (adaptive distance) ...
FloatTestSpace(int n, const Gecode::FloatVal &d)
Initialize test space.
int min(void) const
Return minimum of domain.
const char * int_assign_name[]
Names for integer assignments.
int int_val(const Gecode::Space &, Gecode::IntVar x, int)
Test function for branch value function.
virtual Gecode::Space * copy(void)
Copy space during cloning.
virtual bool run(void)
Perform test.
virtual Gecode::Space * copy(void)
Copy space during cloning.
FloatTestSpace(FloatTestSpace &s)
Constructor for cloning s.
void post(Home home, Term *t, int n, FloatRelType frt, FloatVal c)
Post propagator for linear constraint over floats.
BoolAssign BOOL_ASSIGN_MIN(void)
Select smallest value.
int set_val(const Gecode::Space &, Gecode::SetVar x, int)
Test function for branch value function.
const int n_int_assign
Number of integer value selections.
const FloatNum max
Largest allowed float value.
FloatAssign FLOAT_ASSIGN_MAX(void)
Select median value of the upper part.
void update(Space &home, VarArray< Var > &a)
Update array to be a clone of array a.
static Gecode::Support::RandomGenerator rand
Random number generator.
unsigned int c_d
Create a clone after every c_d commits (commit distance)
Base(const std::string &s)
Create and register test with name s.
IntAssign INT_ASSIGN_MED(void)
Select greatest value not greater than the median.
virtual T * next(void)
Return next solution (NULL, if none exists or search has been stopped)
Gecode::FloatNumBranch float_val(const Gecode::Space &, Gecode::FloatVar x, int)
Test function for branch value function.
FloatAssign FLOAT_ASSIGN_MIN(void)
Select median value of the lower part.
void dom(Home home, FloatVar x, FloatVal n)
Propagates .
Which values to select for assignment.
BoolAssign BOOL_ASSIGN_MAX(void)
Select largest value.
SetTest(const std::string &s, int a, const Gecode::IntSet &d)
Construct and register test.
int min(void) const
Return smallest value of range.
SetAssign SET_ASSIGN_RND_INC(Rnd r)
SetTestSpace(int n, const Gecode::IntSet &d)
Initialize test space.
IntAssign INT_ASSIGN_MIN(void)
Select smallest value.
Iterator for the unknown ranges of a set variable.
Space for executing Boolean tests.
virtual void post(Gecode::Space &home, Gecode::BoolVarArray &x)=0
Post assignment on variables x.
const FloatNum min
Smallest allowed float value.
IntAssign INT_ASSIGN(IntBranchVal v, IntBranchCommit c)
Select value as defined by the value function v and commit function c.
FloatNum n
The middle value for branching.
virtual bool run(void)
Perform test.
int n
Number of negative literals for node type.
FloatAssign FLOAT_ASSIGN_RND(Rnd r)
Select median value of a randomly chosen part.
SetAssign SET_ASSIGN_MAX_INC(void)
IntAssign INT_ASSIGN_RND(Rnd r)
Select random value.
Value description class for branching.
IntTest(const std::string &s, int a, const Gecode::IntSet &d)
Construct and register test.
Space * clone(CloneStatistics &stat=unused_clone) const
Clone space.
IntAssign INT_ASSIGN_MAX(void)
Select largest value.
int arity
Number of variables.
bool l
Whether to try the lower or upper half first.
Base class for all tests to be run
BoolTestSpace(BoolTestSpace &s)
Constructor for cloning s.
BoolAssign BOOL_ASSIGN_RND(Rnd r)
Select random value.
BoolAssign BOOL_ASSIGN(BoolBranchVal v, BoolBranchCommit c)
Select value as defined by the value function v and commit function c.
virtual bool run(void)
Perform test.
virtual bool run(void)
Perform test.
Space for executing Boolean tests.
IntTestSpace(IntTestSpace &s)
Constructor for cloning s.
FloatNum med(void) const
Return median of domain.
SetAssign SET_ASSIGN_MED_INC(void)
Space for executing integer tests.
Boolean integer variables.
SetTestSpace(SetTestSpace &s)
Constructor for cloning s.
SetAssign SET_ASSIGN_RND_EXC(Rnd r)
Node * x
Pointer to corresponding Boolean expression node.
Space(void)
Default constructor.
struct Gecode::@585::NNF::@62::@64 a
For atomic nodes.
Gecode::FloatVarArray x
Variables to be tested.
int min(void) const
Return minimum of domain.
SetAssign SET_ASSIGN_MIN_INC(void)
SetAssign SET_ASSIGN(SetBranchVal v, SetBranchCommit c)
Select value as defined by the value function v and commit function c.
virtual Gecode::Space * copy(void)
Copy space during cloning.
SetAssign SET_ASSIGN_MED_EXC(void)
Which values to select for assignment.
Gecode::BoolVarArray x
Variables to be tested.
int bool_val(const Gecode::Space &, Gecode::BoolVar x, int)
Test function for branch value function.
BoolTestSpace(int n)
Initialize test space.
virtual Gecode::Space * copy(void)
Copy space during cloning.
SpaceStatus status(StatusStatistics &stat=unused_status)
Query space status.
Which values to select for assignment.
SetAssign SET_ASSIGN_MAX_EXC(void)
FloatAssign FLOAT_ASSIGN(FloatBranchVal v, FloatBranchCommit c)
Space for executing Boolean tests.
FloatTest(const std::string &s, int a, const Gecode::FloatVal &d)
Construct and register test.
Which value to select for assignment.
SetAssign SET_ASSIGN_MIN_EXC(void)
Gecode toplevel namespace
Gecode::IntVarArray x
Variables to be tested.
void assign(Home home, const FloatVarArgs &x, FloatAssign fa, FloatBranchFilter bf, FloatVarValPrint vvp)
Assign all x with value selection vals.
Depth-first search engine.
Gecode::SetVarArray x
Variables to be tested.
int solutions(TestSpace *c, Gecode::Search::Options &o, int maxNbSol=-1)
Find number of solutions.
BoolTest(const std::string &s, int a)
Construct and register test.
const bool clone
Whether engines create a clone when being initialized.
IntTestSpace(int n, Gecode::IntSet &d)
Initialize test space.